diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-27 12:02:02 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-29 15:07:35 +0100 |
commit | 7a6f12d75034fed940ce635e76a13123430f088e (patch) | |
tree | f58e0e41f725ae50820889fcc55712b13da6ac55 /include/nftables.h | |
parent | 3c69cf7603534ef6df01ec079c6a4d3d3382f580 (diff) |
src: add nft_ctx_output_{get,set}_json() to nft_ctx_output_{get,set}_flags
Add NFT_CTX_OUTPUT_JSON flag and display output in json format.
Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/nftables.h')
-rw-r--r-- | include/nftables.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/nftables.h b/include/nftables.h index e0e7a113..86788a43 100644 --- a/include/nftables.h +++ b/include/nftables.h @@ -19,7 +19,6 @@ struct output_ctx { unsigned int flags; unsigned int numeric; unsigned int echo; - unsigned int json; union { FILE *output_fp; struct cookie output_cookie; @@ -50,6 +49,11 @@ static inline bool nft_output_handle(const struct output_ctx *octx) return octx->flags & NFT_CTX_OUTPUT_HANDLE; } +static inline bool nft_output_json(const struct output_ctx *octx) +{ + return octx->flags & NFT_CTX_OUTPUT_JSON; +} + struct nft_cache { uint16_t genid; struct list_head list; |