ipfw3: support bpf filter in layer4 module
authorBill Yuan <bycn82@leaf.dragonflybsd.org>
Wed, 17 Jun 2015 01:35:05 +0000 (09:35 +0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 17 Jun 2015 03:50:28 +0000 (20:50 -0700)
commite895e94d539d4e7184f4823177557af4e3a227dd
treed8f2def88301fc70c9bae56baffd7cd4bcea0301
parente88a4cc18f960dacc93ac7fcf903926d930a1124
ipfw3: support bpf filter in layer4 module

syntax:
bpf "<bpf string>"
e.g.
ipfw3 add allow all bpf "icmp and src 8.8.8.8"

bpf can be used to filter the packet payload.

pcap_compile_nocap was used to compile the bpf string
and bpf_filter for the filtering.
Makefile.inc1
lib/libipfw3/layer4/Makefile
lib/libipfw3/layer4/ipfw3_layer4.c
sys/net/ipfw3/ip_fw3.h
sys/net/ipfw3_layer4/ip_fw3_layer4.c
sys/net/ipfw3_layer4/ip_fw3_layer4.h