aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2019-09-01 23:40:00 -0400
committerAnders Broman <a.broman58@gmail.com>2019-09-02 06:54:08 +0000
commitc07e31c71de8fec91c69d451fccb0b10cd5c64a1 (patch)
tree558ed439be63119247c9130cb3c2ebb63b335cb9
parentf959f203a1d54f2f50d3ca495457b9a2e1f8965d (diff)
tshark: Add "ip" as alias for "ipv4" in -z hosts option.
Make it consistent with -z conv,ip and -z endpoints,ip Bug: 15660 Change-Id: I9a3d2e95fed47231c0bab20e6cf069987eed142f Reviewed-on: https://code.wireshark.org/review/34426 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--doc/tshark.pod5
-rw-r--r--ui/cli/tap-hosts.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/doc/tshark.pod b/doc/tshark.pod
index b56f16b00f..803272705b 100644
--- a/doc/tshark.pod
+++ b/doc/tshark.pod
@@ -1311,10 +1311,11 @@ on those calls that match that filter.
Example: B<-z "h225,srt,ip.addr==1.2.3.4"> will only collect stats for
ITU-T H.225 RAS packets exchanged by the host at IP address 1.2.3.4 .
-=item B<-z> hosts[,ipv4][,ipv6]
+=item B<-z> hosts[,ip][,ipv4][,ipv6]
Dump any collected IPv4 and/or IPv6 addresses in "hosts" format. Both IPv4
-and IPv6 addresses are dumped by default.
+and IPv6 addresses are dumped by default. "ip" argument will dump only ipv4
+addresses.
Addresses are collected from a number of sources, including standard "hosts"
files and captured traffic.
diff --git a/ui/cli/tap-hosts.c b/ui/cli/tap-hosts.c
index 584fe6c126..fcf134363a 100644
--- a/ui/cli/tap-hosts.c
+++ b/ui/cli/tap-hosts.c
@@ -102,12 +102,13 @@ hosts_init(const char *opt_arg, void *userdata _U_)
tokens = g_strsplit(opt_arg, ",", 0);
opt_count = 0;
while (tokens[opt_count]) {
- if (strcmp("ipv4", tokens[opt_count]) == 0) {
+ if ((strcmp("ipv4", tokens[opt_count]) == 0) ||
+ (strcmp("ip", tokens[opt_count]) == 0)) {
dump_v4 = TRUE;
} else if (strcmp("ipv6", tokens[opt_count]) == 0) {
dump_v6 = TRUE;
} else if (opt_count > 0) {
- cmdarg_err("invalid \"-z " TAP_NAME "[,ipv4|ipv6]\" argument");
+ cmdarg_err("invalid \"-z " TAP_NAME "[,ip|ipv4|ipv6]\" argument");
exit(1);
}
opt_count++;