aboutsummaryrefslogtreecommitdiffstats
path: root/epan/addr_resolv.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-07-02 16:17:20 -0700
committerGuy Harris <guy@alum.mit.edu>2015-07-03 02:21:20 +0000
commitdf5a315048e9b318f7862901c1bd40fa2c08dad5 (patch)
tree5a098c4f335fcdf485aa3e9f150f44aff92f8166 /epan/addr_resolv.c
parented21afa9521a930c96c69ff11b13b54ca006767e (diff)
Fix address resolution for columns.
Have address_to_name() be a routine that takes an address and returns a string with a "sufficiently long" lifetime for use in columns, using the address type's addr_name_res_str routine for most address types, rather than having a too-small set of address types wired into it. It replaces both the internal solve_address_to_name() routine and get_addr_name(), and can, for example, handle the special WLAN address types rather than leaving them unresolved even with an ethers file. Change-Id: Id09bc412adf5d2752155650a14a77c5378af2e42 Reviewed-on: https://code.wireshark.org/review/9475 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/addr_resolv.c')
-rw-r--r--epan/addr_resolv.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c
index 7fcfbcc057..76b9c7e078 100644
--- a/epan/addr_resolv.c
+++ b/epan/addr_resolv.c
@@ -1037,34 +1037,6 @@ try_resolv:
} /* host_lookup6 */
-static const gchar *
-solve_address_to_name(const address *addr)
-{
- switch (addr->type) {
-
- case AT_ETHER:
- return get_ether_name((const guint8 *)addr->data);
-
- case AT_IPv4: {
- guint32 ip4_addr;
- memcpy(&ip4_addr, addr->data, sizeof ip4_addr);
- return get_hostname(ip4_addr);
- }
-
- case AT_IPv6: {
- struct e_in6_addr ip6_addr;
- memcpy(&ip6_addr.bytes, addr->data, sizeof ip6_addr.bytes);
- return get_hostname6(&ip6_addr);
- }
-
- case AT_STRINGZ:
- return (const gchar *)addr->data;
-
- default:
- return NULL;
- }
-}
-
/*
* Ethernet / manufacturer resolution
*
@@ -3006,32 +2978,6 @@ sctp_port_to_display(wmem_allocator_t *allocator, guint port)
} /* sctp_port_to_display */
-const gchar *
-address_to_display(wmem_allocator_t *allocator, const address *addr)
-{
- gchar *str = NULL;
- const gchar *result = solve_address_to_name(addr);
-
- if (result != NULL) {
- str = wmem_strdup(allocator, result);
- }
- else if (addr->type == AT_NONE) {
- str = wmem_strdup(allocator, "NONE");
- }
- else {
- str = (gchar *) wmem_alloc(allocator, MAX_ADDR_STR_LEN);
- address_to_str_buf(addr, str, MAX_ADDR_STR_LEN);
- }
-
- return str;
-}
-
-const gchar *
-get_addr_name(const address *addr)
-{
- return solve_address_to_name(addr);
-}
-
gchar *
get_ether_name(const guint8 *addr)
{