aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-fip.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-01-03 21:56:16 -0500
committerMichael Mann <mmann78@netscape.net>2015-01-04 16:32:03 +0000
commit553da374461efb87436dbbed7d319d252d4fe2e6 (patch)
tree1f581449dc0a022f8feb4f2088aec6fb47fd023f /epan/dissectors/packet-fip.c
parent2085bbec9d0e4661af77a6e9530cffd5df15ecc8 (diff)
Create BASE_DOT, BASE_DASH, and BASE_SEMICOLON types for the FT_BYTES field type.
These "bases" will put a ".", "-", or ":" respectively between hexidecimal bytes in the field in packet view and display filter. FT_BYTES with BASE_NONE will have no separator in the packet view, but continue to have the ':' as a separator in the display filter. Converted the "string" hf_ entries that used tvb_fc_to_str as a string to use proto_tree_add_item with FT_BYTES/BASE_DOT type. Converted applicable tvb_bytes_to_ep_str_punct() calls to use the new BASE values. Change-Id: I2442185bb314d04a3ff2ba57883652ecd738b5f9 Reviewed-on: https://code.wireshark.org/review/6098 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-fip.c')
-rw-r--r--epan/dissectors/packet-fip.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/epan/dissectors/packet-fip.c b/epan/dissectors/packet-fip.c
index d035da40f1..0e35b84b78 100644
--- a/epan/dissectors/packet-fip.c
+++ b/epan/dissectors/packet-fip.c
@@ -352,7 +352,6 @@ dissect_fip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint val;
tvbuff_t *desc_tvb;
const char *info;
- const char *text;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FIP");
col_clear(pinfo->cinfo, COL_INFO);
@@ -458,10 +457,9 @@ dissect_fip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
case FIP_DT_MAP_OUI:
subtree = fip_desc_type_len(fip_tree, desc_tvb, dtype, ett_fip_dt_map, &item);
- text = tvb_fc_to_str(desc_tvb, 5);
- proto_tree_add_string(subtree, hf_fip_desc_map, desc_tvb,
- 5, 3, text);
- proto_item_append_text(item, "%s", text);
+ proto_tree_add_item(subtree, hf_fip_desc_map, desc_tvb,
+ 5, 3, ENC_NA);
+ proto_item_append_text(item, "%s", tvb_fc_to_str(desc_tvb, 5));
break;
case FIP_DT_NAME:
subtree = fip_desc_type_len(fip_tree, desc_tvb, dtype, ett_fip_dt_name, &item);
@@ -472,9 +470,8 @@ dissect_fip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
subtree = fip_desc_type_len(fip_tree, desc_tvb, dtype, ett_fip_dt_fab, &item);
proto_tree_add_item(subtree, hf_fip_desc_fab_vfid, desc_tvb,
2, 2, ENC_BIG_ENDIAN);
- text = tvb_fc_to_str(desc_tvb, 5);
- proto_tree_add_string(subtree, hf_fip_desc_fab_map, desc_tvb,
- 5, 3, text);
+ proto_tree_add_item(subtree, hf_fip_desc_fab_map, desc_tvb,
+ 5, 3, ENC_NA);
proto_tree_add_item(subtree, hf_fip_desc_fab_name, desc_tvb, 8, 8, ENC_NA);
proto_item_append_text(item, "%s", tvb_fcwwn_to_str(desc_tvb, 8));
break;
@@ -658,7 +655,7 @@ proto_register_fip(void)
{ &hf_fip_desc_map,
{ "FC-MAP-OUI", "fip.map",
- FT_STRING, BASE_NONE, NULL, 0,
+ FT_BYTES, BASE_DOT, NULL, 0,
NULL, HFILL}},
{ &hf_fip_desc_name,
@@ -673,7 +670,7 @@ proto_register_fip(void)
{ &hf_fip_desc_fab_map,
{ "FC-MAP", "fip.fab.map",
- FT_STRING, BASE_NONE, NULL, 0,
+ FT_BYTES, BASE_DOT, NULL, 0,
NULL, HFILL}},
{ &hf_fip_desc_fab_name,