diff options
author | Michael Mann <mmann78@netscape.net> | 2015-02-12 12:03:49 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-02-19 13:09:41 +0000 |
commit | 8d16ac46d50445f4e0ce567acb8e265db08a7576 (patch) | |
tree | 54d7b9813f8b83cca7d9592b2f5ae313f720a940 /epan/addr_resolv.c | |
parent | 7208355fb99f18b5b82d028f6af170f3dbafc8c9 (diff) |
Add name resolution support to address type.
Add address_with_resolution_to_str API that returns address string + name resolution in the format %s (%s), first string is resolved name (if available) and second string is raw address string.
Convert AT_FCWWN to using proper name resolution format
First use of address_with_resolution_to_str with field types in proto.c
Change-Id: I2ae77c29a4ffc30bb919fbec00f06629830898c2
Reviewed-on: https://code.wireshark.org/review/7196
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/addr_resolv.c')
-rw-r--r-- | epan/addr_resolv.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c index ff4dc02cf3..f08e6fe964 100644 --- a/epan/addr_resolv.c +++ b/epan/addr_resolv.c @@ -2968,32 +2968,7 @@ address_to_display(wmem_allocator_t *allocator, const address *addr) const gchar * get_addr_name(const address *addr) { - guint32 ip4_addr; - struct e_in6_addr ip6_addr; - - /* - * Try to look up a name for this address. - * If it's not found, this might return a string corresponding to - * the address, or it might return NULL. - * - * Whatever string is returned has at least session scope. - */ - switch (addr->type) { - - case AT_ETHER: - return get_ether_name((const guint8 *)addr->data); - - case AT_IPv4: - memcpy(&ip4_addr, addr->data, sizeof ip4_addr); - return get_hostname(ip4_addr); - - case AT_IPv6: - memcpy(&ip6_addr.bytes, addr->data, sizeof ip6_addr.bytes); - return get_hostname6(&ip6_addr); - - default: - return NULL; - } + return solve_address_to_name(addr); } gchar * |