diff options
author | Michael Mann <mmann78@netscape.net> | 2015-01-03 21:56:16 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-01-04 16:32:03 +0000 |
commit | 553da374461efb87436dbbed7d319d252d4fe2e6 (patch) | |
tree | 1f581449dc0a022f8feb4f2088aec6fb47fd023f /epan/dissectors/packet-fcswils.c | |
parent | 2085bbec9d0e4661af77a6e9530cffd5df15ecc8 (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-fcswils.c')
-rw-r--r-- | epan/dissectors/packet-fcswils.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c index 482a0bbb65..bb0d39b2cd 100644 --- a/epan/dissectors/packet-fcswils.c +++ b/epan/dissectors/packet-fcswils.c @@ -1016,8 +1016,7 @@ dissect_swils_fspf_lsrechdr(tvbuff_t *tvb, proto_tree *tree, int offset) static void dissect_swils_fspf_ldrec(tvbuff_t *tvb, proto_tree *tree, int offset) { - proto_tree_add_string(tree, hf_swils_ldrec_linkid, tvb, offset, 4, - tvb_fc_to_str(tvb, offset+1)); + proto_tree_add_item(tree, hf_swils_ldrec_linkid, tvb, offset+1, 3, ENC_NA); proto_tree_add_item(tree, hf_swils_ldrec_out_pidx, tvb, offset+5, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_swils_ldrec_nbr_pidx, tvb, offset+9, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_swils_ldrec_link_type, tvb, offset+12, 1, ENC_BIG_ENDIAN); @@ -1138,8 +1137,8 @@ dissect_swils_rscn(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *rscn_tree, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rscn_tree, hf_swils_rscn_addrfmt, tvb, offset+4, 1, ENC_BIG_ENDIAN); - proto_tree_add_string(rscn_tree, hf_swils_rscn_affectedport, tvb, - offset+5, 3, tvb_fc_to_str(tvb, offset+5)); + proto_tree_add_item(rscn_tree, hf_swils_rscn_affectedport, tvb, + offset+5, 3, ENC_NA); proto_tree_add_item(rscn_tree, hf_swils_rscn_detectfn, tvb, offset+8, 4, ENC_BIG_ENDIAN); numrec = tvb_get_ntohl(tvb, offset+12); @@ -1157,8 +1156,7 @@ dissect_swils_rscn(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *rscn_tree, ett_fcswils_rscn_dev, NULL, "Device Entry %d", i); proto_tree_add_item(dev_tree, hf_swils_rscn_portstate, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_string(dev_tree, hf_swils_rscn_portid, tvb, offset+1, 3, - tvb_fc_to_str(tvb, offset+1)); + proto_tree_add_item(dev_tree, hf_swils_rscn_portid, tvb, offset+1, 3, ENC_NA); proto_tree_add_item(dev_tree, hf_swils_rscn_pwwn, tvb, offset+4, 8, ENC_NA); proto_tree_add_item(dev_tree, hf_swils_rscn_nwwn, tvb, offset+12, 8, ENC_NA); offset += 20; @@ -2090,7 +2088,7 @@ proto_register_fcswils(void) { &hf_swils_ldrec_linkid, {"Link ID", "swils.ldr.linkid", - FT_STRING, BASE_NONE, NULL, 0x0, + FT_BYTES, BASE_DOT, NULL, 0x0, NULL, HFILL}}, { &hf_swils_ldrec_out_pidx, @@ -2125,7 +2123,7 @@ proto_register_fcswils(void) { &hf_swils_rscn_affectedport, {"Affected Port ID", "swils.rscn.affectedport", - FT_STRING, BASE_NONE, NULL, 0x0, + FT_BYTES, BASE_DOT, NULL, 0x0, NULL, HFILL}}, { &hf_swils_rscn_detectfn, @@ -2140,7 +2138,7 @@ proto_register_fcswils(void) { &hf_swils_rscn_portid, {"Port Id", "swils.rscn.portid", - FT_STRING, BASE_NONE, NULL, 0x0, + FT_BYTES, BASE_DOT, NULL, 0x0, NULL, HFILL}}, { &hf_swils_rscn_pwwn, |