From 69da3095ea38b42e068bab063b046a5016409d6a Mon Sep 17 00:00:00 2001 From: "Pablo M. Bermudo Garay" Date: Tue, 31 May 2016 12:37:06 +0200 Subject: src: add 'list maps' support This commit adds a new command that lists maps: # nft list maps [family] Only the declaration is displayed. If no family is specified, all maps of all families are listed. Example: # nft list maps table ip filter { map test { type ipv4_addr : inet_service } } table ip6 filter { map test { type ipv6_addr : inet_service } } Signed-off-by: Pablo M. Bermudo Garay Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index dfdf2377..59d7fd38 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -178,6 +178,7 @@ static void location_update(struct location *loc, struct location *rhs, int n) %token SET "set" %token ELEMENT "element" %token MAP "map" +%token MAPS "maps" %token HANDLE "handle" %token RULESET "ruleset" @@ -844,6 +845,10 @@ list_cmd : TABLE table_spec { $$ = cmd_alloc(CMD_LIST, CMD_OBJ_FLOWTABLE, &$3, &@$, NULL); } + | MAPS ruleset_spec + { + $$ = cmd_alloc(CMD_LIST, CMD_OBJ_MAPS, &$2, &@$, NULL); + } ; flush_cmd : TABLE table_spec -- cgit v1.2.3