diff options
author | Shyam Saini <mayhs11saini@gmail.com> | 2017-12-05 19:37:34 +0530 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-01-17 13:46:30 +0100 |
commit | 2fa54d8a49352bda44d3e25d1d7ba3531faf3303 (patch) | |
tree | 55182570ad839f401ed4e4e3c39a28884652cd80 /src/scanner.l | |
parent | 9afd72a883e391e366a1d75bb4e1705357e078e9 (diff) |
src: Add import command for low level json
This new operation allows to import low level virtual machine ruleset in
json to make incremental changes using the parse functions of libnftnl.
A basic way to test this new functionality is:
$ cat file.json | nft import vm json
where the file.json is a ruleset exported in low level json format.
To export json rules in low level virtual machine format
we need to specify "vm" token before json. See below
$ nft export vm json
and
$ nft export/import json
will do no operations.
Same goes with "$nft monitor"
Highly based on work from Alvaro Neira <alvaroneay@gmail.com>
and Arturo Borrero <arturo@netfilter.org>
Acked-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/scanner.l')
-rw-r--r-- | src/scanner.l | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/scanner.l b/src/scanner.l index 6f19eec9..5402be1c 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -274,6 +274,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) "reset" { return RESET; } "flush" { return FLUSH; } "rename" { return RENAME; } +"import" { return IMPORT; } "export" { return EXPORT; } "monitor" { return MONITOR; } @@ -518,6 +519,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) "xml" { return XML; } "json" { return JSON; } +"vm" { return VM; } "exists" { return EXISTS; } "missing" { return MISSING; } |