From a42d2865bc7e96fe63276e22acd523d996aaf0a4 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 24 Oct 2018 17:37:47 +0200 Subject: src: Revert --literal, add -S/--service This is a partial revert of b0f6a45b25dd1 ("src: add --literal option") which was added during the development cycle before 0.9.1 is released. After looking at patch: https://patchwork.ozlabs.org/patch/969864/ that allows to print priority, uid, gid and protocols as numerics, I decided to revisit this to provide individual options to turn on literal printing. What I'm proposing is to provide a good default for everyone, and provide options to turn on literal/numeric printing. This patch adds nft_ctx_output_{set,get}_flags() and define two flags to enable reverse DNS lookups and to print ports as service names. This patch introduces -S/--services, to print service names as per /etc/services. Acked-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/libnftables.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libnftables.c') diff --git a/src/libnftables.c b/src/libnftables.c index 2f67bb34..06d7c177 100644 --- a/src/libnftables.c +++ b/src/libnftables.c @@ -333,14 +333,14 @@ void nft_ctx_output_set_stateless(struct nft_ctx *ctx, bool val) ctx->output.stateless = val; } -enum nft_literal_level nft_ctx_output_get_literal(struct nft_ctx *ctx) +unsigned int nft_ctx_output_get_flags(struct nft_ctx *ctx) { - return ctx->output.literal; + return ctx->output.flags; } -void nft_ctx_output_set_literal(struct nft_ctx *ctx, enum nft_literal_level val) +void nft_ctx_output_set_flags(struct nft_ctx *ctx, unsigned int flags) { - ctx->output.literal = val; + ctx->output.flags = flags; } unsigned int nft_ctx_output_get_debug(struct nft_ctx *ctx) -- cgit v1.2.3