summaryrefslogtreecommitdiffstats
path: root/include/statement.h
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-05-08 13:08:37 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-05-11 12:16:59 +0200
commite70354f53e9f6be4a4be31dbc46c5e23291d3587 (patch)
tree8d0bb763d9e80c5eb33e899666552e2bd414053b /include/statement.h
parente77b31f53a61a8995cd6baf91a6e557260f401bd (diff)
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 <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/statement.h')
-rw-r--r--include/statement.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/statement.h b/include/statement.h
index 2c6d0dfa..de26549b 100644
--- a/include/statement.h
+++ b/include/statement.h
@@ -3,6 +3,7 @@
#include <list.h>
#include <expression.h>
+#include <json.h>
extern struct stmt *expr_stmt_alloc(const struct location *loc,
struct expr *expr);
@@ -289,6 +290,8 @@ struct stmt_ops {
void (*destroy)(struct stmt *stmt);
void (*print)(const struct stmt *stmt,
struct output_ctx *octx);
+ json_t *(*json)(const struct stmt *stmt,
+ struct output_ctx *octx);
};
enum stmt_flags {