From e70354f53e9f6be4a4be31dbc46c5e23291d3587 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 8 May 2018 13:08:37 +0200 Subject: libnftables: Implement JSON output support Although technically there already is support for JSON output via 'nft export json' command, it is hardly useable since it exports all the gory details of nftables VM. Also, libnftables has no control over what is exported since the content comes directly from libnftnl. Instead, implement JSON format support for regular 'nft list' commands. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/rt.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/rt.c') diff --git a/src/rt.c b/src/rt.c index 2530b663..caa4947d 100644 --- a/src/rt.c +++ b/src/rt.c @@ -22,6 +22,7 @@ #include #include #include +#include static struct symbol_table *realm_tbl; void realm_table_rt_init(void) @@ -112,6 +113,7 @@ static const struct expr_ops rt_expr_ops = { .type = EXPR_RT, .name = "rt", .print = rt_expr_print, + .json = rt_expr_json, .cmp = rt_expr_cmp, .clone = rt_expr_clone, }; -- cgit v1.2.3