summaryrefslogtreecommitdiffstats
path: root/src/parser_bison.y
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2016-07-27 12:57:57 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2016-08-23 17:15:52 +0200
commitf6d06a649062464a609125aee1cb5b80693d100e (patch)
tree1fb4711e1a0c8051846b0ed4584483e510eea18d /src/parser_bison.y
parentcec8dde7af3ec0f2e16d6445b14f77a2c357221e (diff)
parser_bison: explicit indication on export ruleset
This patch modifies the grammar to explicitly indicate what you want to export, eg. # nft export ruleset json This leaves room to extend this later on to support other object types, such as integrating conntrack into nft. This also leaves the syntax in consistent state wrt. other existing objects. The existing syntax is still preserved. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r--src/parser_bison.y8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index dcabb464..a3d93bf3 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -879,7 +879,13 @@ rename_cmd : CHAIN chain_spec identifier
}
;
-export_cmd : export_format
+export_cmd : RULESET export_format
+ {
+ struct handle h = { .family = NFPROTO_UNSPEC };
+ struct export *export = export_alloc($2);
+ $$ = cmd_alloc(CMD_EXPORT, CMD_OBJ_EXPORT, &h, &@$, export);
+ }
+ | export_format
{
struct handle h = { .family = NFPROTO_UNSPEC };
struct export *export = export_alloc($1);