summaryrefslogtreecommitdiff
path: root/plugins/wimaxasncp
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-02-14 18:01:53 -0500
committerMichael Mann <mmann78@netscape.net>2015-02-22 02:53:48 +0000
commit8d5da72ff9255a3fd494fb2d842a7ecb9d2c7c14 (patch)
tree3e48036d26dedf29361132faec1682c9aa6fb24a /plugins/wimaxasncp
parentddafa7e381c188f0f282908003518be44130a3b6 (diff)
downloadwireshark-8d5da72ff9255a3fd494fb2d842a7ecb9d2c7c14.tar.gz
Add tvb_address_with_resolution_to_str.
Convert dissectors to using the API where appropriate. Change-Id: I059582f73a75635d4a0338d02d4c4b212162480b Reviewed-on: https://code.wireshark.org/review/7296 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins/wimaxasncp')
-rw-r--r--plugins/wimaxasncp/packet-wimaxasncp.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/plugins/wimaxasncp/packet-wimaxasncp.c b/plugins/wimaxasncp/packet-wimaxasncp.c
index 15f9350dd4..513ae008a9 100644
--- a/plugins/wimaxasncp/packet-wimaxasncp.c
+++ b/plugins/wimaxasncp/packet-wimaxasncp.c
@@ -582,8 +582,7 @@ static void wimaxasncp_proto_tree_add_tlv_ipv4_value(
{
int hf_value;
guint32 ip;
- const gchar *hostname;
- const gchar *ip_str;
+ const gchar *addr_res;
if (tlv_info->hf_ipv4 != -1)
{
@@ -595,17 +594,15 @@ static void wimaxasncp_proto_tree_add_tlv_ipv4_value(
}
ip = tvb_get_ipv4(tvb, offset);
- hostname = get_hostname(ip);
- ip_str = tvb_ip_to_str(tvb, offset);
+ addr_res = tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_IPv4, offset);
proto_tree_add_ipv4_format(
tree, hf_value,
tvb, offset, 4, ip,
- "Value: %s (%s)", hostname, ip_str);
+ "Value: %s", addr_res);
proto_item_append_text(
- tlv_item, " - %s (%s)",
- hostname, ip_str);
+ tlv_item, " - %s", addr_res);
}
/* ========================================================================= */
@@ -619,8 +616,7 @@ static void wimaxasncp_proto_tree_add_tlv_ipv6_value(
{
int hf_value;
struct e_in6_addr ip;
- const gchar *hostname;
- const gchar *ip_str;
+ const gchar *addr_res;
if (tlv_info->hf_ipv4 != -1)
{
@@ -632,17 +628,15 @@ static void wimaxasncp_proto_tree_add_tlv_ipv6_value(
}
tvb_get_ipv6(tvb, offset, &ip);
- hostname = get_hostname6(&ip);
- ip_str = tvb_ip6_to_str(tvb, offset);
+ addr_res = tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_IPv6, offset);
proto_tree_add_ipv6_format(
tree, hf_value,
tvb, offset, 16, (guint8 *)&ip,
- "Value: %s (%s)", hostname, ip_str);
+ "Value: %s", addr_res);
proto_item_append_text(
- tlv_item, " - %s (%s)",
- hostname, ip_str);
+ tlv_item, " - %s", addr_res);
}
/* ========================================================================= */
@@ -658,7 +652,6 @@ static void wimaxasncp_proto_tree_add_ether_value(
int hf_value;
const guint8 *p;
const gchar *ether_name;
- const gchar *ether_str;
if (tlv_info->hf_bsid != -1)
{
@@ -670,18 +663,17 @@ static void wimaxasncp_proto_tree_add_ether_value(
}
p = tvb_get_ptr(tvb, offset, length);
- ether_name = get_ether_name(p);
- ether_str = tvb_ether_to_str(tvb, offset);
+ ether_name = tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, offset);
proto_tree_add_ether_format(
tree, hf_value,
tvb, offset, length, p,
- "Value: %s (%s)",
- ether_name, ether_str);
+ "Value: %s",
+ ether_name);
proto_item_append_text(
- tlv_item, " - %s (%s)",
- ether_name, ether_str);
+ tlv_item, " - %s",
+ ether_name);
}
/* ========================================================================= */