From: Elise Lennion Date: Fri, 17 Mar 2017 15:04:06 +0000 (-0300) Subject: parser_bison: Allow flushing maps X-Git-Tag: v0.8~190 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d37dae4b313e162d3196c2e5aa1670dbaf43bff;p=thirdparty%2Fnftables.git parser_bison: Allow flushing maps This patch enables the command flush on maps, which removes all entries in it: $ nft flush map filter map1 Command above flushes map 'map1' in table 'filter'. The documentation was updated accordingly. Signed-off-by: Elise Lennion Signed-off-by: Pablo Neira Ayuso --- diff --git a/doc/nft.xml b/doc/nft.xml index d4121846..5b754690 100644 --- a/doc/nft.xml +++ b/doc/nft.xml @@ -812,6 +812,7 @@ filter input iif $int_ifs accept delete list + flush map family @@ -848,6 +849,14 @@ filter input iif $int_ifs accept + + + + + Remove all elements from the specified map. + + + diff --git a/src/parser_bison.y b/src/parser_bison.y index e44ff44d..841b2e17 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -1131,6 +1131,10 @@ flush_cmd : TABLE table_spec { $$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_SET, &$3, &@$, NULL); } + | MAP set_spec + { + $$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_SET, &$2, &@$, NULL); + } | RULESET ruleset_spec { $$ = cmd_alloc(CMD_FLUSH, CMD_OBJ_RULESET, &$2, &@$, NULL);