diff options
author | Michael Mann <mmann78@netscape.net> | 2016-12-24 21:00:36 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-12-25 15:04:21 +0000 |
commit | 96d15102f56900acdac587b6407eb4c6545721de (patch) | |
tree | cf25c2b4518ad5e326f3b5a8d3e0e9fec4e0f7a9 /epan/dissectors/packet-prp.c | |
parent | 4270b48b19439cfed0f480f9ce29a34003e45e97 (diff) |
Remove individual post-dissect enable preferences.
Use Analyze -> Enabled Protocol dialog interface. Added support
for backwards compatibility of preference.
Change-Id: I32b3fce9d18083d9324197e3fd7ddc7eb888d1fb
Reviewed-on: https://code.wireshark.org/review/19422
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-prp.c')
-rw-r--r-- | epan/dissectors/packet-prp.c | 48 |
1 files changed, 14 insertions, 34 deletions
diff --git a/epan/dissectors/packet-prp.c b/epan/dissectors/packet-prp.c index 5cf0f9c3d5..5856fd0fc5 100644 --- a/epan/dissectors/packet-prp.c +++ b/epan/dissectors/packet-prp.c @@ -60,17 +60,6 @@ static int hf_prp_redundancy_control_trailer_version = -1; static gint ett_prp_redundancy_control_trailer = -1; -/* Post dissectors (such as the trailer dissector for this protocol) - * get called for every single frame anyone loads into Wireshark. - * Since this protocol is not of general interest we disable this - * protocol by default. - * - * This is done separately from the disabled protocols list mainly so - * we can disable it by default. XXX Maybe there's a better way. - */ -static gboolean prp_enable_dissector = FALSE; - - /* Code to actually dissect the packets */ static int dissect_prp_redundancy_control_trailer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) @@ -250,38 +239,29 @@ void proto_register_prp(void) }; module_t *prp_module; + dissector_handle_t prp_handle; /* Register the protocol name and description */ - proto_prp = proto_register_protocol("Parallel Redundancy Protocol (IEC62439 Part 3)", - "PRP", "prp"); - prp_module = prefs_register_protocol(proto_prp, proto_reg_handoff_prp); + proto_prp = proto_register_protocol("Parallel Redundancy Protocol (IEC62439 Part 3)", "PRP", "prp"); + + /* Post dissectors (such as the trailer dissector for this protocol) + * get called for every single frame anyone loads into Wireshark. + * Since this protocol is not of general interest we disable this + * protocol by default. + */ + proto_disable_by_default(proto_prp); + + prp_module = prefs_register_protocol(proto_prp, NULL); - prefs_register_bool_preference(prp_module, "enable", "Enable dissector", - "Enable this dissector (default is false)", - &prp_enable_dissector); + prefs_register_obsolete_preference(prp_module, "enable"); /* Required function calls to register the header fields and subtree used */ proto_register_field_array(proto_prp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); -} - -void proto_reg_handoff_prp(void) -{ - static gboolean prefs_initialized = FALSE; - - if (!prefs_initialized) { - dissector_handle_t prp_redundancy_control_trailer_handle; - - prp_redundancy_control_trailer_handle = create_dissector_handle(dissect_prp_redundancy_control_trailer, proto_prp); - register_postdissector(prp_redundancy_control_trailer_handle); - - prefs_initialized = TRUE; - } + prp_handle = register_dissector("prp", dissect_prp_redundancy_control_trailer, proto_prp); - if (!prp_enable_dissector) - proto_disable_by_default(proto_prp); - proto_set_decoding(proto_prp, prp_enable_dissector); + register_postdissector(prp_handle); } /* |