From 83e0f4402fb731633975b54ee043820d3cc7ed8e Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 15 Jun 2023 15:24:28 +0200 Subject: 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 --- src/parser_bison.y | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/parser_bison.y') 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 -- cgit v1.2.3