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-fc.c | |
parent | 2085bbec9d0e4661af77a6e9530cffd5df15ecc8 (diff) | |
download | wireshark-553da374461efb87436dbbed7d319d252d4fe2e6.tar.gz |
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-fc.c')
-rw-r--r-- | epan/dissectors/packet-fc.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c index f4102dbb99..68b8440dd4 100644 --- a/epan/dissectors/packet-fc.c +++ b/epan/dissectors/packet-fc.c @@ -956,20 +956,16 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean /* 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, - address_to_str(wmem_packet_scope(), &addr)); - hidden_item = proto_tree_add_string (fc_tree, hf_fc_id, tvb, offset+1, 3, - address_to_str(wmem_packet_scope(), &addr)); + proto_tree_add_item(fc_tree, hf_fc_did, tvb, offset+1, 3, ENC_NA); + hidden_item = proto_tree_add_item (fc_tree, hf_fc_id, tvb, offset+1, 3, ENC_NA); 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, - address_to_str(wmem_packet_scope(), &addr)); - hidden_item = proto_tree_add_string (fc_tree, hf_fc_id, tvb, offset+5, 3, - address_to_str(wmem_packet_scope(), &addr)); + proto_tree_add_item(fc_tree, hf_fc_sid, tvb, offset+5, 3, ENC_NA); + hidden_item = proto_tree_add_item (fc_tree, hf_fc_id, tvb, offset+5, 3, ENC_NA); PROTO_ITEM_SET_HIDDEN(hidden_item); if (ftype == FC_FTYPE_LINKCTL) { @@ -1415,16 +1411,16 @@ proto_register_fc(void) {"Frame type", "fc.ftype", FT_UINT8, BASE_HEX, VALS(fc_ftype_vals), 0x0, "Derived Type", HFILL}}, { &hf_fc_did, - { "Dest Addr", "fc.d_id", FT_STRING, BASE_NONE, NULL, 0x0, + { "Dest Addr", "fc.d_id", FT_BYTES, BASE_DOT, NULL, 0x0, "Destination Address", HFILL}}, { &hf_fc_csctl, {"CS_CTL", "fc.cs_ctl", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, { &hf_fc_sid, - {"Src Addr", "fc.s_id", FT_STRING, BASE_NONE, NULL, 0x0, + {"Src Addr", "fc.s_id", FT_BYTES, BASE_DOT, NULL, 0x0, "Source Address", HFILL}}, { &hf_fc_id, - {"Addr", "fc.id", FT_STRING, BASE_NONE, NULL, 0x0, + {"Addr", "fc.id", FT_BYTES, BASE_DOT, NULL, 0x0, "Source or Destination Address", HFILL}}, { &hf_fc_type, {"Type", "fc.type", FT_UINT8, BASE_HEX, VALS (fc_fc4_val), 0x0, |