diff options
author | Michael Mann <mmann78@netscape.net> | 2016-10-05 16:33:54 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-10-13 02:51:18 +0000 |
commit | 2eb7b05b8c9c6408268f0d1e81f0a18a02610f1c (patch) | |
tree | bd0a909e3d506ea2e61c446aa8a809b6f728af3b /epan/dissectors/packet-cattp.c | |
parent | 4d8581d7e15fe4a80a53496b83a853271fc674b6 (diff) |
Convert most UDP dissectors to use "auto" preferences.
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67,
convert dissectors that use "udp.port".
More cleanup done on dissectors that use both TCP and UDP dissector
tables, so that less preference callbacks exist.
Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3
Reviewed-on: https://code.wireshark.org/review/18120
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-cattp.c')
-rw-r--r-- | epan/dissectors/packet-cattp.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/epan/dissectors/packet-cattp.c b/epan/dissectors/packet-cattp.c index 9237e5a4f5..9e293f4002 100644 --- a/epan/dissectors/packet-cattp.c +++ b/epan/dissectors/packet-cattp.c @@ -560,7 +560,7 @@ proto_register_cattp(void) expert_cattp = expert_register_protocol(proto_cattp); expert_register_field_array(expert_cattp, ei, array_length(ei)); - cattp_module = prefs_register_protocol(proto_cattp, proto_reg_handoff_cattp); + cattp_module = prefs_register_protocol(proto_cattp, NULL); prefs_register_bool_preference(cattp_module, "checksum", "Validate checksum of all messages", "Whether the checksum of all messages should be validated or not", @@ -573,18 +573,13 @@ proto_register_cattp(void) void proto_reg_handoff_cattp(void) { - static gboolean initialized = FALSE; + dissector_handle_t cattp_handle; - if (!initialized) { - dissector_handle_t cattp_handle; + /* Create dissector handle */ + cattp_handle = create_dissector_handle(dissect_cattp, proto_cattp); - /* Create dissector handle */ - cattp_handle = create_dissector_handle(dissect_cattp, proto_cattp); - - heur_dissector_add("udp", dissect_cattp_heur, "CAT-TP over UDP", "cattp_udp", proto_cattp, HEURISTIC_ENABLE); - dissector_add_for_decode_as("udp.port", cattp_handle); - initialized = TRUE; - } + heur_dissector_add("udp", dissect_cattp_heur, "CAT-TP over UDP", "cattp_udp", proto_cattp, HEURISTIC_ENABLE); + dissector_add_for_decode_as_with_preference("udp.port", cattp_handle); } /* |