diff options
author | Michael Mann <mmann78@netscape.net> | 2015-11-15 16:51:45 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-11-16 22:00:30 +0000 |
commit | 799d6fd057b0c20a7692a1181d811a8ff3a88d04 (patch) | |
tree | 31d6d1248aee7c3192ae6d854b43eeb2c0b996a0 /epan/dissectors/packet-ieee802a.c | |
parent | 92bb13a4d22a48c43aa5fa6910c68829edebfdd0 (diff) |
create_dissector_handle -> new_create_dissector_handle
Picking off "easy" dissectors that only have one or two exit points at most.
Change-Id: I96aa9cf53533cbb07105aa400d42922baf3016b3
Reviewed-on: https://code.wireshark.org/review/11860
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-ieee802a.c')
-rw-r--r-- | epan/dissectors/packet-ieee802a.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/epan/dissectors/packet-ieee802a.c b/epan/dissectors/packet-ieee802a.c index 465a5c55ab..1ee75ac476 100644 --- a/epan/dissectors/packet-ieee802a.c +++ b/epan/dissectors/packet-ieee802a.c @@ -76,8 +76,8 @@ ieee802a_add_oui(guint32 oui, const char *table_name, const char *table_ui_name, g_hash_table_insert(oui_info_table, GUINT_TO_POINTER(oui), new_info); } -static void -dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *ieee802a_tree; proto_item *ti; @@ -128,16 +128,15 @@ dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) hf = hf_ieee802a_pid; subdissector_table = NULL; } - if (tree) - proto_tree_add_uint(ieee802a_tree, hf, tvb, 3, 2, pid); + + proto_tree_add_uint(ieee802a_tree, hf, tvb, 3, 2, pid); next_tvb = tvb_new_subset_remaining(tvb, 5); - if (subdissector_table != NULL) { + if ((subdissector_table == NULL) || /* do lookup with the subdissector table */ - if (dissector_try_uint(subdissector_table, pid, next_tvb, - pinfo, tree)) - return; + (!dissector_try_uint(subdissector_table, pid, next_tvb, pinfo, tree))) { + call_dissector(data_handle, next_tvb, pinfo, tree); } - call_dissector(data_handle, next_tvb, pinfo, tree); + return tvb_captured_length(tvb); } void @@ -176,7 +175,7 @@ proto_reg_handoff_ieee802a(void) data_handle = find_dissector("data"); - ieee802a_handle = create_dissector_handle(dissect_ieee802a, + ieee802a_handle = new_create_dissector_handle(dissect_ieee802a, proto_ieee802a); dissector_add_uint("ethertype", ETHERTYPE_IEEE802_OUI_EXTENDED, ieee802a_handle); |