diff options
author | Michael Mann <mmann78@netscape.net> | 2016-06-21 20:06:01 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-06-22 04:57:43 +0000 |
commit | e7b78eb0a60a52e844a64452817649126213f771 (patch) | |
tree | 4cf3b86582a0cbd2632b79b6ce6932fd47a32ef5 /epan/conversation_table.c | |
parent | 3ed06ec32b64821b311f47c95862f3486f78aa53 (diff) |
Move AT_USB to inside USB dissector.
This required some hacking in the conversation table handling, but
still seemed worth it as USB address is not widely used.
Maybe a "is_stringlike" property for address types...
Change-Id: I628a15c17cb1f595bb292130867adbc5bea0f41a
Reviewed-on: https://code.wireshark.org/review/16068
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/conversation_table.c')
-rw-r--r-- | epan/conversation_table.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/epan/conversation_table.c b/epan/conversation_table.c index e92f986d10..db6e972aab 100644 --- a/epan/conversation_table.c +++ b/epan/conversation_table.c @@ -29,6 +29,7 @@ #include "packet_info.h" #include "conversation_table.h" #include "addr_resolv.h" +#include "address_types.h" #include "stat_tap_ui.h" @@ -396,24 +397,30 @@ ct_port_to_str(port_type ptype, guint32 port) return NULL; } +static int usb_address_type = -1; + char *get_conversation_filter(conv_item_t *conv_item, conv_direction_e direction) { char *sport, *dport, *src_addr, *dst_addr; char *str; + /* XXX - Hack until we find something better */ + if (usb_address_type == -1) + usb_address_type = address_type_get_by_name("AT_USB"); + sport = ct_port_to_str(conv_item->ptype, conv_item->src_port); dport = ct_port_to_str(conv_item->ptype, conv_item->dst_port); src_addr = address_to_str(NULL, &conv_item->src_address); dst_addr = address_to_str(NULL, &conv_item->dst_address); - if (conv_item->src_address.type == AT_STRINGZ || conv_item->src_address.type == AT_USB) { + if (conv_item->src_address.type == AT_STRINGZ || conv_item->src_address.type == usb_address_type) { char *new_addr; new_addr = wmem_strdup_printf(NULL, "\"%s\"", src_addr); wmem_free(NULL, src_addr); src_addr = new_addr; } - if (conv_item->dst_address.type == AT_STRINGZ || conv_item->dst_address.type == AT_USB) { + if (conv_item->dst_address.type == AT_STRINGZ || conv_item->dst_address.type == usb_address_type) { char *new_addr; new_addr = wmem_strdup_printf(NULL, "\"%s\"", dst_addr); @@ -555,9 +562,13 @@ char *get_hostlist_filter(hostlist_talker_t *host) char *sport, *src_addr; char *str; + /* XXX - Hack until we find something better */ + if (usb_address_type == -1) + usb_address_type = address_type_get_by_name("AT_USB"); + sport = ct_port_to_str(host->ptype, host->port); src_addr = address_to_str(NULL, &host->myaddress); - if (host->myaddress.type == AT_STRINGZ || host->myaddress.type == AT_USB) { + if (host->myaddress.type == AT_STRINGZ || host->myaddress.type == usb_address_type) { char *new_addr; new_addr = wmem_strdup_printf(NULL, "\"%s\"", src_addr); |