summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/evaluate.c1
-rw-r--r--src/parser_bison.y5
-rw-r--r--src/rule.c8
-rw-r--r--src/scanner.l1
4 files changed, 14 insertions, 1 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index cb4d2a56..ea1a63dc 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -2701,6 +2701,7 @@ static int cmd_evaluate_list(struct eval_ctx *ctx, struct cmd *cmd)
case CMD_OBJ_SETS:
case CMD_OBJ_RULESET:
case CMD_OBJ_FLOWTABLES:
+ case CMD_OBJ_MAPS:
return 0;
default:
BUG("invalid command object type %u\n", cmd->obj);
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
diff --git a/src/rule.c b/src/rule.c
index 5613f966..38fd6645 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -1074,11 +1074,15 @@ static int do_list_sets(struct netlink_ctx *ctx, struct cmd *cmd)
list_for_each_entry(set, &table->sets, list) {
if (cmd->obj == CMD_OBJ_SETS &&
- set->flags & SET_F_ANONYMOUS)
+ (set->flags & SET_F_ANONYMOUS ||
+ set->flags & SET_F_MAP))
continue;
if (cmd->obj == CMD_OBJ_FLOWTABLES &&
!(set->flags & SET_F_EVAL))
continue;
+ if (cmd->obj == CMD_OBJ_MAPS &&
+ !(set->flags & SET_F_MAP))
+ continue;
set_print_declaration(set, &opts);
printf("%s}%s", opts.tab, opts.nl);
}
@@ -1216,6 +1220,8 @@ static int do_command_list(struct netlink_ctx *ctx, struct cmd *cmd)
return do_list_sets(ctx, cmd);
case CMD_OBJ_FLOWTABLE:
return do_list_set(ctx, cmd, table);
+ case CMD_OBJ_MAPS:
+ return do_list_sets(ctx, cmd);
default:
BUG("invalid command object type %u\n", cmd->obj);
}
diff --git a/src/scanner.l b/src/scanner.l
index b0221145..88669d0e 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -245,6 +245,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
"set" { return SET; }
"element" { return ELEMENT; }
"map" { return MAP; }
+"maps" { return MAPS; }
"handle" { return HANDLE; }
"ruleset" { return RULESET; }