diff options
| author | Phil Sutter <phil@nwl.cc> | 2024-09-28 00:55:34 +0200 |
|---|---|---|
| committer | Phil Sutter <phil@nwl.cc> | 2024-11-06 11:00:21 +0100 |
| commit | bb6312484af93a83a9ec8716f3887a43566a775a (patch) | |
| tree | 9e4a151a53d0ef3011a8e9bf1a0048b85da4f512 /tests/shell/testcases/sets/dumps/inner_0.json-nft | |
| parent | 193faa5475a5df7d9ac0b1a8fe647196de3e5688 (diff) | |
json: Support typeof in set and map types
Implement this as a special "type" property value which is an object
with sole property "typeof". The latter's value is the JSON
representation of the expression in set->key, so for concatenated
typeofs it is a concat expression.
All this is a bit clumsy right now but it works and it should be
possible to tear it down a bit for more user-friendliness in a
compatible way by either replacing the concat expression by the array it
contains or even the whole "typeof" object - the parser would just
assume any object (or objects in an array) in the "type" property value
are expressions to extract a type from.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'tests/shell/testcases/sets/dumps/inner_0.json-nft')
| -rw-r--r-- | tests/shell/testcases/sets/dumps/inner_0.json-nft | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/tests/shell/testcases/sets/dumps/inner_0.json-nft b/tests/shell/testcases/sets/dumps/inner_0.json-nft index 8d84e1cc..e5dc198f 100644 --- a/tests/shell/testcases/sets/dumps/inner_0.json-nft +++ b/tests/shell/testcases/sets/dumps/inner_0.json-nft @@ -27,10 +27,26 @@ "family": "netdev", "name": "x", "table": "x", - "type": [ - "ipv4_addr", - "ipv4_addr" - ], + "type": { + "typeof": { + "concat": [ + { + "payload": { + "tunnel": "vxlan", + "protocol": "ip", + "field": "saddr" + } + }, + { + "payload": { + "tunnel": "vxlan", + "protocol": "ip", + "field": "daddr" + } + } + ] + } + }, "handle": 0, "elem": [ { @@ -47,7 +63,15 @@ "family": "netdev", "name": "y", "table": "x", - "type": "ipv4_addr", + "type": { + "typeof": { + "payload": { + "tunnel": "vxlan", + "protocol": "ip", + "field": "saddr" + } + } + }, "handle": 0, "size": 65535, "flags": [ |
