From 505794f75f2a342e8f8115eb0f04965979f2b634 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 29 Oct 2018 16:03:32 +0100 Subject: src: get rid of nft_ctx_output_{get,set}_numeric() This patch adds NFT_CTX_OUTPUT_NUMERIC_SYMBOL, which replaces the last client of the numeric level approach. This patch updates `-n' option semantics to display all output numerically. Note that monitor code was still using the -n option to skip printing the process name, this patch updates that path too to print it inconditionally to simplify things. Given the numeric levels have no more clients after this patch, remove that code. Update several tests/shell not to use -nn. This patch adds NFT_CTX_OUTPUT_NUMERIC_ALL which enables all flags to provide a fully numerical output. Acked-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- include/nftables.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/nftables.h') diff --git a/include/nftables.h b/include/nftables.h index a4d01e0c..5c029261 100644 --- a/include/nftables.h +++ b/include/nftables.h @@ -17,7 +17,6 @@ struct cookie { struct output_ctx { unsigned int flags; - unsigned int numeric; union { FILE *output_fp; struct cookie output_cookie; @@ -73,6 +72,11 @@ static inline bool nft_output_numeric_prio(const struct output_ctx *octx) return octx->flags & NFT_CTX_OUTPUT_NUMERIC_PRIO; } +static inline bool nft_output_numeric_symbol(const struct output_ctx *octx) +{ + return octx->flags & NFT_CTX_OUTPUT_NUMERIC_SYMBOL; +} + struct nft_cache { uint16_t genid; struct list_head list; -- cgit v1.2.3