Replace fc_to_str with address_to_str or tvb_fc_to_str.

Change-Id: I69bf25f5abb9d6ad325f922fab73b6f0cf8ca2ea
Reviewed-on: https://code.wireshark.org/review/6035
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Michael Mann 2014-12-21 13:51:20 -05:00 committed by Anders Broman
parent d3888ff69f
commit e03ffe2583
7 changed files with 12 additions and 24 deletions

View File

@ -401,19 +401,10 @@ ib_addr_to_str_buf( const address *addr, gchar *buf, int buf_len){
}
}
/* XXX FIXME
remove this one later when every call has been converted to ep_address_to_str()
*/
const gchar *
fc_to_str(const guint8 *ad)
{
return bytestring_to_ep_str (ad, 3, '.');
}
const gchar *
tvb_fc_to_str(tvbuff_t *tvb, const gint offset)
{
return bytestring_to_ep_str (tvb_get_ptr(tvb, offset, 3), 3, '.');
return bytestring_to_str(wmem_packet_scope(), tvb_get_ptr(tvb, offset, 3), 3, '.');
}
/* FC Network Header Network Address Authority Identifiers */

View File

@ -742,6 +742,7 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
guint32 frag_id, frag_size;
guint8 df_ctl, seq_id;
guint32 f_ctl;
address addr;
guint32 param, exchange_key;
guint16 real_seqcnt;
@ -954,19 +955,21 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
PROTO_ITEM_SET_HIDDEN(hidden_item);
/* XXX - use "fc_wka_vals[]" on this? */
SET_ADDRESS(&addr, AT_FC, 3, fchdr.d_id.data);
proto_tree_add_string (fc_tree, hf_fc_did, tvb, offset+1, 3,
fc_to_str ((const guint8 *)fchdr.d_id.data));
address_to_str(wmem_packet_scope(), &addr));
hidden_item = proto_tree_add_string (fc_tree, hf_fc_id, tvb, offset+1, 3,
fc_to_str ((const guint8 *)fchdr.d_id.data));
address_to_str(wmem_packet_scope(), &addr));
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_uint (fc_tree, hf_fc_csctl, tvb, offset+4, 1, fchdr.cs_ctl);
/* XXX - use "fc_wka_vals[]" on this? */
SET_ADDRESS(&addr, AT_FC, 3, fchdr.s_id.data);
proto_tree_add_string (fc_tree, hf_fc_sid, tvb, offset+5, 3,
fc_to_str ((const guint8 *)fchdr.s_id.data));
address_to_str(wmem_packet_scope(), &addr));
hidden_item = proto_tree_add_string (fc_tree, hf_fc_id, tvb, offset+5, 3,
fc_to_str ((const guint8 *)fchdr.s_id.data));
address_to_str(wmem_packet_scope(), &addr));
PROTO_ITEM_SET_HIDDEN(hidden_item);
if (ftype == FC_FTYPE_LINKCTL) {

View File

@ -142,6 +142,7 @@ dissect_fcct (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
offset = 0;
guint8 server;
fc_ct_preamble cthdr;
address addr;
/* Make entries in Protocol column and Info column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FC_CT");
@ -188,8 +189,9 @@ dissect_fcct (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
proto_tree_add_item (fcct_tree, hf_fcct_revision, tvb, offset++,
sizeof (guint8), ENC_BIG_ENDIAN);
SET_ADDRESS(&addr, AT_FC, 3, &in_id);
proto_tree_add_string (fcct_tree, hf_fcct_inid, tvb, offset, 3,
fc_to_str ((guint8 *)&in_id));
address_to_str(wmem_packet_scope(), &addr));
offset += 3; /* sizeof FC address */
proto_tree_add_item (fcct_tree, hf_fcct_gstype, tvb, offset++,

View File

@ -1345,8 +1345,7 @@ dissect_fcdns_swils_entries (tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree_add_item (tree, &hfi_fcdns_sw2_objfmt, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_string (tree, &hfi_fcdns_rply_ownerid, tvb, offset+1,
3, fc_to_str (tvb_get_string_enc(wmem_packet_scope(), tvb, offset+1,
3, ENC_ASCII)));
3, tvb_fc_to_str (tvb, offset+1));
proto_tree_add_item (tree, &hfi_fcdns_rply_ptype, tvb, offset+4,
1, ENC_BIG_ENDIAN);
proto_tree_add_string (tree, &hfi_fcdns_rply_portid, tvb, offset+5, 3,

View File

@ -464,11 +464,6 @@ proto_register_fddi(void)
{
static hf_register_info hf[] = {
/*
* XXX - we want this guy to have his own private formatting
* routine, using "fc_to_str()"; if "fc_to_str()" returns
* NULL, just show the hex value, else show the string.
*/
{ &hf_fddi_fc,
{ "Frame Control", "fddi.fc", FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }},

View File

@ -57,7 +57,6 @@ WS_DLL_PUBLIC const gchar* tvb_ether_to_str(tvbuff_t *tvb, const gint offset);
WS_DLL_PUBLIC const gchar* ip_to_str(const guint8 *);
WS_DLL_PUBLIC const gchar* tvb_ip_to_str(tvbuff_t *tvb, const gint offset);
void ip_to_str_buf(const guint8 *ad, gchar *buf, const int buf_len);
extern const gchar* fc_to_str(const guint8 *);
extern gchar* fcwwn_to_str (const guint8 *);
WS_DLL_PUBLIC const gchar* tvb_fc_to_str(tvbuff_t *tvb, const gint offset);
WS_DLL_PUBLIC gchar* tvb_fcwwn_to_str (tvbuff_t *tvb, const gint offset);

View File

@ -1468,7 +1468,6 @@ my @TvbPtrAPIs = (
# Use the tvb_* version of these:
'ip_to_str',
'ip6_to_str',
'fc_to_str',
'fcwwn_to_str',
# Use tvb_bytes_to_str[_punct] instead of:
'bytes_to_str',