]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: Add import command for low level json
authorShyam Saini <mayhs11saini@gmail.com>
Tue, 5 Dec 2017 14:07:34 +0000 (19:37 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 17 Jan 2018 12:46:30 +0000 (13:46 +0100)
commit2fa54d8a49352bda44d3e25d1d7ba3531faf3303
tree55182570ad839f401ed4e4e3c39a28884652cd80
parent9afd72a883e391e366a1d75bb4e1705357e078e9
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>
include/netlink.h
include/rule.h
src/evaluate.c
src/netlink.c
src/parser_bison.y
src/rule.c
src/scanner.l