close_scope_arp : { scanner_pop_start_cond(nft->scanner, PARSER_SC_ARP); };
close_scope_ct : { scanner_pop_start_cond(nft->scanner, PARSER_SC_CT); };
+close_scope_counter : { scanner_pop_start_cond(nft->scanner, PARSER_SC_COUNTER); };
close_scope_eth : { scanner_pop_start_cond(nft->scanner, PARSER_SC_ETH); };
close_scope_fib : { scanner_pop_start_cond(nft->scanner, PARSER_SC_EXPR_FIB); };
close_scope_hash : { scanner_pop_start_cond(nft->scanner, PARSER_SC_EXPR_HASH); };
handle_merge(&$3->handle, &$2);
$$ = cmd_alloc(CMD_ADD, CMD_OBJ_FLOWTABLE, &$2, &@$, $5);
}
- | COUNTER obj_spec
+ | COUNTER obj_spec close_scope_counter
{
struct obj *obj;
handle_merge(&obj->handle, &$2);
$$ = cmd_alloc(CMD_ADD, CMD_OBJ_COUNTER, &$2, &@$, obj);
}
- | COUNTER obj_spec counter_obj counter_config
+ | COUNTER obj_spec counter_obj counter_config close_scope_counter
{
$$ = cmd_alloc(CMD_ADD, CMD_OBJ_COUNTER, &$2, &@$, $3);
}
- | COUNTER obj_spec counter_obj '{' counter_block '}'
+ | COUNTER obj_spec counter_obj '{' counter_block '}' close_scope_counter
{
$$ = cmd_alloc(CMD_ADD, CMD_OBJ_COUNTER, &$2, &@$, $3);
}
handle_merge(&$3->handle, &$2);
$$ = cmd_alloc(CMD_CREATE, CMD_OBJ_FLOWTABLE, &$2, &@$, $5);
}
- | COUNTER obj_spec
+ | COUNTER obj_spec close_scope_counter
{
struct obj *obj;
handle_merge(&obj->handle, &$2);
$$ = cmd_alloc(CMD_CREATE, CMD_OBJ_COUNTER, &$2, &@$, obj);
}
- | COUNTER obj_spec counter_obj counter_config
+ | COUNTER obj_spec counter_obj counter_config close_scope_counter
{
$$ = cmd_alloc(CMD_CREATE, CMD_OBJ_COUNTER, &$2, &@$, $3);
}
handle_merge(&$3->handle, &$2);
$$ = cmd_alloc(CMD_DELETE, CMD_OBJ_FLOWTABLE, &$2, &@$, $5);
}
- | COUNTER obj_or_id_spec
+ | COUNTER obj_or_id_spec close_scope_counter
{
$$ = cmd_alloc(CMD_DELETE, CMD_OBJ_COUNTER, &$2, &@$, NULL);
}
{
$$ = cmd_alloc(CMD_LIST, CMD_OBJ_COUNTERS, &$3, &@$, NULL);
}
- | COUNTER obj_spec
+ | COUNTER obj_spec close_scope_counter
{
$$ = cmd_alloc(CMD_LIST, CMD_OBJ_COUNTER, &$2, &@$, NULL);
}
{
$$ = cmd_alloc(CMD_RESET, CMD_OBJ_COUNTERS, &$3, &@$, NULL);
}
- | COUNTER obj_spec
+ | COUNTER obj_spec close_scope_counter
{
$$ = cmd_alloc(CMD_RESET, CMD_OBJ_COUNTER, &$2,&@$, NULL);
}
}
| table_block COUNTER obj_identifier
obj_block_alloc '{' counter_block '}'
- stmt_separator
+ stmt_separator close_scope_counter
{
$4->location = @3;
$4->type = NFT_OBJECT_COUNTER;
}
;
-map_block_obj_type : COUNTER { $$ = NFT_OBJECT_COUNTER; }
+map_block_obj_type : COUNTER close_scope_counter { $$ = NFT_OBJECT_COUNTER; }
| QUOTA close_scope_quota { $$ = NFT_OBJECT_QUOTA; }
| LIMIT close_scope_limit { $$ = NFT_OBJECT_LIMIT; }
| SECMARK close_scope_secmark { $$ = NFT_OBJECT_SECMARK; }
{
$$->dev_expr = $4;
}
- | flowtable_block COUNTER
+ | flowtable_block COUNTER close_scope_counter
{
$$->flags |= NFT_FLOWTABLE_COUNTER;
}
counter_stmt : counter_stmt_alloc
| counter_stmt_alloc counter_args
-counter_stmt_alloc : COUNTER
+counter_stmt_alloc : COUNTER close_scope_counter
{
$$ = counter_stmt_alloc(&@$);
}
- | COUNTER NAME stmt_expr
+ | COUNTER NAME stmt_expr close_scope_counter
{
$$ = objref_stmt_alloc(&@$);
$$->objref.type = NFT_OBJECT_COUNTER;
}
;
-set_elem_stmt : COUNTER
+set_elem_stmt : COUNTER close_scope_counter
{
$$ = counter_stmt_alloc(&@$);
}
- | COUNTER PACKETS NUM BYTES NUM
+ | COUNTER PACKETS NUM BYTES NUM close_scope_counter
{
$$ = counter_stmt_alloc(&@$);
$$->counter.packets = $3;