diff options
author | Camiel Dobbelaar <camield@cvs.openbsd.org> | 2003-01-19 10:03:27 +0000 |
---|---|---|
committer | Camiel Dobbelaar <camield@cvs.openbsd.org> | 2003-01-19 10:03:27 +0000 |
commit | 1fb2bdf52d5515d4a06b3265549104db9c45982d (patch) | |
tree | 2e5473b23827cbc192d721f7021eaeecf4308d62 /regress | |
parent | d5ef0d7a2ac86a6e3a8f2bd8628317b96dc7cf7e (diff) |
Test label expansion functions.
ok dhartmei henning
Diffstat (limited to 'regress')
-rw-r--r-- | regress/sbin/pfctl/Makefile | 4 | ||||
-rw-r--r-- | regress/sbin/pfctl/pf47.in | 66 | ||||
-rw-r--r-- | regress/sbin/pfctl/pf47.ok | 60 |
3 files changed, 128 insertions, 2 deletions
diff --git a/regress/sbin/pfctl/Makefile b/regress/sbin/pfctl/Makefile index 26c7c26b7c2..502a834949f 100644 --- a/regress/sbin/pfctl/Makefile +++ b/regress/sbin/pfctl/Makefile @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile,v 1.63 2003/01/15 17:08:16 cedric Exp $ +# $OpenBSD: Makefile,v 1.64 2003/01/19 10:03:26 camield Exp $ PFTESTS=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 -PFTESTS+=28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 +PFTESTS+=28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 PFFAIL=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 PFSIMPLE=1 2 PFSETUP=1 diff --git a/regress/sbin/pfctl/pf47.in b/regress/sbin/pfctl/pf47.in new file mode 100644 index 00000000000..04901c68625 --- /dev/null +++ b/regress/sbin/pfctl/pf47.in @@ -0,0 +1,66 @@ +pass in on lo0 all label "" + +pass in all label "$if" +pass in on lo0 all label "$if" +pass in on lo0 all label "$if$if" + +pass in on lo0 all label "$srcaddr" +pass in on lo0 from 0/0 to any label "$srcaddr" +pass in on lo0 from 127.0.0.1 to any label "$srcaddr" +pass in on lo0 from 127.0.0.1 to any label "$srcaddr$srcaddr" +pass in on lo0 from 127.0.0.1 to any label ":$srcaddr:$srcaddr:" +pass in on lo0 from 127.0.0.1/8 to any label "$srcaddr" +pass in on lo0 from 127.0.0.1/16 to any label "$srcaddr$srcaddr" +pass in on lo0 from 127.0.0.1/31 to any label ":$srcaddr:$srcaddr:" +pass in on lo0 inet6 from fe80::1 to any label "$srcaddr" +pass in on lo0 inet6 from fe80::1 to any label "$srcaddr$srcaddr" +pass in on lo0 inet6 from fe80::1 to any label ":$srcaddr:$srcaddr:" +pass in on lo0 inet6 from lo0/8 to any label "$srcaddr" +pass in on lo0 inet6 from lo0/64 to any label "$srcaddr$srcaddr" +pass in on lo0 inet6 from lo0/127 to any label ":$srcaddr:$srcaddr:" + +pass in on lo0 all label "!$dstaddr!" +pass in on lo0 inet from any to (lo0) label "$dstaddr" +pass in on lo0 inet from any to (lo0) label "$dstaddr$dstaddr" +pass in on lo0 inet from any to (lo0) label " $dstaddr $dstaddr " +pass in on lo0 from any to ! 127.0.0.1/8 label "$dstaddr" +pass in on lo0 from any to ! 127.0.0.1/16 label "$dstaddr$dstaddr" +pass in on lo0 from any to ! 127.0.0.1/31 label " $dstaddr $dstaddr " +pass in on lo0 inet6 from any to ! (lo0) label "$dstaddr" +pass in on lo0 inet6 from any to ! (lo0) label "$dstaddr$dstaddr" +pass in on lo0 inet6 from any to ! (lo0) label " $dstaddr $dstaddr " +pass in on lo0 inet6 from any to ! ::1/8 label "$dstaddr" +pass in on lo0 inet6 from any to ! ::1/64 label "$dstaddr$dstaddr" +pass in on lo0 inet6 from any to ! ::1/127 label " $dstaddr $dstaddr " + +pass in on lo0 all label "x$srcportx" +pass in on lo0 proto tcp from any port = 28 to any label "$srcport" +pass in on lo0 proto tcp from any port 28 >< 29 to any label "$srcport" +pass in on lo0 proto tcp from any port 28 <> 29 to any label "$srcport" +pass in on lo0 proto tcp from any port != 28 to any label "$srcport" +pass in on lo0 proto tcp from any port < 28 to any label "$srcport" +pass in on lo0 proto tcp from any port <= 28 to any label "$srcport" +pass in on lo0 proto tcp from any port > 28 to any label "$srcport" +pass in on lo0 proto tcp from any port >= 28 to any label "$srcport" +pass in on lo0 proto tcp from any port = 28 to any label "$srcport$srcport" +pass in on lo0 proto tcp from any port = 28 to any label "$$srcport$$srcport$" + +pass in on lo0 all label "$dstport" +pass in on lo0 proto udp from any to any port = 29 label "$dstport" +pass in on lo0 proto udp from any to any port != 29 label "$dstport$dstport" +pass in on lo0 proto udp from any to any port > 29 label "x$dstportx$dstportx" + +pass in on lo0 all label "$proto" +pass in on lo0 proto esp all label "$proto" +pass in on lo0 proto esp all label "$proto$proto" +pass in on lo0 proto esp all label "-$proto-$proto-" +pass in on lo0 proto 166 all label "$proto" +pass in on lo0 proto 166 all label "$proto$proto" +pass in on lo0 proto 166 all label "_$proto_$proto_" + +pass in on lo0 all label "$nr" +pass in on lo0 all label "$nr$nr" +pass in on lo0 all label "%$nr%$nr%" + +pass in on lo0 proto tcp from 127.0.0.1 port = 30 to 127.0.0.2 port = 44 \ + label "if $if proto $proto $srcaddr $srcport $dstaddr $dstport" diff --git a/regress/sbin/pfctl/pf47.ok b/regress/sbin/pfctl/pf47.ok new file mode 100644 index 00000000000..8ef39e6bd90 --- /dev/null +++ b/regress/sbin/pfctl/pf47.ok @@ -0,0 +1,60 @@ +pass in on lo0 all +pass in all label "any" +pass in on lo0 all label "lo0" +pass in on lo0 all label "lo0lo0" +pass in on lo0 all label "any" +pass in on lo0 inet all label "any" +pass in on lo0 inet from 127.0.0.1 to any label "127.0.0.1" +pass in on lo0 inet from 127.0.0.1 to any label "127.0.0.1127.0.0.1" +pass in on lo0 inet from 127.0.0.1 to any label ":127.0.0.1:127.0.0.1:" +pass in on lo0 inet from 127.0.0.0/8 to any label "127.0.0.0/8" +pass in on lo0 inet from 127.0.0.0/16 to any label "127.0.0.0/16127.0.0.0/16" +pass in on lo0 inet from 127.0.0.0/31 to any label ":127.0.0.0/31:127.0.0.0/31:" +pass in on lo0 inet6 from fe80::1 to any label "fe80::1" +pass in on lo0 inet6 from fe80::1 to any label "fe80::1fe80::1" +pass in on lo0 inet6 from fe80::1 to any label ":fe80::1:fe80::1:" +pass in on lo0 inet6 from ::/8 to any label "::/8" +pass in on lo0 inet6 from fe00::/8 to any label "fe00::/8" +pass in on lo0 inet6 from ::/64 to any label "::/64::/64" +pass in on lo0 inet6 from fe80::/64 to any label "fe80::/64fe80::/64" +pass in on lo0 inet6 from ::/127 to any label ":::/127:::/127:" +pass in on lo0 inet6 from fe80::/127 to any label ":fe80::/127:fe80::/127:" +pass in on lo0 all label "!any!" +pass in on lo0 inet from any to (lo0) label "(lo0)" +pass in on lo0 inet from any to (lo0) label "(lo0)(lo0)" +pass in on lo0 inet from any to (lo0) label " (lo0) (lo0) " +pass in on lo0 inet from any to ! 127.0.0.0/8 label "! 127.0.0.0/8" +pass in on lo0 inet from any to ! 127.0.0.0/16 label "! 127.0.0.0/16! 127.0.0.0/16" +pass in on lo0 inet from any to ! 127.0.0.0/31 label " ! 127.0.0.0/31 ! 127.0.0.0/31 " +pass in on lo0 inet6 from any to ! (lo0) label "! (lo0)" +pass in on lo0 inet6 from any to ! (lo0) label "! (lo0)! (lo0)" +pass in on lo0 inet6 from any to ! (lo0) label " ! (lo0) ! (lo0) " +pass in on lo0 inet6 from any to ! ::/8 label "! ::/8" +pass in on lo0 inet6 from any to ! ::/64 label "! ::/64! ::/64" +pass in on lo0 inet6 from any to ! ::/127 label " ! ::/127 ! ::/127 " +pass in on lo0 all label "xx" +pass in on lo0 proto tcp from any port = 28 to any label "28" +pass in on lo0 proto tcp from any port 28 >< 29 to any label "28><29" +pass in on lo0 proto tcp from any port 28 <> 29 to any label "28<>29" +pass in on lo0 proto tcp from any port != 28 to any label "!=28" +pass in on lo0 proto tcp from any port < 28 to any label "<28" +pass in on lo0 proto tcp from any port <= 28 to any label "<=28" +pass in on lo0 proto tcp from any port > 28 to any label ">28" +pass in on lo0 proto tcp from any port >= 28 to any label ">=28" +pass in on lo0 proto tcp from any port = 28 to any label "2828" +pass in on lo0 proto tcp from any port = 28 to any label "$28$28$" +pass in on lo0 all +pass in on lo0 proto udp from any to any port = 29 label "29" +pass in on lo0 proto udp from any to any port != 29 label "!=29!=29" +pass in on lo0 proto udp from any to any port > 29 label "x>29x>29x" +pass in on lo0 all label "ip" +pass in on lo0 proto esp all label "esp" +pass in on lo0 proto esp all label "espesp" +pass in on lo0 proto esp all label "-esp-esp-" +pass in on lo0 proto 166 all label "166" +pass in on lo0 proto 166 all label "166166" +pass in on lo0 proto 166 all label "_166_166_" +pass in on lo0 all label "56" +pass in on lo0 all label "5757" +pass in on lo0 all label "%58%58%" +pass in on lo0 inet proto tcp from 127.0.0.1 port = 30 to 127.0.0.2 port = 44 label "if lo0 proto tcp 127.0.0.1 30 127.0.0.2 44" |