diff options
author | Harsha Sharma <harshasharmaiitr@gmail.com> | 2018-01-14 21:48:46 +0530 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-03-05 16:41:07 +0100 |
commit | f4a34d25f6d5f4188573dbe16613ce96327f0e6c (patch) | |
tree | 1e22f0cf48ec94c66b6a6016b671ad9168775d6a /src/parser_bison.y | |
parent | 51d3592d22ea5b0d5e5740a3b3cc4b62a2fabb36 (diff) |
src: list set handle and delete set via set handle
Print 'handle' attribute in sets when listing via '-a' option and
delete sets via their unique set handles listed with '-a' option.
For e.g.
nft delete set [<family>] <table-name> [handle <handle>]
Signed-off-by: Harsha Sharma <harshasharmaiitr@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 | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y index dd0dcc51..d4481ad6 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -509,8 +509,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 %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 -%type <handle> set_spec set_identifier flowtable_identifier obj_spec obj_identifier -%destructor { handle_free(&$$); } set_spec set_identifier obj_spec obj_identifier +%type <handle> set_spec setid_spec set_identifier flowtable_identifier obj_spec obj_identifier +%destructor { handle_free(&$$); } set_spec setid_spec set_identifier obj_spec obj_identifier %type <val> family_spec family_spec_explicit chain_policy prio_spec %type <string> dev_spec quota_unit @@ -1048,6 +1048,10 @@ delete_cmd : TABLE table_spec { $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_SET, &$2, &@$, NULL); } + | SET setid_spec + { + $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_SET, &$2, &@$, NULL); + } | MAP set_spec { $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_SET, &$2, &@$, NULL); @@ -1856,6 +1860,14 @@ set_spec : table_spec identifier } ; +setid_spec : table_spec HANDLE NUM + { + $$ = $1; + $$.handle.location = @$; + $$.handle.id = $3; + } + ; + set_identifier : identifier { memset(&$$, 0, sizeof($$)); |