summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2018-10-27 11:55:00 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-10-29 15:07:35 +0100
commit3c69cf7603534ef6df01ec079c6a4d3d3382f580 (patch)
tree95d7047945d3a41e87e238ae74f5a22c2af897a2 /include
parent0c6379953ab575b3b71dda4bcd94b940f0f68447 (diff)
src: add nft_ctx_output_{get,set}_handle() to nft_ctx_output_{get,set}_flags
Add NFT_CTX_OUTPUT_HANDLE flag and print handle that uniquely identify objects from new output flags interface. 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 cb36e066..e0e7a113 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 handle;
unsigned int echo;
unsigned int json;
union {
@@ -46,6 +45,11 @@ static inline bool nft_output_stateless(const struct output_ctx *octx)
return octx->flags & NFT_CTX_OUTPUT_STATELESS;
}
+static inline bool nft_output_handle(const struct output_ctx *octx)
+{
+ return octx->flags & NFT_CTX_OUTPUT_HANDLE;
+}
+
struct nft_cache {
uint16_t genid;
struct list_head list;
diff --git a/include/nftables/libnftables.h b/include/nftables/libnftables.h
index 4f1c1090..a6ce9383 100644
--- a/include/nftables/libnftables.h
+++ b/include/nftables/libnftables.h
@@ -48,6 +48,7 @@ enum {
NFT_CTX_OUTPUT_REVERSEDNS = (1 << 0),
NFT_CTX_OUTPUT_SERVICE = (1 << 1),
NFT_CTX_OUTPUT_STATELESS = (1 << 2),
+ NFT_CTX_OUTPUT_HANDLE = (1 << 3),
};
unsigned int nft_ctx_output_get_flags(struct nft_ctx *ctx);
@@ -57,8 +58,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_handle(struct nft_ctx *ctx);
-void nft_ctx_output_set_handle(struct nft_ctx *ctx, bool val);
bool nft_ctx_output_get_echo(struct nft_ctx *ctx);
void nft_ctx_output_set_echo(struct nft_ctx *ctx, bool val);
bool nft_ctx_output_get_json(struct nft_ctx *ctx);