summaryrefslogtreecommitdiff
path: root/contrib/ipfilter/test
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ipfilter/test')
-rw-r--r--contrib/ipfilter/test/Makefile39
-rw-r--r--contrib/ipfilter/test/dotest26
-rw-r--r--contrib/ipfilter/test/expected/116
-rw-r--r--contrib/ipfilter/test/expected/10108
-rw-r--r--contrib/ipfilter/test/expected/1166
-rw-r--r--contrib/ipfilter/test/expected/1254
-rw-r--r--contrib/ipfilter/test/expected/236
-rw-r--r--contrib/ipfilter/test/expected/340
-rw-r--r--contrib/ipfilter/test/expected/440
-rw-r--r--contrib/ipfilter/test/expected/51344
-rw-r--r--contrib/ipfilter/test/expected/61344
-rw-r--r--contrib/ipfilter/test/expected/754
-rw-r--r--contrib/ipfilter/test/expected/836
-rw-r--r--contrib/ipfilter/test/expected/9108
-rw-r--r--contrib/ipfilter/test/expected/i111
-rw-r--r--contrib/ipfilter/test/expected/i104
-rw-r--r--contrib/ipfilter/test/expected/i114
-rw-r--r--contrib/ipfilter/test/expected/i26
-rw-r--r--contrib/ipfilter/test/expected/i38
-rw-r--r--contrib/ipfilter/test/expected/i47
-rw-r--r--contrib/ipfilter/test/expected/i55
-rw-r--r--contrib/ipfilter/test/expected/i64
-rw-r--r--contrib/ipfilter/test/expected/i73
-rw-r--r--contrib/ipfilter/test/expected/i82
-rw-r--r--contrib/ipfilter/test/expected/i95
-rw-r--r--contrib/ipfilter/test/hextest23
-rw-r--r--contrib/ipfilter/test/input/14
-rw-r--r--contrib/ipfilter/test/input/106
-rw-r--r--contrib/ipfilter/test/input/1111
-rw-r--r--contrib/ipfilter/test/input/1235
-rw-r--r--contrib/ipfilter/test/input/1339
-rw-r--r--contrib/ipfilter/test/input/26
-rw-r--r--contrib/ipfilter/test/input/35
-rw-r--r--contrib/ipfilter/test/input/45
-rw-r--r--contrib/ipfilter/test/input/528
-rw-r--r--contrib/ipfilter/test/input/628
-rw-r--r--contrib/ipfilter/test/input/79
-rw-r--r--contrib/ipfilter/test/input/86
-rw-r--r--contrib/ipfilter/test/input/96
-rw-r--r--contrib/ipfilter/test/itest21
-rw-r--r--contrib/ipfilter/test/regress/14
-rw-r--r--contrib/ipfilter/test/regress/1018
-rw-r--r--contrib/ipfilter/test/regress/116
-rw-r--r--contrib/ipfilter/test/regress/126
-rw-r--r--contrib/ipfilter/test/regress/136
-rw-r--r--contrib/ipfilter/test/regress/26
-rw-r--r--contrib/ipfilter/test/regress/38
-rw-r--r--contrib/ipfilter/test/regress/48
-rw-r--r--contrib/ipfilter/test/regress/548
-rw-r--r--contrib/ipfilter/test/regress/648
-rw-r--r--contrib/ipfilter/test/regress/76
-rw-r--r--contrib/ipfilter/test/regress/86
-rw-r--r--contrib/ipfilter/test/regress/918
-rw-r--r--contrib/ipfilter/test/regress/i111
-rw-r--r--contrib/ipfilter/test/regress/i104
-rw-r--r--contrib/ipfilter/test/regress/i114
-rw-r--r--contrib/ipfilter/test/regress/i26
-rw-r--r--contrib/ipfilter/test/regress/i38
-rw-r--r--contrib/ipfilter/test/regress/i47
-rw-r--r--contrib/ipfilter/test/regress/i55
-rw-r--r--contrib/ipfilter/test/regress/i64
-rw-r--r--contrib/ipfilter/test/regress/i73
-rw-r--r--contrib/ipfilter/test/regress/i82
-rw-r--r--contrib/ipfilter/test/regress/i95
64 files changed, 3849 insertions, 0 deletions
diff --git a/contrib/ipfilter/test/Makefile b/contrib/ipfilter/test/Makefile
new file mode 100644
index 000000000000..d3bdcc24d2ff
--- /dev/null
+++ b/contrib/ipfilter/test/Makefile
@@ -0,0 +1,39 @@
+#
+# (C)opyright 1993-1996 by Darren Reed.
+#
+# This code may be freely distributed as long as it retains this notice
+# and is not changed in any way. The author accepts no responsibility
+# for the use of this software. I hate legaleese, don't you ?
+#
+# where to put things.
+#
+BINDEST=/usr/local/bin
+SBINDEST=/sbin
+MANDIR=/usr/share/man
+
+tests: first 0 ftests ptests
+
+first:
+ -mkdir -p results
+
+# Filtering tests
+ftests: 1 2 3 4 5 6 7 8 9 10 11 12
+
+# Rule parsing tests
+ptests: i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11
+
+0:
+ @(cd ..; make ipftest; )
+
+1 2 3 4 5 6 7 8 9 10 11:
+ @./dotest $@
+
+12:
+ @./hextest $@
+
+i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11:
+ @./itest $@
+
+clean:
+ /bin/rm -f 1 2 3 4 5 6 7 8 9 10 11 12 results/*
+ /bin/rm -f i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11
diff --git a/contrib/ipfilter/test/dotest b/contrib/ipfilter/test/dotest
new file mode 100644
index 000000000000..06d04c5e8c31
--- /dev/null
+++ b/contrib/ipfilter/test/dotest
@@ -0,0 +1,26 @@
+#!/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 -br - -i input/$1 >> results/$1;
+ if [ $? -ne 0 ] ; then
+ exit 1;
+ fi
+done ) < regress/$1
+cmp expected/$1 results/$1
+status=$?
+if [ $status = 0 ] ; then
+ $TOUCH $1
+fi
+exit $status
diff --git a/contrib/ipfilter/test/expected/1 b/contrib/ipfilter/test/expected/1
new file mode 100644
index 000000000000..93b733336d39
--- /dev/null
+++ b/contrib/ipfilter/test/expected/1
@@ -0,0 +1,16 @@
+block
+block
+nomatch
+nomatch
+pass
+pass
+nomatch
+nomatch
+nomatch
+nomatch
+block
+block
+nomatch
+nomatch
+pass
+pass
diff --git a/contrib/ipfilter/test/expected/10 b/contrib/ipfilter/test/expected/10
new file mode 100644
index 000000000000..bc0d83ec88f2
--- /dev/null
+++ b/contrib/ipfilter/test/expected/10
@@ -0,0 +1,108 @@
+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/11 b/contrib/ipfilter/test/expected/11
new file mode 100644
index 000000000000..eb00875e01a9
--- /dev/null
+++ b/contrib/ipfilter/test/expected/11
@@ -0,0 +1,66 @@
+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/12 b/contrib/ipfilter/test/expected/12
new file mode 100644
index 000000000000..f94cf768273a
--- /dev/null
+++ b/contrib/ipfilter/test/expected/12
@@ -0,0 +1,54 @@
+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/2 b/contrib/ipfilter/test/expected/2
new file mode 100644
index 000000000000..03b71cdb9ea9
--- /dev/null
+++ b/contrib/ipfilter/test/expected/2
@@ -0,0 +1,36 @@
+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/3 b/contrib/ipfilter/test/expected/3
new file mode 100644
index 000000000000..d06d92b3e02a
--- /dev/null
+++ b/contrib/ipfilter/test/expected/3
@@ -0,0 +1,40 @@
+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/4 b/contrib/ipfilter/test/expected/4
new file mode 100644
index 000000000000..d06d92b3e02a
--- /dev/null
+++ b/contrib/ipfilter/test/expected/4
@@ -0,0 +1,40 @@
+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/5 b/contrib/ipfilter/test/expected/5
new file mode 100644
index 000000000000..bc805805f136
--- /dev/null
+++ b/contrib/ipfilter/test/expected/5
@@ -0,0 +1,1344 @@
+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/6 b/contrib/ipfilter/test/expected/6
new file mode 100644
index 000000000000..bc805805f136
--- /dev/null
+++ b/contrib/ipfilter/test/expected/6
@@ -0,0 +1,1344 @@
+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/7 b/contrib/ipfilter/test/expected/7
new file mode 100644
index 000000000000..c53d6eaa0cb9
--- /dev/null
+++ b/contrib/ipfilter/test/expected/7
@@ -0,0 +1,54 @@
+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/8 b/contrib/ipfilter/test/expected/8
new file mode 100644
index 000000000000..398058a5ec52
--- /dev/null
+++ b/contrib/ipfilter/test/expected/8
@@ -0,0 +1,36 @@
+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/9 b/contrib/ipfilter/test/expected/9
new file mode 100644
index 000000000000..a4572e6e94e0
--- /dev/null
+++ b/contrib/ipfilter/test/expected/9
@@ -0,0 +1,108 @@
+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/i1 b/contrib/ipfilter/test/expected/i1
new file mode 100644
index 000000000000..f69e0553a874
--- /dev/null
+++ b/contrib/ipfilter/test/expected/i1
@@ -0,0 +1,11 @@
+pass in from any to any
+block out from any to any
+log in from any to any
+log body in from any to any
+count in from any to any
+pass in on ed0(!) from 127.0.0.1/32 to 127.0.0.1/32
+block in log first on lo0(!) from any to any
+pass in log body quick from any to any
+block return-rst in quick on le0(!) proto tcp from any to any
+block return-icmp in on qe0(!) from any to any
+block return-icmp(host-unr) in on qe0(!) from any to any
diff --git a/contrib/ipfilter/test/expected/i10 b/contrib/ipfilter/test/expected/i10
new file mode 100644
index 000000000000..57bd4ef6867f
--- /dev/null
+++ b/contrib/ipfilter/test/expected/i10
@@ -0,0 +1,4 @@
+pass in from 127.0.0.1/32 to 127.0.0.1/32 with opt sec
+block in from any to any with not opt sec-class topsecret
+block in from any to any with not opt sec-class topsecret,secret
+pass in from any to any with opt sec-class topsecret,confid not opt sec-class unclass
diff --git a/contrib/ipfilter/test/expected/i11 b/contrib/ipfilter/test/expected/i11
new file mode 100644
index 000000000000..9268c66a5abc
--- /dev/null
+++ b/contrib/ipfilter/test/expected/i11
@@ -0,0 +1,4 @@
+pass in on ed0(!) proto tcp from 127.0.0.1/32 to 127.0.0.1/32 port = 23 keep state
+block in log first on lo0(!) proto tcp/udp from any to any keep state
+pass in proto udp from 127.0.0.1/32 to 127.0.0.1/32 port = 2049 keep frags
+pass in proto udp from 127.0.0.1/32 to 127.0.0.1/32 port = 53 keep state keep frags
diff --git a/contrib/ipfilter/test/expected/i2 b/contrib/ipfilter/test/expected/i2
new file mode 100644
index 000000000000..9d3398d3e11f
--- /dev/null
+++ b/contrib/ipfilter/test/expected/i2
@@ -0,0 +1,6 @@
+log in proto tcp from any to any
+pass in proto tcp from any to any
+pass in proto udp from 127.0.0.1/32 to 127.0.0.1/32
+block in proto udp from any to any
+block in proto 250 from any to any
+pass in proto tcp/udp from any to any
diff --git a/contrib/ipfilter/test/expected/i3 b/contrib/ipfilter/test/expected/i3
new file mode 100644
index 000000000000..4d70a94dd3d2
--- /dev/null
+++ b/contrib/ipfilter/test/expected/i3
@@ -0,0 +1,8 @@
+log in from any to any
+pass in from 128.0.0.0/24 to 128.0.0.0/16
+pass in from 128.0.0.0/24 to 128.0.0.0/16
+pass in from 128.0.0.0/24 to 128.0.0.0/16
+pass in from 128.0.0.0/24 to 128.0.0.0/16
+pass in from 128.0.0.0/24 to 128.0.0.0/16
+pass in from 127.0.0.1/32 to 127.0.0.1/32
+block in log from any to any
diff --git a/contrib/ipfilter/test/expected/i4 b/contrib/ipfilter/test/expected/i4
new file mode 100644
index 000000000000..dfa3674db2a6
--- /dev/null
+++ b/contrib/ipfilter/test/expected/i4
@@ -0,0 +1,7 @@
+log in proto tcp from any port > 0 to any
+log in proto tcp from any to any port > 0
+pass in proto tcp from any port != 0 to any port 0 >< 65535
+pass in proto udp from 127.0.0.1/32 port > 32000 to 127.0.0.1/32 port < 29000
+block in proto udp from any port != 123 to any port < 123
+block in proto tcp from any port = 25 to any port > 25
+pass in proto tcp/udp from any port 1 >< 3 to any port 1 <> 3
diff --git a/contrib/ipfilter/test/expected/i5 b/contrib/ipfilter/test/expected/i5
new file mode 100644
index 000000000000..3bcb10bf205e
--- /dev/null
+++ b/contrib/ipfilter/test/expected/i5
@@ -0,0 +1,5 @@
+log in from any to any
+count in tos 0x80 from any to any
+pass in on ed0(!) tos 0x40 from 127.0.0.1/32 to 127.0.0.1/32
+block in log on lo0(!) ttl 0 from any to any
+pass in quick ttl 1 from any to any
diff --git a/contrib/ipfilter/test/expected/i6 b/contrib/ipfilter/test/expected/i6
new file mode 100644
index 000000000000..4849626fdcf0
--- /dev/null
+++ b/contrib/ipfilter/test/expected/i6
@@ -0,0 +1,4 @@
+pass in on lo0(!) fastroute from any to any
+pass in on lo0(!) dup-to qe0(!) from 127.0.0.1/32 to 127.0.0.1/32
+pass in on qe0(!) dup-to qe0(!):127.0.0.1 from 127.0.0.1/32 to 127.0.0.1/32
+block in quick on qe0(!) to qe1(!) from any to any
diff --git a/contrib/ipfilter/test/expected/i7 b/contrib/ipfilter/test/expected/i7
new file mode 100644
index 000000000000..2414f57b8281
--- /dev/null
+++ b/contrib/ipfilter/test/expected/i7
@@ -0,0 +1,3 @@
+pass in on ed0(!) proto tcp from 127.0.0.1/32 to 127.0.0.1/32 port = 23 flags S/SA
+block in on lo0(!) proto tcp from any to any flags A/FSRPAU
+pass in on lo0(!) proto tcp from any to any flags /SPA
diff --git a/contrib/ipfilter/test/expected/i8 b/contrib/ipfilter/test/expected/i8
new file mode 100644
index 000000000000..77dc1775763e
--- /dev/null
+++ b/contrib/ipfilter/test/expected/i8
@@ -0,0 +1,2 @@
+pass in proto icmp from 127.0.0.1/32 to 127.0.0.1/32 icmp-type timest
+block in proto icmp from any to any icmp-type unreach code 1
diff --git a/contrib/ipfilter/test/expected/i9 b/contrib/ipfilter/test/expected/i9
new file mode 100644
index 000000000000..b36d864a6e5e
--- /dev/null
+++ b/contrib/ipfilter/test/expected/i9
@@ -0,0 +1,5 @@
+pass in from 127.0.0.1/32 to 127.0.0.1/32 with short
+block in from any to any with ipopt
+pass in from any to any with opt nop,rr,zsu
+pass in from any to any with opt nop,rr,zsu not opt lsrr,ssrr
+pass in from 127.0.0.1/32 to 127.0.0.1/32 with not frag
diff --git a/contrib/ipfilter/test/hextest b/contrib/ipfilter/test/hextest
new file mode 100644
index 000000000000..76e1af5dcb02
--- /dev/null
+++ b/contrib/ipfilter/test/hextest
@@ -0,0 +1,23 @@
+#!/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 -br - -Hi input/$1 >> 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/input/1 b/contrib/ipfilter/test/input/1
new file mode 100644
index 000000000000..7c3ae8a3a3db
--- /dev/null
+++ b/contrib/ipfilter/test/input/1
@@ -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/10 b/contrib/ipfilter/test/input/10
new file mode 100644
index 000000000000..254cee7316ff
--- /dev/null
+++ b/contrib/ipfilter/test/input/10
@@ -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/11 b/contrib/ipfilter/test/input/11
new file mode 100644
index 000000000000..b6e2c1d977ad
--- /dev/null
+++ b/contrib/ipfilter/test/input/11
@@ -0,0 +1,11 @@
+in tcp 1.1.1.1,1 2.1.2.2,23 S
+in tcp 1.1.1.1,1 2.1.2.2,23 A
+in tcp 2.1.2.2,23 1.1.1.1,1 A
+in tcp 1.1.1.1,1 2.1.2.2,23 F
+in tcp 1.1.1.1,1 2.1.2.2,23 A
+in tcp 1.1.1.1,2 2.1.2.2,23 A
+in udp 1.1.1.1,1 4.4.4.4,53
+in udp 2.2.2.2,2 4.4.4.4,53
+in udp 4.4.4.4,53 1.1.1.1,1
+in udp 4.4.4.4,1023 1.1.1.1,2049
+in udp 4.4.4.4,2049 1.1.1.1,1023
diff --git a/contrib/ipfilter/test/input/12 b/contrib/ipfilter/test/input/12
new file mode 100644
index 000000000000..5d9c1de3590d
--- /dev/null
+++ b/contrib/ipfilter/test/input/12
@@ -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/13 b/contrib/ipfilter/test/input/13
new file mode 100644
index 000000000000..56ec16d99b83
--- /dev/null
+++ b/contrib/ipfilter/test/input/13
@@ -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/2 b/contrib/ipfilter/test/input/2
new file mode 100644
index 000000000000..d168af0c716a
--- /dev/null
+++ b/contrib/ipfilter/test/input/2
@@ -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/3 b/contrib/ipfilter/test/input/3
new file mode 100644
index 000000000000..16a806ffec7b
--- /dev/null
+++ b/contrib/ipfilter/test/input/3
@@ -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/4 b/contrib/ipfilter/test/input/4
new file mode 100644
index 000000000000..2956d1b15454
--- /dev/null
+++ b/contrib/ipfilter/test/input/4
@@ -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/5 b/contrib/ipfilter/test/input/5
new file mode 100644
index 000000000000..41600c10763b
--- /dev/null
+++ b/contrib/ipfilter/test/input/5
@@ -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/6 b/contrib/ipfilter/test/input/6
new file mode 100644
index 000000000000..21f0be3336c5
--- /dev/null
+++ b/contrib/ipfilter/test/input/6
@@ -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/7 b/contrib/ipfilter/test/input/7
new file mode 100644
index 000000000000..2721af2fb71e
--- /dev/null
+++ b/contrib/ipfilter/test/input/7
@@ -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/8 b/contrib/ipfilter/test/input/8
new file mode 100644
index 000000000000..cace511fbeb8
--- /dev/null
+++ b/contrib/ipfilter/test/input/8
@@ -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/9 b/contrib/ipfilter/test/input/9
new file mode 100644
index 000000000000..33f3be392a7d
--- /dev/null
+++ b/contrib/ipfilter/test/input/9
@@ -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/itest b/contrib/ipfilter/test/itest
new file mode 100644
index 000000000000..c1b5f573d543
--- /dev/null
+++ b/contrib/ipfilter/test/itest
@@ -0,0 +1,21 @@
+#!/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
+../ipf -nvf regress/$1 2>/dev/null > results/$1
+cmp expected/$1 results/$1
+status=$?
+if [ $status = 0 ] ; then
+ $TOUCH $1
+fi
+exit $status
diff --git a/contrib/ipfilter/test/regress/1 b/contrib/ipfilter/test/regress/1
new file mode 100644
index 000000000000..6a2ede9e31c0
--- /dev/null
+++ b/contrib/ipfilter/test/regress/1
@@ -0,0 +1,4 @@
+block in all
+pass in all
+block out all
+pass out all
diff --git a/contrib/ipfilter/test/regress/10 b/contrib/ipfilter/test/regress/10
new file mode 100644
index 000000000000..444737a59b1c
--- /dev/null
+++ b/contrib/ipfilter/test/regress/10
@@ -0,0 +1,18 @@
+block in from any to any and not ipopts
+pass in from any to any and not opt sec-class topsecret
+block in from any to any and not opt ssrr,sec-class topsecret
+pass in from any to any and not opt ssrr,sec-class topsecret
+block in from any to any and not opt ts,sec-class topsecret
+pass in from any to any and not opt ts,sec-class topsecret
+block in from any to any and not opt sec-class secret
+pass in from any to any and not opt sec-class secret
+block in from any to any and not opt lsrr,ssrr
+pass in from any to any and not opt lsrr,ssrr
+pass in from any to any and not ipopts
+block in from any to any and not opt lsrr
+pass in from any to any and not opt lsrr
+block in from any to any and not opt ssrr,ts
+pass in from any to any and not opt ssrr,ts
+block in from any to any and not opt rr
+pass in from any to any and not opt rr
+block in from any to any and not opt sec-class topsecret
diff --git a/contrib/ipfilter/test/regress/11 b/contrib/ipfilter/test/regress/11
new file mode 100644
index 000000000000..0bf0a2a7322d
--- /dev/null
+++ b/contrib/ipfilter/test/regress/11
@@ -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/12 b/contrib/ipfilter/test/regress/12
new file mode 100644
index 000000000000..c29f839aa502
--- /dev/null
+++ b/contrib/ipfilter/test/regress/12
@@ -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/13 b/contrib/ipfilter/test/regress/13
new file mode 100644
index 000000000000..f123e4781c86
--- /dev/null
+++ b/contrib/ipfilter/test/regress/13
@@ -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/2 b/contrib/ipfilter/test/regress/2
new file mode 100644
index 000000000000..e2f02a46e283
--- /dev/null
+++ b/contrib/ipfilter/test/regress/2
@@ -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/3 b/contrib/ipfilter/test/regress/3
new file mode 100644
index 000000000000..ee80729cfc9b
--- /dev/null
+++ b/contrib/ipfilter/test/regress/3
@@ -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/4 b/contrib/ipfilter/test/regress/4
new file mode 100644
index 000000000000..bc8af2f0cae2
--- /dev/null
+++ b/contrib/ipfilter/test/regress/4
@@ -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/5 b/contrib/ipfilter/test/regress/5
new file mode 100644
index 000000000000..998eabd4b10b
--- /dev/null
+++ b/contrib/ipfilter/test/regress/5
@@ -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/6 b/contrib/ipfilter/test/regress/6
new file mode 100644
index 000000000000..291f09adcdbc
--- /dev/null
+++ b/contrib/ipfilter/test/regress/6
@@ -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/7 b/contrib/ipfilter/test/regress/7
new file mode 100644
index 000000000000..6848a688a374
--- /dev/null
+++ b/contrib/ipfilter/test/regress/7
@@ -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/8 b/contrib/ipfilter/test/regress/8
new file mode 100644
index 000000000000..0f28fd261148
--- /dev/null
+++ b/contrib/ipfilter/test/regress/8
@@ -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/9 b/contrib/ipfilter/test/regress/9
new file mode 100644
index 000000000000..17bc96737877
--- /dev/null
+++ b/contrib/ipfilter/test/regress/9
@@ -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/i1 b/contrib/ipfilter/test/regress/i1
new file mode 100644
index 000000000000..583cd8b5b770
--- /dev/null
+++ b/contrib/ipfilter/test/regress/i1
@@ -0,0 +1,11 @@
+pass in all
+block out all
+log in all
+log body in all
+count in from any to any
+pass in on ed0 from localhost to localhost
+block in log first on lo0 from any to any
+pass in log body quick from any to any
+block return-rst in quick on le0 proto tcp from any to any
+block return-icmp in on qe0 from any to any
+block return-icmp(1) in on qe0 from any to any
diff --git a/contrib/ipfilter/test/regress/i10 b/contrib/ipfilter/test/regress/i10
new file mode 100644
index 000000000000..ece27126f0af
--- /dev/null
+++ b/contrib/ipfilter/test/regress/i10
@@ -0,0 +1,4 @@
+pass in from localhost to localhost with opt sec
+block in from any to any with not opt sec-class topsecret
+block in from any to any with not opt sec-class topsecret,secret
+pass in from any to any with opt sec-class topsecret,confid not opt sec-class unclass
diff --git a/contrib/ipfilter/test/regress/i11 b/contrib/ipfilter/test/regress/i11
new file mode 100644
index 000000000000..c257f513eab3
--- /dev/null
+++ b/contrib/ipfilter/test/regress/i11
@@ -0,0 +1,4 @@
+pass in on ed0 proto tcp from localhost to localhost port = telnet keep state
+block in log first on lo0 proto tcp/udp from any to any keep state
+pass in proto udp from localhost to localhost port = 2049 keep frags
+pass in proto udp from localhost to localhost port = 53 keep state keep frags
diff --git a/contrib/ipfilter/test/regress/i2 b/contrib/ipfilter/test/regress/i2
new file mode 100644
index 000000000000..101deaa30512
--- /dev/null
+++ b/contrib/ipfilter/test/regress/i2
@@ -0,0 +1,6 @@
+log in proto tcp all
+pass in proto 6 from any to any
+pass in proto udp from localhost to localhost
+block in proto 17 from any to any
+block in proto 250 from any to any
+pass in proto tcp/udp from any to any
diff --git a/contrib/ipfilter/test/regress/i3 b/contrib/ipfilter/test/regress/i3
new file mode 100644
index 000000000000..e69663ee7a0d
--- /dev/null
+++ b/contrib/ipfilter/test/regress/i3
@@ -0,0 +1,8 @@
+log in all
+pass in from 128.0.0.1/24 to 128.0.0.1/16
+pass in from 128.0.0.1/0xffffff00 to 128.0.0.1/0xffff0000
+pass in from 128.0.0.1/255.255.255.0 to 128.0.0.1/255.255.0.0
+pass in from 128.0.0.1 mask 0xffffff00 to 128.0.0.1 mask 0xffff0000
+pass in from 128.0.0.1 mask 255.255.255.0 to 128.0.0.1 mask 255.255.0.0
+pass in from localhost to localhost
+block in log from 0/0 to 0/0
diff --git a/contrib/ipfilter/test/regress/i4 b/contrib/ipfilter/test/regress/i4
new file mode 100644
index 000000000000..1095ed97c91a
--- /dev/null
+++ b/contrib/ipfilter/test/regress/i4
@@ -0,0 +1,7 @@
+log in proto tcp from any port > 0 to any
+log in proto tcp from any to any port > 0
+pass in proto 6 from any port != 0 to any port 0 >< 65535
+pass in proto 17 from localhost port > 32000 to localhost port < 29000
+block in proto udp from any port != ntp to any port < ntp
+block in proto tcp from any port = smtp to any port > 25
+pass in proto tcp/udp from any port 1 >< 3 to any port 1 <> 3
diff --git a/contrib/ipfilter/test/regress/i5 b/contrib/ipfilter/test/regress/i5
new file mode 100644
index 000000000000..38482f3a584e
--- /dev/null
+++ b/contrib/ipfilter/test/regress/i5
@@ -0,0 +1,5 @@
+log in all
+count in tos 0x80 from any to any
+pass in on ed0 tos 64 from localhost to localhost
+block in log on lo0 ttl 0 from any to any
+pass in quick ttl 1 from any to any
diff --git a/contrib/ipfilter/test/regress/i6 b/contrib/ipfilter/test/regress/i6
new file mode 100644
index 000000000000..a35633bfd411
--- /dev/null
+++ b/contrib/ipfilter/test/regress/i6
@@ -0,0 +1,4 @@
+pass in on lo0 fastroute from any to any
+pass in on lo0 dup-to qe0 from localhost to localhost
+pass in on qe0 dup-to qe0:127.0.0.1 from localhost to localhost
+block in quick on qe0 to qe1 from any to any
diff --git a/contrib/ipfilter/test/regress/i7 b/contrib/ipfilter/test/regress/i7
new file mode 100644
index 000000000000..9cb35723c67e
--- /dev/null
+++ b/contrib/ipfilter/test/regress/i7
@@ -0,0 +1,3 @@
+pass in on ed0 proto tcp from localhost to localhost port = 23 flags S/SA
+block in on lo0 proto tcp from any to any flags A
+pass in on lo0 proto tcp from any to any flags /SAP
diff --git a/contrib/ipfilter/test/regress/i8 b/contrib/ipfilter/test/regress/i8
new file mode 100644
index 000000000000..bde6ed52900e
--- /dev/null
+++ b/contrib/ipfilter/test/regress/i8
@@ -0,0 +1,2 @@
+pass in proto icmp from localhost to localhost icmp-type timest
+block in proto icmp from any to any icmp-type unreach code 1
diff --git a/contrib/ipfilter/test/regress/i9 b/contrib/ipfilter/test/regress/i9
new file mode 100644
index 000000000000..327cff45651d
--- /dev/null
+++ b/contrib/ipfilter/test/regress/i9
@@ -0,0 +1,5 @@
+pass in from localhost to localhost with short
+block in from any to any with ipopts
+pass in from any to any with opt nop,rr,zsu
+pass in from any to any with opt nop,rr,zsu not opt ssrr,lsrr
+pass in from localhost to localhost with not frag