summaryrefslogtreecommitdiffstats
path: root/src/parser_bison.y
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2024-02-29 11:41:23 +0100
committerFlorian Westphal <fw@strlen.de>2024-03-01 00:38:33 +0100
commit25f1e6ccc0590e1081879022809afb83fc45f673 (patch)
tree7bb524013f7d004584eea1c60d2bd5d31ed5abd6 /src/parser_bison.y
parentfb98cb91c575880617e5da2cb6f094525516cb78 (diff)
parser: allow typeof in objref maps
Its currently not possible to declare a map that stores object references with the "typeof" keyword, e.g. map m { type ipv4_addr : limit will work, but map m { typeof ip saddr : limit will give a syntax error ("unexpected limit"). Followup pach will add support for listing side too. Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r--src/parser_bison.y9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index cba37c68..cd1dc658 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -2340,6 +2340,15 @@ map_block : /* empty */ { $$ = $<set>-1; }
$1->flags |= NFT_SET_OBJECT;
$$ = $1;
}
+ | map_block TYPEOF
+ typeof_expr COLON map_block_obj_type
+ stmt_separator
+ {
+ $1->key = $3;
+ $1->objtype = $5;
+ $1->flags |= NFT_SET_OBJECT;
+ $$ = $1;
+ }
| map_block FLAGS set_flag_list stmt_separator
{
$1->flags |= $3;