diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-29 12:49:00 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-29 15:07:35 +0100 |
commit | 1a5153117784c267ceb81c048dd5e9b9c4309fbb (patch) | |
tree | 23b5b83b5a8e76c4ed1463e8f93980564f2c3ebd /include | |
parent | 48636e1fe6f6d3141de735f9faf4c359938b837c (diff) |
src: default to numeric UID and GID listing
Like iptables-save, print UID and GID as numeric values by default.
Add a new option `-u' to print the UID and GID names as defined by
/etc/passwd and /etc/group.
Note that -n is ignored after this patch, since default are numeric
printing for UID and GID.
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 fa6665a1..2dff07fe 100644 --- a/include/nftables.h +++ b/include/nftables.h @@ -58,6 +58,11 @@ static inline bool nft_output_echo(const struct output_ctx *octx) return octx->flags & NFT_CTX_OUTPUT_ECHO; } +static inline bool nft_output_guid(const struct output_ctx *octx) +{ + return octx->flags & NFT_CTX_OUTPUT_GUID; +} + struct nft_cache { uint16_t genid; struct list_head list; diff --git a/include/nftables/libnftables.h b/include/nftables/libnftables.h index 47772408..ff7b47aa 100644 --- a/include/nftables/libnftables.h +++ b/include/nftables/libnftables.h @@ -51,6 +51,7 @@ enum { NFT_CTX_OUTPUT_HANDLE = (1 << 3), NFT_CTX_OUTPUT_JSON = (1 << 4), NFT_CTX_OUTPUT_ECHO = (1 << 5), + NFT_CTX_OUTPUT_GUID = (1 << 6), }; unsigned int nft_ctx_output_get_flags(struct nft_ctx *ctx); |