diff options
author | Florian Westphal <fw@strlen.de> | 2019-12-18 12:10:41 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2020-01-03 13:09:56 +0100 |
commit | 09fcaafc5a2de4379574a0882f976a14d8c49dfe (patch) | |
tree | f3e6a40abeac0ac40fa42f81aaded9f9d41b93d3 /tests/py | |
parent | b5932e4283a7249fc51e221b31da282adce156bf (diff) |
meta: add slave device matching
Adds "meta sdif" and "meta sdifname".
Both only work in input/forward hook of ipv4/ipv6/inet family.
Cc: Martin Willi <martin@strongswan.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py')
-rw-r--r-- | tests/py/ip/meta.t | 3 | ||||
-rw-r--r-- | tests/py/ip/meta.t.payload | 11 | ||||
-rw-r--r-- | tests/py/ip6/meta.t | 3 | ||||
-rw-r--r-- | tests/py/ip6/meta.t.payload | 12 |
4 files changed, 29 insertions, 0 deletions
diff --git a/tests/py/ip/meta.t b/tests/py/ip/meta.t index 4db88354..f733d22d 100644 --- a/tests/py/ip/meta.t +++ b/tests/py/ip/meta.t @@ -10,3 +10,6 @@ icmpv6 type nd-router-advert;ok meta ibrname "br0";fail meta obrname "br0";fail + +meta sdif "lo" accept;ok +meta sdifname != "vrf1" accept;ok diff --git a/tests/py/ip/meta.t.payload b/tests/py/ip/meta.t.payload index 322c0878..7bc69a29 100644 --- a/tests/py/ip/meta.t.payload +++ b/tests/py/ip/meta.t.payload @@ -33,3 +33,14 @@ ip test-ip4 input [ payload load 1b @ transport header + 0 => reg 1 ] [ cmp eq reg 1 0x00000086 ] +# meta sdif "lo" accept +ip6 test-ip4 input + [ meta load sdif => reg 1 ] + [ cmp eq reg 1 0x00000001 ] + [ immediate reg 0 accept ] + +# meta sdifname != "vrf1" accept +ip6 test-ip4 input + [ meta load sdifname => reg 1 ] + [ cmp neq reg 1 0x31667276 0x00000000 0x00000000 0x00000000 ] + [ immediate reg 0 accept ] diff --git a/tests/py/ip6/meta.t b/tests/py/ip6/meta.t index 24445084..dce97f5b 100644 --- a/tests/py/ip6/meta.t +++ b/tests/py/ip6/meta.t @@ -8,3 +8,6 @@ meta l4proto ipv6-icmp icmpv6 type nd-router-advert;ok;icmpv6 type nd-router-adv meta l4proto icmp icmp type echo-request;ok;icmp type echo-request meta l4proto 1 icmp type echo-request;ok;icmp type echo-request icmp type echo-request;ok + +meta sdif "lo" accept;ok +meta sdifname != "vrf1" accept;ok diff --git a/tests/py/ip6/meta.t.payload b/tests/py/ip6/meta.t.payload index f203baab..be04816e 100644 --- a/tests/py/ip6/meta.t.payload +++ b/tests/py/ip6/meta.t.payload @@ -32,3 +32,15 @@ ip6 test-ip6 input [ cmp eq reg 1 0x00000001 ] [ payload load 1b @ transport header + 0 => reg 1 ] [ cmp eq reg 1 0x00000008 ] + +# meta sdif "lo" accept +ip6 test-ip6 input + [ meta load sdif => reg 1 ] + [ cmp eq reg 1 0x00000001 ] + [ immediate reg 0 accept ] + +# meta sdifname != "vrf1" accept +ip6 test-ip6 input + [ meta load sdifname => reg 1 ] + [ cmp neq reg 1 0x31667276 0x00000000 0x00000000 0x00000000 ] + [ immediate reg 0 accept ] |