diff options
author | Eric Jallot <ejallot@gmail.com> | 2019-11-04 21:23:59 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-11-06 12:38:24 +0100 |
commit | 91487a80551ea91714082da41aa49ba52dd6e9bb (patch) | |
tree | 7f9c00b47fe7b3221c9dc9d8ced8f894b8b2566b /src/parser_bison.y | |
parent | f5953e519ea8ae4243f58015a1311a3639524648 (diff) |
src: flowtable: add support for delete command by handle
Also, display handle when listing with '-a'.
Signed-off-by: Eric Jallot <ejallot@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r-- | src/parser_bison.y | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y index 94494f6f..6f525d5b 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -559,8 +559,8 @@ int nft_lex(void *, void *, void *); %type <handle> table_spec tableid_spec chain_spec chainid_spec flowtable_spec chain_identifier ruleid_spec handle_spec position_spec rule_position ruleset_spec index_spec %destructor { handle_free(&$$); } table_spec tableid_spec chain_spec chainid_spec flowtable_spec chain_identifier ruleid_spec handle_spec position_spec rule_position ruleset_spec index_spec -%type <handle> set_spec setid_spec set_identifier flowtable_identifier obj_spec objid_spec obj_identifier -%destructor { handle_free(&$$); } set_spec setid_spec set_identifier obj_spec objid_spec obj_identifier +%type <handle> set_spec setid_spec set_identifier flowtableid_spec flowtable_identifier obj_spec objid_spec obj_identifier +%destructor { handle_free(&$$); } set_spec setid_spec set_identifier flowtableid_spec obj_spec objid_spec obj_identifier %type <val> family_spec family_spec_explicit %type <val32> int_num chain_policy %type <prio_spec> extended_prio_spec prio_spec @@ -1151,6 +1151,10 @@ delete_cmd : TABLE table_spec { $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_FLOWTABLE, &$2, &@$, NULL); } + | FLOWTABLE flowtableid_spec + { + $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_FLOWTABLE, &$2, &@$, NULL); + } | COUNTER obj_spec { $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_COUNTER, &$2, &@$, NULL); @@ -2225,7 +2229,6 @@ set_identifier : identifier } ; - flowtable_spec : table_spec identifier { $$ = $1; @@ -2234,6 +2237,14 @@ flowtable_spec : table_spec identifier } ; +flowtableid_spec : table_spec HANDLE NUM + { + $$ = $1; + $$.handle.location = @$; + $$.handle.id = $3; + } + ; + flowtable_identifier : identifier { memset(&$$, 0, sizeof($$)); |