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-bt-dht.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-bt-dht.c')
-rw-r--r-- | epan/dissectors/packet-bt-dht.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/epan/dissectors/packet-bt-dht.c b/epan/dissectors/packet-bt-dht.c index c5da3e349c..19bf16eaa0 100644 --- a/epan/dissectors/packet-bt-dht.c +++ b/epan/dissectors/packet-bt-dht.c @@ -567,13 +567,9 @@ proto_register_bt_dht(void) module_t *bt_dht_module; - proto_bt_dht = proto_register_protocol ( - "BitTorrent DHT Protocol", /* name */ - "BT-DHT", /* short name */ - "bt-dht" /* abbrev */ - ); + proto_bt_dht = proto_register_protocol ("BitTorrent DHT Protocol", "BT-DHT", "bt-dht"); - bt_dht_module = prefs_register_protocol(proto_bt_dht, proto_reg_handoff_bt_dht); + bt_dht_module = prefs_register_protocol(proto_bt_dht, NULL); prefs_register_obsolete_preference(bt_dht_module, "enable"); proto_register_field_array(proto_bt_dht, hf, array_length(hf)); @@ -583,20 +579,14 @@ proto_register_bt_dht(void) void proto_reg_handoff_bt_dht(void) { - static gboolean prefs_initialized = FALSE; - /* "Decode As" is always available; * Heuristic dissection in disabled by default since the heuristic is quite weak. * XXX - Still too weak? */ - if (!prefs_initialized) { - heur_dissector_add("udp", dissect_bt_dht_heur, "BitTorrent DHT over UDP", "bittorrent_dht_udp", proto_bt_dht, HEURISTIC_DISABLE); - - bt_dht_handle = create_dissector_handle(dissect_bt_dht, proto_bt_dht); - dissector_add_for_decode_as("udp.port", bt_dht_handle); + heur_dissector_add("udp", dissect_bt_dht_heur, "BitTorrent DHT over UDP", "bittorrent_dht_udp", proto_bt_dht, HEURISTIC_DISABLE); - prefs_initialized = TRUE; - } + bt_dht_handle = create_dissector_handle(dissect_bt_dht, proto_bt_dht); + dissector_add_for_decode_as_with_preference("udp.port", bt_dht_handle); } /* |