diff options
author | darrenr <darrenr@FreeBSD.org> | 2007-10-18 21:42:51 +0000 |
---|---|---|
committer | darrenr <darrenr@FreeBSD.org> | 2007-10-18 21:42:51 +0000 |
commit | 71e82d94e82560b20789833f60056506de34de8b (patch) | |
tree | da6aaa7272c76c9c4cad931122fd1f4e4db237a5 /contrib/ipfilter/test | |
parent | e2e28d4361fc9bdb67694eedaf349bdc7ca088a3 (diff) | |
download | FreeBSD-src-71e82d94e82560b20789833f60056506de34de8b.zip FreeBSD-src-71e82d94e82560b20789833f60056506de34de8b.tar.gz |
Import IPFilter 4.1.28
Diffstat (limited to 'contrib/ipfilter/test')
25 files changed, 370 insertions, 34 deletions
diff --git a/contrib/ipfilter/test/Makefile b/contrib/ipfilter/test/Makefile index 9273ca6..b0462f3 100644 --- a/contrib/ipfilter/test/Makefile +++ b/contrib/ipfilter/test/Makefile @@ -6,7 +6,10 @@ BINDEST=/usr/local/bin SBINDEST=/sbin MANDIR=/usr/share/man -all: results tests +all: expected.d results tests + +expected.d: + (cd expected; make) results: mkdir -p results @@ -21,13 +24,13 @@ first: -mkdir -p results # Filtering tests -ftests: f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 f20 +ftests: f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 f20 f24 # Rule parsing tests ptests: i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 \ i20 i21 -ntests: n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 n14 +ntests: n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 n14 n16 nitests: ni1 ni2 ni3 ni4 ni5 ni6 ni7 ni8 ni9 ni10 ni11 ni12 ni13 ni14 ni15 \ ni16 ni19 ni20 ni21 ni23 @@ -38,20 +41,20 @@ logtests: l1 pools: p1 p2 p3 p5 ip1 ip2 -ipv6: ipv6.1 ipv6.2 ipv6.3 ipv6.5 +ipv6: ipv6.1 ipv6.2 ipv6.3 ipv6.5 ipv6.6 bpf: bpf1 bpf-f1 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f19: @/bin/sh ./dotest `awk "/^$@ / { print; } " test.format` -f15 f16 f17 f18 f20: +f15 f16 f17 f18 f20 f24: @/bin/sh ./mtest `awk "/^$@ / { print; } " test.format` i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 bpf1: @/bin/sh ./itest `awk "/^$@ / { print; } " test.format` -n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 n14: +n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 n14 n16: @/bin/sh ./nattest `awk "/^$@ / { print; } " test.format` ni2 ni3 ni4 ni5 ni7 ni8 ni9 ni10 ni11 ni12 ni13 ni14 ni15 ni16 ni19 ni20: @@ -66,7 +69,7 @@ in1 in2 in3 in4 in5 in6: l1: @/bin/sh ./logtest `awk "/^$@ / { print; } " test.format` -ipv6.1 ipv6.2 ipv6.3 ipv6.5: +ipv6.1 ipv6.2 ipv6.3 ipv6.5 ipv6.6: @/bin/sh ./dotest6 `awk "/^$@ / { print; } " test.format` p1 p2 p3 p5: @@ -79,17 +82,18 @@ bpf-f1: /bin/sh ./bpftest `awk "/^$@ / { print; } " test.format` clean: - /bin/rm -f f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 f20 + /bin/rm -f f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 f20 f24 /bin/rm -f i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 - /bin/rm -f n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 n14 + /bin/rm -f n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 n14 n16 /bin/rm -f ni1 ni2 ni3 ni4 ni5 ni6 ni7 ni8 ni9 /bin/rm -f ni10 ni11 ni12 ni13 ni14 ni15 ni16 ni19 ni20 ni21 ni23 /bin/rm -f in1 in2 in3 in4 in5 in6 /bin/rm -f p1 p2 p3 p5 ip1 ip2 /bin/rm -f l1 - /bin/rm -f ipv6.1 ipv6.2 ipv6.3 ipv6.5 + /bin/rm -f ipv6.1 ipv6.2 ipv6.3 ipv6.5 ipv6.6 /bin/rm -f bpf1 bpf-f1 /bin/rm -f results/* logout + (cd expected; make clean) diffs: -cd expected; for i in *; do if [ -f $$i -a ! -f ../$$i -a -f ../results/$$i ] ; then diff -c $$i ../results/$$i >> ../diff.out; fi done diff --git a/contrib/ipfilter/test/dotest b/contrib/ipfilter/test/dotest index 72853d4..2989109 100644 --- a/contrib/ipfilter/test/dotest +++ b/contrib/ipfilter/test/dotest @@ -15,7 +15,13 @@ else fi fi if [ "$tuning" != "" ] ; then - tuning="-T $tuning" + case $tuning in + -*) + ;; + *) + tuning="-T $tuning" + ;; + esac fi echo "${thistest}..."; /bin/cp /dev/null results/${thistest} diff --git a/contrib/ipfilter/test/expected/Makefile b/contrib/ipfilter/test/expected/Makefile new file mode 100644 index 0000000..bb91b8b --- /dev/null +++ b/contrib/ipfilter/test/expected/Makefile @@ -0,0 +1,41 @@ +# +# (C)opyright 2007 by Darren Reed. +# +# See the IPFILTER.LICENCE file for details on licencing. +# +all: i19 + +i19: i19.dist Makefile + -if [ "`grep LOG_SECURITY /usr/include/sys/syslog.h 2>&1`" = "" ] ; then \ + if [ "`grep LOG_AUDIT /usr/include/sys/syslog.h 2>&1`" = "" ] ; then \ + sed -e 's/security/!!!/g' i19.dist > i19.p1; \ + else \ + sed -e 's/security/audit/g' i19.dist > i19.p1; \ + fi \ + else \ + /bin/cp i19.dist i19.p1; \ + fi + -if [ "`grep LOG_AUTHPRIV /usr/include/sys/syslog.h 2>&1`" = "" ] ; then \ + sed -e 's/authpriv/!!!/g' i19.p1 > i19.p2; \ + else \ + /bin/cp i19.p1 i19.p2; \ + fi + -if [ "`grep LOG_LOGALERT /usr/include/sys/syslog.h 2>&1`" = "" ] ; then \ + sed -e 's/logalert/!!!/g' i19.p2 > i19.p1; \ + else \ + /bin/cp i19.p2 i19.p1; \ + fi + -if [ "`grep LOG_FTP /usr/include/sys/syslog.h 2>&1`" = "" ] ; then \ + sed -e 's/ftp/!!!/g' i19.p1 > i19.p2; \ + else \ + /bin/cp i19.p1 i19.p2; \ + fi + -if [ "`egrep 'LOG_CRON.*15' /usr/include/sys/syslog.h 2>&1`" != "" ] ; then \ + sed -e 's/cron/cron2/g' i19.p2 > i19; \ + else \ + /bin/cp i19.p2 i19; \ + fi + /bin/rm i19.p? + +clean: + /bin/rm -f i19 diff --git a/contrib/ipfilter/test/expected/f11 b/contrib/ipfilter/test/expected/f11 index b977e41..c1eb060 100644 --- a/contrib/ipfilter/test/expected/f11 +++ b/contrib/ipfilter/test/expected/f11 @@ -14,6 +14,16 @@ nomatch nomatch nomatch nomatch +List of active MAP/Redirect filters: + +List of active sessions: + +Hostmap table: +List of active state sessions: +List of configured pools +List of configured hash tables +List of groups configured (set 0) +List of groups configured (set 1) -------- block nomatch @@ -31,6 +41,16 @@ nomatch nomatch nomatch nomatch +List of active MAP/Redirect filters: + +List of active sessions: + +Hostmap table: +List of active state sessions: +List of configured pools +List of configured hash tables +List of groups configured (set 0) +List of groups configured (set 1) -------- nomatch nomatch @@ -48,6 +68,16 @@ pass nomatch nomatch nomatch +List of active MAP/Redirect filters: + +List of active sessions: + +Hostmap table: +List of active state sessions: +List of configured pools +List of configured hash tables +List of groups configured (set 0) +List of groups configured (set 1) -------- nomatch nomatch @@ -65,6 +95,16 @@ block nomatch nomatch nomatch +List of active MAP/Redirect filters: + +List of active sessions: + +Hostmap table: +List of active state sessions: +List of configured pools +List of configured hash tables +List of groups configured (set 0) +List of groups configured (set 1) -------- nomatch nomatch @@ -82,6 +122,36 @@ pass pass nomatch nomatch +List of active MAP/Redirect filters: + +List of active sessions: + +Hostmap table: +List of active state sessions: +2.2.2.2 -> 4.4.4.4 pass 0x40008402 pr 17 state 0/0 + tag 0 ttl 240 2 -> 53 + forward: pkts in 1 bytes in 28 pkts out 0 bytes out 0 + backward: pkts in 0 bytes in 0 pkts out 0 bytes out 0 + pass in keep state IPv4 + pkt_flags & 0(0) = 0, pkt_options & ffffffff = 0, ffffffff = 0 + pkt_security & ffff = 0, pkt_auth & ffff = 0 + is_flx 0x8001 0 0 0 + interfaces: in X[e1],X[] out X[],X[] + Sync status: not synchronized +1.1.1.1 -> 4.4.4.4 pass 0x40008402 pr 17 state 0/0 + tag 0 ttl 24 1 -> 53 + forward: pkts in 1 bytes in 28 pkts out 0 bytes out 0 + backward: pkts in 1 bytes in 28 pkts out 0 bytes out 0 + pass in keep state IPv4 + pkt_flags & 0(0) = 0, pkt_options & ffffffff = 0, ffffffff = 0 + pkt_security & ffff = 0, pkt_auth & ffff = 0 + is_flx 0x8001 0x8001 0 0 + interfaces: in X[e1],X[e0] out X[],X[] + Sync status: not synchronized +List of configured pools +List of configured hash tables +List of groups configured (set 0) +List of groups configured (set 1) -------- nomatch nomatch @@ -99,6 +169,36 @@ block block nomatch nomatch +List of active MAP/Redirect filters: + +List of active sessions: + +Hostmap table: +List of active state sessions: +2.2.2.2 -> 4.4.4.4 pass 0x40008401 pr 17 state 0/0 + tag 0 ttl 240 2 -> 53 + forward: pkts in 1 bytes in 28 pkts out 0 bytes out 0 + backward: pkts in 0 bytes in 0 pkts out 0 bytes out 0 + block in keep state IPv4 + pkt_flags & 0(0) = 0, pkt_options & ffffffff = 0, ffffffff = 0 + pkt_security & ffff = 0, pkt_auth & ffff = 0 + is_flx 0x8001 0 0 0 + interfaces: in X[e1],X[] out X[],X[] + Sync status: not synchronized +1.1.1.1 -> 4.4.4.4 pass 0x40008401 pr 17 state 0/0 + tag 0 ttl 24 1 -> 53 + forward: pkts in 1 bytes in 28 pkts out 0 bytes out 0 + backward: pkts in 1 bytes in 28 pkts out 0 bytes out 0 + block in keep state IPv4 + pkt_flags & 0(0) = 0, pkt_options & ffffffff = 0, ffffffff = 0 + pkt_security & ffff = 0, pkt_auth & ffff = 0 + is_flx 0x8001 0x8001 0 0 + interfaces: in X[e1],X[e0] out X[],X[] + Sync status: not synchronized +List of configured pools +List of configured hash tables +List of groups configured (set 0) +List of groups configured (set 1) -------- nomatch nomatch @@ -116,4 +216,28 @@ nomatch nomatch nomatch nomatch +List of active MAP/Redirect filters: + +List of active sessions: + +Hostmap table: +List of active state sessions: +1.1.1.1 -> 2.1.2.2 pass 0x40008402 pr 6 state 3/4 + tag 0 ttl 864000 + 1 -> 25 2:66 4096<<0:16384<<0 + cmsk 0000 smsk 0000 s0 00000000/00000000 + FWD:ISN inc 0 sumd 0 + REV:ISN inc 0 sumd 0 + forward: pkts in 1 bytes in 40 pkts out 0 bytes out 0 + backward: pkts in 1 bytes in 40 pkts out 0 bytes out 0 + pass in keep state IPv4 + pkt_flags & 0(0) = 0, pkt_options & ffffffff = 0, ffffffff = 0 + pkt_security & ffff = 0, pkt_auth & ffff = 0 + is_flx 0x8001 0x8001 0 0 + interfaces: in X[e0],X[e1] out X[],X[] + Sync status: not synchronized +List of configured pools +List of configured hash tables +List of groups configured (set 0) +List of groups configured (set 1) -------- diff --git a/contrib/ipfilter/test/expected/f24 b/contrib/ipfilter/test/expected/f24 new file mode 100644 index 0000000..801abd3 --- /dev/null +++ b/contrib/ipfilter/test/expected/f24 @@ -0,0 +1,5 @@ +pass +pass +pass +pass +-------- diff --git a/contrib/ipfilter/test/expected/i19.dist b/contrib/ipfilter/test/expected/i19.dist new file mode 100644 index 0000000..5d9c26c --- /dev/null +++ b/contrib/ipfilter/test/expected/i19.dist @@ -0,0 +1,22 @@ +block in log level user.debug quick proto icmp from any to any +block in log level mail.info quick proto icmp from any to any +block in log level daemon.notice quick proto icmp from any to any +block in log level auth.warn quick proto icmp from any to any +block in log level syslog.err quick proto icmp from any to any +block in log level lpr.crit quick proto icmp from any to any +block in log level news.alert quick proto icmp from any to any +block in log level uucp.emerg quick proto icmp from any to any +block in log level cron.debug quick proto icmp from any to any +block in log level ftp.info quick proto icmp from any to any +block in log level authpriv.notice quick proto icmp from any to any +block in log level logalert.warn quick proto icmp from any to any +block in log level local0.err quick proto icmp from any to any +block in log level local1.crit quick proto icmp from any to any +block in log level local2.alert quick proto icmp from any to any +block in log level local3.emerg quick proto icmp from any to any +block in log level local4.debug quick proto icmp from any to any +block in log level local5.info quick proto icmp from any to any +block in log level local6.notice quick proto icmp from any to any +block in log level local7.warn quick proto icmp from any to any +block in log level kern.err quick proto icmp from any to any +block in log level security.emerg quick proto icmp from any to any diff --git a/contrib/ipfilter/test/expected/i21 b/contrib/ipfilter/test/expected/i21 index a5f55b3..d4d28da 100644 --- a/contrib/ipfilter/test/expected/i21 +++ b/contrib/ipfilter/test/expected/i21 @@ -8,3 +8,9 @@ pass out from any to any port = 7 pass out from any to any port = 9 block in from any port = 20 to any block in from any port = 25 to any +pass in from any port 11:12 to any port 1:2 +pass in from any port 21:22 to any port 1:2 +pass in from any port 11:12 to any port 4:5 +pass in from any port 21:22 to any port 4:5 +pass in from any port 11:12 to any port 8:9 +pass in from any port 21:22 to any port 8:9 diff --git a/contrib/ipfilter/test/expected/in1 b/contrib/ipfilter/test/expected/in1 index 8c47a92..03436b6 100644 --- a/contrib/ipfilter/test/expected/in1 +++ b/contrib/ipfilter/test/expected/in1 @@ -28,3 +28,4 @@ map fxp0 from 192.168.0.0/18 to any port = 21 -> 1.2.3.4/32 proxy port 21 ftp/tc map thisisalonginte 0.0.0.0/0 -> 0.0.0.0/32 mssclamp 1452 tag freddyliveshere map bar0 0.0.0.0/0 -> 0.0.0.0/32 icmpidmap icmp 1000:2000 map ppp0,adsl0 0.0.0.0/0 -> 0.0.0.0/32 +map ppp0 from 192.168.0.0/16 to any port = 123 -> 0.0.0.0/32 age 30/1 udp diff --git a/contrib/ipfilter/test/expected/in6 b/contrib/ipfilter/test/expected/in6 index 338bd80..05426e7 100644 --- a/contrib/ipfilter/test/expected/in6 +++ b/contrib/ipfilter/test/expected/in6 @@ -5,3 +5,4 @@ map foo0 from any port < 1 to any port > 0 -> 0.0.0.0/32 tcp map foo0 from any port <= 1 to any port >= 0 -> 0.0.0.0/32 tcp/udp map foo0 from any port <= 1 to any port >= 0 -> 0.0.0.0/32 tcp/udp map foo0 from any port 1 >< 20 to any port 20 <> 40 -> 0.0.0.0/32 tcp/udp +map foo0 from any port 10:20 to any port 30:40 -> 0.0.0.0/32 tcp/udp diff --git a/contrib/ipfilter/test/expected/ipv6.6 b/contrib/ipfilter/test/expected/ipv6.6 new file mode 100644 index 0000000..abc0e87 --- /dev/null +++ b/contrib/ipfilter/test/expected/ipv6.6 @@ -0,0 +1,3 @@ +pass +pass +-------- diff --git a/contrib/ipfilter/test/expected/n16 b/contrib/ipfilter/test/expected/n16 new file mode 100644 index 0000000..da617d9 --- /dev/null +++ b/contrib/ipfilter/test/expected/n16 @@ -0,0 +1,21 @@ +4520 0068 17e4 0000 6b11 cbba c05b ac33 ac1f 5318 1194 07dd 0054 0000 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 + +4520 0068 17e4 0000 6a11 ccba c05b ac33 ac1f 5318 1194 07dd 0054 0000 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 + +4500 0084 ee0f 0000 8001 e0a2 ac1f 5318 c05b ac33 0303 4ca1 0000 0000 4520 0068 17e4 0000 6a11 ccba c05b ac33 ac1f 5318 1194 07dd 0054 0000 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 + +4500 0084 ee0f 0000 8001 4a21 45f8 4fc1 c05b ac33 0303 bf85 0000 0000 4520 0068 17e4 0000 6a11 3639 c05b ac33 45f8 4fc1 1194 94f8 0054 0000 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 + +List of active MAP/Redirect filters: +rdr vlan0 from any to 69.248.79.193/32 port = 38136 -> 172.31.83.24 port 2013 udp + +List of active sessions: +RDR 172.31.83.24 2013 <- -> 69.248.79.193 38136 [192.91.172.51 4500] + +Hostmap table: +List of active state sessions: +List of configured pools +List of configured hash tables +List of groups configured (set 0) +List of groups configured (set 1) +------------------------------- diff --git a/contrib/ipfilter/test/input/f11 b/contrib/ipfilter/test/input/f11 index c54bb80..d558150 100644 --- a/contrib/ipfilter/test/input/f11 +++ b/contrib/ipfilter/test/input/f11 @@ -1,14 +1,14 @@ -in on e0 tcp 1.1.1.1,1 2.1.2.2,23 S -in on e0 tcp 1.1.1.1,1 2.1.2.2,24 SA -in on e1 tcp 2.1.2.2,23 1.1.1.1,2 SA -in on e1 tcp 2.1.2.2,23 1.1.1.1,1 SA -in on e0 tcp 1.1.1.1,1 2.1.2.2,23 A -in on e0 tcp 1.1.1.1,1 2.1.2.2,25 A -in on e1 tcp 2.1.2.2,23 1.1.1.1,1 A -in on e1 tcp 2.1.2.2,25 1.1.1.1,1 A -in on e0 tcp 1.1.1.1,1 2.1.2.2,23 FA -in on e0 tcp 1.1.1.1,1 2.1.2.2,23 A -in on e0 tcp 1.1.1.1,2 2.1.2.2,23 A +in on e0 tcp 1.1.1.1,1 2.1.2.2,23 S seq=1 ack=0 +in on e0 tcp 1.1.1.1,1 2.1.2.2,24 SA seq=1 ack=1 +in on e1 tcp 2.1.2.2,23 1.1.1.1,2 SA seq=101 ack=2 +in on e1 tcp 2.1.2.2,23 1.1.1.1,1 SA seq=101 ack=2 +in on e0 tcp 1.1.1.1,1 2.1.2.2,23 A seq=2 ack=102 +in on e0 tcp 1.1.1.1,1 2.1.2.2,25 A seq=2 ack=102 +in on e1 tcp 2.1.2.2,23 1.1.1.1,1 A seq=102 ack=2 +in on e1 tcp 2.1.2.2,25 1.1.1.1,1 A seq=102 ack=2 +in on e0 tcp 1.1.1.1,1 2.1.2.2,23 FA seq=2 ack=102 +in on e0 tcp 1.1.1.1,1 2.1.2.2,23 A seq=2 ack=102 +in on e0 tcp 1.1.1.1,2 2.1.2.2,23 A seq=2 ack=102 in on e1 udp 1.1.1.1,1 4.4.4.4,53 in on e1 udp 2.2.2.2,2 4.4.4.4,53 in on e0 udp 4.4.4.4,53 1.1.1.1,1 diff --git a/contrib/ipfilter/test/input/f24 b/contrib/ipfilter/test/input/f24 new file mode 100644 index 0000000..1d06682 --- /dev/null +++ b/contrib/ipfilter/test/input/f24 @@ -0,0 +1,27 @@ +[out,hme0] +4500 003f 6e48 0000 4011 8816 c0a8 0101 +c0a8 01fe eb22 0035 002b d9e6 4a82 0100 +0001 0000 0000 0000 0663 6f6f 6d62 7303 +616e 7503 6564 7502 6175 0000 0100 01 + +[in,hme0] +4500 004c fc96 2000 4011 d9ba c0a8 01fe +c0a8 0101 0035 eb22 00a9 d7b9 4a82 8180 +0001 0001 0003 0003 0663 6f6f 6d62 7303 +616e 7503 6564 7502 6175 0000 0100 01c0 +0c00 0100 0100 0000 3c00 0496 + +[in,hme0] +4500 004c fc96 2006 4011 d9b4 c0a8 01fe +c0a8 0101 cbe7 50c0 1300 0200 0100 0078 +8c00 0603 6e73 31c0 13c0 1300 0200 0100 +0078 8c00 0e02 6e73 0861 6465 6c61 6964 +65c0 17c0 1300 0200 0100 0078 + +[in,hme0] +4500 004d fc96 000c 4011 f9ad c0a8 01fe +c0a8 0101 8c00 0603 756e 61c0 13c0 6b00 +0100 0100 0027 5800 0496 cb16 1cc0 5100 +0100 0100 0018 4700 0481 7f28 03c0 3f00 +0100 0100 0027 5800 0496 cb01 0a + diff --git a/contrib/ipfilter/test/input/ipv6.6 b/contrib/ipfilter/test/input/ipv6.6 new file mode 100644 index 0000000..82efeac --- /dev/null +++ b/contrib/ipfilter/test/input/ipv6.6 @@ -0,0 +1,17 @@ +[out,gif0] +6000 0000 0020 2c01 +ef00 1001 2002 0001 0000 0000 0000 0070 +2001 1002 3333 0001 0000 0000 0000 0001 +1100 0001 0000 0001 +8083 829a +0020 +f4c1 +0000 0000 0000 0000 0000 0000 0000 0000 + +[out,gif0] +6000 0000 0020 2c01 +ef00 1001 2002 0001 0000 0000 0000 0070 +2001 1002 3333 0001 0000 0000 0000 0001 +1100 0008 0000 0001 +0000 0000 0000 0000 0000 0000 0000 0000 + diff --git a/contrib/ipfilter/test/input/l1 b/contrib/ipfilter/test/input/l1 index 56d766a..a59dbe3 100644 --- a/contrib/ipfilter/test/input/l1 +++ b/contrib/ipfilter/test/input/l1 @@ -1,36 +1,36 @@ # 1.1.1.1,1025 -> 2.2.2.2,25 TTL=63 TCP DF SYN [] 4500 0028 0000 4000 3f06 35cb 0101 0101 0202 0202 -0401 0019 0000 0000 0000 0000 5002 2000 85c3 0000 +0401 0019 0000 0001 0000 0000 5002 2000 85c2 0000 #in on e0 tcp 1.1.1.1,1025 2.1.2.2,25 A [] 4500 0028 0000 4000 3f06 35cb 0101 0101 0202 0202 -0401 0019 0000 0000 0000 0000 5010 2000 85b5 0000 +0401 0019 0000 0001 0000 0000 5010 2000 85b4 0000 #in on e1 tcp 2.1.2.2,25 1.1.1.1,1025 AS [] 4500 0028 0000 4000 3f06 35cb 0202 0202 0101 0101 -0019 0401 0000 0000 0000 0000 5012 2000 85b3 0000 +0019 0401 0000 0011 0000 0002 5012 2000 85a0 0000 #in on e1 tcp 2.1.2.2,25 1.1.1.1,1025 A [out,e1] 4500 0028 0000 4000 3f06 35cb 0202 0202 0101 0101 -0019 0401 0000 0000 0000 0000 5010 2000 85b5 0000 +0019 0401 0000 0012 0000 0002 5010 2000 85a1 0000 -#in on e0 tcp 1.1.1.1,1025 2.1.2.2,25 F +#in on e0 tcp 1.1.1.1,1025 2.1.2.2,25 AF [] 4500 0028 0000 4000 3f06 35cb 0101 0101 0202 0202 -0401 0019 0000 0000 0000 0000 5011 2000 85b4 0000 +0401 0019 0000 0002 0000 0012 5011 2000 85a0 0000 #in on e0 tcp 1.1.1.1,1025 2.1.2.2,25 A [] 4500 0028 0000 4000 3f06 35cb 0101 0101 0202 0202 -0401 0019 0000 0000 0000 0000 5010 2000 85b5 0000 +0401 0019 0000 0012 0000 0003 5010 2000 85a0 0000 #in on e0 tcp 1.1.1.1,1025 2.1.2.2,25 A [] 4500 0028 0000 4000 3f06 35cb 0101 0101 0202 0202 -0401 0019 0000 0000 0000 0000 5010 2000 85b5 0000 +0401 0019 0000 0012 0000 0003 5010 2000 85a0 0000 #in on e1 udp 1.1.1.1,1 4.4.4.4,53 [] diff --git a/contrib/ipfilter/test/input/n16 b/contrib/ipfilter/test/input/n16 new file mode 100644 index 0000000..2e77e40 --- /dev/null +++ b/contrib/ipfilter/test/input/n16 @@ -0,0 +1,40 @@ +[in,vlan0] +4520 0068 17e4 0000 6b11 3539 c05b ac33 45f8 4fc1 +1194 94f8 0054 0000 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 + +[out,vlan2] +4520 0068 17e4 0000 6a11 ccba c05b ac33 +ac1f 5318 1194 07dd 0054 0000 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 + +[in,vlan2] +4500 0084 ee0f 0000 8001 e0a2 ac1f 5318 +c05b ac33 0303 4ca1 0000 0000 4520 0068 +17e4 0000 6a11 ccba c05b ac33 ac1f 5318 +1194 07dd 0054 0000 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 + +[out,vlan0] +4500 0084 ee0f 0000 8001 e0a2 ac1f 5318 +c05b ac33 0303 4ca1 0000 0000 4520 0068 +17e4 0000 6a11 ccba c05b ac33 ac1f 5318 +1194 07dd 0054 0000 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 +a5a5 a5a5 + diff --git a/contrib/ipfilter/test/nattest b/contrib/ipfilter/test/nattest index 78b757e..fece276 100755 --- a/contrib/ipfilter/test/nattest +++ b/contrib/ipfilter/test/nattest @@ -5,7 +5,14 @@ else format="-F $2" fi if [ "$4" != "" ] ; then - format="-T $4 $format" + case $4 in + -*) + format="$4 $format" + ;; + *) + format="-T $4 $format" + ;; + esac fi if [ -f /usr/ucb/touch ] ; then TOUCH=/usr/ucb/touch diff --git a/contrib/ipfilter/test/regress/f24 b/contrib/ipfilter/test/regress/f24 new file mode 100644 index 0000000..5cb3bab --- /dev/null +++ b/contrib/ipfilter/test/regress/f24 @@ -0,0 +1 @@ +pass out quick proto udp all keep state keep frags diff --git a/contrib/ipfilter/test/regress/i21 b/contrib/ipfilter/test/regress/i21 index bf797f9..9d583ab 100644 --- a/contrib/ipfilter/test/regress/i21 +++ b/contrib/ipfilter/test/regress/i21 @@ -4,3 +4,4 @@ block in from port 20:21 block out from any to port 10 <> 100 pass out from any to port = (3,5,7,9) block in from port = (20,25) +pass in from any port = (11:12, 21:22) to any port = (1:2, 4:5, 8:9) diff --git a/contrib/ipfilter/test/regress/i3 b/contrib/ipfilter/test/regress/i3 index 0d82e8a..390fc3c 100644 --- a/contrib/ipfilter/test/regress/i3 +++ b/contrib/ipfilter/test/regress/i3 @@ -1,7 +1,9 @@ log in all pass in from 128.16/16 to 129.10.10/24 -pass in from 128.0.0.1/24 to 128\ -.0.0.1/16 +pass in from 128.0.0.1/24 to 1\ +28\ +.\ +0.0.1/16 pass in from 128.0.0.1/0xffffff00 to 128.0.0.1/0xffff0000 pass in from 128.0.0.1/255.255.255.0 to 128.0.0.1/255.255.0.0 pass in from 128.0.0.1 mask 0xffffff00 to 128.0.0.1 mask 0xffff0000 diff --git a/contrib/ipfilter/test/regress/in1 b/contrib/ipfilter/test/regress/in1 index 163d834..d5d0cf4 100644 --- a/contrib/ipfilter/test/regress/in1 +++ b/contrib/ipfilter/test/regress/in1 @@ -28,3 +28,4 @@ map fxp0 from 192.168.0.0/18 to 0/0 port = 21 -> 1.2.3.4/32 proxy port 21 ftp/tc map thisisalonginte 0/0 -> 0/32 mssclamp 1452 tag freddyliveshere map bar0 0/0 -> 0/32 icmpidmap icmp 1000:2000 map ppp0,adsl0 0/0 -> 0/32 +map ppp0 from 192.168.0.0/16 to any port = 123 -> 0/32 age 30/1 udp diff --git a/contrib/ipfilter/test/regress/in6 b/contrib/ipfilter/test/regress/in6 index 932df9b..70e71dd 100644 --- a/contrib/ipfilter/test/regress/in6 +++ b/contrib/ipfilter/test/regress/in6 @@ -5,3 +5,4 @@ map foo0 from any port lt 1 to any port gt 0 -> 0/32 tcp map foo0 from any port <= 1 to any port >= 0 -> 0/32 tcp/udp map foo0 from any port le 1 to any port ge 0 -> 0/32 tcp/udp map foo0 from any port 1 >< 20 to any port 20 <> 40 -> 0/32 tcp/udp +map foo0 from any port 10:20 to any port 30:40 -> 0/32 tcp/udp diff --git a/contrib/ipfilter/test/regress/ipv6.6 b/contrib/ipfilter/test/regress/ipv6.6 new file mode 100644 index 0000000..f1f904b --- /dev/null +++ b/contrib/ipfilter/test/regress/ipv6.6 @@ -0,0 +1 @@ +pass out on gif0 proto udp all keep frag diff --git a/contrib/ipfilter/test/regress/n16 b/contrib/ipfilter/test/regress/n16 new file mode 100644 index 0000000..ff8958c --- /dev/null +++ b/contrib/ipfilter/test/regress/n16 @@ -0,0 +1 @@ +rdr vlan0 from any to 69.248.79.193 port = 38136 -> 172.31.83.24 port 2013 udp diff --git a/contrib/ipfilter/test/test.format b/contrib/ipfilter/test/test.format index 7c13d6e..dfc3f35 100644 --- a/contrib/ipfilter/test/test.format +++ b/contrib/ipfilter/test/test.format @@ -11,7 +11,7 @@ f7 text text f8 text text f9 text text f10 text text -f11 text text +f11 text text -D f12 hex hex f13 hex hex f14 text text @@ -94,3 +94,6 @@ p2 text text p3 text text p4 text text p5 text text +n16 hex hex -D +f24 hex text +ipv6.6 hex text |