From 2fa54d8a49352bda44d3e25d1d7ba3531faf3303 Mon Sep 17 00:00:00 2001 From: Shyam Saini Date: Tue, 5 Dec 2017 19:37:34 +0530 Subject: 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 and Arturo Borrero Acked-by: Arturo Borrero Gonzalez Signed-off-by: Shyam Saini Signed-off-by: Pablo Neira Ayuso --- include/netlink.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/netlink.h') diff --git a/include/netlink.h b/include/netlink.h index 4ec215da..0d71a6b9 100644 --- a/include/netlink.h +++ b/include/netlink.h @@ -227,4 +227,13 @@ bool netlink_batch_supported(struct mnl_socket *nf_sock, uint32_t *seqnum); int netlink_echo_callback(const struct nlmsghdr *nlh, void *data); +struct ruleset_parse { + struct netlink_ctx *nl_ctx; + struct cmd *cmd; +}; + +struct nftnl_parse_ctx; + +int netlink_markup_parse_cb(const struct nftnl_parse_ctx *ctx); + #endif /* NFTABLES_NETLINK_H */ -- cgit v1.2.3