diff options
author | Michael Mann <mmann78@netscape.net> | 2014-08-01 10:08:57 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-08-03 16:30:10 +0000 |
commit | 5db1352526e71727091ff0e1c0e97821eec4e4cb (patch) | |
tree | 01f836967616b7ae8b2840c488b500c7ff13d55c /epan/dissectors/packet-cisco-wids.c | |
parent | 3fa5625ea074908d5617111a7edfcf6d95e6108a (diff) |
Eliminate proto_tree_add_text from some dissectors.
Change-Id: I398e9cf4f6882e76644aa758e12c39a39159e95f
Reviewed-on: https://code.wireshark.org/review/3319
Petri-Dish: Michael Mann <mmann78@netscape.net>
Petri-Dish: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-cisco-wids.c')
-rw-r--r-- | epan/dissectors/packet-cisco-wids.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/epan/dissectors/packet-cisco-wids.c b/epan/dissectors/packet-cisco-wids.c index 8fa76a9de2..4bc90f225d 100644 --- a/epan/dissectors/packet-cisco-wids.c +++ b/epan/dissectors/packet-cisco-wids.c @@ -66,6 +66,8 @@ static int hf_cwids_unknown3 = -1; static gint ett_cwids = -1; +static expert_field ie_ieee80211_subpacket = EI_INIT; + static dissector_handle_t ieee80211_handle; static void @@ -116,16 +118,7 @@ dissect_cwids(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * was unable to restore it). */ pinfo->private_data = pd_save; - -#if 0 - wlan_tvb = tvb_new_subset_length(tvb, offset, capturelen); - /* FIXME: Why does this throw an exception? */ - proto_tree_add_text(cwids_tree, wlan_tvb, offset, capturelen, - "[Malformed or short IEEE80211 subpacket]"); -#else - tvb_new_subset_length(tvb, offset, capturelen); -#endif - ; + expert_add_info(pinfo, ti, &ie_ieee80211_subpacket); } ENDTRY; offset += capturelen; @@ -172,11 +165,18 @@ proto_register_cwids(void) &ett_cwids, }; + static ei_register_info ei[] = { + { &ie_ieee80211_subpacket, { "cwids.ieee80211_malformed", PI_MALFORMED, PI_ERROR, "Malformed or short IEEE80211 subpacket", EXPFILL }}, + }; + module_t *cwids_module; + expert_module_t* expert_cwids; proto_cwids = proto_register_protocol("Cisco Wireless IDS Captures", "CWIDS", "cwids"); proto_register_field_array(proto_cwids, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + expert_cwids = expert_register_protocol(proto_cwids); + expert_register_field_array(expert_cwids, ei, array_length(ei)); cwids_module = prefs_register_protocol(proto_cwids, proto_reg_handoff_cwids); prefs_register_uint_preference(cwids_module, "udp.port", |