diff options
author | Michael Mann <mmann78@netscape.net> | 2014-12-21 13:51:20 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-12-24 18:59:14 +0000 |
commit | e03ffe25833216694a0d1a543f180b2969ef339e (patch) | |
tree | bd73e09fe8e0922377ff5d1f9cdd4b70f6f95fc2 | |
parent | d3888ff69fffd3a0a0fe809a4608757b5c78da06 (diff) | |
download | wireshark-e03ffe25833216694a0d1a543f180b2969ef339e.tar.gz |
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>
-rw-r--r-- | epan/address_to_str.c | 11 | ||||
-rw-r--r-- | epan/dissectors/packet-fc.c | 11 | ||||
-rw-r--r-- | epan/dissectors/packet-fcct.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-fcdns.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-fddi.c | 5 | ||||
-rw-r--r-- | epan/to_str.h | 1 | ||||
-rwxr-xr-x | tools/checkAPIs.pl | 1 |
7 files changed, 12 insertions, 24 deletions
diff --git a/epan/address_to_str.c b/epan/address_to_str.c index 18e7cdc7f0..4ca6546077 100644 --- a/epan/address_to_str.c +++ b/epan/address_to_str.c @@ -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 */ diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c index 4fc32a8f5c..45efa6ab2b 100644 --- a/epan/dissectors/packet-fc.c +++ b/epan/dissectors/packet-fc.c @@ -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) { diff --git a/epan/dissectors/packet-fcct.c b/epan/dissectors/packet-fcct.c index 38e5c8fc88..2c46b1d714 100644 --- a/epan/dissectors/packet-fcct.c +++ b/epan/dissectors/packet-fcct.c @@ -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++, diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c index 4c9981931d..f23ccea98e 100644 --- a/epan/dissectors/packet-fcdns.c +++ b/epan/dissectors/packet-fcdns.c @@ -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, diff --git a/epan/dissectors/packet-fddi.c b/epan/dissectors/packet-fddi.c index bc79553515..3eb9288e94 100644 --- a/epan/dissectors/packet-fddi.c +++ b/epan/dissectors/packet-fddi.c @@ -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 }}, diff --git a/epan/to_str.h b/epan/to_str.h index badac01fda..a4582826c1 100644 --- a/epan/to_str.h +++ b/epan/to_str.h @@ -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); diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl index 150d45620e..3afcefb497 100755 --- a/tools/checkAPIs.pl +++ b/tools/checkAPIs.pl @@ -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', |