summaryrefslogtreecommitdiffstats
path: root/src/parser_bison.y
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-06-15 15:24:28 +0200
committerPhil Sutter <phil@nwl.cc>2023-07-13 16:57:56 +0200
commit83e0f4402fb731633975b54ee043820d3cc7ed8e (patch)
tree36fa5f53e74d9e9c457305accd6196140709e4f1 /src/parser_bison.y
parente2431ab955fe453b5fd25a3ab3090fbf4bf3e653 (diff)
Implement 'reset {set,map,element}' commands
All these are used to reset state in set/map elements, i.e. reset the timeout or zero quota and counter values. While 'reset element' expects a (list of) elements to be specified which should be reset, 'reset set/map' will reset all elements in the given set/map. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r--src/parser_bison.y12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index beb277b6..553ddf97 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -1742,6 +1742,18 @@ reset_cmd : COUNTERS ruleset_spec
{
$$ = cmd_alloc(CMD_RESET, CMD_OBJ_RULE, &$2, &@$, NULL);
}
+ | ELEMENT set_spec set_block_expr
+ {
+ $$ = cmd_alloc(CMD_RESET, CMD_OBJ_ELEMENTS, &$2, &@$, $3);
+ }
+ | SET set_or_id_spec
+ {
+ $$ = cmd_alloc(CMD_RESET, CMD_OBJ_SET, &$2, &@$, NULL);
+ }
+ | MAP set_or_id_spec
+ {
+ $$ = cmd_alloc(CMD_RESET, CMD_OBJ_MAP, &$2, &@$, NULL);
+ }
;
flush_cmd : TABLE table_spec