diff options
author | Florian Westphal <fw@strlen.de> | 2021-06-02 20:38:46 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2021-06-02 23:46:11 +0200 |
commit | 5c2c6b09286048b39d51964391ef2aecfd247512 (patch) | |
tree | 03295d9dc27ec95a40a8ceb1012e69c356058732 /tests/py/ip | |
parent | 4359cb82833a6907f9ee9803be270db89ceaf758 (diff) |
json: catchall element support
Treat '*' as catchall element, not as a symbol.
Also add missing json test cases for wildcard set support.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py/ip')
-rw-r--r-- | tests/py/ip/sets.t.json | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/tests/py/ip/sets.t.json b/tests/py/ip/sets.t.json index 65d2df87..d24b3918 100644 --- a/tests/py/ip/sets.t.json +++ b/tests/py/ip/sets.t.json @@ -188,3 +188,87 @@ } ] +# ip saddr @set6 drop +[ + { + "match": { + "left": { + "payload": { + "field": "saddr", + "protocol": "ip" + } + }, + "op": "==", + "right": "@set6" + } + }, + { + "drop": null + } +] + +# ip saddr vmap { 1.1.1.1 : drop, * : accept } +[ + { + "vmap": { + "data": { + "set": [ + [ + "1.1.1.1", + { + "drop": null + } + ], + [ + "*", + { + "accept": null + } + ] + ] + }, + "key": { + "payload": { + "field": "saddr", + "protocol": "ip" + } + } + } + } +] + +# meta mark set ip saddr map { 1.1.1.1 : 0x00000001, * : 0x00000002 } +[ + { + "mangle": { + "key": { + "meta": { + "key": "mark" + } + }, + "value": { + "map": { + "data": { + "set": [ + [ + "1.1.1.1", + 1 + ], + [ + "*", + 2 + ] + ] + }, + "key": { + "payload": { + "field": "saddr", + "protocol": "ip" + } + } + } + } + } + } +] + |