forked from osmocom/wireshark
Introduce, and start using, tvb_eth_to_str().
Export tvb_*_to_str() and put them in alphabetical order. svn path=/trunk/; revision=35602
This commit is contained in:
parent
03066d0820
commit
6e0fcb7ab5
|
@ -91,6 +91,12 @@ ether_to_str(const guint8 *ad)
|
|||
return bytestring_to_str(ad, 6, ':');
|
||||
}
|
||||
|
||||
gchar *
|
||||
tvb_ether_to_str(tvbuff_t *tvb, const gint offset)
|
||||
{
|
||||
return bytestring_to_str(tvb_get_ptr(tvb, offset, 6), 6, ':');
|
||||
}
|
||||
|
||||
/*
|
||||
This function is very fast and this function is called a lot.
|
||||
XXX update the ep_address_to_str stuff to use this function.
|
||||
|
|
|
@ -220,7 +220,7 @@ dissect_lan_destination(tvbuff_t *tvb, int offset, const char *type, proto_tree
|
|||
|
||||
case TAG_MAC_ADDRESS:
|
||||
proto_tree_add_text(dest_tree, tvb, offset, 6, "MAC address: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
break;
|
||||
|
||||
case TAG_ROUTE_DESCRIPTOR:
|
||||
|
|
|
@ -501,10 +501,10 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
tvb_get_guint8(tvb, offset+20));
|
||||
proto_tree_add_text(tlv_tree, tvb, offset+21, 6,
|
||||
"Cluster Commander MAC: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset+21, 6)));
|
||||
tvb_ether_to_str(tvb, offset+21));
|
||||
proto_tree_add_text(tlv_tree, tvb, offset+27, 6,
|
||||
"Switch's MAC: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset+27, 6)));
|
||||
tvb_ether_to_str(tvb, offset+27));
|
||||
proto_tree_add_text(tlv_tree, tvb, offset+33, 1,
|
||||
"UNKNOWN: 0x%02X",
|
||||
tvb_get_guint8(tvb, offset+33));
|
||||
|
|
|
@ -1266,7 +1266,7 @@ dissect_ipxsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
proto_tree_add_text(s_tree, tvb, cursor+50, 4, "Network: %s",
|
||||
ipxnet_to_string(tvb_get_ptr(tvb, cursor+50, 4)));
|
||||
proto_tree_add_text(s_tree, tvb, cursor+54, 6, "Node: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, cursor+54, 6)));
|
||||
tvb_ether_to_str(tvb, cursor+54));
|
||||
server_port = tvb_get_ntohs(tvb, cursor+60);
|
||||
proto_tree_add_text(s_tree, tvb, cursor+60, 2, "Socket: %s (0x%04x)",
|
||||
socket_text(server_port),
|
||||
|
|
|
@ -260,7 +260,7 @@ dissect_ismp_edp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *ismp
|
|||
|
||||
col_add_fstr(pinfo->cinfo, COL_INFO, "MIP %s, MMAC %s, ifIdx %d",
|
||||
tvb_ip_to_str(tvb, offset+2),
|
||||
ether_to_str(tvb_get_ptr(tvb, offset+6, 6)),
|
||||
tvb_ether_to_str(tvb, offset+6),
|
||||
tvb_get_ntohl(tvb, offset+12));
|
||||
|
||||
proto_tree_add_item(edp_tree, hf_ismp_edp_version, tvb, offset, 2, FALSE);
|
||||
|
|
|
@ -125,8 +125,8 @@ dissect_mactelnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
type = tvb_get_guint8(tvb, 1);
|
||||
|
||||
col_add_fstr(pinfo->cinfo, COL_INFO, "%s > %s Type: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, 2, 6)),
|
||||
ether_to_str(tvb_get_ptr(tvb, 8, 6)),
|
||||
tvb_ether_to_str(tvb, 2),
|
||||
tvb_ether_to_str(tvb, 8),
|
||||
val_to_str(type, packettypenames, "Unknown Type:0x%02x"));
|
||||
|
||||
if (tree) {
|
||||
|
|
|
@ -775,7 +775,7 @@ dissect_nbns_answer(tvbuff_t *tvb, int offset, int nbns_data_offset,
|
|||
}
|
||||
proto_tree_add_text(rr_tree, tvb, cur_offset, 6,
|
||||
"Unit ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, cur_offset, 6)));
|
||||
tvb_ether_to_str(tvb, cur_offset));
|
||||
cur_offset += 6;
|
||||
data_len -= 6;
|
||||
|
||||
|
|
|
@ -686,7 +686,7 @@ dissect_netb_datagram( tvbuff_t *tvb, int offset, proto_tree *tree)
|
|||
if (tvb_memeql(tvb, offset + NB_SENDER_NAME, zeroes, 10) == 0) {
|
||||
proto_tree_add_text( tree, tvb, offset + NB_SENDER_NAME + 10, 6,
|
||||
"Sender's MAC Address: %s",
|
||||
ether_to_str( tvb_get_ptr( tvb,offset + NB_SENDER_NAME + 10, 6)));
|
||||
tvb_ether_to_str(tvb, offset + NB_SENDER_NAME + 10));
|
||||
} else {
|
||||
netbios_add_name("Sender's Name", tvb, offset + NB_SENDER_NAME,
|
||||
tree);
|
||||
|
@ -705,7 +705,7 @@ dissect_netb_datagram_bcast( tvbuff_t *tvb, int offset, proto_tree *tree)
|
|||
if (tvb_memeql(tvb, offset + NB_SENDER_NAME, zeroes, 10) == 0) {
|
||||
proto_tree_add_text( tree, tvb, offset + NB_SENDER_NAME + 10, 6,
|
||||
"Sender's Node Address: %s",
|
||||
ether_to_str( tvb_get_ptr( tvb,offset + NB_SENDER_NAME + 10, 6)));
|
||||
tvb_ether_to_str(tvb, offset + NB_SENDER_NAME + 10));
|
||||
} else {
|
||||
netbios_add_name("Sender's Name", tvb, offset + NB_SENDER_NAME,
|
||||
tree);
|
||||
|
|
|
@ -307,7 +307,7 @@ dissect_neighbor_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
|
|||
if (tree) {
|
||||
proto_tree_add_text(tree, tvb, offset, 6,
|
||||
"Neighbor: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
offset += 6;
|
||||
length -= 6;
|
||||
|
@ -441,11 +441,11 @@ nlsp_dissect_nlsp_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
if (tree) {
|
||||
proto_tree_add_text(tree, tvb, offset, 6,
|
||||
"Sending Router System ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
if (check_col(pinfo->cinfo, COL_INFO)) {
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, ", System ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
offset += 6;
|
||||
|
||||
|
@ -481,7 +481,7 @@ nlsp_dissect_nlsp_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
if (tree) {
|
||||
proto_tree_add_text(tree, tvb, offset, 6,
|
||||
"Designated Router System ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
proto_tree_add_text(tree, tvb, offset+6, 1,
|
||||
"Designated Router Pseudonode ID: %u",
|
||||
tvb_get_guint8(tvb, offset+6));
|
||||
|
@ -547,7 +547,7 @@ dissect_lsp_mgt_info_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
|
|||
if (tree) {
|
||||
proto_tree_add_text(tree, tvb, offset, 6,
|
||||
"Node number: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
offset += 6;
|
||||
length -= 6;
|
||||
|
@ -696,7 +696,7 @@ dissect_lsp_link_info_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
|
|||
if (tree) {
|
||||
proto_tree_add_text(tree, tvb, offset, 6,
|
||||
"Router System ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
proto_tree_add_text(tree, tvb, offset+6, 1,
|
||||
"Router Pseudonode ID: %u",
|
||||
tvb_get_guint8(tvb, offset+6));
|
||||
|
@ -811,7 +811,7 @@ dissect_lsp_svcs_info_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
|
|||
if (tree) {
|
||||
proto_tree_add_text(tree, tvb, offset, 6,
|
||||
"Node number: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
offset += 6;
|
||||
length -= 6;
|
||||
|
@ -1013,12 +1013,12 @@ nlsp_dissect_nlsp_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
|
||||
if (check_col(pinfo->cinfo, COL_INFO)) {
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, ", LSP ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
if (tree) {
|
||||
proto_tree_add_text(tree, tvb, offset, 6,
|
||||
"LSP ID system ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
offset += 6;
|
||||
/* XXX - append the pseudonode ID */
|
||||
|
@ -1117,7 +1117,7 @@ dissect_csnp_lsp_entries(tvbuff_t *tvb, proto_tree *tree, int offset,
|
|||
|
||||
ti = proto_tree_add_text(tree, tvb, offset, 16,
|
||||
"LSP-ID: %s, Sequence: 0x%08x, Lifetime: %5us, Checksum: 0x%04x",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset+2, 6)), /* XXX - rest of system ID */
|
||||
tvb_ether_to_str(tvb, offset+2), /* XXX - rest of system ID */
|
||||
tvb_get_ntohl(tvb, offset+10),
|
||||
tvb_get_ntohs(tvb, offset),
|
||||
tvb_get_ntohs(tvb, offset+14));
|
||||
|
@ -1126,7 +1126,7 @@ dissect_csnp_lsp_entries(tvbuff_t *tvb, proto_tree *tree, int offset,
|
|||
|
||||
proto_tree_add_text(subtree, tvb, offset+2, 6,
|
||||
"LSP ID source ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset+2, 6)));
|
||||
tvb_ether_to_str(tvb, offset+2));
|
||||
proto_tree_add_text(subtree, tvb, offset+8, 1,
|
||||
"LSP ID pseudonode ID: %u",
|
||||
tvb_get_guint8(tvb, offset+8));
|
||||
|
@ -1166,7 +1166,7 @@ dissect_psnp_lsp_entries(tvbuff_t *tvb, proto_tree *tree, int offset,
|
|||
|
||||
ti = proto_tree_add_text(tree, tvb, offset, 16,
|
||||
"LSP-ID: %s, Sequence: 0x%08x, Lifetime: %5us, Checksum: 0x%04x",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset+2, 6)), /* XXX - rest of system ID */
|
||||
tvb_ether_to_str(tvb, offset+2), /* XXX - rest of system ID */
|
||||
tvb_get_ntohl(tvb, offset+10),
|
||||
tvb_get_ntohs(tvb, offset),
|
||||
tvb_get_ntohs(tvb, offset+14));
|
||||
|
@ -1175,7 +1175,7 @@ dissect_psnp_lsp_entries(tvbuff_t *tvb, proto_tree *tree, int offset,
|
|||
|
||||
proto_tree_add_text(subtree, tvb, offset+2, 6,
|
||||
"LSP ID source ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset+2, 6)));
|
||||
tvb_ether_to_str(tvb, offset+2));
|
||||
proto_tree_add_text(subtree, tvb, offset+8, 1,
|
||||
"LSP ID pseudonode ID: %u",
|
||||
tvb_get_guint8(tvb, offset+8));
|
||||
|
@ -1248,12 +1248,12 @@ nlsp_dissect_nlsp_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
|
||||
if (check_col(pinfo->cinfo, COL_INFO)) {
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
if (tree) {
|
||||
proto_tree_add_text(tree, tvb, offset, 6,
|
||||
"Source ID system ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
offset += 6;
|
||||
/* XXX - add the pseudonode ID */
|
||||
|
@ -1266,12 +1266,12 @@ nlsp_dissect_nlsp_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
|
||||
if (check_col(pinfo->cinfo, COL_INFO)) {
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, ", Start LSP ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
if (tree) {
|
||||
proto_tree_add_text(tree, tvb, offset, 6,
|
||||
"Start LSP ID source ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
offset += 6;
|
||||
/* XXX - append the pseudonode ID */
|
||||
|
@ -1290,12 +1290,12 @@ nlsp_dissect_nlsp_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
|
||||
if (check_col(pinfo->cinfo, COL_INFO)) {
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, ", End LSP ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
if (tree) {
|
||||
proto_tree_add_text(tree, tvb, offset, 6,
|
||||
"End LSP ID source ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
offset += 6;
|
||||
/* XXX - append the pseudonode ID */
|
||||
|
@ -1369,12 +1369,12 @@ nlsp_dissect_nlsp_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
|
||||
if (check_col(pinfo->cinfo, COL_INFO)) {
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
if (tree) {
|
||||
proto_tree_add_text(tree, tvb, offset, 6,
|
||||
"Source ID system ID: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
offset += 6;
|
||||
/* XXX - add the pseudonode ID */
|
||||
|
|
|
@ -2121,7 +2121,7 @@ dissect_lcp_multilink_ep_disc_opt(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
|||
length, plurality(length, "", "s"));
|
||||
} else {
|
||||
proto_tree_add_text(field_tree, tvb, offset, length,
|
||||
"Address: %s", ether_to_str(tvb_get_ptr(tvb, offset, 6)));
|
||||
"Address: %s", tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -724,7 +724,7 @@ void radius_ether(radius_attr_info_t* a, proto_tree* tree, packet_info *pinfo _U
|
|||
}
|
||||
|
||||
proto_tree_add_item(tree, a->hf, tvb, offset, len, FALSE);
|
||||
proto_item_append_text(avp_item, "%s", ether_to_str(tvb_get_ptr(tvb, offset, len)));
|
||||
proto_item_append_text(avp_item, "%s", tvb_ether_to_str(tvb, offset));
|
||||
}
|
||||
|
||||
void radius_ifid(radius_attr_info_t* a, proto_tree* tree, packet_info *pinfo _U_, tvbuff_t* tvb, int offset, int len, proto_item* avp_item) {
|
||||
|
|
|
@ -181,7 +181,7 @@ sv_text(tvbuff_t *tvb, int svoff, proto_tree *tree)
|
|||
case 0x0A: /* Address of last neighbor notification */
|
||||
proto_tree_add_text(tree, tvb, svoff+1, sv_length-1,
|
||||
"Address of Last Neighbor Notification: %s",
|
||||
ether_to_str(tvb_get_ptr(tvb, svoff+2, 6)));
|
||||
tvb_ether_to_str(tvb, svoff+2));
|
||||
break;
|
||||
|
||||
case 0x0B: /* Physical Location */
|
||||
|
|
|
@ -1478,7 +1478,7 @@ rtp_show_gateway_info(proto_tree *tree, tvbuff_t *tvb, int offset,
|
|||
proto_tree_add_text(tree, tvb, offset, link_addr_length,
|
||||
"Preferred Gateway Data Link Address: %s",
|
||||
link_addr_length == 6 ?
|
||||
ether_to_str(tvb_get_ptr(tvb, offset, link_addr_length)) :
|
||||
tvb_ether_to_str(tvb, offset) :
|
||||
tvb_bytes_to_str(tvb, offset, link_addr_length));
|
||||
offset += link_addr_length;
|
||||
}
|
||||
|
|
|
@ -614,10 +614,8 @@ InfoRequestNakReason_vals DATA
|
|||
init_dissection
|
||||
init_progfile_dir
|
||||
ip6_to_str
|
||||
tvb_ip6_to_str
|
||||
in_cksum
|
||||
ip_to_str
|
||||
tvb_ip_to_str
|
||||
ipprotostr
|
||||
ipv4_get_net_order_addr
|
||||
is_big_endian
|
||||
|
@ -1033,7 +1031,10 @@ tvb_bytes_to_str
|
|||
tvb_bytes_to_str_punct
|
||||
tvb_ensure_bytes_exist
|
||||
tvb_ensure_length_remaining
|
||||
tvb_eth_to_str
|
||||
tvb_fake_unicode
|
||||
tvb_fc_to_str
|
||||
tvb_fcwwm_to_str
|
||||
tvb_find_guint8
|
||||
tvb_find_line_end
|
||||
tvb_find_line_end_unquoted
|
||||
|
@ -1077,6 +1078,8 @@ tvb_get_ntohs
|
|||
tvb_get_ptr
|
||||
tvb_get_string
|
||||
tvb_get_stringz
|
||||
tvb_ip6_to_str
|
||||
tvb_ip_to_str
|
||||
tvb_length
|
||||
tvb_length_remaining
|
||||
tvb_memcpy
|
||||
|
|
|
@ -49,6 +49,7 @@ extern gchar* se_address_to_str(const address *);
|
|||
extern void address_to_str_buf(const address *addr, gchar *buf, int buf_len);
|
||||
extern gchar* bytestring_to_str(const guint8 *, const guint32, const char);
|
||||
extern gchar* ether_to_str(const guint8 *);
|
||||
extern gchar* tvb_ether_to_str(tvbuff_t *tvb, const gint offset);
|
||||
extern const gchar* ip_to_str(const guint8 *);
|
||||
extern const gchar* tvb_ip_to_str(tvbuff_t *tvb, const gint offset);
|
||||
extern void ip_to_str_buf(const guint8 *ad, gchar *buf, const int buf_len);
|
||||
|
|
Loading…
Reference in New Issue