aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bt-utp.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-bt-utp.c')
-rw-r--r--epan/dissectors/packet-bt-utp.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/epan/dissectors/packet-bt-utp.c b/epan/dissectors/packet-bt-utp.c
index adf19effdb..b1ff2b1403 100644
--- a/epan/dissectors/packet-bt-utp.c
+++ b/epan/dissectors/packet-bt-utp.c
@@ -466,13 +466,9 @@ proto_register_bt_utp(void)
module_t *bt_utp_module;
/* Register protocol */
- proto_bt_utp = proto_register_protocol (
- "uTorrent Transport Protocol", /* name */
- "BT-uTP", /* short name */
- "bt-utp" /* abbrev */
- );
+ proto_bt_utp = proto_register_protocol ("uTorrent Transport Protocol", "BT-uTP", "bt-utp");
- bt_utp_module = prefs_register_protocol(proto_bt_utp, proto_reg_handoff_bt_utp);
+ bt_utp_module = prefs_register_protocol(proto_bt_utp, NULL);
prefs_register_obsolete_preference(bt_utp_module, "enable");
proto_register_field_array(proto_bt_utp, hf, array_length(hf));
@@ -482,17 +478,11 @@ proto_register_bt_utp(void)
void
proto_reg_handoff_bt_utp(void)
{
- static gboolean prefs_initialized = FALSE;
+ /* disabled by default since heuristic is weak */
+ heur_dissector_add("udp", dissect_bt_utp, "BitTorrent UTP over UDP", "bt_utp_udp", proto_bt_utp, HEURISTIC_DISABLE);
- if (!prefs_initialized) {
- /* disabled by default since heuristic is weak */
- heur_dissector_add("udp", dissect_bt_utp, "BitTorrent UTP over UDP", "bt_utp_udp", proto_bt_utp, HEURISTIC_DISABLE);
-
- bt_utp_handle = create_dissector_handle(dissect_bt_utp, proto_bt_utp);
- dissector_add_for_decode_as("udp.port", bt_utp_handle);
-
- prefs_initialized = TRUE;
- }
+ bt_utp_handle = create_dissector_handle(dissect_bt_utp, proto_bt_utp);
+ dissector_add_for_decode_as_with_preference("udp.port", bt_utp_handle);
}
/*