summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/test
diff options
context:
space:
mode:
authordarrenr <darrenr@FreeBSD.org>2002-03-19 11:45:24 +0000
committerdarrenr <darrenr@FreeBSD.org>2002-03-19 11:45:24 +0000
commit8753e713f5f6f2bf2f467e1e43dc252d2d31b389 (patch)
treed6bb5e426959109d335f22e7215936da1c3d528c /contrib/ipfilter/test
parent5df96985515dd8f51d4209b69c12cbab7c289fd0 (diff)
downloadFreeBSD-src-8753e713f5f6f2bf2f467e1e43dc252d2d31b389.zip
FreeBSD-src-8753e713f5f6f2bf2f467e1e43dc252d2d31b389.tar.gz
Import IPFilter 3.4.25
Diffstat (limited to 'contrib/ipfilter/test')
-rw-r--r--contrib/ipfilter/test/expected/f159
-rw-r--r--contrib/ipfilter/test/expected/f169
-rw-r--r--contrib/ipfilter/test/expected/l149
-rw-r--r--contrib/ipfilter/test/expected/l1.b47
-rw-r--r--contrib/ipfilter/test/expected/ni13
-rw-r--r--contrib/ipfilter/test/expected/ni210
-rw-r--r--contrib/ipfilter/test/input/f158
-rw-r--r--contrib/ipfilter/test/input/f168
-rw-r--r--contrib/ipfilter/test/input/ipf6-126
-rw-r--r--contrib/ipfilter/test/input/l152
-rw-r--r--contrib/ipfilter/test/input/ni16
-rw-r--r--contrib/ipfilter/test/input/ni2161
-rwxr-xr-xcontrib/ipfilter/test/logtest48
-rwxr-xr-xcontrib/ipfilter/test/mtest36
-rwxr-xr-xcontrib/ipfilter/test/natipftest28
-rw-r--r--contrib/ipfilter/test/regress/f158
-rw-r--r--contrib/ipfilter/test/regress/f1610
-rw-r--r--contrib/ipfilter/test/regress/ipf6-13
-rw-r--r--contrib/ipfilter/test/regress/l16
-rw-r--r--contrib/ipfilter/test/regress/ni1.ipf4
-rw-r--r--contrib/ipfilter/test/regress/ni1.nat1
-rw-r--r--contrib/ipfilter/test/regress/ni2.ipf1
-rw-r--r--contrib/ipfilter/test/regress/ni2.nat1
23 files changed, 534 insertions, 0 deletions
diff --git a/contrib/ipfilter/test/expected/f15 b/contrib/ipfilter/test/expected/f15
new file mode 100644
index 0000000..9b31258
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f15
@@ -0,0 +1,9 @@
+block return-rst
+pass
+block return-icmp
+pass
+block
+nomatch
+pass
+pass
+--------
diff --git a/contrib/ipfilter/test/expected/f16 b/contrib/ipfilter/test/expected/f16
new file mode 100644
index 0000000..b6cb3fa
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f16
@@ -0,0 +1,9 @@
+block
+block
+pass
+block
+pass
+pass
+block
+block
+--------
diff --git a/contrib/ipfilter/test/expected/l1 b/contrib/ipfilter/test/expected/l1
new file mode 100644
index 0000000..c158752
--- /dev/null
+++ b/contrib/ipfilter/test/expected/l1
@@ -0,0 +1,49 @@
+log in all
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -F IN
+01/01/1970 10:00:00.000000 2x anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 10:00:00.000000 2x anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 3.3.3.3,1023 -> 1.1.1.1,2049 PR udp len 20 28 IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,2049 -> 3.3.3.3,1023 PR udp len 20 28 IN
+--------
+pass in on anon0 all head 100
+--------
+pass in log quick from 3.3.3.3 to any group 100
+--------
+pass in log body quick from 2.2.2.2 to any
+01/01/1970 10:00:00.000000 anon0 @0:1 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS IN
+01/01/1970 10:00:00.000000 2x anon0 @0:1 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 10:00:00.000000 anon0 @0:1 p 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+--------
+pass in log quick proto tcp from 1.1.1.1 to any flags S keep state
+01/01/1970 10:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S K-S IN
+01/01/1970 10:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A K-S IN
+01/01/1970 10:00:00.000000 anon0 @0:1 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS K-S IN
+01/01/1970 10:00:00.000000 e1 @0:1 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -A K-S OUT
+01/01/1970 10:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -F K-S IN
+--------
+pass in log first quick proto tcp from 1.1.1.1 to any flags S keep state
+01/01/1970 10:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S K-S IN
+--------
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S IN
+01/01/1970 10:00:00.000000 anon0 @0:4 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S K-S IN
+01/01/1970 10:00:00.000000 anon0 @0:4 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A K-S IN
+01/01/1970 10:00:00.000000 anon0 @0:4 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS K-S IN
+01/01/1970 10:00:00.000000 e1 @0:4 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -A K-S OUT
+01/01/1970 10:00:00.000000 anon0 @0:4 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -F K-S IN
+01/01/1970 10:00:00.000000 2x anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 10:00:00.000000 anon0 @0:3 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 56 IN
+01/01/1970 10:00:00.000000 anon0 @0:3 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 56 IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+01/01/1970 10:00:00.000000 anon0 @0:3 p 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 3.3.3.3,1023 -> 1.1.1.1,2049 PR udp len 20 28 IN
+01/01/1970 10:00:00.000000 anon0 @100:1 p 3.3.3.3,1023 -> 1.1.1.1,2049 PR udp len 20 28 IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,2049 -> 3.3.3.3,1023 PR udp len 20 28 IN
+--------
diff --git a/contrib/ipfilter/test/expected/l1.b b/contrib/ipfilter/test/expected/l1.b
new file mode 100644
index 0000000..eef3660
--- /dev/null
+++ b/contrib/ipfilter/test/expected/l1.b
@@ -0,0 +1,47 @@
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -F IN
+01/01/1970 10:00:00.000000 2x anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 10:00:00.000000 2x anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 3.3.3.3,1023 -> 1.1.1.1,2049 PR udp len 20 28 IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,2049 -> 3.3.3.3,1023 PR udp len 20 28 IN
+--------
+--------
+--------
+01/01/1970 10:00:00.000000 anon0 @0:1 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS IN
+01/01/1970 10:00:00.000000 2x anon0 @0:1 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01 02 03 04 05 06 07 08 09 0a 0b 0d ............
+01/01/1970 10:00:00.000000 anon0 @0:1 p 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+--------
+01/01/1970 10:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S K-S IN
+01/01/1970 10:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A K-S IN
+01/01/1970 10:00:00.000000 anon0 @0:1 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS K-S IN
+01/01/1970 10:00:00.000000 e1 @0:1 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -A K-S OUT
+01/01/1970 10:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -F K-S IN
+--------
+01/01/1970 10:00:00.000000 anon0 @0:1 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S K-S IN
+--------
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S IN
+01/01/1970 10:00:00.000000 anon0 @0:4 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -S K-S IN
+01/01/1970 10:00:00.000000 anon0 @0:4 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A K-S IN
+01/01/1970 10:00:00.000000 anon0 @0:4 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -AS K-S IN
+01/01/1970 10:00:00.000000 e1 @0:4 p 2.2.2.2,25 -> 1.1.1.1,1025 PR tcp len 20 40 -A K-S OUT
+01/01/1970 10:00:00.000000 anon0 @0:4 p 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -F K-S IN
+01/01/1970 10:00:00.000000 2x anon0 @-1:-1 L 1.1.1.1,1025 -> 2.2.2.2,25 PR tcp len 20 40 -A IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01/01/1970 10:00:00.000000 anon0 @0:3 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 40 IN
+01 02 03 04 05 06 07 08 09 0a 0b 0d ............
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 56 IN
+01/01/1970 10:00:00.000000 anon0 @0:3 p 2.2.2.2,1 -> 4.4.4.4,53 PR udp len 20 56 IN
+01 02 03 04 05 06 07 08 09 0a 0b 0d 0e 0f 40 61 ..............@a
+42 63 44 65 46 67 48 69 4a 6b 4c 6d BcDeFgHiJkLm
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+01/01/1970 10:00:00.000000 anon0 @0:3 p 2.2.2.2 -> 4.4.4.4 PR ip len 20 (20) IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 3.3.3.3,1023 -> 1.1.1.1,2049 PR udp len 20 28 IN
+01/01/1970 10:00:00.000000 anon0 @100:1 p 3.3.3.3,1023 -> 1.1.1.1,2049 PR udp len 20 28 IN
+01/01/1970 10:00:00.000000 anon0 @-1:-1 L 1.1.1.1,2049 -> 3.3.3.3,1023 PR udp len 20 28 IN
+--------
diff --git a/contrib/ipfilter/test/expected/ni1 b/contrib/ipfilter/test/expected/ni1
new file mode 100644
index 0000000..a47b3da
--- /dev/null
+++ b/contrib/ipfilter/test/expected/ni1
@@ -0,0 +1,3 @@
+4500 0028 4706 4000 0111 ced8 0606 0606 0404 0404 afc9 829e 0014 0b2d 0402 0000 3be5 468d 000a cfc3
+4500 0038 809a 0000 ff01 8f31 0303 0303 0202 0202 0b00 a537 0000 0000 4500 0028 4703 4000 0111 ef89 0202 0202 0404 0404 afc9 829e 0014 1d4f
+-------------------------------
diff --git a/contrib/ipfilter/test/expected/ni2 b/contrib/ipfilter/test/expected/ni2
new file mode 100644
index 0000000..4fa04c0
--- /dev/null
+++ b/contrib/ipfilter/test/expected/ni2
@@ -0,0 +1,10 @@
+4510 002c bd0d 4000 3e06 ea1d 0101 0101 c0a8 0133 9c40 0077 a664 2485 0000 0000 6002 4000 cea4 0000 0204 05b4
+4500 002c ce83 4000 7e06 98b7 c0a8 0133 0a01 0201 0077 05f6 fbdf 1a21 a664 2486 6012 2238 62a5 0000 0204 05b4
+4510 0028 bd0e 4000 3e06 ea20 0101 0101 c0a8 0133 9c40 0077 a664 2486 fbdf 1a22 5010 4470 cbdf 0000
+4500 005b cf83 4000 7e06 9788 c0a8 0133 0a01 0201 0077 05f6 fbdf 1a22 a664 2486 5018 2238 b5d9 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0a
+4510 0028 bd18 4000 3e06 ea16 0101 0101 c0a8 0133 9c40 0077 a664 2486 fbdf 1a55 5010 4470 cbac 0000
+4510 002e bd1e 4000 3e06 ea0a 0101 0101 c0a8 0133 9c40 0077 a664 2486 fbdf 1a55 5018 4470 deb6 0000 0000 0000 0d0a
+4500 0048 e383 4000 7e06 839b c0a8 0133 0a01 0201 0077 05f6 fbdf 1a55 a664 248c 5018 2232 fe54 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+4500 05dc e483 4000 7e06 7d07 c0a8 0133 0a01 0201 0077 05f6 fbdf 1a75 a664 248c 5010 2232 9f6c 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3331 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 1111 2222 3333 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+4500 0038 d71d 4000 4001 f0be 0101 0101 c0a8 0133 0304 348b 0000 05a0 4500 05dc e483 4000 7e06 8707 c0a8 0133 0101 0101 0077 9c40 fbdf 1a75
+-------------------------------
diff --git a/contrib/ipfilter/test/input/f15 b/contrib/ipfilter/test/input/f15
new file mode 100644
index 0000000..db547cb
--- /dev/null
+++ b/contrib/ipfilter/test/input/f15
@@ -0,0 +1,8 @@
+in on hme0 tcp 10.1.2.3,1200 195.134.65.10,100 S
+in on hme0 tcp 10.1.2.3,1200 195.134.65.10,22 S
+in on hme0 udp 10.1.2.3,1200 195.134.65.10,100
+in on hme0 udp 10.1.2.3,53 195.134.65.10,53
+in on hme0 10.1.2.3 195.134.65.10
+in on hme1 195.134.65.10 10.1.2.3
+in on hme1 udp 195.134.65.10,53 10.1.2.3,53
+in on hme1 tcp 195.134.65.10,22 10.1.2.3,1200 SA
diff --git a/contrib/ipfilter/test/input/f16 b/contrib/ipfilter/test/input/f16
new file mode 100644
index 0000000..a17f41f
--- /dev/null
+++ b/contrib/ipfilter/test/input/f16
@@ -0,0 +1,8 @@
+in 2.2.2.2 5.5.5.5
+in 2.2.2.2 1.1.1.1
+in udp 4.4.4.4,110 1.1.1.1,53
+in udp 4.4.4.9,101 1.1.1.3,35
+in udp 4.4.4.8,111 1.1.1.2,53
+in tcp 4.4.4.7,220 1.1.1.1,23
+in tcp 4.4.4.6,202 1.1.1.3,22
+in tcp 4.4.4.5,222 1.1.1.2,52
diff --git a/contrib/ipfilter/test/input/ipf6-1 b/contrib/ipfilter/test/input/ipf6-1
new file mode 100644
index 0000000..8cc2d17
--- /dev/null
+++ b/contrib/ipfilter/test/input/ipf6-1
@@ -0,0 +1,26 @@
+[out,de0]
+6000 0000 0020 3aff ef00 0000 0000 0000
+0000 0000 0001 0013 ff02 0000 0000 0000
+0000 0001 ff01 000b 8700 ea32 0000 0000
+ef00 0000 0000 0000 0000 0000 0001 000b
+0101 0048 5487 5c6f
+
+[in,de0]
+6000 0000 0020 3aff ef00 0000 0000 0000
+0000 0000 0001 000b ef00 0000 0000 0000
+0000 0000 0001 0013 8800 5322 6000 0000
+ef00 0000 0000 0000 0000 0000 0001 000b
+0201 0800 2071 cce1
+
+[out,de0]
+6000 0000 0010 3a40 ef00 0000 0000 0000
+0000 0000 0001 0013 ef00 0000 0000 0000
+0000 0000 0001 000b 8000 3210 06ff 0002
+9ec3 3c3c 8a82 0300
+
+[in,de0]
+6000 0000 0010 3aff ef00 0000 0000 0000
+0000 0000 0001 000b ef00 0000 0000 0000
+0000 0000 0001 0013 8100 3110 06ff 0002
+9ec3 3c3c 8a82 0300
+
diff --git a/contrib/ipfilter/test/input/l1 b/contrib/ipfilter/test/input/l1
new file mode 100644
index 0000000..afda0db
--- /dev/null
+++ b/contrib/ipfilter/test/input/l1
@@ -0,0 +1,52 @@
+# 1.1.1.1,1025 -> 2.2.2.2,25 TTL=63 TCP DF SYN
+45 00 0028 0000 4000 3f 06 0000 01010101 02020202
+0401 0019 00000000 00000000 50 02 2000 0000 0000
+
+#in on e0 tcp 1.1.1.1,1025 2.1.2.2,25 A
+45 00 0028 0000 4000 3f 06 0000 01010101 02020202
+0401 0019 00000000 00000000 50 10 2000 0000 0000
+
+#in on e1 tcp 2.1.2.2,25 1.1.1.1,1025 AS
+45 00 0028 0000 4000 3f 06 0000 02020202 01010101
+0019 0401 00000000 00000000 50 12 2000 0000 0000
+
+#in on e1 tcp 2.1.2.2,25 1.1.1.1,1025 A
+[out,e1] 45 00 0028 0000 4000 3f 06 0000 02020202 01010101
+0019 0401 00000000 00000000 50 10 2000 0000 0000
+
+#in on e0 tcp 1.1.1.1,1025 2.1.2.2,25 F
+45 00 0028 0000 4000 3f 06 0000 01010101 02020202
+0401 0019 00000000 00000000 50 01 2000 0000 0000
+
+#in on e0 tcp 1.1.1.1,1025 2.1.2.2,25 A
+45 00 0028 0000 4000 3f 06 0000 01010101 02020202
+0401 0019 00000000 00000000 50 10 2000 0000 0000
+
+#in on e0 tcp 1.1.1.1,1025 2.1.2.2,25 A
+45 00 0028 0000 4000 3f 06 0000 01010101 02020202
+0401 0019 00000000 00000000 50 10 2000 0000 0000
+
+#in on e1 udp 1.1.1.1,1 4.4.4.4,53
+45 00 0028 0000 4000 3f 11 0000 01010101 04040404
+0001 0035 0000 0000 0102 0304 0506 0708 090a 0b0d
+
+#in on e1 udp 2.2.2.2,2 4.4.4.4,53
+45 00 0028 0000 4000 3f 11 0000 02020202 04040404
+0001 0035 0000 0000 0102 0304 0506 0708 090a 0b0d
+
+#in on e1 udp 2.2.2.2,2 4.4.4.4,53
+45 00 0038 0000 4000 3f 11 0000 02020202 04040404
+0001 0035 0000 0000 0102 0304 0506 0708 090a 0b0d
+0e0f 4061 4263 4465 4667 4869 4a6b 4c6d
+
+#in on e0 ip 4.4.4.4,53 1.1.1.1,1
+45 00 0014 0000 4000 3f 00 0000 02020202 04040404
+
+#in on e0 udp 3.3.3.3,1023 1.1.1.1,2049
+45 00 001c 0000 4000 3f 11 0000 03030303 01010101
+03ff 0801 0000 0000
+
+#in on e0 udp 1.1.1.1,2049 3.3.3.3,1023
+45 00 001c 0000 4000 3f 11 0000 01010101 03030303
+0801 03ff 0000 0000
+
diff --git a/contrib/ipfilter/test/input/ni1 b/contrib/ipfilter/test/input/ni1
new file mode 100644
index 0000000..a099f80
--- /dev/null
+++ b/contrib/ipfilter/test/input/ni1
@@ -0,0 +1,6 @@
+#v tos len id off ttl p sum src dst
+# ICMP timeout exceeded in reply to a ICMP packet going out.
+[out,df0] 45 00 0028 4706 4000 01 11 ced8 0202 0202 0404 0404 afc9 829e 0014 1335 0402 0000 3be5 468d 000a cfc3
+
+[in,df0] 45 00 0038 809a 0000 ff 01 8f31 0303 0303 0101 0101 0b00 ad3f 0000 0000 4500 0028 4703 4000 0111 e781 0606 0606 0404 0404 afc9 829e 0014 1547
+
diff --git a/contrib/ipfilter/test/input/ni2 b/contrib/ipfilter/test/input/ni2
new file mode 100644
index 0000000..95547fe
--- /dev/null
+++ b/contrib/ipfilter/test/input/ni2
@@ -0,0 +1,161 @@
+# Test of fragmentation required coming from the inside.
+[out,xl0]
+4510 002c bd0d 4000 3e06 ea1d
+0a01 0201
+c0a8 0133
+05f6 0077 a664 2485 0000 0000
+6002 4000 5aef 0000 0204 05b4
+
+[in,xl0]
+4500 002c ce83 4000 7e06 98b7
+c0a8 0133
+0a01 0201
+0077 05f6 fbdf 1a21 a664 2486
+6012 2238 62a5 0000 0204 05b4 0000
+
+[out,xl0]
+4510 0028 bd0e 4000 3e06 ea20
+0a01 0201
+c0a8 0133
+05f6 0077 a664 2486 fbdf 1a22
+5010 4470 582a 0000
+
+[in,xl0]
+4500 005b cf83 4000 7e06 9788
+c0a8 0133
+0a01 0201
+0077 05f6 fbdf 1a22 a664 2486
+5018 2238 b5d9 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0a
+
+[out,xl0]
+4510 0028 bd18 4000 3e06 ea16
+0a01 0201
+c0a8 0133
+05f6 0077 a664 2486 fbdf 1a55
+5010 4470 57f7 0000
+
+[out,xl0]
+4510 002e bd1e 4000 3e06 ea0a
+0a01 0201
+c0a8 0133
+05f6 0077 a664 2486 fbdf 1a55
+5018 4470 6b01 0000 0000 0000 0d0a
+
+[in,xl0]
+4500 0048 e383 4000 7e06 839b
+c0a8 0133
+0a01 0201
+0077 05f6 fbdf 1a55 a664 248c
+5018 2232 fe54 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000
+
+[in,xl0]
+4500 05dc e483 4000 7e06 7d07
+c0a8 0133
+0a01 0201
+0077 05f6 fbdf 1a75 a664 248c
+5010 2232 9f6c 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3331 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 1111 2222 3333
+0000 0000 0000 0000 0000 0000 1111 2222
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 1111 2222 3333 0000 0000 0000 0000
+0000 0000 1111 2222 3333 0000 0000 0000
+0000 0000 0000 1111 2222 3333 0000 0000
+0000 0000 0000 0000 1111 2222 3333 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000 0000 0000
+0000 0000 0000 0000 0000 0000
+
+[out,xl0]
+4500 0038 d71d 4000 4001 ce16
+c0a8 6401
+c0a8 0133
+0304 cad5 0000 05a0 4500 05dc
+e483 4000 7e06 7d07 c0a8 0133 0a01 0201
+0077 05f6 fbdf 1a75
+
diff --git a/contrib/ipfilter/test/logtest b/contrib/ipfilter/test/logtest
new file mode 100755
index 0000000..0600056
--- /dev/null
+++ b/contrib/ipfilter/test/logtest
@@ -0,0 +1,48 @@
+#!/bin/sh
+if [ -f /usr/ucb/touch ] ; then
+ TOUCH=/usr/ucb/touch
+else
+ if [ -f /usr/bin/touch ] ; then
+ TOUCH=/usr/bin/touch
+ else
+ if [ -f /bin/touch ] ; then
+ TOUCH=/bin/touch
+ fi
+ fi
+fi
+echo "$1...";
+
+/bin/cp /dev/null results/$1
+/bin/cp /dev/null results/$1.b
+
+( while read rule; do
+ echo $rule >> results/$1
+ echo $rule | ../ipftest -br - -Hi input/$1 -l logout > /dev/null
+ if [ $? -ne 0 ] ; then
+ /bin/rm -f logout
+ exit 1
+ fi
+ ../ipmon -P /dev/null -f logout >> results/$1
+ echo "--------" >> results/$1
+ ../ipmon -P /dev/null -bf logout >> results/$1.b
+ echo "--------" >> results/$1.b
+done ) < regress/$1
+../ipftest -br regress/$1 -Hi input/$1 -l logout > /dev/null
+../ipmon -P /dev/null -f logout >> results/$1
+echo "--------" >> results/$1
+../ipmon -P /dev/null -bf logout >> results/$1.b
+echo "--------" >> results/$1.b
+
+cmp expected/$1 results/$1
+status=$?
+if [ $status -ne 0 ] ; then
+ exit $status
+fi
+cmp expected/$1.b results/$1.b
+status=$?
+if [ $status -ne 0 ] ; then
+ exit $status
+fi
+/bin/rm -f logout
+$TOUCH $1
+exit 0
diff --git a/contrib/ipfilter/test/mtest b/contrib/ipfilter/test/mtest
new file mode 100755
index 0000000..b185abb
--- /dev/null
+++ b/contrib/ipfilter/test/mtest
@@ -0,0 +1,36 @@
+#!/bin/sh
+# multiple rules at the same time
+
+if [ -f /usr/ucb/touch ] ; then
+ TOUCH=/usr/ucb/touch
+else
+ if [ -f /usr/bin/touch ] ; then
+ TOUCH=/usr/bin/touch
+ else
+ if [ -f /bin/touch ] ; then
+ TOUCH=/bin/touch
+ fi
+ fi
+fi
+echo "$1...";
+
+/bin/cp /dev/null results/$1
+
+../ipftest -br regress/$1 -i input/$1 > results/$1
+if [ $? -ne 0 ] ; then
+ exit 1
+fi
+echo "--------" >> results/$1
+
+cmp expected/$1 results/$1
+status=$?
+if [ $status -ne 0 ] ; then
+ exit $status
+fi
+cmp expected/$1 results/$1
+status=$?
+if [ $status -ne 0 ] ; then
+ exit $status
+fi
+$TOUCH $1
+exit 0
diff --git a/contrib/ipfilter/test/natipftest b/contrib/ipfilter/test/natipftest
new file mode 100755
index 0000000..8627168
--- /dev/null
+++ b/contrib/ipfilter/test/natipftest
@@ -0,0 +1,28 @@
+#!/bin/sh
+if [ -f /usr/ucb/touch ] ; then
+ TOUCH=/usr/ucb/touch
+else
+ if [ -f /usr/bin/touch ] ; then
+ TOUCH=/usr/bin/touch
+ else
+ if [ -f /bin/touch ] ; then
+ TOUCH=/bin/touch
+ fi
+ fi
+fi
+echo "$1...";
+/bin/cp /dev/null results/$1
+( while read rule; do
+ echo "$rule" | ../ipftest -bHx -r regress/$1.ipf -Nr - -i input/$1 >> \
+ results/$1;
+ if [ $? -ne 0 ] ; then
+ exit 1;
+ fi
+ echo "-------------------------------" >> results/$1
+done ) < regress/$1.nat
+cmp expected/$1 results/$1
+status=$?
+if [ $status = 0 ] ; then
+ $TOUCH $1
+fi
+exit $status
diff --git a/contrib/ipfilter/test/regress/f15 b/contrib/ipfilter/test/regress/f15
new file mode 100644
index 0000000..16185e1
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f15
@@ -0,0 +1,8 @@
+block in log quick on hme0 from any to 195.134.65.0/25 head 10
+block return-rst in log quick proto tcp all flags S head 100 group 10
+pass in quick proto tcp from any to any port = 22 keep state group 100
+pass in quick proto tcp from any to any port = 23 keep state group 100
+pass in quick proto tcp from any to any port = 21 keep state group 100
+block return-icmp in quick proto udp all keep state head 110 group 10
+pass in quick proto udp from any to any port = 53 keep state group 110
+block in log quick on hme0 from any to any
diff --git a/contrib/ipfilter/test/regress/f16 b/contrib/ipfilter/test/regress/f16
new file mode 100644
index 0000000..920ad8c
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f16
@@ -0,0 +1,10 @@
+pass in all
+skip 2 in proto tcp all
+block in quick proto tcp all
+skip 4 in proto udp all
+block in quick proto udp all
+pass in quick proto tcp from any to 1.1.1.1
+pass in quick proto tcp from any to 1.1.1.2 port = 22
+block in quick proto udp from any to any port = 53
+pass in quick proto udp from any to any port = 53
+block in all
diff --git a/contrib/ipfilter/test/regress/ipf6-1 b/contrib/ipfilter/test/regress/ipf6-1
new file mode 100644
index 0000000..814dfd6
--- /dev/null
+++ b/contrib/ipfilter/test/regress/ipf6-1
@@ -0,0 +1,3 @@
+block in all
+block out all
+pass out proto 58 all keep state
diff --git a/contrib/ipfilter/test/regress/l1 b/contrib/ipfilter/test/regress/l1
new file mode 100644
index 0000000..88cca58
--- /dev/null
+++ b/contrib/ipfilter/test/regress/l1
@@ -0,0 +1,6 @@
+log in all
+pass in on anon0 all head 100
+pass in log quick from 3.3.3.3 to any group 100
+pass in log body quick from 2.2.2.2 to any
+pass in log quick proto tcp from 1.1.1.1 to any flags S keep state
+pass in log first quick proto tcp from 1.1.1.1 to any flags S keep state
diff --git a/contrib/ipfilter/test/regress/ni1.ipf b/contrib/ipfilter/test/regress/ni1.ipf
new file mode 100644
index 0000000..c7e5797
--- /dev/null
+++ b/contrib/ipfilter/test/regress/ni1.ipf
@@ -0,0 +1,4 @@
+block in all
+block out all
+pass out proto udp from any to any keep state
+pass out proto tcp from any to any flags S keep state
diff --git a/contrib/ipfilter/test/regress/ni1.nat b/contrib/ipfilter/test/regress/ni1.nat
new file mode 100644
index 0000000..4306f4b
--- /dev/null
+++ b/contrib/ipfilter/test/regress/ni1.nat
@@ -0,0 +1 @@
+map df0 2.2.2.2/32 -> 6.6.6.6/32
diff --git a/contrib/ipfilter/test/regress/ni2.ipf b/contrib/ipfilter/test/regress/ni2.ipf
new file mode 100644
index 0000000..5956cf9
--- /dev/null
+++ b/contrib/ipfilter/test/regress/ni2.ipf
@@ -0,0 +1 @@
+pass out quick proto tcp from any to any flags S/SAFR keep state
diff --git a/contrib/ipfilter/test/regress/ni2.nat b/contrib/ipfilter/test/regress/ni2.nat
new file mode 100644
index 0000000..4ad73c2
--- /dev/null
+++ b/contrib/ipfilter/test/regress/ni2.nat
@@ -0,0 +1 @@
+map xl0 10.0.0.0/8 -> 1.1.1.1/32 portmap tcp/udp 40000:60000
OpenPOWER on IntegriCloud