diff options
author | Phil Sutter <phil@nwl.cc> | 2018-05-08 13:08:37 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-05-11 12:16:59 +0200 |
commit | e70354f53e9f6be4a4be31dbc46c5e23291d3587 (patch) | |
tree | 8d0bb763d9e80c5eb33e899666552e2bd414053b /src/exthdr.c | |
parent | e77b31f53a61a8995cd6baf91a6e557260f401bd (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 'src/exthdr.c')
-rw-r--r-- | src/exthdr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/exthdr.c b/src/exthdr.c index 06a82070..cb0a58e8 100644 --- a/src/exthdr.c +++ b/src/exthdr.c @@ -70,6 +70,7 @@ const struct expr_ops exthdr_expr_ops = { .type = EXPR_EXTHDR, .name = "exthdr", .print = exthdr_expr_print, + .json = exthdr_expr_json, .cmp = exthdr_expr_cmp, .clone = exthdr_expr_clone, }; @@ -107,6 +108,7 @@ static const struct stmt_ops exthdr_stmt_ops = { .type = STMT_EXTHDR, .name = "exthdr", .print = exthdr_stmt_print, + .json = exthdr_stmt_json, }; struct stmt *exthdr_stmt_alloc(const struct location *loc, |