diff options
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r-- | src/parser_bison.y | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y index 5b829a24..795b0ee2 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -365,6 +365,7 @@ static void location_update(struct location *loc, struct location *rhs, int n) %token LABEL "label" %token COUNTER "counter" +%token NAME "name" %token PACKETS "packets" %token BYTES "bytes" @@ -1623,6 +1624,12 @@ counter_stmt_alloc : COUNTER { $$ = counter_stmt_alloc(&@$); } + | COUNTER NAME stmt_expr + { + $$ = objref_stmt_alloc(&@$); + $$->objref.type = NFT_OBJECT_COUNTER; + $$->objref.expr = $3; + } ; counter_args : counter_arg @@ -1823,6 +1830,12 @@ quota_stmt : QUOTA quota_mode NUM quota_unit quota_used $$->quota.used = $5; $$->quota.flags = $2; } + | QUOTA NAME stmt_expr + { + $$ = objref_stmt_alloc(&@$); + $$->objref.type = NFT_OBJECT_QUOTA; + $$->objref.expr = $3; + } ; limit_mode : OVER { $$ = NFT_LIMIT_F_INV; } |