Wireshark-bugs: [Wireshark-bugs] [Bug 7267] New Dissector function for SPB link metric sub tlv(t

Date: Sat, 19 May 2012 04:05:30 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7267

Pascal Quantin <pascal.quantin@xxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pascal.quantin@xxxxxxxxx

--- Comment #3 from Pascal Quantin <pascal.quantin@xxxxxxxxx> 2012-05-19 04:05:29 PDT ---
Hi,

instead of using proto_tree_add_text function (like what is done almost
everywhere else in packet-isi-lsp.c), I would suggest you to replace it with
proto_tree_add_item. It would initiate the transition from an old style to new
style dissector and would allow to apply filters on the dissected parameters.

For example the lines:
link_metric = tvb_get_ntoh24(tvb, offset);
proto_tree_add_text( subtree, tvb, offset, 3, "SPB Link Metric: 0x%06x (%d)",
link_metric & 0x00ffffff, link_metric & 0x00ffffff);
Can be replaced by;
proto_tree_add_item(subtree, hf_isis_lsp_spb_link_metric, tvb, offset, 3,
ENC_BIG_ENDIAN);
with
{ &hf_isis_lsp_spb_link_metric,
  { "SPB Link Metric", "isis.lsp.spb.link_metric",
    FT_UINT24, BASE_HEX_DEC, NULL, 0, NULL, HFILL }
},

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.