diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-29 16:03:32 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-30 10:29:44 +0100 |
commit | 505794f75f2a342e8f8115eb0f04965979f2b634 (patch) | |
tree | cba6b69cdb44a5708664be33229b7b5d935325f4 /src/monitor.c | |
parent | 92abc51d3580dc719fdcbca8d36fdcf5a3751be5 (diff) |
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 <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/monitor.c')
-rw-r--r-- | src/monitor.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/monitor.c b/src/monitor.c index b2267e1f..0e735ed5 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -835,11 +835,9 @@ static int netlink_events_newgen_cb(const struct nlmsghdr *nlh, int type, } if (genid >= 0) { nft_mon_print(monh, "# new generation %d", genid); - if (pid >= 0) { - nft_mon_print(monh, " by process %d", pid); - if (!monh->ctx->nft->output.numeric) - nft_mon_print(monh, " (%s)", name); - } + if (pid >= 0) + nft_mon_print(monh, " by process %d (%s)", pid, name); + nft_mon_print(monh, "\n"); } |