diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-05-24 21:12:56 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-05-31 17:57:31 +0200 |
commit | 27f6a4c68b4fdc351890d9a675603fefc48f7353 (patch) | |
tree | b4c1cd44b2d5758b4b93da19acb28db42338fa64 /tests/py/any | |
parent | a35e3a0cdc63a1e177a9950e3f8e73ce862d3163 (diff) |
tests: replace single element sets
Add at least two elements to sets.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py/any')
-rw-r--r-- | tests/py/any/ct.t | 9 | ||||
-rw-r--r-- | tests/py/any/ct.t.payload | 52 | ||||
-rw-r--r-- | tests/py/any/meta.t | 30 | ||||
-rw-r--r-- | tests/py/any/meta.t.payload | 386 |
4 files changed, 250 insertions, 227 deletions
diff --git a/tests/py/any/ct.t b/tests/py/any/ct.t index b5c13524..81d937d9 100644 --- a/tests/py/any/ct.t +++ b/tests/py/any/ct.t @@ -73,17 +73,16 @@ ct expiration 33-45;ok;ct expiration 33s-45s ct expiration != 33-45;ok;ct expiration != 33s-45s ct expiration {33, 55, 67, 88};ok;ct expiration { 1m7s, 33s, 55s, 1m28s} ct expiration != {33, 55, 67, 88};ok;ct expiration != { 1m7s, 33s, 55s, 1m28s} -ct expiration {33-55};ok;ct expiration { 33s-55s} -ct expiration != {33-55};ok;ct expiration != { 33s-55s} +ct expiration {33-55, 66-88};ok;ct expiration { 33s-55s, 1m6s-1m28s} +ct expiration != {33-55, 66-88};ok;ct expiration != { 33s-55s, 1m6s-1m28s} ct helper "ftp";ok ct helper "12345678901234567";fail ct helper "";fail -ct state . ct mark { new . 0x12345678};ok ct state . ct mark { new . 0x12345678, new . 0x34127856, established . 0x12785634};ok -ct direction . ct mark { original . 0x12345678};ok -ct state . ct mark vmap { new . 0x12345678 : drop};ok +ct direction . ct mark { original . 0x12345678, reply . 0x87654321};ok +ct state . ct mark vmap { new . 0x12345678 : drop, established . 0x87654321 : accept};ok ct original bytes > 100000;ok ct reply packets < 100;ok diff --git a/tests/py/any/ct.t.payload b/tests/py/any/ct.t.payload index 9338466d..86ac81cd 100644 --- a/tests/py/any/ct.t.payload +++ b/tests/py/any/ct.t.payload @@ -283,20 +283,20 @@ ip test-ip4 output [ ct load expiration => reg 1 ] [ lookup reg 1 set __set%d 0x1 ] -# ct expiration {33-55} -__set%d test-ip4 7 +# ct expiration {33-55, 66-88} +__set%d test-ip4 7 size 5 __set%d test-ip4 0 - element 00000000 : 1 [end] element e8800000 : 0 [end] element d9d60000 : 1 [end] -ip test-ip4 output + element 00000000 : 1 [end] element e8800000 : 0 [end] element d9d60000 : 1 [end] element d0010100 : 0 [end] element c1570100 : 1 [end] +ip test-ip4 output [ ct load expiration => reg 1 ] [ byteorder reg 1 = hton(reg 1, 4, 4) ] [ lookup reg 1 set __set%d ] -# ct expiration != {33-55} -__set%d test-ip4 7 +# ct expiration != {33-55, 66-88} +__set%d test-ip4 7 size 5 __set%d test-ip4 0 - element 00000000 : 1 [end] element e8800000 : 0 [end] element d9d60000 : 1 [end] -ip test-ip4 output + element 00000000 : 1 [end] element e8800000 : 0 [end] element d9d60000 : 1 [end] element d0010100 : 0 [end] element c1570100 : 1 [end] +ip test-ip4 output [ ct load expiration => reg 1 ] [ byteorder reg 1 = hton(reg 1, 4, 4) ] [ lookup reg 1 set __set%d 0x1 ] @@ -324,24 +324,6 @@ ip test-ip4 output [ ct load mark => reg 9 ] [ lookup reg 1 set __set%d ] -# ct direction . ct mark { original . 0x12345678} -__set%d test 3 -__set%d test 0 - element 00000000 12345678 : 0 [end] -ip test-ip4 output - [ ct load direction => reg 1 ] - [ ct load mark => reg 9 ] - [ lookup reg 1 set __set%d ] - -# ct state . ct mark vmap { new . 0x12345678 : drop} -__map%d test-ip4 b -__map%d test-ip4 0 - element 00000008 12345678 : 0 [end] -ip test-ip4 output - [ ct load state => reg 1 ] - [ ct load mark => reg 9 ] - [ lookup reg 1 set __map%d dreg 0 ] - # ct mark set mark ip test-ip4 output [ meta load mark => reg 1 ] @@ -493,3 +475,21 @@ ip test-ip4 output ip test-ip4 output [ notrack ] +# ct direction . ct mark { original . 0x12345678, reply . 0x87654321} +__set%d test-ip4 3 size 2 +__set%d test-ip4 0 + element 00000000 12345678 : 0 [end] element 00000001 87654321 : 0 [end] +ip test-ip4 output + [ ct load direction => reg 1 ] + [ ct load mark => reg 9 ] + [ lookup reg 1 set __set%d ] + +# ct state . ct mark vmap { new . 0x12345678 : drop, established . 0x87654321 : accept} +__map%d test-ip4 b size 2 +__map%d test-ip4 0 + element 00000008 12345678 : 0 [end] element 00000002 87654321 : 0 [end] +ip test-ip4 output + [ ct load state => reg 1 ] + [ ct load mark => reg 9 ] + [ lookup reg 1 set __map%d dreg 0 ] + diff --git a/tests/py/any/meta.t b/tests/py/any/meta.t index d69b8b4e..4b3c604d 100644 --- a/tests/py/any/meta.t +++ b/tests/py/any/meta.t @@ -17,8 +17,8 @@ meta length { 33, 55, 67, 88};ok meta length { 33-55, 67-88};ok meta length { 33-55, 56-88, 100-120};ok;meta length { 33-88, 100-120} meta length != { 33, 55, 67, 88};ok -meta length { 33-55};ok -meta length != { 33-55};ok +meta length { 33-55, 66-88};ok +meta length != { 33-55, 66-88};ok meta protocol { ip, arp, ip6, vlan };ok;meta protocol { ip6, ip, vlan, arp} meta protocol != {ip, arp, ip6, vlan};ok @@ -31,8 +31,8 @@ meta l4proto 33-45;ok meta l4proto != 33-45;ok meta l4proto { 33, 55, 67, 88};ok;meta l4proto { 33, 55, 67, 88} meta l4proto != { 33, 55, 67, 88};ok -meta l4proto { 33-55};ok -meta l4proto != { 33-55};ok +meta l4proto { 33-55, 66-88};ok +meta l4proto != { 33-55, 66-88};ok meta priority root;ok meta priority none;ok @@ -81,8 +81,6 @@ meta iiftype ppp;ok meta oif "lo" accept;ok;oif "lo" accept meta oif != "lo" accept;ok;oif != "lo" accept -meta oif {"lo"} accept;ok;oif {"lo"} accept -meta oif != {"lo"} accept;ok;oif != {"lo"} accept meta oifname "dummy0";ok;oifname "dummy0" meta oifname != "dummy0";ok;oifname != "dummy0" @@ -105,8 +103,8 @@ meta skuid gt 3000 accept;ok;meta skuid > 3000 accept meta skuid eq 3000 accept;ok;meta skuid 3000 accept meta skuid 3001-3005 accept;ok;meta skuid 3001-3005 accept meta skuid != 2001-2005 accept;ok;meta skuid != 2001-2005 accept -meta skuid { 2001-2005} accept;ok;meta skuid { 2001-2005} accept -meta skuid != { 2001-2005} accept;ok;meta skuid != { 2001-2005} accept +meta skuid { 2001-2005, 3001-3005} accept;ok;meta skuid { 2001-2005, 3001-3005} accept +meta skuid != { 2001-2005, 3001-3005} accept;ok;meta skuid != { 2001-2005, 3001-3005} accept meta skgid {"bin", "root", "daemon"} accept;ok;meta skgid { 0, 1, 2} accept meta skgid != {"bin", "root", "daemon"} accept;ok;meta skgid != { 1, 0, 2} accept @@ -173,22 +171,22 @@ meta iifgroup 0;ok;iifgroup "default" meta iifgroup != 0;ok;iifgroup != "default" meta iifgroup "default";ok;iifgroup "default" meta iifgroup != "default";ok;iifgroup != "default" -meta iifgroup {"default"};ok;iifgroup {"default"} -meta iifgroup != {"default"};ok;iifgroup != {"default"} +meta iifgroup {"default", 11};ok;iifgroup {"default", 11} +meta iifgroup != {"default", 11};ok;iifgroup != {"default", 11} meta iifgroup { 11,33};ok;iifgroup { 11,33} -meta iifgroup {11-33};ok;iifgroup {11-33} +meta iifgroup {11-33, 44-55};ok;iifgroup {11-33, 44-55} meta iifgroup != { 11,33};ok;iifgroup != { 11,33} -meta iifgroup != {11-33};ok;iifgroup != {11-33} +meta iifgroup != {11-33, 44-55};ok;iifgroup != {11-33, 44-55} meta oifgroup 0;ok;oifgroup "default" meta oifgroup != 0;ok;oifgroup != "default" meta oifgroup "default";ok;oifgroup "default" meta oifgroup != "default";ok;oifgroup != "default" -meta oifgroup {"default"};ok;oifgroup {"default"} -meta oifgroup != {"default"};ok;oifgroup != {"default"} +meta oifgroup {"default", 11};ok;oifgroup {"default", 11} +meta oifgroup != {"default", 11};ok;oifgroup != {"default", 11} meta oifgroup { 11,33};ok;oifgroup { 11,33} -meta oifgroup {11-33};ok;oifgroup {11-33} +meta oifgroup {11-33, 44-55};ok;oifgroup {11-33, 44-55} meta oifgroup != { 11,33};ok;oifgroup != { 11,33} -meta oifgroup != {11-33};ok;oifgroup != {11-33} +meta oifgroup != {11-33, 44-55};ok;oifgroup != {11-33, 44-55} meta cgroup 1048577;ok;meta cgroup 1048577 meta cgroup != 1048577;ok;meta cgroup != 1048577 diff --git a/tests/py/any/meta.t.payload b/tests/py/any/meta.t.payload index b32770f5..1d8426de 100644 --- a/tests/py/any/meta.t.payload +++ b/tests/py/any/meta.t.payload @@ -34,15 +34,6 @@ ip test-ip4 input [ meta load len => reg 1 ] [ lookup reg 1 set __set%d ] -# meta length { 33-55} -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element 21000000 : 0 [end] element 38000000 : 1 [end] -ip test-ip4 input - [ meta load len => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 4, 4) ] - [ lookup reg 1 set __set%d ] - # meta length { 33-55, 67-88} __set%d test-ip4 7 __set%d test-ip4 0 @@ -69,15 +60,6 @@ ip test-ip4 input [ meta load len => reg 1 ] [ lookup reg 1 set __set%d 0x1 ] -# meta length != { 33-55} -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element 21000000 : 0 [end] element 38000000 : 1 [end] -ip test-ip4 input - [ meta load len => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 4, 4) ] - [ lookup reg 1 set __set%d 0x1 ] - # meta protocol { ip, arp, ip6, vlan } __set%d test-ip4 3 __set%d test-ip4 0 @@ -143,24 +125,6 @@ ip test-ip4 input [ meta load l4proto => reg 1 ] [ lookup reg 1 set __set%d 0x1 ] -# meta l4proto { 33-55} -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element 00000021 : 0 [end] element 00000038 : 1 [end] -ip test-ip4 input - [ meta load l4proto => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 2, 1) ] - [ lookup reg 1 set __set%d ] - -# meta l4proto != { 33-55} -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element 00000021 : 0 [end] element 00000038 : 1 [end] -ip test-ip4 input - [ meta load l4proto => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 2, 1) ] - [ lookup reg 1 set __set%d 0x1 ] - # meta mark 0x4 ip test-ip4 input [ meta load mark => reg 1 ] @@ -311,24 +275,6 @@ ip test-ip4 input [ cmp neq reg 1 0x00000001 ] [ immediate reg 0 accept ] -# meta oif {"lo"} accept -__set%d test-ip4 3 -__set%d test-ip4 0 - element 00000001 : 0 [end] -ip test-ip4 input - [ meta load oif => reg 1 ] - [ lookup reg 1 set __set%d ] - [ immediate reg 0 accept ] - -# meta oif != {"lo"} accept -__set%d test-ip4 3 -__set%d test-ip4 0 - element 00000001 : 0 [end] -ip test-ip4 input - [ meta load oif => reg 1 ] - [ lookup reg 1 set __set%d 0x1 ] - [ immediate reg 0 accept ] - # meta oifname "dummy0" ip test-ip4 input [ meta load oifname => reg 1 ] @@ -446,26 +392,6 @@ ip test-ip4 input [ range neq reg 1 0xd1070000 0xd5070000 ] [ immediate reg 0 accept ] -# meta skuid { 2001-2005} accept -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element d1070000 : 0 [end] element d6070000 : 1 [end] -ip test-ip4 input - [ meta load skuid => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 4, 4) ] - [ lookup reg 1 set __set%d ] - [ immediate reg 0 accept ] - -# meta skuid != { 2001-2005} accept -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element d1070000 : 0 [end] element d6070000 : 1 [end] -ip test-ip4 input - [ meta load skuid => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 4, 4) ] - [ lookup reg 1 set __set%d 0x1 ] - [ immediate reg 0 accept ] - # meta skgid {"bin", "root", "daemon"} accept __set%d test-ip4 3 __set%d test-ip4 0 @@ -529,26 +455,6 @@ ip test-ip4 input [ range neq reg 1 0xd1070000 0xd5070000 ] [ immediate reg 0 accept ] -# meta skgid { 2001-2005} accept -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element d1070000 : 0 [end] element d6070000 : 1 [end] -ip test-ip4 input - [ meta load skgid => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 4, 4) ] - [ lookup reg 1 set __set%d ] - [ immediate reg 0 accept ] - -# meta skgid != { 2001-2005} accept -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element d1070000 : 0 [end] element d6070000 : 1 [end] -ip test-ip4 input - [ meta load skgid => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 4, 4) ] - [ lookup reg 1 set __set%d 0x1 ] - [ immediate reg 0 accept ] - # meta mark set 0xffffffc8 xor 0x16 ip test-ip4 input [ immediate reg 1 0xffffffde ] @@ -751,32 +657,6 @@ ip test-ip4 input [ meta load iifgroup => reg 1 ] [ lookup reg 1 set __set%d ] -# meta iifgroup {11-33} -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element 0b000000 : 0 [end] element 22000000 : 1 [end] -ip test-ip4 input - [ meta load iifgroup => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 4, 4) ] - [ lookup reg 1 set __set%d ] - -# meta iifgroup != { 11,33} -__set%d test-ip4 3 -__set%d test-ip4 0 - element 0000000b : 0 [end] element 00000021 : 0 [end] -ip test-ip4 input - [ meta load iifgroup => reg 1 ] - [ lookup reg 1 set __set%d 0x1 ] - -# meta iifgroup != {11-33} -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element 0b000000 : 0 [end] element 22000000 : 1 [end] -ip test-ip4 input - [ meta load iifgroup => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 4, 4) ] - [ lookup reg 1 set __set%d 0x1 ] - # meta oifgroup 0 ip test-ip4 input [ meta load oifgroup => reg 1 ] @@ -797,22 +677,6 @@ ip test-ip4 input [ meta load oifgroup => reg 1 ] [ cmp neq reg 1 0x00000000 ] -# meta oifgroup {"default"} -__set%d test-ip4 3 -__set%d test-ip4 0 - element 00000000 : 0 [end] -ip test-ip4 input - [ meta load oifgroup => reg 1 ] - [ lookup reg 1 set __set%d ] - -# meta oifgroup != {"default"} -__set%d test-ip4 3 -__set%d test-ip4 0 - element 00000000 : 0 [end] -ip test-ip4 input - [ meta load oifgroup => reg 1 ] - [ lookup reg 1 set __set%d 0x1 ] - # meta oifgroup { 11,33} __set%d test-ip4 3 __set%d test-ip4 0 @@ -821,32 +685,6 @@ ip test-ip4 input [ meta load oifgroup => reg 1 ] [ lookup reg 1 set __set%d ] -# meta oifgroup {11-33} -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element 0b000000 : 0 [end] element 22000000 : 1 [end] -ip test-ip4 input - [ meta load oifgroup => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 4, 4) ] - [ lookup reg 1 set __set%d ] - -# meta oifgroup != { 11,33} -__set%d test-ip4 3 -__set%d test-ip4 0 - element 0000000b : 0 [end] element 00000021 : 0 [end] -ip test-ip4 input - [ meta load oifgroup => reg 1 ] - [ lookup reg 1 set __set%d 0x1 ] - -# meta oifgroup != {11-33} -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element 0b000000 : 0 [end] element 22000000 : 1 [end] -ip test-ip4 input - [ meta load oifgroup => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 4, 4) ] - [ lookup reg 1 set __set%d 0x1 ] - # meta cgroup 1048577 ip test-ip4 input [ meta load cgroup => reg 1 ] @@ -886,24 +724,6 @@ ip test-ip4 input [ byteorder reg 1 = hton(reg 1, 4, 4) ] [ range neq reg 1 0x01001000 0x02001000 ] -# meta cgroup {1048577-1048578} -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element 01001000 : 0 [end] element 03001000 : 1 [end] -ip test-ip4 input - [ meta load cgroup => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 4, 4) ] - [ lookup reg 1 set __set%d ] - -# meta cgroup != { 1048577-1048578} -__set%d test-ip4 7 -__set%d test-ip4 0 - element 00000000 : 1 [end] element 01001000 : 0 [end] element 03001000 : 1 [end] -ip test-ip4 input - [ meta load cgroup => reg 1 ] - [ byteorder reg 1 = hton(reg 1, 4, 4) ] - [ lookup reg 1 set __set%d 0x1 ] - # meta iif . meta oif { "lo" . "lo" } __set%d test-ip4 3 __set%d test-ip4 0 @@ -1021,3 +841,209 @@ ip test-ip4 input [ meta load priority => reg 1 ] [ cmp eq reg 1 0x87654321 ] +# meta length { 33-55, 66-88} +__set%d test-ip4 7 size 5 +__set%d test-ip4 0 + element 00000000 : 1 [end] element 21000000 : 0 [end] element 38000000 : 1 [end] element 42000000 : 0 [end] element 59000000 : 1 [end] +ip test-ip4 input + [ meta load len => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 4, 4) ] + [ lookup reg 1 set __set%d ] + +# meta length != { 33-55, 66-88} +__set%d test-ip4 7 size 5 +__set%d test-ip4 0 + element 00000000 : 1 [end] element 21000000 : 0 [end] element 38000000 : 1 [end] element 42000000 : 0 [end] element 59000000 : 1 [end] +ip test-ip4 input + [ meta load len => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 4, 4) ] + [ lookup reg 1 set __set%d 0x1 ] + +# meta l4proto { 33-55, 66-88} +__set%d test-ip4 7 size 5 +__set%d test-ip4 0 + element 00000000 : 1 [end] element 00000021 : 0 [end] element 00000038 : 1 [end] element 00000042 : 0 [end] element 00000059 : 1 [end] +ip test-ip4 input + [ meta load l4proto => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 2, 1) ] + [ lookup reg 1 set __set%d ] + +# meta l4proto != { 33-55, 66-88} +__set%d test-ip4 7 size 5 +__set%d test-ip4 0 + element 00000000 : 1 [end] element 00000021 : 0 [end] element 00000038 : 1 [end] element 00000042 : 0 [end] element 00000059 : 1 [end] +ip test-ip4 input + [ meta load l4proto => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 2, 1) ] + [ lookup reg 1 set __set%d 0x1 ] + +# meta skuid { 2001-2005, 3001-3005} accept +__set%d test-ip4 7 size 5 +__set%d test-ip4 0 + element 00000000 : 1 [end] element d1070000 : 0 [end] element d6070000 : 1 [end] element b90b0000 : 0 [end] element be0b0000 : 1 [end] +ip test-ip4 input + [ meta load skuid => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 4, 4) ] + [ lookup reg 1 set __set%d ] + [ immediate reg 0 accept ] + +# meta iifgroup {"default", 11} +__set%d test-ip4 3 size 2 +__set%d test-ip4 0 + element 00000000 : 0 [end] element 0000000b : 0 [end] +ip test-ip4 input + [ meta load iifgroup => reg 1 ] + [ lookup reg 1 set __set%d ] + +# meta iifgroup != {"default", 11} +__set%d test-ip4 3 size 2 +__set%d test-ip4 0 + element 00000000 : 0 [end] element 0000000b : 0 [end] +ip test-ip4 input + [ meta load iifgroup => reg 1 ] + [ lookup reg 1 set __set%d 0x1 ] + +# meta iifgroup {11-33, 44-55} +__set%d test-ip4 7 size 5 +__set%d test-ip4 0 + element 00000000 : 1 [end] element 0b000000 : 0 [end] element 22000000 : 1 [end] element 2c000000 : 0 [end] element 38000000 : 1 [end] +ip test-ip4 input + [ meta load iifgroup => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 4, 4) ] + [ lookup reg 1 set __set%d ] + +# meta iifgroup != { 11,33} +__set%d test-ip4 3 size 2 +__set%d test-ip4 0 + element 0000000b : 0 [end] element 00000021 : 0 [end] +ip test-ip4 input + [ meta load iifgroup => reg 1 ] + [ lookup reg 1 set __set%d 0x1 ] + +# meta iifgroup != {11-33, 44-55} +__set%d test-ip4 7 size 5 +__set%d test-ip4 0 + element 00000000 : 1 [end] element 0b000000 : 0 [end] element 22000000 : 1 [end] element 2c000000 : 0 [end] element 38000000 : 1 [end] +ip test-ip4 input + [ meta load iifgroup => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 4, 4) ] + [ lookup reg 1 set __set%d 0x1 ] + +# meta oifgroup {"default", 11} +__set%d test-ip4 3 size 2 +__set%d test-ip4 0 + element 00000000 : 0 [end] element 0000000b : 0 [end] +ip test-ip4 input + [ meta load oifgroup => reg 1 ] + [ lookup reg 1 set __set%d ] + +# meta oifgroup {11-33, 44-55} +__set%d test-ip4 7 size 5 +__set%d test-ip4 0 + element 00000000 : 1 [end] element 0b000000 : 0 [end] element 22000000 : 1 [end] element 2c000000 : 0 [end] element 38000000 : 1 [end] +ip test-ip4 input + [ meta load oifgroup => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 4, 4) ] + [ lookup reg 1 set __set%d ] + +# meta oifgroup != { 11,33} +__set%d test-ip4 3 size 2 +__set%d test-ip4 0 + element 0000000b : 0 [end] element 00000021 : 0 [end] +ip test-ip4 input + [ meta load oifgroup => reg 1 ] + [ lookup reg 1 set __set%d 0x1 ] + +# meta oifgroup != {11-33, 44-55} +__set%d test-ip4 7 size 5 +__set%d test-ip4 0 + element 00000000 : 1 [end] element 0b000000 : 0 [end] element 22000000 : 1 [end] element 2c000000 : 0 [end] element 38000000 : 1 [end] +ip test-ip4 input + [ meta load oifgroup => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 4, 4) ] + [ lookup reg 1 set __set%d 0x1 ] + +# meta skuid != { 2001-2005, 3001-3005} accept +__set%d test-ip4 7 size 5 +__set%d test-ip4 0 + element 00000000 : 1 [end] element d1070000 : 0 [end] element d6070000 : 1 [end] element b90b0000 : 0 [end] element be0b0000 : 1 [end] +ip test-ip4 input + [ meta load skuid => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 4, 4) ] + [ lookup reg 1 set __set%d 0x1 ] + [ immediate reg 0 accept ] + +# meta oifgroup != {"default", 11} +__set%d test-ip4 3 size 2 +__set%d test-ip4 0 + element 00000000 : 0 [end] element 0000000b : 0 [end] +ip test-ip4 input + [ meta load oifgroup => reg 1 ] + [ lookup reg 1 set __set%d 0x1 ] + +# meta iif . meta oif { "lo" . "lo" , "dummy0" . "dummy0" } +__set%d test-ip4 3 size 2 +__set%d test-ip4 0 + element 00000001 00000001 : 0 [end] element 00000005 00000005 : 0 [end] +ip test-ip4 input + [ meta load iif => reg 1 ] + [ meta load oif => reg 9 ] + [ lookup reg 1 set __set%d ] + +# meta iif . meta oif . meta mark { "lo" . "lo" . 0x0000000a, "dummy0" . "dummy0" . 0x0000000b } +__set%d test-ip4 3 size 2 +__set%d test-ip4 0 + element 00000001 00000001 0000000a : 0 [end] element 00000005 00000005 0000000b : 0 [end] +ip test-ip4 input + [ meta load iif => reg 1 ] + [ meta load oif => reg 9 ] + [ meta load mark => reg 10 ] + [ lookup reg 1 set __set%d ] + +# meta iif . meta oif vmap { "lo" . "lo" : drop, "dummy0" . "dummy0" : accept } +__map%d test-ip4 b size 2 +__map%d test-ip4 0 + element 00000001 00000001 : 0 [end] element 00000005 00000005 : 0 [end] +ip test-ip4 input + [ meta load iif => reg 1 ] + [ meta load oif => reg 9 ] + [ lookup reg 1 set __map%d dreg 0 ] + +# meta skgid { 2001-2005} accept +__set%d test-ip4 7 size 3 +__set%d test-ip4 0 + element 00000000 : 1 [end] element d1070000 : 0 [end] element d6070000 : 1 [end] +ip test-ip4 input + [ meta load skgid => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 4, 4) ] + [ lookup reg 1 set __set%d ] + [ immediate reg 0 accept ] + +# meta skgid != { 2001-2005} accept +__set%d test-ip4 7 size 3 +__set%d test-ip4 0 + element 00000000 : 1 [end] element d1070000 : 0 [end] element d6070000 : 1 [end] +ip test-ip4 input + [ meta load skgid => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 4, 4) ] + [ lookup reg 1 set __set%d 0x1 ] + [ immediate reg 0 accept ] + +# meta cgroup {1048577-1048578} +__set%d test-ip4 7 size 3 +__set%d test-ip4 0 + element 00000000 : 1 [end] element 01001000 : 0 [end] element 03001000 : 1 [end] +ip test-ip4 input + [ meta load cgroup => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 4, 4) ] + [ lookup reg 1 set __set%d ] + +# meta cgroup != { 1048577-1048578} +__set%d test-ip4 7 size 3 +__set%d test-ip4 0 + element 00000000 : 1 [end] element 01001000 : 0 [end] element 03001000 : 1 [end] +ip test-ip4 input + [ meta load cgroup => reg 1 ] + [ byteorder reg 1 = hton(reg 1, 4, 4) ] + [ lookup reg 1 set __set%d 0x1 ] + |