summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2018-10-29 12:11:09 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2018-10-29 15:07:35 +0100
commit48636e1fe6f6d3141de735f9faf4c359938b837c (patch)
tree261623cb4aa26de34f1432fd2b6964f9a57ae789 /include
parent7a6f12d75034fed940ce635e76a13123430f088e (diff)
src: add nft_ctx_output_{get,set}_echo() to nft_ctx_output_{get,set}_flags
Add NFT_CTX_OUTPUT_ECHO flag and echo the command that has been send to the kernel. Acked-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/nftables.h6
-rw-r--r--include/nftables/libnftables.h3
2 files changed, 6 insertions, 3 deletions
diff --git a/include/nftables.h b/include/nftables.h
index 86788a43..fa6665a1 100644
--- a/include/nftables.h
+++ b/include/nftables.h
@@ -18,7 +18,6 @@ struct cookie {
struct output_ctx {
unsigned int flags;
unsigned int numeric;
- unsigned int echo;
union {
FILE *output_fp;
struct cookie output_cookie;
@@ -54,6 +53,11 @@ static inline bool nft_output_json(const struct output_ctx *octx)
return octx->flags & NFT_CTX_OUTPUT_JSON;
}
+static inline bool nft_output_echo(const struct output_ctx *octx)
+{
+ return octx->flags & NFT_CTX_OUTPUT_ECHO;
+}
+
struct nft_cache {
uint16_t genid;
struct list_head list;
diff --git a/include/nftables/libnftables.h b/include/nftables/libnftables.h
index 35374072..47772408 100644
--- a/include/nftables/libnftables.h
+++ b/include/nftables/libnftables.h
@@ -50,6 +50,7 @@ enum {
NFT_CTX_OUTPUT_STATELESS = (1 << 2),
NFT_CTX_OUTPUT_HANDLE = (1 << 3),
NFT_CTX_OUTPUT_JSON = (1 << 4),
+ NFT_CTX_OUTPUT_ECHO = (1 << 5),
};
unsigned int nft_ctx_output_get_flags(struct nft_ctx *ctx);
@@ -59,8 +60,6 @@ enum nft_numeric_level nft_ctx_output_get_numeric(struct nft_ctx *ctx);
void nft_ctx_output_set_numeric(struct nft_ctx *ctx, enum nft_numeric_level level);
unsigned int nft_ctx_output_get_debug(struct nft_ctx *ctx);
void nft_ctx_output_set_debug(struct nft_ctx *ctx, unsigned int mask);
-bool nft_ctx_output_get_echo(struct nft_ctx *ctx);
-void nft_ctx_output_set_echo(struct nft_ctx *ctx, bool val);
FILE *nft_ctx_set_output(struct nft_ctx *ctx, FILE *fp);
int nft_ctx_buffer_output(struct nft_ctx *ctx);