diff options
author | Phil Oester <kernel@linuxace.com> | 2013-08-15 16:24:11 -0700 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-08-22 13:48:00 +0200 |
commit | 5f7bd74728981358e15b09a3ea9d9627b197f84c (patch) | |
tree | fae2b6170b7f258c64694930b27bcb5d38366b67 /src | |
parent | c03424bce3fab4885056995a83c0c3a68ef0d235 (diff) |
nftables: add additional --numeric level
Personally, I like seeing ports and IPs numerically, but prefer protocols
to be shown by name. As such, add a third --numeric level which will
show protocols by number, splitting them out from ports.
-n/--numeric When specified once, show network addresses numerically.
When specified twice, also show Internet services,
user IDs and group IDs numerically.
When specified thrice, also show protocols numerically.
Signed-off-by: Phil Oester <kernel@linuxace.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/datatype.c | 2 | ||||
-rw-r--r-- | src/main.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/datatype.c b/src/datatype.c index 932acc7d..3eec931b 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -502,7 +502,7 @@ static void inet_service_type_print(const struct expr *expr) sin.sin_port = mpz_get_be16(expr->value); err = getnameinfo((struct sockaddr *)&sin, sizeof(sin), NULL, 0, buf, sizeof(buf), - numeric_output < NUMERIC_ALL ? 0 : NI_NUMERICSERV); + numeric_output < NUMERIC_PORT ? 0 : NI_NUMERICSERV); if (err != 0) { getnameinfo((struct sockaddr *)&sin, sizeof(sin), NULL, 0, buf, sizeof(buf), NI_NUMERICSERV); @@ -104,8 +104,9 @@ static void show_help(const char *name) " -i/--interactive Read input from interactive CLI\n" "\n" " -n/--numeric When specified once, show network addresses numerically.\n" -" When specified twice, also show Internet protocols,\n" -" Internet services, user IDs and group IDs numerically.\n" +" When specified twice, also show Internet services,\n" +" user IDs and group IDs numerically.\n" +" When specified thrice, also show protocols numerically.\n" " -a/--handle Output rule handle.\n" " -I/--includepath <directory> Add <directory> to the paths searched for include files.\n" #ifdef DEBUG |