From cb86c1691c6900881b43229c07779412ffc48154 Mon Sep 17 00:00:00 2001 From: Arturo Borrero Gonzalez Date: Thu, 23 Jan 2014 17:42:34 +0000 Subject: ruleset: add XML/JSON export This patch adds the following operation: :~# nft export The XML/JSON output is provided raw by libnftnl, thus without format. In case of XML, you can give format with the `xmllint' tool from libxml2-tools: :~# nft list ruleset xml | xmllint --format - In case of JSON, you can use `json_pp' from perl standar package: :~# nft list ruleset json | json_pp A format field is added in struct cmd, and it will be reused in the import operation. Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Patrick McHardy --- include/netlink.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/netlink.h') diff --git a/include/netlink.h b/include/netlink.h index 3f8d465c..84b24877 100644 --- a/include/netlink.h +++ b/include/netlink.h @@ -136,4 +136,7 @@ extern int netlink_batch_send(struct list_head *err_list); extern int netlink_io_error(struct netlink_ctx *ctx, const struct location *loc, const char *fmt, ...); +extern struct nft_ruleset *netlink_dump_ruleset(struct netlink_ctx *ctx, + const struct handle *h, + const struct location *loc); #endif /* NFTABLES_NETLINK_H */ -- cgit v1.2.3