From 81c51fc1ab699fb6e417ada77221657ca34efd0b Mon Sep 17 00:00:00 2001 From: Eric Jallot Date: Wed, 30 Oct 2019 18:06:19 +0100 Subject: src: flowtable: add support for named flowtable listing This patch allows you to dump a named flowtable. # nft list flowtable inet t f table inet t { flowtable f { hook ingress priority filter + 10 devices = { eth0, eth1 } } } Also: libnftables-json.adoc: fix missing quotes. Fixes: db0697ce7f60 ("src: support for flowtable listing") Fixes: 872f373dc50f ("doc: Add JSON schema documentation") Signed-off-by: Eric Jallot Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index 7f9b1752..94494f6f 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -1315,6 +1315,10 @@ list_cmd : TABLE table_spec { $$ = cmd_alloc(CMD_LIST, CMD_OBJ_FLOWTABLES, &$2, &@$, NULL); } + | FLOWTABLE flowtable_spec + { + $$ = cmd_alloc(CMD_LIST, CMD_OBJ_FLOWTABLE, &$2, &@$, NULL); + } | MAPS ruleset_spec { $$ = cmd_alloc(CMD_LIST, CMD_OBJ_MAPS, &$2, &@$, NULL); @@ -2224,15 +2228,17 @@ set_identifier : identifier flowtable_spec : table_spec identifier { - $$ = $1; - $$.flowtable = $2; + $$ = $1; + $$.flowtable.name = $2; + $$.flowtable.location = @2; } ; flowtable_identifier : identifier { memset(&$$, 0, sizeof($$)); - $$.flowtable = $1; + $$.flowtable.name = $1; + $$.flowtable.location = @1; } ; -- cgit v1.2.3