diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-29 14:04:07 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-29 18:19:13 +0100 |
commit | baa4e0e3fa5ff9ad6e3c97b0347ad23058c545d9 (patch) | |
tree | 3a9bbd3d76c459e1e0a3c6082fe584d5e24e6c1e /include | |
parent | 1a5153117784c267ceb81c048dd5e9b9c4309fbb (diff) |
src: add NFT_CTX_OUTPUT_NUMERIC_PROTO
We keep printing layer 4 protocols as literals since we do not use
/etc/protocols. This new flag allows us to print it as a number.
libnftables internally uses this to print layer 4 protocol as numbers
when part of a range.
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.h | 5 | ||||
-rw-r--r-- | include/nftables/libnftables.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/nftables.h b/include/nftables.h index 2dff07fe..d0031e84 100644 --- a/include/nftables.h +++ b/include/nftables.h @@ -63,6 +63,11 @@ static inline bool nft_output_guid(const struct output_ctx *octx) return octx->flags & NFT_CTX_OUTPUT_GUID; } +static inline bool nft_output_numeric_proto(const struct output_ctx *octx) +{ + return octx->flags & NFT_CTX_OUTPUT_NUMERIC_PROTO; +} + struct nft_cache { uint16_t genid; struct list_head list; diff --git a/include/nftables/libnftables.h b/include/nftables/libnftables.h index ff7b47aa..74f2dabb 100644 --- a/include/nftables/libnftables.h +++ b/include/nftables/libnftables.h @@ -52,6 +52,7 @@ enum { NFT_CTX_OUTPUT_JSON = (1 << 4), NFT_CTX_OUTPUT_ECHO = (1 << 5), NFT_CTX_OUTPUT_GUID = (1 << 6), + NFT_CTX_OUTPUT_NUMERIC_PROTO = (1 << 7), }; unsigned int nft_ctx_output_get_flags(struct nft_ctx *ctx); |