summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/test
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ipfilter/test')
-rw-r--r--contrib/ipfilter/test/Makefile16
-rw-r--r--contrib/ipfilter/test/dotest1
-rw-r--r--contrib/ipfilter/test/expected/f120
-rw-r--r--contrib/ipfilter/test/expected/f10126
-rw-r--r--contrib/ipfilter/test/expected/f1172
-rw-r--r--contrib/ipfilter/test/expected/f1260
-rw-r--r--contrib/ipfilter/test/expected/f1448
-rw-r--r--contrib/ipfilter/test/expected/f242
-rw-r--r--contrib/ipfilter/test/expected/f348
-rw-r--r--contrib/ipfilter/test/expected/f448
-rw-r--r--contrib/ipfilter/test/expected/f51392
-rw-r--r--contrib/ipfilter/test/expected/f61392
-rw-r--r--contrib/ipfilter/test/expected/f760
-rw-r--r--contrib/ipfilter/test/expected/f842
-rw-r--r--contrib/ipfilter/test/expected/f9126
-rw-r--r--contrib/ipfilter/test/expected/n196
-rw-r--r--contrib/ipfilter/test/expected/n280
-rw-r--r--contrib/ipfilter/test/expected/n312
-rw-r--r--contrib/ipfilter/test/expected/n430
-rw-r--r--contrib/ipfilter/test/hextest4
-rw-r--r--contrib/ipfilter/test/input/f14
-rw-r--r--contrib/ipfilter/test/input/f106
-rw-r--r--contrib/ipfilter/test/input/f1111
-rw-r--r--contrib/ipfilter/test/input/f1235
-rw-r--r--contrib/ipfilter/test/input/f1339
-rw-r--r--contrib/ipfilter/test/input/f145
-rw-r--r--contrib/ipfilter/test/input/f26
-rw-r--r--contrib/ipfilter/test/input/f35
-rw-r--r--contrib/ipfilter/test/input/f45
-rw-r--r--contrib/ipfilter/test/input/f528
-rw-r--r--contrib/ipfilter/test/input/f628
-rw-r--r--contrib/ipfilter/test/input/f79
-rw-r--r--contrib/ipfilter/test/input/f86
-rw-r--r--contrib/ipfilter/test/input/f96
-rw-r--r--contrib/ipfilter/test/input/n131
-rw-r--r--contrib/ipfilter/test/input/n219
-rw-r--r--contrib/ipfilter/test/input/n35
-rw-r--r--contrib/ipfilter/test/input/n45
-rwxr-xr-xcontrib/ipfilter/test/nattest27
-rw-r--r--contrib/ipfilter/test/regress/f14
-rw-r--r--contrib/ipfilter/test/regress/f1018
-rw-r--r--contrib/ipfilter/test/regress/f116
-rw-r--r--contrib/ipfilter/test/regress/f126
-rw-r--r--contrib/ipfilter/test/regress/f136
-rw-r--r--contrib/ipfilter/test/regress/f148
-rw-r--r--contrib/ipfilter/test/regress/f26
-rw-r--r--contrib/ipfilter/test/regress/f38
-rw-r--r--contrib/ipfilter/test/regress/f48
-rw-r--r--contrib/ipfilter/test/regress/f548
-rw-r--r--contrib/ipfilter/test/regress/f648
-rw-r--r--contrib/ipfilter/test/regress/f76
-rw-r--r--contrib/ipfilter/test/regress/f86
-rw-r--r--contrib/ipfilter/test/regress/f918
-rw-r--r--contrib/ipfilter/test/regress/n13
-rw-r--r--contrib/ipfilter/test/regress/n24
-rw-r--r--contrib/ipfilter/test/regress/n32
-rw-r--r--contrib/ipfilter/test/regress/n45
57 files changed, 4200 insertions, 5 deletions
diff --git a/contrib/ipfilter/test/Makefile b/contrib/ipfilter/test/Makefile
index a0e07e7..a6d73ef 100644
--- a/contrib/ipfilter/test/Makefile
+++ b/contrib/ipfilter/test/Makefile
@@ -9,29 +9,35 @@ BINDEST=/usr/local/bin
SBINDEST=/sbin
MANDIR=/usr/share/man
-tests: first 0 ftests ptests
+tests: first 0 ftests ptests ntests
first:
-mkdir -p results
# Filtering tests
-ftests: 1 2 3 4 5 6 7 8 9 10 11 12 14
+ftests: f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f14
# Rule parsing tests
ptests: i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11
+ntests: n1 n2 n3 n4
+
0:
@(cd ..; make ipftest; )
-1 2 3 4 5 6 7 8 9 10 11 14:
+f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f14:
@/bin/sh ./dotest $@
-12:
+f12:
@/bin/sh ./hextest $@
i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11:
@/bin/sh ./itest $@
+n1 n2 n3 n4:
+ @/bin/sh ./nattest $@
+
clean:
- /bin/rm -f 1 2 3 4 5 6 7 8 9 10 11 12 results/*
+ /bin/rm -f f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f14 results/*
/bin/rm -f i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11
+ /bin/rm -f n1 n2 n3 n4
diff --git a/contrib/ipfilter/test/dotest b/contrib/ipfilter/test/dotest
index 06d04c5..5a11605 100644
--- a/contrib/ipfilter/test/dotest
+++ b/contrib/ipfilter/test/dotest
@@ -17,6 +17,7 @@ echo "$1...";
if [ $? -ne 0 ] ; then
exit 1;
fi
+ echo "--------" >> results/$1
done ) < regress/$1
cmp expected/$1 results/$1
status=$?
diff --git a/contrib/ipfilter/test/expected/f1 b/contrib/ipfilter/test/expected/f1
new file mode 100644
index 0000000..86d9592
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f1
@@ -0,0 +1,20 @@
+block
+block
+nomatch
+nomatch
+--------
+pass
+pass
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+block
+block
+--------
+nomatch
+nomatch
+pass
+pass
+--------
diff --git a/contrib/ipfilter/test/expected/f10 b/contrib/ipfilter/test/expected/f10
new file mode 100644
index 0000000..da6c312
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f10
@@ -0,0 +1,126 @@
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+--------
+block
+block
+block
+nomatch
+nomatch
+block
+--------
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+--------
+block
+block
+nomatch
+nomatch
+nomatch
+block
+--------
+pass
+pass
+nomatch
+nomatch
+nomatch
+pass
+--------
+block
+block
+block
+block
+block
+block
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+block
+block
+block
+nomatch
+block
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+pass
+--------
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+block
+block
+block
+--------
+nomatch
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+nomatch
+block
+nomatch
+block
+--------
+pass
+pass
+nomatch
+pass
+nomatch
+pass
+--------
+block
+block
+block
+block
+block
+block
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+block
+nomatch
+nomatch
+block
+--------
diff --git a/contrib/ipfilter/test/expected/f11 b/contrib/ipfilter/test/expected/f11
new file mode 100644
index 0000000..ac37783
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f11
@@ -0,0 +1,72 @@
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+nomatch
+--------
diff --git a/contrib/ipfilter/test/expected/f12 b/contrib/ipfilter/test/expected/f12
new file mode 100644
index 0000000..88354d9
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f12
@@ -0,0 +1,60 @@
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+pass
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+--------
diff --git a/contrib/ipfilter/test/expected/f14 b/contrib/ipfilter/test/expected/f14
new file mode 100644
index 0000000..1c6ed5c
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f14
@@ -0,0 +1,48 @@
+block
+nomatch
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+nomatch
+nomatch
+pass
+pass
+--------
+block
+nomatch
+nomatch
+nomatch
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
diff --git a/contrib/ipfilter/test/expected/f2 b/contrib/ipfilter/test/expected/f2
new file mode 100644
index 0000000..7093a41
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f2
@@ -0,0 +1,42 @@
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+block
+block
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+--------
diff --git a/contrib/ipfilter/test/expected/f3 b/contrib/ipfilter/test/expected/f3
new file mode 100644
index 0000000..5df3ac4
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f3
@@ -0,0 +1,48 @@
+nomatch
+block
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+nomatch
+nomatch
+--------
+nomatch
+pass
+pass
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+block
+nomatch
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+--------
+block
+block
+block
+block
+block
+--------
+pass
+pass
+pass
+pass
+pass
+--------
diff --git a/contrib/ipfilter/test/expected/f4 b/contrib/ipfilter/test/expected/f4
new file mode 100644
index 0000000..5df3ac4
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f4
@@ -0,0 +1,48 @@
+nomatch
+block
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+nomatch
+nomatch
+--------
+nomatch
+pass
+pass
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+block
+nomatch
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+--------
+block
+block
+block
+block
+block
+--------
+pass
+pass
+pass
+pass
+pass
+--------
diff --git a/contrib/ipfilter/test/expected/f5 b/contrib/ipfilter/test/expected/f5
new file mode 100644
index 0000000..36c7d40
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f5
@@ -0,0 +1,1392 @@
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+--------
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+--------
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
diff --git a/contrib/ipfilter/test/expected/f6 b/contrib/ipfilter/test/expected/f6
new file mode 100644
index 0000000..36c7d40
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f6
@@ -0,0 +1,1392 @@
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+--------
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+block
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+pass
+--------
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
diff --git a/contrib/ipfilter/test/expected/f7 b/contrib/ipfilter/test/expected/f7
new file mode 100644
index 0000000..6aa7951
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f7
@@ -0,0 +1,60 @@
+block
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+pass
+pass
+--------
diff --git a/contrib/ipfilter/test/expected/f8 b/contrib/ipfilter/test/expected/f8
new file mode 100644
index 0000000..ad42ff2
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f8
@@ -0,0 +1,42 @@
+block
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+block
+nomatch
+block
+nomatch
+nomatch
+nomatch
+--------
+pass
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
diff --git a/contrib/ipfilter/test/expected/f9 b/contrib/ipfilter/test/expected/f9
new file mode 100644
index 0000000..709744d
--- /dev/null
+++ b/contrib/ipfilter/test/expected/f9
@@ -0,0 +1,126 @@
+block
+block
+block
+block
+block
+block
+--------
+nomatch
+nomatch
+nomatch
+pass
+pass
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+block
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+pass
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+block
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+pass
+pass
+pass
+pass
+--------
+block
+block
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+nomatch
+--------
+nomatch
+nomatch
+nomatch
+block
+block
+nomatch
+--------
diff --git a/contrib/ipfilter/test/expected/n1 b/contrib/ipfilter/test/expected/n1
new file mode 100644
index 0000000..77365f8
--- /dev/null
+++ b/contrib/ipfilter/test/expected/n1
@@ -0,0 +1,96 @@
+ip 20(20) 255 10.1.1.0 > 10.1.1.2
+ip 20(20) 255 10.2.2.2 > 10.1.1.2
+ip 20(20) 255 10.1.1.2 > 10.1.1.1
+ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025
+ip 20(20) 255 10.2.2.1 > 10.1.2.1
+ip 20(20) 255 10.2.2.2 > 10.1.2.1
+ip 20(20) 255 10.1.1.1 > 10.1.1.2
+ip 20(20) 255 10.1.1.2 > 10.1.1.1
+ip 20(20) 255 10.2.2.1 > 10.2.1.1
+ip 20(20) 255 10.2.2.2 > 10.2.1.1
+ip 20(20) 255 10.2.2.3 > 10.1.1.1
+ip 20(20) 255 10.2.3.4 > 10.2.2.2
+ip 20(20) 255 10.1.1.1 > 10.2.2.2
+ip 20(20) 255 10.1.1.2 > 10.1.1.1
+ip 20(20) 255 10.1.1.0 > 10.3.4.5
+ip 20(20) 255 10.1.1.1 > 10.3.4.5
+ip 20(20) 255 10.1.1.2 > 10.3.4.5
+ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025
+ip 48(20) 1 10.2.2.2 > 10.4.3.2
+ip 48(20) 1 10.4.3.2 > 10.1.1.1
+ip 48(20) 1 10.4.3.2 > 10.3.4.3
+ip 48(20) 1 10.4.3.2 > 10.3.4.5
+ip 20(20) 34 10.1.1.2 > 10.4.3.2
+ip 20(20) 34 10.4.3.2 > 10.3.4.4
+ip 20(20) 34 10.1.1.2 > 10.4.3.4
+ip 20(20) 34 10.4.3.4 > 10.3.4.5
+ip 20(20) 34 10.1.1.3 > 10.4.3.4
+ip 20(20) 34 10.4.3.4 > 10.3.4.6
+ip 20(20) 35 10.1.1.3 > 10.4.3.4
+ip 20(20) 35 10.4.3.4 > 10.3.4.7
+-------------------------------
+ip 20(20) 255 10.3.4.5 > 10.1.1.2
+ip 20(20) 255 10.1.1.1 > 10.1.1.2
+ip 20(20) 255 10.3.4.5 > 10.1.1.1
+ip 40(20) 6 10.3.4.5,1025 > 10.1.1.1,1025
+ip 40(20) 6 10.3.4.5,1026 > 10.1.1.1,1025
+ip 20(20) 255 10.2.2.1 > 10.1.2.1
+ip 20(20) 255 10.2.2.2 > 10.1.2.1
+ip 20(20) 255 10.1.1.1 > 10.1.1.2
+ip 20(20) 255 10.1.1.2 > 10.1.1.1
+ip 20(20) 255 10.2.2.1 > 10.2.1.1
+ip 20(20) 255 10.2.2.2 > 10.2.1.1
+ip 20(20) 255 10.2.2.3 > 10.1.1.1
+ip 20(20) 255 10.2.3.4 > 10.2.2.2
+ip 20(20) 255 10.1.1.1 > 10.2.2.2
+ip 20(20) 255 10.1.1.2 > 10.2.2.2
+ip 20(20) 255 10.1.1.0 > 10.3.4.5
+ip 20(20) 255 10.1.1.1 > 10.1.1.2
+ip 20(20) 255 10.1.1.2 > 10.1.1.0
+ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+ip 48(20) 1 10.3.4.5 > 10.4.3.2
+ip 48(20) 1 10.4.3.2 > 10.2.2.2
+ip 48(20) 1 10.4.3.2 > 10.3.4.3
+ip 48(20) 1 10.4.3.2 > 10.1.1.1
+ip 20(20) 34 10.3.4.5 > 10.4.3.2
+ip 20(20) 34 10.4.3.2 > 10.3.4.4
+ip 20(20) 34 10.3.4.5 > 10.4.3.4
+ip 20(20) 34 10.4.3.4 > 10.1.1.2
+ip 20(20) 34 10.1.1.3 > 10.4.3.4
+ip 20(20) 34 10.4.3.4 > 10.3.4.6
+ip 20(20) 35 10.3.4.5 > 10.4.3.4
+ip 20(20) 35 10.4.3.4 > 10.3.4.7
+-------------------------------
+ip 20(20) 255 10.3.4.1 > 10.1.1.2
+ip 20(20) 255 10.3.4.2 > 10.1.1.2
+ip 20(20) 255 10.3.4.3 > 10.1.1.1
+ip 40(20) 6 10.3.4.3,1025 > 10.1.1.1,1025
+ip 40(20) 6 10.3.4.3,1026 > 10.1.1.1,1025
+ip 20(20) 255 10.2.2.1 > 10.1.2.1
+ip 20(20) 255 10.2.2.2 > 10.1.2.1
+ip 20(20) 255 10.1.1.1 > 10.1.1.2
+ip 20(20) 255 10.1.1.2 > 10.1.1.1
+ip 20(20) 255 10.2.2.1 > 10.2.1.1
+ip 20(20) 255 10.2.2.2 > 10.2.1.1
+ip 20(20) 255 10.2.2.3 > 10.1.1.1
+ip 20(20) 255 10.2.3.4 > 10.2.2.2
+ip 20(20) 255 10.1.1.1 > 10.2.2.2
+ip 20(20) 255 10.1.1.2 > 10.2.2.2
+ip 20(20) 255 10.1.1.0 > 10.3.4.5
+ip 20(20) 255 10.1.1.1 > 10.3.4.5
+ip 20(20) 255 10.1.1.2 > 10.3.4.5
+ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025
+ip 48(20) 1 10.3.4.4 > 10.4.3.2
+ip 48(20) 1 10.4.3.2 > 10.2.2.2
+ip 48(20) 1 10.4.3.2 > 10.3.4.3
+ip 48(20) 1 10.4.3.2 > 10.3.4.5
+ip 20(20) 34 10.3.4.5 > 10.4.3.2
+ip 20(20) 34 10.4.3.2 > 10.3.4.4
+ip 20(20) 34 10.3.4.6 > 10.4.3.4
+ip 20(20) 34 10.4.3.4 > 10.3.4.5
+ip 20(20) 34 10.3.4.7 > 10.4.3.4
+ip 20(20) 34 10.4.3.4 > 10.1.1.2
+ip 20(20) 35 10.3.4.7 > 10.4.3.4
+ip 20(20) 35 10.4.3.4 > 10.1.1.3
+-------------------------------
diff --git a/contrib/ipfilter/test/expected/n2 b/contrib/ipfilter/test/expected/n2
new file mode 100644
index 0000000..dc70138
--- /dev/null
+++ b/contrib/ipfilter/test/expected/n2
@@ -0,0 +1,80 @@
+ip 40(20) 6 10.2.2.2,10000 > 10.1.1.1,1025
+ip 40(20) 6 10.2.2.2,10001 > 10.1.1.2,1025
+ip 20(20) 0 10.1.1.0 > 10.1.1.2
+ip 20(20) 0 10.1.1.1 > 10.1.2.1
+ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025
+ip 28(20) 17 10.1.1.2,1025 > 10.1.1.1,1025
+ip 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80
+ip 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80
+ip 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80
+ip 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80
+ip 20(20) 0 10.1.1.1 > 10.1.1.2
+ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+ip 20(20) 0 10.1.1.2 > 10.1.1.1
+ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000
+ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+-------------------------------
+ip 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025
+ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+ip 20(20) 0 10.1.1.0 > 10.1.1.2
+ip 20(20) 0 10.1.1.1 > 10.1.2.1
+ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025
+ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025
+ip 28(20) 17 10.3.4.5,10000 > 10.1.1.1,1025
+ip 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80
+ip 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80
+ip 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80
+ip 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80
+ip 20(20) 0 10.1.1.1 > 10.1.1.2
+ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+ip 20(20) 0 10.1.1.2 > 10.1.1.1
+ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000
+ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+-------------------------------
+ip 40(20) 6 10.3.4.1,10000 > 10.1.1.1,1025
+ip 40(20) 6 10.3.4.1,10001 > 10.1.1.2,1025
+ip 20(20) 0 10.1.1.0 > 10.1.1.2
+ip 20(20) 0 10.1.1.1 > 10.1.2.1
+ip 40(20) 6 10.3.4.1,10002 > 10.1.1.1,1025
+ip 40(20) 6 10.3.4.1,10002 > 10.1.1.1,1025
+ip 40(20) 6 10.3.4.1,10003 > 10.1.1.1,1025
+ip 28(20) 17 10.3.4.1,10004 > 10.1.1.1,1025
+ip 40(20) 6 10.3.4.1,10005 > 10.1.2.1,80
+ip 40(20) 6 10.3.4.1,10006 > 10.1.3.1,80
+ip 40(20) 6 10.3.4.1,10007 > 10.1.4.1,80
+ip 40(20) 6 10.3.4.1,10008 > 10.1.4.1,80
+ip 20(20) 0 10.1.1.1 > 10.1.1.2
+ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+ip 20(20) 0 10.1.1.2 > 10.1.1.1
+ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000
+ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001
+-------------------------------
+ip 40(20) 6 10.3.4.5,40000 > 10.1.1.1,1025
+ip 40(20) 6 10.3.4.5,40001 > 10.1.1.2,1025
+ip 20(20) 0 10.1.1.0 > 10.1.1.2
+ip 20(20) 0 10.1.1.1 > 10.1.2.1
+ip 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025
+ip 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025
+ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025
+ip 28(20) 17 10.3.4.5,40000 > 10.1.1.1,1025
+ip 40(20) 6 10.3.4.5,40001 > 10.1.2.1,80
+ip 40(20) 6 10.3.4.5,40000 > 10.1.3.1,80
+ip 40(20) 6 10.3.4.5,40001 > 10.1.4.1,80
+ip 40(20) 6 10.3.4.5,40000 > 10.1.4.1,80
+ip 20(20) 0 10.1.1.1 > 10.1.1.2
+ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025
+ip 20(20) 0 10.1.1.2 > 10.1.1.1
+ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000
+ip 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025
+ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001
+ip 40(20) 6 10.1.2.1,80 > 10.1.1.3,2000
+-------------------------------
diff --git a/contrib/ipfilter/test/expected/n3 b/contrib/ipfilter/test/expected/n3
new file mode 100644
index 0000000..03c0717
--- /dev/null
+++ b/contrib/ipfilter/test/expected/n3
@@ -0,0 +1,12 @@
+ip 40(20) 6 192.168.2.1,1488 > 203.1.1.1,80
+ip 40(20) 6 192.168.2.1,1276 > 203.1.1.1,80
+ip 40(20) 6 192.168.2.1,1032 > 203.1.1.1,80
+ip 28(20) 17 192.168.2.1,1032 > 203.1.1.1,80
+ip 40(20) 6 192.168.2.1,65299 > 203.1.1.1,80
+-------------------------------
+ip 40(20) 6 192.168.1.1,1488 > 203.1.1.1,80
+ip 40(20) 6 192.168.1.1,1276 > 203.1.1.1,80
+ip 40(20) 6 192.168.1.0,1032 > 203.1.1.1,80
+ip 28(20) 17 192.168.1.0,1032 > 203.1.1.1,80
+ip 40(20) 6 192.168.1.255,65299 > 203.1.1.1,80
+-------------------------------
diff --git a/contrib/ipfilter/test/expected/n4 b/contrib/ipfilter/test/expected/n4
new file mode 100644
index 0000000..c6fb4d4
--- /dev/null
+++ b/contrib/ipfilter/test/expected/n4
@@ -0,0 +1,30 @@
+ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023
+ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53
+ip 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23
+ip 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53
+ip 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53
+-------------------------------
+ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023
+ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53
+ip 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23
+ip 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53
+ip 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53
+-------------------------------
+ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023
+ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53
+ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023
+ip 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53
+ip 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53
+-------------------------------
+ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,23
+ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53
+ip 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23
+ip 28(20) 17 10.3.3.3,12345 > 10.2.2.1,10053
+ip 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53
+-------------------------------
+ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,23
+ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,53
+ip 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23
+ip 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53
+ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,53
+-------------------------------
diff --git a/contrib/ipfilter/test/hextest b/contrib/ipfilter/test/hextest
index 76e1af5..c500c6b 100644
--- a/contrib/ipfilter/test/hextest
+++ b/contrib/ipfilter/test/hextest
@@ -14,6 +14,10 @@ echo "$1...";
/bin/cp /dev/null results/$1
( while read rule; do
echo "$rule" | ../ipftest -br - -Hi input/$1 >> results/$1;
+ if [ $? -ne 0 ] ; then
+ exit 1;
+ fi
+ echo "--------" >> results/$1
done ) < regress/$1
cmp expected/$1 results/$1
status=$?
diff --git a/contrib/ipfilter/test/input/f1 b/contrib/ipfilter/test/input/f1
new file mode 100644
index 0000000..7c3ae8a
--- /dev/null
+++ b/contrib/ipfilter/test/input/f1
@@ -0,0 +1,4 @@
+in 127.0.0.1 127.0.0.1
+in 1.1.1.1 1.2.1.1
+out 127.0.0.1 127.0.0.1
+out 1.1.1.1 1.2.1.1
diff --git a/contrib/ipfilter/test/input/f10 b/contrib/ipfilter/test/input/f10
new file mode 100644
index 0000000..254cee7
--- /dev/null
+++ b/contrib/ipfilter/test/input/f10
@@ -0,0 +1,6 @@
+in 1.1.1.1 2.1.1.1 opt lsrr
+in 1.1.1.1 2.1.1.1
+in 1.1.1.1 2.1.1.1 opt ts
+in 1.1.1.1 2.1.1.1 opt sec-class=topsecret
+in 1.1.1.1 2.1.1.1 opt ssrr,sec-class=topsecret
+in 1.1.1.1 2.1.1.1 opt sec
diff --git a/contrib/ipfilter/test/input/f11 b/contrib/ipfilter/test/input/f11
new file mode 100644
index 0000000..4eda58e
--- /dev/null
+++ b/contrib/ipfilter/test/input/f11
@@ -0,0 +1,11 @@
+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,23 A
+in on e1 tcp 2.1.2.2,23 1.1.1.1,1 A
+in on e0 tcp 1.1.1.1,1 2.1.2.2,23 F
+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 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
+in on e0 udp 4.4.4.4,1023 1.1.1.1,2049
+in on e0 udp 4.4.4.4,2049 1.1.1.1,1023
diff --git a/contrib/ipfilter/test/input/f12 b/contrib/ipfilter/test/input/f12
new file mode 100644
index 0000000..5d9c1de
--- /dev/null
+++ b/contrib/ipfilter/test/input/f12
@@ -0,0 +1,35 @@
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF SYN
+45 00 0028 0000 4000 3f 06 0000 01010101 02010101
+0401 0019 00000000 00000000 50 02 2000 0000 0000
+
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF ACK
+45 00 0028 0000 4000 3f 06 0000 01010101 02010101
+0401 0019 00000000 00000000 50 10 2000 0000 0000
+
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF MF FO=0 ACK
+45 00 0028 0000 6000 3f 06 0000 01010101 02010101
+0401 0019 00000000 00000000 50 10 2000 0000 0000
+
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF FO=0
+45 00 001c 0000 6000 3f 06 0000 01010101 02010101
+0401 0019 00000000
+
+# 1.1.1.1 -> 2.1.1.1 TTL=63 TCP DF FO=1 ACK
+45 00 001c 0000 6001 3f 06 0000 01010101 02010101
+00000000 50 10 2000
+
+# 1.1.1.1 -> 2.1.1.1 TTL=63 UDP DF MF FO=0
+45 00 0014 0000 6000 3f 11 0000 01010101 02010101
+
+# 1.1.1.1,53 -> 2.1.1.1,53 TTL=63 UDP MF FO=0
+45 00 0018 0000 2000 3f 11 0000 01010101 02010101
+0035 0035
+
+# 1.1.1.1,1 -> 2.1.1.1,1 TTL=63 UDP MF FO=0
+45 00 001c 0000 2000 3f 11 0000 01010101 02010101
+0001 0001 0004 0000
+
+# 1.1.1.1,53 -> 2.1.1.1,53 TTL=63 UDP MF FO=0
+45 00 001c 0000 2000 3f 11 0000 01010101 02010101
+0035 0035 0004 0000
+
diff --git a/contrib/ipfilter/test/input/f13 b/contrib/ipfilter/test/input/f13
new file mode 100644
index 0000000..56ec16d
--- /dev/null
+++ b/contrib/ipfilter/test/input/f13
@@ -0,0 +1,39 @@
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF,MF,FO=0 SYN
+45 00 0028 0001 4000 3f 06 0000 01010101 02010101
+0401 0019 00000000 00000000 50 02 2000 0000 0000
+
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP MF ACK
+45 00 0024 0002 2000 3f 06 0000 01010101 02010101
+0401001900000000 0000000050102000
+
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP FO=2 ACK
+45 00 002c 0002 0002 3f 06 0000 01010101 02010101
+0000000000010203 0405060708090a0b 0c0d0e0f10111213
+
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF MF FO=0 SYN
+45 00 0028 0003 6000 3f 06 0000 01010101 02010101
+0401 0019 00000000 00000000 50 10 2000 0000 0000
+
+# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF FO=0
+45 00 001c 0004 6000 3f 06 0000 01010101 02010101
+0401 0019 00000000
+
+# 1.1.1.1 -> 2.1.1.1 TTL=63 TCP DF FO=1 SYN
+45 00 001c 0005 6001 3f 06 0000 01010101 02010101
+00000000 50 10 2000
+
+# 1.1.1.1 -> 2.1.1.1 TTL=63 UDP DF MF FO=0
+45 00 0014 0006 6000 3f 11 0000 01010101 02010101
+
+# 1.1.1.1,53 -> 2.1.1.1,53 TTL=63 UDP MF FO=0
+45 00 0018 0007 2000 3f 11 0000 01010101 02010101
+0035 0035
+
+# 1.1.1.1,1 -> 2.1.1.1,1 TTL=63 UDP MF FO=0
+45 00 001c 0008 2000 3f 11 0000 01010101 02010101
+0035003500040000
+
+# 1.1.1.1,53 -> 2.1.1.1,53 TTL=63 UDP FO=1
+45 00 001c 0008 0001 3f 11 0000 01010101 02010101
+0000000000000000
+
diff --git a/contrib/ipfilter/test/input/f14 b/contrib/ipfilter/test/input/f14
new file mode 100644
index 0000000..16a806f
--- /dev/null
+++ b/contrib/ipfilter/test/input/f14
@@ -0,0 +1,5 @@
+in 127.0.0.1 127.0.0.1
+in 1.1.1.1 1.2.1.1
+in 1.1.1.2 1.2.1.1
+in 1.1.2.2 1.2.1.1
+in 1.2.2.2 1.2.1.1
diff --git a/contrib/ipfilter/test/input/f2 b/contrib/ipfilter/test/input/f2
new file mode 100644
index 0000000..d168af0
--- /dev/null
+++ b/contrib/ipfilter/test/input/f2
@@ -0,0 +1,6 @@
+in tcp 127.0.0.1,1 127.0.0.1,21
+in tcp 1.1.1.1,1 1.2.1.1,21
+in udp 127.0.0.1,1 127.0.0.1,21
+in udp 1.1.1.1,1 1.2.1.1,21
+in icmp 127.0.0.1 127.0.0.1
+in icmp 1.1.1.1 1.2.1.1
diff --git a/contrib/ipfilter/test/input/f3 b/contrib/ipfilter/test/input/f3
new file mode 100644
index 0000000..16a806f
--- /dev/null
+++ b/contrib/ipfilter/test/input/f3
@@ -0,0 +1,5 @@
+in 127.0.0.1 127.0.0.1
+in 1.1.1.1 1.2.1.1
+in 1.1.1.2 1.2.1.1
+in 1.1.2.2 1.2.1.1
+in 1.2.2.2 1.2.1.1
diff --git a/contrib/ipfilter/test/input/f4 b/contrib/ipfilter/test/input/f4
new file mode 100644
index 0000000..2956d1b
--- /dev/null
+++ b/contrib/ipfilter/test/input/f4
@@ -0,0 +1,5 @@
+in 127.0.0.1 127.0.0.1
+in 1.1.1.1 1.1.1.1
+in 1.1.1.1 1.1.1.2
+in 1.1.1.1 1.1.2.2
+in 1.1.1.1 1.2.2.2
diff --git a/contrib/ipfilter/test/input/f5 b/contrib/ipfilter/test/input/f5
new file mode 100644
index 0000000..41600c1
--- /dev/null
+++ b/contrib/ipfilter/test/input/f5
@@ -0,0 +1,28 @@
+in tcp 1.1.1.1,0 2.2.2.2,2222
+in tcp 1.1.1.1,1 2.2.2.2,2222
+in tcp 1.1.1.1,23 2.2.2.2,2222
+in tcp 1.1.1.1,21 2.2.2.2,2222
+in tcp 1.1.1.1,1023 2.2.2.2,2222
+in tcp 1.1.1.1,1024 2.2.2.2,2222
+in tcp 1.1.1.1,1025 2.2.2.2,2222
+in tcp 1.1.1.1,32767 2.2.2.2,2222
+in tcp 1.1.1.1,32768 2.2.2.2,2222
+in tcp 1.1.1.1,65535 2.2.2.2,2222
+in tcp 1.1.1.1,5999 2.2.2.2,2222
+in tcp 1.1.1.1,6000 2.2.2.2,2222
+in tcp 1.1.1.1,6009 2.2.2.2,2222
+in tcp 1.1.1.1,6010 2.2.2.2,2222
+in udp 1.1.1.1,0 2.2.2.2,2222
+in udp 1.1.1.1,1 2.2.2.2,2222
+in udp 1.1.1.1,23 2.2.2.2,2222
+in udp 1.1.1.1,21 2.2.2.2,2222
+in udp 1.1.1.1,1023 2.2.2.2,2222
+in udp 1.1.1.1,1024 2.2.2.2,2222
+in udp 1.1.1.1,1025 2.2.2.2,2222
+in udp 1.1.1.1,32767 2.2.2.2,2222
+in udp 1.1.1.1,32768 2.2.2.2,2222
+in udp 1.1.1.1,65535 2.2.2.2,2222
+in udp 1.1.1.1,5999 2.2.2.2,2222
+in udp 1.1.1.1,6000 2.2.2.2,2222
+in udp 1.1.1.1,6009 2.2.2.2,2222
+in udp 1.1.1.1,6010 2.2.2.2,2222
diff --git a/contrib/ipfilter/test/input/f6 b/contrib/ipfilter/test/input/f6
new file mode 100644
index 0000000..21f0be3
--- /dev/null
+++ b/contrib/ipfilter/test/input/f6
@@ -0,0 +1,28 @@
+in tcp 2.2.2.2,2222 1.1.1.1,0
+in tcp 2.2.2.2,2222 1.1.1.1,1
+in tcp 2.2.2.2,2222 1.1.1.1,23
+in tcp 2.2.2.2,2222 1.1.1.1,21
+in tcp 2.2.2.2,2222 1.1.1.1,1023
+in tcp 2.2.2.2,2222 1.1.1.1,1024
+in tcp 2.2.2.2,2222 1.1.1.1,1025
+in tcp 2.2.2.2,2222 1.1.1.1,32767
+in tcp 2.2.2.2,2222 1.1.1.1,32768
+in tcp 2.2.2.2,2222 1.1.1.1,65535
+in tcp 2.2.2.2,2222 1.1.1.1,5999
+in tcp 2.2.2.2,2222 1.1.1.1,6000
+in tcp 2.2.2.2,2222 1.1.1.1,6009
+in tcp 2.2.2.2,2222 1.1.1.1,6010
+in udp 2.2.2.2,2222 1.1.1.1,0
+in udp 2.2.2.2,2222 1.1.1.1,1
+in udp 2.2.2.2,2222 1.1.1.1,23
+in udp 2.2.2.2,2222 1.1.1.1,21
+in udp 2.2.2.2,2222 1.1.1.1,1023
+in udp 2.2.2.2,2222 1.1.1.1,1024
+in udp 2.2.2.2,2222 1.1.1.1,1025
+in udp 2.2.2.2,2222 1.1.1.1,32767
+in udp 2.2.2.2,2222 1.1.1.1,32768
+in udp 2.2.2.2,2222 1.1.1.1,65535
+in udp 2.2.2.2,2222 1.1.1.1,5999
+in udp 2.2.2.2,2222 1.1.1.1,6000
+in udp 2.2.2.2,2222 1.1.1.1,6009
+in udp 2.2.2.2,2222 1.1.1.1,6010
diff --git a/contrib/ipfilter/test/input/f7 b/contrib/ipfilter/test/input/f7
new file mode 100644
index 0000000..2721af2
--- /dev/null
+++ b/contrib/ipfilter/test/input/f7
@@ -0,0 +1,9 @@
+in icmp 1.1.1.1 2.1.1.1 echo
+in icmp 1.1.1.1 2.1.1.1 echo,1
+in icmp 1.1.1.1 2.1.1.1 echo,3
+in icmp 1.1.1.1 2.1.1.1 unreach
+in icmp 1.1.1.1 2.1.1.1 unreach,1
+in icmp 1.1.1.1 2.1.1.1 unreach,3
+in icmp 1.1.1.1 2.1.1.1 echorep
+in icmp 1.1.1.1 2.1.1.1 echorep,1
+in icmp 1.1.1.1 2.1.1.1 echorep,3
diff --git a/contrib/ipfilter/test/input/f8 b/contrib/ipfilter/test/input/f8
new file mode 100644
index 0000000..cace511
--- /dev/null
+++ b/contrib/ipfilter/test/input/f8
@@ -0,0 +1,6 @@
+in tcp 1.1.1.1,1 2.1.2.2,1 S
+in tcp 1.1.1.1,1 2.1.2.2,1 SA
+in tcp 1.1.1.1,1 2.1.2.2,1 SF
+in tcp 1.1.1.1,1 2.1.2.2,1 SFPAUR
+in tcp 1.1.1.1,1 2.1.2.2,1 PAU
+in tcp 1.1.1.1,1 2.1.2.2,1 A
diff --git a/contrib/ipfilter/test/input/f9 b/contrib/ipfilter/test/input/f9
new file mode 100644
index 0000000..33f3be3
--- /dev/null
+++ b/contrib/ipfilter/test/input/f9
@@ -0,0 +1,6 @@
+in 1.1.1.1 2.1.1.1 opt lsrr
+in 1.1.1.1 2.1.1.1 opt lsrr,ssrr
+in 1.1.1.1 2.1.1.1 opt ts
+in 1.1.1.1 2.1.1.1 opt sec-class=topsecret
+in 1.1.1.1 2.1.1.1 opt ssrr,sec-class=topsecret
+in 1.1.1.1 2.1.1.1 opt sec
diff --git a/contrib/ipfilter/test/input/n1 b/contrib/ipfilter/test/input/n1
new file mode 100644
index 0000000..a607390
--- /dev/null
+++ b/contrib/ipfilter/test/input/n1
@@ -0,0 +1,31 @@
+out on zx0 255 10.1.1.0 10.1.1.2
+out on zx0 255 10.1.1.1 10.1.1.2
+out on zx0 255 10.1.1.2 10.1.1.1
+out on zx0 tcp 10.1.1.2,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.2,1026 10.1.1.1,1025
+out on zx0 255 10.2.2.1 10.1.2.1
+out on zx0 255 10.2.2.2 10.1.2.1
+in on zx0 255 10.1.1.1 10.1.1.2
+in on zx0 255 10.1.1.2 10.1.1.1
+in on zx0 255 10.2.2.1 10.2.1.1
+in on zx0 255 10.2.2.2 10.2.1.1
+in on zx0 255 10.2.2.3 10.1.1.1
+in on zx0 255 10.2.3.4 10.2.2.2
+in on zx0 255 10.1.1.1 10.2.2.2
+in on zx0 255 10.1.1.2 10.2.2.2
+in on zx0 255 10.1.1.0 10.3.4.5
+in on zx0 255 10.1.1.1 10.3.4.5
+in on zx0 255 10.1.1.2 10.3.4.5
+in on zx0 tcp 10.1.1.1,1025 10.3.4.5,1025
+out on zx0 icmp 10.1.1.1 10.4.3.2
+in on zx0 icmp 10.4.3.2 10.2.2.2
+in on zx0 icmp 10.4.3.2 10.3.4.3
+in on zx0 icmp 10.4.3.2 10.3.4.5
+out on zx0 34 10.1.1.2 10.4.3.2
+in on zx0 34 10.4.3.2 10.3.4.4
+out on zx0 34 10.1.1.2 10.4.3.4
+in on zx0 34 10.4.3.4 10.3.4.5
+out on zx0 34 10.1.1.3 10.4.3.4
+in on zx0 34 10.4.3.4 10.3.4.6
+out on zx0 35 10.1.1.3 10.4.3.4
+in on zx0 35 10.4.3.4 10.3.4.7
diff --git a/contrib/ipfilter/test/input/n2 b/contrib/ipfilter/test/input/n2
new file mode 100644
index 0000000..476f16e
--- /dev/null
+++ b/contrib/ipfilter/test/input/n2
@@ -0,0 +1,19 @@
+out on zx0 tcp 10.1.1.1,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.1,1025 10.1.1.2,1025
+out on zx0 10.1.1.0 10.1.1.2
+out on zx0 10.1.1.1 10.1.2.1
+out on zx0 tcp 10.1.1.2,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.2,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.2,1026 10.1.1.1,1025
+out on zx0 udp 10.1.1.2,1025 10.1.1.1,1025
+out on zx0 tcp 10.1.1.3,2000 10.1.2.1,80
+out on zx0 tcp 10.1.1.3,2001 10.1.3.1,80
+out on zx0 tcp 10.1.1.3,2002 10.1.4.1,80
+out on zx0 tcp 10.1.1.3,2003 10.1.4.1,80
+in on zx0 10.1.1.1 10.1.1.2
+in on zx0 tcp 10.1.1.1,1025 10.1.1.2,1025
+in on zx0 10.1.1.2 10.1.1.1
+in on zx0 tcp 10.1.1.1,1026 10.3.4.5,40000
+in on zx0 tcp 10.1.1.1,1025 10.3.4.5,40000
+in on zx0 udp 10.1.1.2,1025 10.3.4.5,40001
+in on zx0 tcp 10.1.2.1,80 10.3.4.5,40001
diff --git a/contrib/ipfilter/test/input/n3 b/contrib/ipfilter/test/input/n3
new file mode 100644
index 0000000..deca317
--- /dev/null
+++ b/contrib/ipfilter/test/input/n3
@@ -0,0 +1,5 @@
+out on zz0 tcp 10.1.1.1,5000 203.1.1.1,80
+out on zz0 tcp 10.1.1.1,252 203.1.1.1,80
+out on zz0 tcp 10.1.0.0,32768 203.1.1.1,80
+out on zz0 udp 10.1.0.0,32768 203.1.1.1,80
+out on zz0 tcp 10.1.255.255,65535 203.1.1.1,80
diff --git a/contrib/ipfilter/test/input/n4 b/contrib/ipfilter/test/input/n4
new file mode 100644
index 0000000..52c2d88
--- /dev/null
+++ b/contrib/ipfilter/test/input/n4
@@ -0,0 +1,5 @@
+in on zx0 tcp 10.3.3.3,12345 10.1.1.1,23
+in on zx0 tcp 10.3.3.3,12345 10.1.1.1,53
+in on zx0 tcp 10.3.3.3,12345 10.1.0.0,23
+in on zx0 udp 10.3.3.3,12345 10.1.1.0,53
+in on zx0 tcp 10.3.3.3,12345 10.1.1.0,53
diff --git a/contrib/ipfilter/test/nattest b/contrib/ipfilter/test/nattest
new file mode 100755
index 0000000..2b3e931
--- /dev/null
+++ b/contrib/ipfilter/test/nattest
@@ -0,0 +1,27 @@
+#!/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 -Nbr - -i input/$1 >> results/$1;
+ if [ $? -ne 0 ] ; then
+ exit 1;
+ fi
+ echo "-------------------------------" >> results/$1
+done ) < regress/$1
+cmp expected/$1 results/$1
+status=$?
+if [ $status = 0 ] ; then
+ $TOUCH $1
+fi
+exit $status
diff --git a/contrib/ipfilter/test/regress/f1 b/contrib/ipfilter/test/regress/f1
new file mode 100644
index 0000000..6a2ede9
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f1
@@ -0,0 +1,4 @@
+block in all
+pass in all
+block out all
+pass out all
diff --git a/contrib/ipfilter/test/regress/f10 b/contrib/ipfilter/test/regress/f10
new file mode 100644
index 0000000..3552983
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f10
@@ -0,0 +1,18 @@
+block in from any to any with not ipopts
+pass in from any to any with not opt sec-class topsecret
+block in from any to any with not opt ssrr,sec-class topsecret
+pass in from any to any with not opt ssrr,sec-class topsecret
+block in from any to any with not opt ts,sec-class topsecret
+pass in from any to any with not opt ts,sec-class topsecret
+block in from any to any with not opt sec-class secret
+pass in from any to any with not opt sec-class secret
+block in from any to any with not opt lsrr,ssrr
+pass in from any to any with not opt lsrr,ssrr
+pass in from any to any with not ipopts
+block in from any to any with not opt lsrr
+pass in from any to any with not opt lsrr
+block in from any to any with not opt ssrr,ts
+pass in from any to any with not opt ssrr,ts
+block in from any to any with not opt rr
+pass in from any to any with not opt rr
+block in from any to any with not opt sec-class topsecret
diff --git a/contrib/ipfilter/test/regress/f11 b/contrib/ipfilter/test/regress/f11
new file mode 100644
index 0000000..0bf0a2a
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f11
@@ -0,0 +1,6 @@
+pass in proto tcp from any to any port = 23 flags S/SA keep state
+block in proto tcp from any to any port = 23 flags S/SA keep state
+pass in proto udp from any to any port = 53 keep frags
+block in proto udp from any to any port = 53 keep frags
+pass in proto udp from any to any port = 53 keep state
+block in proto udp from any to any port = 53 keep state
diff --git a/contrib/ipfilter/test/regress/f12 b/contrib/ipfilter/test/regress/f12
new file mode 100644
index 0000000..c29f839
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f12
@@ -0,0 +1,6 @@
+pass in proto tcp from any port > 1024 to any port = 25 with not short
+pass in proto tcp from any port > 1024 to any port = 25
+block in proto tcp from any to any with short
+block in proto tcp from any to any with frag
+pass in proto udp from any port = 53 to any port = 53
+block in proto udp from any port = 53 to any port = 53 with not short
diff --git a/contrib/ipfilter/test/regress/f13 b/contrib/ipfilter/test/regress/f13
new file mode 100644
index 0000000..f123e47
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f13
@@ -0,0 +1,6 @@
+pass in proto tcp from any to any port = 25 flags S/SA keep frags
+block in proto tcp from any to any port = 25 flags S/SA keep frags
+pass in proto udp from any to any port = 53 keep frags
+block in proto udp from any to any port = 53 keep frags
+pass in proto tcp from any to any port = 25 flags S/SA keep state keep frags
+block in proto tcp from any to any port = 25 flags S/SA keep state keep frags
diff --git a/contrib/ipfilter/test/regress/f14 b/contrib/ipfilter/test/regress/f14
new file mode 100644
index 0000000..06ab519
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f14
@@ -0,0 +1,8 @@
+block in from !1.1.1.1 to any
+pass in from 1.1.1.1 to !any
+block in from 1.1.1.0/24 to !any
+pass in from !1.1.1.0/24 to any
+block in from !1.1.0.0/16 to any
+pass in from 1.1.0.0/16 to !1.2.0.0/16
+block in from any to !127.0.0.0/8
+pass in from !any to any
diff --git a/contrib/ipfilter/test/regress/f2 b/contrib/ipfilter/test/regress/f2
new file mode 100644
index 0000000..e2f02a4
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f2
@@ -0,0 +1,6 @@
+block in proto tcp from any to any
+pass in proto tcp from any to any
+block in proto udp from any to any
+pass in proto udp from any to any
+block in proto icmp from any to any
+pass in proto icmp from any to any
diff --git a/contrib/ipfilter/test/regress/f3 b/contrib/ipfilter/test/regress/f3
new file mode 100644
index 0000000..ee80729
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f3
@@ -0,0 +1,8 @@
+block in from 1.1.1.1 to any
+pass in from 1.1.1.1 to any
+block in from 1.1.1.1/24 to any
+pass in from 1.1.1.1/24 to any
+block in from 1.1.1.1/16 to any
+pass in from 1.1.1.1/16 to any
+block in from 1.1.1.1/0 to any
+pass in from 1.1.1.1/0 to any
diff --git a/contrib/ipfilter/test/regress/f4 b/contrib/ipfilter/test/regress/f4
new file mode 100644
index 0000000..bc8af2f
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f4
@@ -0,0 +1,8 @@
+block in from any to 1.1.1.1
+pass in from any to 1.1.1.1
+block in from any to 1.1.1.1/24
+pass in from any to 1.1.1.1/24
+block in from any to 1.1.1.1/16
+pass in from any to 1.1.1.1/16
+block in from any to 1.1.1.1/0
+pass in from any to 1.1.1.1/0
diff --git a/contrib/ipfilter/test/regress/f5 b/contrib/ipfilter/test/regress/f5
new file mode 100644
index 0000000..998eabd
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f5
@@ -0,0 +1,48 @@
+block in proto tcp from any port = 23 to any
+block in proto udp from any port = 23 to any
+block in proto tcp/udp from any port = 23 to any
+pass in proto tcp from any port <= 1023 to any
+pass in proto udp from any port <= 1023 to any
+pass in proto tcp/udp from any port <= 1023 to any
+block in proto tcp from any port >= 1024 to any
+block in proto udp from any port >= 1024 to any
+block in proto tcp/udp from any port >= 1024 to any
+pass in proto tcp from any port >= 1024 to any
+pass in proto udp from any port >= 1024 to any
+pass in proto tcp/udp from any port >= 1024 to any
+block in proto tcp from any port 0 >< 512 to any
+block in proto udp from any port 0 >< 512 to any
+block in proto tcp/udp from any port 0 >< 512 to any
+pass in proto tcp from any port 0 >< 512 to any
+pass in proto udp from any port 0 >< 512 to any
+pass in proto tcp/udp from any port 0 >< 512 to any
+block in proto tcp from any port 6000 <> 6009 to any
+block in proto udp from any port 6000 <> 6009 to any
+block in proto tcp/udp from any port 6000 <> 6009 to any
+pass in proto tcp from any port 6000 <> 6009 to any
+pass in proto udp from any port 6000 <> 6009 to any
+pass in proto tcp/udp from any port 6000 <> 6009 to any
+pass in proto tcp from any port = 23 to any
+pass in proto udp from any port = 23 to any
+pass in proto tcp/udp from any port = 23 to any
+block in proto tcp from any port != 21 to any
+block in proto udp from any port != 21 to any
+block in proto tcp/udp from any port != 21 to any
+pass in proto tcp from any port != 21 to any
+pass in proto udp from any port != 21 to any
+pass in proto tcp/udp from any port != 21 to any
+block in proto tcp from any port < 1024 to any
+block in proto udp from any port < 1024 to any
+block in proto tcp/udp from any port < 1024 to any
+pass in proto tcp from any port < 1024 to any
+pass in proto udp from any port < 1024 to any
+pass in proto tcp/udp from any port < 1024 to any
+block in proto tcp from any port > 1023 to any
+block in proto udp from any port > 1023 to any
+block in proto tcp/udp from any port > 1023 to any
+pass in proto tcp from any port > 1023 to any
+pass in proto udp from any port > 1023 to any
+pass in proto tcp/udp from any port > 1023 to any
+block in proto tcp from any port <= 1023 to any
+block in proto udp from any port <= 1023 to any
+block in proto tcp/udp from any port <= 1023 to any
diff --git a/contrib/ipfilter/test/regress/f6 b/contrib/ipfilter/test/regress/f6
new file mode 100644
index 0000000..291f09ad
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f6
@@ -0,0 +1,48 @@
+block in proto tcp from any to any port = 23
+block in proto udp from any to any port = 23
+block in proto tcp/udp from any to any port = 23
+pass in proto tcp from any to any port <= 1023
+pass in proto udp from any to any port <= 1023
+pass in proto tcp/udp from any to any port <= 1023
+block in proto tcp from any to any port >= 1024
+block in proto udp from any to any port >= 1024
+block in proto tcp/udp from any to any port >= 1024
+pass in proto tcp from any to any port >= 1024
+pass in proto udp from any to any port >= 1024
+pass in proto tcp/udp from any to any port >= 1024
+block in proto tcp from any to any port 0 >< 512
+block in proto udp from any to any port 0 >< 512
+block in proto tcp/udp from any to any port 0 >< 512
+pass in proto tcp from any to any port 0 >< 512
+pass in proto udp from any to any port 0 >< 512
+pass in proto tcp/udp from any to any port 0 >< 512
+block in proto tcp from any to any port 6000 <> 6009
+block in proto udp from any to any port 6000 <> 6009
+block in proto tcp/udp from any to any port 6000 <> 6009
+pass in proto tcp from any to any port 6000 <> 6009
+pass in proto udp from any to any port 6000 <> 6009
+pass in proto tcp/udp from any to any port 6000 <> 6009
+pass in proto tcp from any to any port = 23
+pass in proto udp from any to any port = 23
+pass in proto tcp/udp from any to any port = 23
+block in proto tcp from any to any port != 21
+block in proto udp from any to any port != 21
+block in proto tcp/udp from any to any port != 21
+pass in proto tcp from any to any port != 21
+pass in proto udp from any to any port != 21
+pass in proto tcp/udp from any to any port != 21
+block in proto tcp from any to any port < 1024
+block in proto udp from any to any port < 1024
+block in proto tcp/udp from any to any port < 1024
+pass in proto tcp from any to any port < 1024
+pass in proto udp from any to any port < 1024
+pass in proto tcp/udp from any to any port < 1024
+block in proto tcp from any to any port > 1023
+block in proto udp from any to any port > 1023
+block in proto tcp/udp from any to any port > 1023
+pass in proto tcp from any to any port > 1023
+pass in proto udp from any to any port > 1023
+pass in proto tcp/udp from any to any port > 1023
+block in proto tcp from any to any port <= 1023
+block in proto udp from any to any port <= 1023
+block in proto tcp/udp from any to any port <= 1023
diff --git a/contrib/ipfilter/test/regress/f7 b/contrib/ipfilter/test/regress/f7
new file mode 100644
index 0000000..6848a68
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f7
@@ -0,0 +1,6 @@
+block in proto icmp from any to any icmp-type echo
+pass in proto icmp from any to any icmp-type echo
+block in proto icmp from any to any icmp-type unreach code 3
+pass in proto icmp from any to any icmp-type unreach code 3
+block in proto icmp from any to any icmp-type echorep
+pass in proto icmp from any to any icmp-type echorep
diff --git a/contrib/ipfilter/test/regress/f8 b/contrib/ipfilter/test/regress/f8
new file mode 100644
index 0000000..0f28fd2
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f8
@@ -0,0 +1,6 @@
+block in proto tcp from any to any flags S
+pass in proto tcp from any to any flags S
+block in proto tcp from any to any flags S/SA
+pass in proto tcp from any to any flags S/SA
+block in proto tcp from any to any flags S/APU
+pass in proto tcp from any to any flags S/APU
diff --git a/contrib/ipfilter/test/regress/f9 b/contrib/ipfilter/test/regress/f9
new file mode 100644
index 0000000..17bc967
--- /dev/null
+++ b/contrib/ipfilter/test/regress/f9
@@ -0,0 +1,18 @@
+block in from any to any with ipopts
+pass in from any to any with opt sec-class topsecret
+block in from any to any with opt ssrr,sec-class topsecret
+pass in from any to any with opt ssrr,sec-class topsecret
+block in from any to any with opt ts,sec-class topsecret
+pass in from any to any with opt ts,sec-class topsecret
+block in from any to any with opt sec-class secret
+pass in from any to any with opt sec-class secret
+block in from any to any with opt lsrr,ssrr
+pass in from any to any with opt lsrr,ssrr
+pass in from any to any with ipopts
+block in from any to any with opt lsrr
+pass in from any to any with opt lsrr
+block in from any to any with opt ssrr,ts
+pass in from any to any with opt ssrr,ts
+block in from any to any with opt rr
+pass in from any to any with opt rr
+block in from any to any with opt sec-class topsecret
diff --git a/contrib/ipfilter/test/regress/n1 b/contrib/ipfilter/test/regress/n1
new file mode 100644
index 0000000..9bcf29b
--- /dev/null
+++ b/contrib/ipfilter/test/regress/n1
@@ -0,0 +1,3 @@
+map zx0 10.1.1.1/32 -> 10.2.2.2/32
+map zx0 10.1.1.0/24 -> 10.3.4.5/32
+map zx0 10.1.1.0/24 -> 10.3.4.0/24
diff --git a/contrib/ipfilter/test/regress/n2 b/contrib/ipfilter/test/regress/n2
new file mode 100644
index 0000000..dbce5aa
--- /dev/null
+++ b/contrib/ipfilter/test/regress/n2
@@ -0,0 +1,4 @@
+map zx0 10.1.1.1/32 -> 10.2.2.2/32 portmap tcp 10000:20000
+map zx0 10.1.1.0/24 -> 10.3.4.5/32 portmap udp 10000:20000
+map zx0 10.1.0.0/16 -> 10.3.4.0/24 portmap tcp/udp 10000:20000
+map zx0 10.1.1.0/24 -> 10.3.4.5/32 portmap tcp/udp 40000:40001
diff --git a/contrib/ipfilter/test/regress/n3 b/contrib/ipfilter/test/regress/n3
new file mode 100644
index 0000000..82c83dd
--- /dev/null
+++ b/contrib/ipfilter/test/regress/n3
@@ -0,0 +1,2 @@
+map zz0 10.1.0.0/16 -> 192.168.2.0/24 portmap tcp/udp auto
+map-block zz0 10.1.0.0/16 -> 192.168.1.0/24 ports 252
diff --git a/contrib/ipfilter/test/regress/n4 b/contrib/ipfilter/test/regress/n4
new file mode 100644
index 0000000..b066c7a
--- /dev/null
+++ b/contrib/ipfilter/test/regress/n4
@@ -0,0 +1,5 @@
+rdr zx0 10.1.1.1/32 port 23 -> 10.2.2.1 port 10023 tcp
+rdr zx0 10.1.1.0/24 port 23 -> 10.2.2.1 port 10023 tcp
+rdr zx0 0/0 port 23 -> 10.2.2.1 port 10023 tcp
+rdr zx0 10.1.1.0/24 port 53 -> 10.2.2.1 port 10053 udp
+rdr zx0 10.1.1.0/24 port 0 -> 10.2.2.1 port 0 tcp
OpenPOWER on IntegriCloud