diff options
author | Michael Mann <mmann78@netscape.net> | 2016-12-16 20:06:11 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-12-31 07:31:42 +0000 |
commit | f4b0abc7296bbb431e64e31f85b24c29196c2ae4 (patch) | |
tree | 68394f5fdfa1987900f0b079d0ecfd34003e8a5a /epan/dissectors/packet-catapult-dct2000.c | |
parent | 13964595ad09e5d1115f6c5cb604cded27f9f55d (diff) |
Dissectors don't need a journey of self discovery.
They already know who they are when they register themselves. Saving the
handle then to avoid finding it later.
Not sure if this will increase unnecessary register_dissector functions
(instead of using create_dissector_handle in proto_reg_handoff function)
when other dissectors copy/paste, but it should make startup time
a few microseconds better.
Change-Id: I3839be791b32b84887ac51a6a65fb5733e9f1f43
Reviewed-on: https://code.wireshark.org/review/19481
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-catapult-dct2000.c')
-rw-r--r-- | epan/dissectors/packet-catapult-dct2000.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c index 13605f8900..e3c47895ed 100644 --- a/epan/dissectors/packet-catapult-dct2000.c +++ b/epan/dissectors/packet-catapult-dct2000.c @@ -294,6 +294,7 @@ extern int proto_pdcp_lte; static dissector_handle_t mac_lte_handle; static dissector_handle_t rlc_lte_handle; static dissector_handle_t pdcp_lte_handle; +static dissector_handle_t catapult_dct2000_handle; static dissector_handle_t look_for_dissector(const char *protocol_name); static void parse_outhdr_string(const guchar *outhdr_string, gint outhdr_length); @@ -2865,8 +2866,6 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo /******************************************************************************/ void proto_reg_handoff_catapult_dct2000(void) { - dissector_handle_t catapult_dct2000_handle = find_dissector("dct2000"); - dissector_add_uint("wtap_encap", WTAP_ENCAP_CATAPULT_DCT2000, catapult_dct2000_handle); mac_lte_handle = find_dissector("mac-lte"); @@ -3315,7 +3314,7 @@ void proto_register_catapult_dct2000(void) expert_register_field_array(expert_catapult_dct2000, ei, array_length(ei)); /* Allow dissector to find be found by name. */ - register_dissector("dct2000", dissect_catapult_dct2000, proto_catapult_dct2000); + catapult_dct2000_handle = register_dissector("dct2000", dissect_catapult_dct2000, proto_catapult_dct2000); /* Preferences */ catapult_dct2000_module = prefs_register_protocol(proto_catapult_dct2000, NULL); |