diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2006-04-21 22:40:33 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2006-04-21 22:40:33 +0000 |
commit | e291c857cd5fa987bf6a895c9e260398f2b94f44 (patch) | |
tree | fd8607bed65bb739b537659149f41d1a812f0887 /capture_opts.c | |
parent | 73e65216bcc31c5afb5fc795d3bdf97a9c49acf1 (diff) | |
download | wireshark-e291c857cd5fa987bf6a895c9e260398f2b94f44.tar.gz wireshark-e291c857cd5fa987bf6a895c9e260398f2b94f44.tar.bz2 wireshark-e291c857cd5fa987bf6a895c9e260398f2b94f44.zip |
prepare to list the IP addresses in the command line interfaces list output
svn path=/trunk/; revision=17950
Diffstat (limited to 'capture_opts.c')
-rw-r--r-- | capture_opts.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/capture_opts.c b/capture_opts.c index 3f0c27cb33..c8302dc05d 100644 --- a/capture_opts.c +++ b/capture_opts.c @@ -432,6 +432,11 @@ int capture_opts_list_interfaces() gchar err_str[CAPTURE_PCAP_ERRBUF_SIZE]; gchar *cant_get_if_list_errstr; int i; +#if 0 + GSList *ip_addr; + if_addr_t *if_addr; + guint8 ipv4[4]; +#endif if_list = get_interface_list(&err, err_str); @@ -457,6 +462,25 @@ int capture_opts_list_interfaces() printf("%d. %s", i++, if_info->name); if (if_info->description != NULL) printf(" (%s)", if_info->description); +#if 0 + for(ip_addr = g_slist_nth(if_info->ip_addr, 0); ip_addr != NULL; + ip_addr = g_slist_next(ip_addr)) { + if_addr = ip_addr->data; + switch(if_addr->type) { + case AT_IPv4: + memcpy(ipv4, (void *) &if_addr->ip_addr.ip4_addr, 4); + printf(" %u.%u.%u.%u", ipv4[0], ipv4[1], ipv4[2], ipv4[3]); + break; + case AT_IPv6: + /* XXX - display the IPv6 address without using stuff from epan */ + printf(" XXX-IPv6"); + break; + default: + printf(" unknown address type %u", if_addr->type); + } + } +#endif + printf("\n"); } free_interface_list(if_list); |