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>
This commit is contained in:
Michael Mann 2019-09-01 23:40:00 -04:00 committed by Anders Broman
parent f959f203a1
commit c07e31c71d
2 changed files with 6 additions and 4 deletions

View File

@ -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.

View File

@ -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++;