diff options
author | Michael Mann <mmann78@netscape.net> | 2015-02-12 19:51:11 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-02-21 15:33:56 +0000 |
commit | 13531d36fb91f3abbd6e62add83faf863e62d974 (patch) | |
tree | 4f31d03273b57468e8f47d9a8f7f649ef3c42082 | |
parent | c1b672cf23dc2f3e55dc37e84099240932953806 (diff) |
Convert dissectors to use address_with_resolution_to_str instead of two separate calls for address string and name resolution.
Change-Id: I7c8cfbcf201b3b73afe731302572646ce7833d64
Reviewed-on: https://code.wireshark.org/review/7284
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r-- | epan/dissectors/packet-bat.c | 28 | ||||
-rw-r--r-- | epan/dissectors/packet-batadv.c | 96 | ||||
-rw-r--r-- | epan/dissectors/packet-eth.c | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-ieee80211.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-ip.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-ipv6.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-mim.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-wol.c | 12 |
8 files changed, 82 insertions, 86 deletions
diff --git a/epan/dissectors/packet-bat.c b/epan/dissectors/packet-bat.c index 562fbeb511..dbf7413b02 100644 --- a/epan/dissectors/packet-bat.c +++ b/epan/dissectors/packet-bat.c @@ -266,8 +266,8 @@ static int dissect_bat_batman_v5(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, offset, BATMAN_PACKET_V5_SIZE, - "B.A.T.M.A.N., Orig: %s (%s)", - get_hostname(orig), address_to_str(wmem_packet_scope(), &batman_packeth->orig)); + "B.A.T.M.A.N., Orig: %s", + address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); bat_batman_tree = proto_item_add_subtree(ti, ett_bat_batman); } @@ -471,16 +471,16 @@ static void dissect_bat_vis_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t col_set_str(pinfo->cinfo, COL_PROTOCOL, "BAT_VIS"); /* Set info column */ - col_add_fstr(pinfo->cinfo, COL_INFO, "Src: %s (%s)", - get_hostname(sender_ip), address_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); + col_add_fstr(pinfo->cinfo, COL_INFO, "Src: %s", + address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); /* Set tree info */ if (tree) { proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, 0, VIS_PACKET_V22_SIZE, - "B.A.T.M.A.N. Vis, Src: %s (%s)", - get_hostname(sender_ip), address_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); + "B.A.T.M.A.N. Vis, Src: %s", + address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); bat_vis_tree = proto_item_add_subtree(ti, ett_bat_vis); /* items */ @@ -548,9 +548,9 @@ static void dissect_vis_entry_v22(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t proto_tree *bat_vis_entry_tree; ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, 0, 7, - "VIS Entry: [%s] %s (%s)", + "VIS Entry: [%s] %s", val_to_str(vis_datah->type, vis_packettypenames, "Unknown (0x%02x)"), - get_hostname(ip), address_to_str(wmem_packet_scope(), &vis_datah->ip)); + address_with_resolution_to_str(wmem_packet_scope(), &vis_datah->ip)); bat_vis_entry_tree = proto_item_add_subtree(ti, ett_bat_vis_entry); proto_tree_add_item(bat_vis_entry_tree, hf_bat_vis_data_type, tvb, 0, 1, ENC_BIG_ENDIAN); @@ -592,16 +592,16 @@ static void dissect_bat_vis_v23(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t col_set_str(pinfo->cinfo, COL_PROTOCOL, "BAT_VIS"); /* Set info column */ - col_add_fstr(pinfo->cinfo, COL_INFO, "Src: %s (%s)", - get_hostname(sender_ip), address_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); + col_add_fstr(pinfo->cinfo, COL_INFO, "Src: %s", + address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); /* Set tree info */ if (tree) { proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, 0, VIS_PACKET_V23_SIZE, - "B.A.T.M.A.N. Vis, Src: %s (%s)", - get_hostname(sender_ip), address_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); + "B.A.T.M.A.N. Vis, Src: %s", + address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); bat_vis_tree = proto_item_add_subtree(ti, ett_bat_vis); /* items */ @@ -669,9 +669,9 @@ static void dissect_vis_entry_v23(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t proto_tree *bat_vis_entry_tree; ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, 0, 7, - "VIS Entry: [%s] %s (%s)", + "VIS Entry: [%s] %s", val_to_str(vis_datah->type, vis_packettypenames, "Unknown (0x%02x)"), - get_hostname(ip), address_to_str(wmem_packet_scope(), &vis_datah->ip)); + address_with_resolution_to_str(wmem_packet_scope(), &vis_datah->ip)); bat_vis_entry_tree = proto_item_add_subtree(ti, ett_bat_vis_entry); proto_tree_add_item(bat_vis_entry_tree, hf_bat_vis_data_type, tvb, 0, 1, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-batadv.c b/epan/dissectors/packet-batadv.c index c936ba6473..127282628b 100644 --- a/epan/dissectors/packet-batadv.c +++ b/epan/dissectors/packet-batadv.c @@ -1074,8 +1074,8 @@ static int dissect_batadv_batman_v5(tvbuff_t *tvb, int offset, packet_info *pinf proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, offset, BATMAN_PACKET_V5_SIZE, - "B.A.T.M.A.N., Orig: %s (%s)", - get_ether_name(orig_addr), address_to_str(wmem_packet_scope(), &batman_packeth->orig)); + "B.A.T.M.A.N., Orig: %s", + address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); batadv_batman_tree = proto_item_add_subtree(ti, ett_batadv_batman); } @@ -1172,8 +1172,8 @@ static int dissect_batadv_batman_v7(tvbuff_t *tvb, int offset, packet_info *pinf proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, offset, BATMAN_PACKET_V7_SIZE, - "B.A.T.M.A.N., Orig: %s (%s)", - get_ether_name(orig_addr), address_to_str(wmem_packet_scope(), &batman_packeth->orig)); + "B.A.T.M.A.N., Orig: %s", + address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); batadv_batman_tree = proto_item_add_subtree(ti, ett_batadv_batman); } @@ -1265,8 +1265,8 @@ static int dissect_batadv_batman_v9(tvbuff_t *tvb, int offset, packet_info *pinf proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, offset, BATMAN_PACKET_V9_SIZE, - "B.A.T.M.A.N., Orig: %s (%s)", - get_ether_name(orig_addr), address_to_str(wmem_packet_scope(), &batman_packeth->orig)); + "B.A.T.M.A.N., Orig: %s", + address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); batadv_batman_tree = proto_item_add_subtree(ti, ett_batadv_batman); } @@ -1365,8 +1365,8 @@ static int dissect_batadv_batman_v10(tvbuff_t *tvb, int offset, packet_info *pin proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, offset, BATMAN_PACKET_V10_SIZE, - "B.A.T.M.A.N., Orig: %s (%s)", - get_ether_name(orig_addr), address_to_str(wmem_packet_scope(), &batman_packeth->orig)); + "B.A.T.M.A.N., Orig: %s", + address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); batadv_batman_tree = proto_item_add_subtree(ti, ett_batadv_batman); } @@ -1463,8 +1463,8 @@ static int dissect_batadv_batman_v11(tvbuff_t *tvb, int offset, packet_info *pin proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, offset, BATMAN_PACKET_V11_SIZE, - "B.A.T.M.A.N., Orig: %s (%s)", - get_ether_name(orig_addr), address_to_str(wmem_packet_scope(), &batman_packeth->orig)); + "B.A.T.M.A.N., Orig: %s", + address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); batadv_batman_tree = proto_item_add_subtree(ti, ett_batadv_batman); } @@ -1559,8 +1559,8 @@ static int dissect_batadv_batman_v14(tvbuff_t *tvb, int offset, packet_info *pin proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, offset, BATMAN_PACKET_V14_SIZE, - "B.A.T.M.A.N., Orig: %s (%s)", - get_ether_name(orig_addr), address_to_str(wmem_packet_scope(), &batman_packeth->orig)); + "B.A.T.M.A.N., Orig: %s", + address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); batadv_batman_tree = proto_item_add_subtree(ti, ett_batadv_batman); } @@ -1837,8 +1837,8 @@ static void dissect_batadv_bcast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tre proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, BCAST_PACKET_V6_SIZE, - "B.A.T.M.A.N. Bcast, Orig: %s (%s)", - get_ether_name(orig_addr), address_to_str(wmem_packet_scope(), &bcast_packeth->orig)); + "B.A.T.M.A.N. Bcast, Orig: %s", + address_with_resolution_to_str(wmem_packet_scope(), &bcast_packeth->orig)); batadv_bcast_tree = proto_item_add_subtree(ti, ett_batadv_bcast); } @@ -1897,8 +1897,8 @@ static void dissect_batadv_bcast_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tr proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, BCAST_PACKET_V10_SIZE, - "B.A.T.M.A.N. Bcast, Orig: %s (%s)", - get_ether_name(orig_addr), address_to_str(wmem_packet_scope(), &bcast_packeth->orig)); + "B.A.T.M.A.N. Bcast, Orig: %s", + address_with_resolution_to_str(wmem_packet_scope(), &bcast_packeth->orig)); batadv_bcast_tree = proto_item_add_subtree(ti, ett_batadv_bcast); } @@ -1963,8 +1963,8 @@ static void dissect_batadv_bcast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tr proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, BCAST_PACKET_V14_SIZE, - "B.A.T.M.A.N. Bcast, Orig: %s (%s)", - get_ether_name(orig_addr), address_to_str(wmem_packet_scope(), &bcast_packeth->orig)); + "B.A.T.M.A.N. Bcast, Orig: %s", + address_with_resolution_to_str(wmem_packet_scope(), &bcast_packeth->orig)); batadv_bcast_tree = proto_item_add_subtree(ti, ett_batadv_bcast); } @@ -2078,9 +2078,9 @@ static void dissect_batadv_icmp_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, ICMP_PACKET_V6_SIZE, - "B.A.T.M.A.N. ICMP, Orig: %s (%s), Dst: %s (%s)", - get_ether_name(orig_addr), address_to_str(wmem_packet_scope(), &icmp_packeth->orig), - get_ether_name(dst_addr), address_to_str(wmem_packet_scope(), &icmp_packeth->dst)); + "B.A.T.M.A.N. ICMP, Orig: %s, Dst: %s", + address_with_resolution_to_str(wmem_packet_scope(), &icmp_packeth->orig), + address_with_resolution_to_str(wmem_packet_scope(), &icmp_packeth->dst)); batadv_icmp_tree = proto_item_add_subtree(ti, ett_batadv_icmp); } @@ -2208,9 +2208,9 @@ static void dissect_batadv_icmp_v7(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* Set tree info */ if (tree) { ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, ICMP_PACKET_V7_SIZE, - "B.A.T.M.A.N. ICMP, Orig: %s (%s), Dst: %s (%s)", - get_ether_name(orig_addr), address_to_str(wmem_packet_scope(), &icmp_packeth->orig), - get_ether_name(dst_addr), address_to_str(wmem_packet_scope(), &icmp_packeth->dst)); + "B.A.T.M.A.N. ICMP, Orig: %s, Dst: %s", + address_with_resolution_to_str(wmem_packet_scope(), &icmp_packeth->orig), + address_with_resolution_to_str(wmem_packet_scope(), &icmp_packeth->dst)); batadv_icmp_tree = proto_item_add_subtree(ti, ett_batadv_icmp); } @@ -2295,9 +2295,9 @@ static void dissect_batadv_icmp_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tre /* Set tree info */ if (tree) { ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, ICMP_PACKET_V14_SIZE, - "B.A.T.M.A.N. ICMP, Orig: %s (%s), Dst: %s (%s)", - get_ether_name(orig_addr), address_to_str(wmem_packet_scope(), &icmp_packeth->orig), - get_ether_name(dst_addr), address_to_str(wmem_packet_scope(), &icmp_packeth->dst)); + "B.A.T.M.A.N. ICMP, Orig: %s, Dst: %s", + address_with_resolution_to_str(wmem_packet_scope(), &icmp_packeth->orig), + address_with_resolution_to_str(wmem_packet_scope(), &icmp_packeth->dst)); batadv_icmp_tree = proto_item_add_subtree(ti, ett_batadv_icmp); } @@ -2512,8 +2512,8 @@ static void dissect_batadv_unicast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_t proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, UNICAST_PACKET_V6_SIZE, - "B.A.T.M.A.N. Unicast, Dst: %s (%s)", - get_ether_name(dest_addr), address_to_str(wmem_packet_scope(), &unicast_packeth->dest)); + "B.A.T.M.A.N. Unicast, Dst: %s", + address_with_resolution_to_str(wmem_packet_scope(), &unicast_packeth->dest)); batadv_unicast_tree = proto_item_add_subtree(ti, ett_batadv_unicast); } @@ -2574,8 +2574,8 @@ static void dissect_batadv_unicast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_ proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, UNICAST_PACKET_V14_SIZE, - "B.A.T.M.A.N. Unicast, Dst: %s (%s)", - get_ether_name(dest_addr), address_to_str(wmem_packet_scope(), &unicast_packeth->dest)); + "B.A.T.M.A.N. Unicast, Dst: %s", + address_with_resolution_to_str(wmem_packet_scope(), &unicast_packeth->dest)); batadv_unicast_tree = proto_item_add_subtree(ti, ett_batadv_unicast); } @@ -2670,8 +2670,8 @@ static void dissect_batadv_unicast_4addr_v14(tvbuff_t *tvb, packet_info *pinfo, proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, UNICAST_4ADDR_PACKET_V14_SIZE, - "B.A.T.M.A.N. Unicast 4Addr, Dst: %s (%s)", - get_ether_name(dest_addr), address_to_str(wmem_packet_scope(), &unicast_4addr_packeth->dest)); + "B.A.T.M.A.N. Unicast 4Addr, Dst: %s", + address_with_resolution_to_str(wmem_packet_scope(), &unicast_4addr_packeth->dest)); batadv_unicast_4addr_tree = proto_item_add_subtree(ti, ett_batadv_unicast_4addr); } @@ -2783,8 +2783,8 @@ static void dissect_batadv_unicast_frag_v12(tvbuff_t *tvb, packet_info *pinfo, p proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, UNICAST_FRAG_PACKET_V12_SIZE, - "B.A.T.M.A.N. Unicast Fragment, Dst: %s (%s)", - get_ether_name(dest_addr), address_to_str(wmem_packet_scope(), &unicast_frag_packeth->dest)); + "B.A.T.M.A.N. Unicast Fragment, Dst: %s", + address_with_resolution_to_str(wmem_packet_scope(), &unicast_frag_packeth->dest)); batadv_unicast_frag_tree = proto_item_add_subtree(ti, ett_batadv_unicast_frag); } @@ -2880,8 +2880,8 @@ static void dissect_batadv_unicast_frag_v14(tvbuff_t *tvb, packet_info *pinfo, p proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, UNICAST_FRAG_PACKET_V14_SIZE, - "B.A.T.M.A.N. Unicast Fragment, Dst: %s (%s)", - get_ether_name(dest_addr), address_to_str(wmem_packet_scope(), &unicast_frag_packeth->dest)); + "B.A.T.M.A.N. Unicast Fragment, Dst: %s", + address_with_resolution_to_str(wmem_packet_scope(), &unicast_frag_packeth->dest)); batadv_unicast_frag_tree = proto_item_add_subtree(ti, ett_batadv_unicast_frag); } @@ -3137,8 +3137,8 @@ static void dissect_batadv_vis_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, VIS_PACKET_V6_SIZE, - "B.A.T.M.A.N. Vis, Orig: %s (%s)", - get_ether_name(vis_orig_addr), address_to_str(wmem_packet_scope(), &vis_packeth->vis_orig)); + "B.A.T.M.A.N. Vis, Orig: %s", + address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->vis_orig)); batadv_vis_tree = proto_item_add_subtree(ti, ett_batadv_vis); } @@ -3261,8 +3261,8 @@ static void dissect_batadv_vis_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, VIS_PACKET_V10_SIZE, - "B.A.T.M.A.N. Vis, Orig: %s (%s)", - get_ether_name(vis_orig_addr), address_to_str(wmem_packet_scope(), &vis_packeth->vis_orig)); + "B.A.T.M.A.N. Vis, Orig: %s", + address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->vis_orig)); batadv_vis_tree = proto_item_add_subtree(ti, ett_batadv_vis); } @@ -3360,8 +3360,8 @@ static void dissect_batadv_vis_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, VIS_PACKET_V14_SIZE, - "B.A.T.M.A.N. Vis, Orig: %s (%s)", - get_ether_name(vis_orig_addr), address_to_str(wmem_packet_scope(), &vis_packeth->vis_orig)); + "B.A.T.M.A.N. Vis, Orig: %s", + address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->vis_orig)); batadv_vis_tree = proto_item_add_subtree(ti, ett_batadv_vis); } @@ -3518,8 +3518,8 @@ static void dissect_batadv_tt_query_v14(tvbuff_t *tvb, packet_info *pinfo _U_, p proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, TT_QUERY_PACKET_V14_SIZE, - "B.A.T.M.A.N. TT Query, Dst: %s (%s)", - get_ether_name(dst_addr), address_to_str(wmem_packet_scope(), &tt_query_packeth->dst)); + "B.A.T.M.A.N. TT Query, Dst: %s", + address_with_resolution_to_str(wmem_packet_scope(), &tt_query_packeth->dst)); batadv_tt_query_tree = proto_item_add_subtree(ti, ett_batadv_tt_query); } @@ -3646,15 +3646,15 @@ static void dissect_batadv_roam_adv_v14(tvbuff_t *tvb, packet_info *pinfo, proto TVB_SET_ADDRESS(&roam_adv_packeth->client, AT_ETHER, tvb, 16, 6); /* Set info column */ - col_add_fstr(pinfo->cinfo, COL_INFO, "Client %s (%s)", get_ether_name(client_addr), address_to_str(wmem_packet_scope(), &roam_adv_packeth->client)); + col_add_fstr(pinfo->cinfo, COL_INFO, "Client %s", address_with_resolution_to_str(wmem_packet_scope(), &roam_adv_packeth->client)); /* Set tree info */ if (tree) { proto_item *ti; ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, ROAM_ADV_PACKET_V14_SIZE, - "B.A.T.M.A.N. Roam: %s (%s)", - get_ether_name(client_addr), address_to_str(wmem_packet_scope(), &roam_adv_packeth->client)); + "B.A.T.M.A.N. Roam: %s", + address_with_resolution_to_str(wmem_packet_scope(), &roam_adv_packeth->client)); batadv_roam_adv_tree = proto_item_add_subtree(ti, ett_batadv_roam_adv); } diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c index fb98f9b4f4..13d44df877 100644 --- a/epan/dissectors/packet-eth.c +++ b/epan/dissectors/packet-eth.c @@ -378,9 +378,9 @@ dissect_eth_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, "Ethernet Unknown: Invalid length/type: 0x%04x (%d)", ehdr->type, ehdr->type); ti = proto_tree_add_protocol_format(tree, proto_eth, tvb, 0, ETH_HEADER_SIZE, - "Ethernet Unknown, Src: %s (%s), Dst: %s (%s)", - src_addr_name, address_to_str(wmem_packet_scope(), &pinfo->src), - dst_addr_name, address_to_str(wmem_packet_scope(), &pinfo->dst)); + "Ethernet Unknown, Src: %s, Dst: %s", + address_with_resolution_to_str(wmem_packet_scope(), &pinfo->src), + address_with_resolution_to_str(wmem_packet_scope(), &pinfo->dst)); fh_tree = proto_item_add_subtree(ti, ett_ether); addr_item = proto_tree_add_ether(fh_tree, hf_eth_dst, tvb, 0, 6, dst_addr); if (addr_item) @@ -489,9 +489,9 @@ dissect_eth_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, if (parent_tree) { if (PTREE_DATA(parent_tree)->visible) { ti = proto_tree_add_protocol_format(parent_tree, proto_eth, tvb, 0, ETH_HEADER_SIZE, - "Ethernet II, Src: %s (%s), Dst: %s (%s)", - src_addr_name, address_to_str(wmem_packet_scope(), &pinfo->src), - dst_addr_name, address_to_str(wmem_packet_scope(), &pinfo->dst)); + "Ethernet II, Src: %s, Dst: %s", + address_with_resolution_to_str(wmem_packet_scope(), &pinfo->src), + address_with_resolution_to_str(wmem_packet_scope(), &pinfo->dst)); } else { ti = proto_tree_add_item(parent_tree, proto_eth, tvb, 0, ETH_HEADER_SIZE, ENC_NA); diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index 46e46d01cd..6309c80a2e 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -16358,8 +16358,7 @@ set_src_addr_cols(packet_info *pinfo, const guint8 *addr, const char *type) SET_ADDRESS(ðer_addr, AT_ETHER, 6, addr); col_add_fstr(pinfo->cinfo, COL_RES_DL_SRC, "%s (%s)", - get_ether_name(addr), type); - col_add_str(pinfo->cinfo, COL_UNRES_DL_SRC, address_to_str(wmem_packet_scope(), ðer_addr)); + address_with_resolution_to_str(wmem_packet_scope(), ðer_addr), type); } static void @@ -16370,8 +16369,7 @@ set_dst_addr_cols(packet_info *pinfo, const guint8 *addr, const char *type) SET_ADDRESS(ðer_addr, AT_ETHER, 6, addr); col_add_fstr(pinfo->cinfo, COL_RES_DL_DST, "%s (%s)", - get_ether_name(addr), type); - col_add_str(pinfo->cinfo, COL_UNRES_DL_DST, address_to_str(wmem_packet_scope(), ðer_addr)); + address_with_resolution_to_str(wmem_packet_scope(), ðer_addr), type); } static guint32 diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 46f3d0cd44..ffef10eb05 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -2232,8 +2232,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) memcpy(&addr, iph->ip_src.data, 4); src_host = get_hostname(addr); if (ip_summary_in_tree) { - proto_item_append_text(ti, ", Src: %s (%s)", src_host, - address_to_str(wmem_packet_scope(), &iph->ip_src)); + proto_item_append_text(ti, ", Src: %s", address_with_resolution_to_str(wmem_packet_scope(), &iph->ip_src)); } proto_tree_add_ipv4(ip_tree, hf_ip_src, tvb, offset + 12, 4, addr); item = proto_tree_add_ipv4(ip_tree, hf_ip_addr, tvb, offset + 12, 4, addr); @@ -2296,8 +2295,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) memcpy(&addr, iph->ip_dst.data, 4); dst_host = get_hostname(addr); if (ip_summary_in_tree) { - proto_item_append_text(ti, ", Dst: %s (%s)", dst_host, - address_to_str(wmem_packet_scope(), &iph->ip_dst)); + proto_item_append_text(ti, ", Dst: %s", address_with_resolution_to_str(wmem_packet_scope(), &iph->ip_dst)); } if (dst_off) { diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c index 409e1a0680..ad3d82c156 100644 --- a/epan/dissectors/packet-ipv6.c +++ b/epan/dissectors/packet-ipv6.c @@ -1929,7 +1929,7 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) name = address_to_display(wmem_packet_scope(), &pinfo->src); if (ipv6_summary_in_tree) { SET_ADDRESS(&addr, AT_IPv6, 16, ipv6->ip6_src.bytes); - proto_item_append_text(ipv6_item, ", Src: %s (%s)", name, address_to_str(wmem_packet_scope(), &addr)); + proto_item_append_text(ipv6_item, ", Src: %s", address_with_resolution_to_str(wmem_packet_scope(), &addr)); } ti = proto_tree_add_string(ipv6_tree, hf_ipv6_src_host, tvb, offset + (int)offsetof(struct ip6_hdr, ip6_src), @@ -2017,7 +2017,7 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) name = address_to_display(wmem_packet_scope(), &pinfo->dst); if (ipv6_summary_in_tree) { SET_ADDRESS(&addr, AT_IPv6, 16, ipv6->ip6_dst.bytes); - proto_item_append_text(ipv6_item, ", Dst: %s (%s)", name, address_to_str(wmem_packet_scope(), &addr)); + proto_item_append_text(ipv6_item, ", Dst: %s", address_with_resolution_to_str(wmem_packet_scope(), &addr)); } ti = proto_tree_add_string(ipv6_tree, hf_ipv6_dst_host, tvb, offset + (int)offsetof(struct ip6_hdr, ip6_dst), diff --git a/epan/dissectors/packet-mim.c b/epan/dissectors/packet-mim.c index bce6bf42e3..a9a4c2c206 100644 --- a/epan/dissectors/packet-mim.c +++ b/epan/dissectors/packet-mim.c @@ -239,9 +239,9 @@ dissect_fp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ SET_ADDRESS(ðer_addr, AT_ETHER, 6, dst_addr); ti = proto_tree_add_protocol_format(tree, proto_fp, tvb, 0, FP_HEADER_SIZE, - "Cisco FabricPath, Src: %03x.%02x.%04x, Dst: %s (%s)", + "Cisco FabricPath, Src: %03x.%02x.%04x, Dst: %s", sswid, ssswid, slid, - get_ether_name(dst_addr), address_to_str(wmem_packet_scope(), ðer_addr)); + address_with_resolution_to_str(wmem_packet_scope(), ðer_addr)); } else { ti = proto_tree_add_protocol_format(tree, proto_fp, tvb, 0, FP_HEADER_SIZE, "Cisco FabricPath, Src: %03x.%02x.%04x, Dst: %03x.%02x.%04x", diff --git a/epan/dissectors/packet-wol.c b/epan/dissectors/packet-wol.c index a1ecb537bb..a0639e3120 100644 --- a/epan/dissectors/packet-wol.c +++ b/epan/dissectors/packet-wol.c @@ -168,8 +168,8 @@ dissect_wol_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data */ SET_ADDRESS(&mac_addr, AT_ETHER, 6, mac); - col_add_fstr(pinfo->cinfo, COL_INFO, "MagicPacket for %s (%s)", - get_ether_name(mac), address_to_str(wmem_packet_scope(), &mac_addr)); + col_add_fstr(pinfo->cinfo, COL_INFO, "MagicPacket for %s", + address_with_resolution_to_str(wmem_packet_scope(), &mac_addr)); /* NOTE: ether-wake uses a dotted-decimal format for specifying a * 4-byte password or an Ethernet mac address format for specifying @@ -228,8 +228,8 @@ dissect_wol_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_wol, tvb, 0, len, ENC_NA); - proto_item_append_text(ti, ", MAC: %s (%s)", get_ether_name(mac), - address_to_str(wmem_packet_scope(), &mac_addr)); + proto_item_append_text(ti, ", MAC: %s", + address_with_resolution_to_str(wmem_packet_scope(), &mac_addr)); if ( passwd ) proto_item_append_text(ti, ", password: %s", passwd); wol_tree = proto_item_add_subtree(ti, ett_wol); @@ -239,8 +239,8 @@ dissect_wol_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data /* Continue adding tree items to process the packet here */ mac_tree = proto_tree_add_subtree_format(wol_tree, tvb, 6, 96, - ett_wol_macblock, NULL, "MAC: %s (%s)", - get_ether_name(mac), address_to_str(wmem_packet_scope(), &mac_addr)); + ett_wol_macblock, NULL, "MAC: %s", + address_with_resolution_to_str(wmem_packet_scope(), &mac_addr)); for ( offset = 6; offset < 102; offset += 6 ) proto_tree_add_ether(mac_tree, hf_wol_mac, tvb, offset, 6, mac); |