parser: allow listing sets in one table
Florian Westphal
maintainerPATCH 1/1 parser: allow listing sets in one table
currently nft can lists sets:
nft list sets
but unlike e.g. 'quotas' or 'counters' we didn't support restricting it to a table. Now its possible to restrict set definition listing to one table:
nft list sets table inet filter
Signed-off-by Florian Westphal <[email protected]>
--- src/evaluate.c | 2 +- src/parser_bison.y | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)
src/evaluate.c +1 -1
@@ -3037,6 +3037,7 @@ static int cmd_evaluate_list(struct eval_ctx *ctx, struct cmd *cmd)case CMD_OBJ_COUNTERS :case CMD_OBJ_QUOTAS :case CMD_OBJ_CT_HELPERS : +case CMD_OBJ_SETS :if (cmd->handle.table ==NULL )return 0 ;if (table_lookup (&cmd->handle) ==NULL )
@@ -3044,7 +3045,6 @@ static int cmd_evaluate_list(struct eval_ctx *ctx, struct cmd *cmd) cmd->handle.table);return 0 ;case CMD_OBJ_CHAINS : -case CMD_OBJ_SETS :case CMD_OBJ_RULESET :case CMD_OBJ_FLOWTABLES :case CMD_OBJ_MAPS :
src/parser_bison.y +4 -0
@@ -1007,6 +1007,10 @@ list_cmd : TABLE table_spec { $$ = cmd_alloc(CMD_LIST, CMD_OBJ_SETS, &$2, &@$, NULL); } + | SETS TABLE table_spec + { + $$ = cmd_alloc(CMD_LIST, CMD_OBJ_SETS, &$3, &@$, NULL); + } | SET set_spec { $$ = cmd_alloc(CMD_LIST, CMD_OBJ_SET, &$2, &@$, NULL);
Signature · 1 line
2.10.2
Quoted 10 lines · Florian Westphal
currently nft can lists sets:
nft list setsbut unlike e.g. 'quotas' or 'counters' we didn't support restricting it to a table. Now its possible to restrict set definition listing to one table:
nft list sets table inet filter
Signed-off-by Florian Westphal <[email protected]>