forked from osmocom/wireshark
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>
This commit is contained in:
parent
c1b672cf23
commit
13531d36fb
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue