parser: Support table spec in 'list chains' command
Phil Sutter
reviewerPATCH 1/1 parser: Support table spec in 'list chains' command
Make it possible for users to list all chains in a given table.
Signed-off-by Phil Sutter <[email protected]>
--- doc/nft.txt | 2 +- src/parser_bison.y | 2 +- src/parser_json.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-)
doc/nft.txt +1 -1
@@ -390,7 +390,7 @@ CHAINS ____ {*add* | *create*} *chain* ['family'] 'table' 'chain' [*{ type* 'type' *hook* 'hook' ['DEVICE'] *priority* 'priority' *;* [*policy* 'policy' *;*] [*comment* 'comment' *;*] *}*] {*delete* | *destroy* | *list* | *flush*} *chain* ['family'] 'table' 'chain' -*list chains* ['family'] +*list chains* ['family'] ['table'] *delete chain* ['family'] 'table' *handle* 'handle' *destroy chain* ['family'] 'table' *handle* 'handle' *rename chain* ['family'] 'table' 'chain' 'newname'
src/parser_bison.y +1 -1
@@ -1669,7 +1669,7 @@ list_cmd : TABLE table_spec { $$ = cmd_alloc(CMD_LIST, CMD_OBJ_CHAIN, &$2, &@$, NULL); } - | CHAINS ruleset_spec + | CHAINS list_cmd_spec_any { $$ = cmd_alloc(CMD_LIST, CMD_OBJ_CHAINS, &$2, &@$, NULL); }
src/parser_json.c +1 -0
@@ -4140,6 +4140,7 @@ static struct cmd *json_parse_cmd_list_multiple(struct json_ctx *ctx, } }switch (obj) { +case CMD_OBJ_CHAINS :case CMD_OBJ_SETS :case CMD_OBJ_COUNTERS :case CMD_OBJ_CT_HELPERS :
Signature · 1 line
2.51.0
Quoted 1 line · Phil Sutter
Make it possible for users to list all chains in a given table.
LGTM, thanks.
Acked-by Florian Westphal <[email protected]>
Phil Sutter
reviewerQuoted 6 lines · Florian Westphal
Quoted 1 line · Phil Sutter
Make it possible for users to list all chains in a given table.
LGTM, thanks.
Acked-by Florian Westphal <[email protected]>
Also applied, thanks!