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-vuze-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-vuze-dht.c')
-rw-r--r-- | epan/dissectors/packet-vuze-dht.c | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/epan/dissectors/packet-vuze-dht.c b/epan/dissectors/packet-vuze-dht.c index 30d8cf4f94..334101532f 100644 --- a/epan/dissectors/packet-vuze-dht.c +++ b/epan/dissectors/packet-vuze-dht.c @@ -24,10 +24,9 @@ #include "config.h" #include <epan/packet.h> -#include <epan/prefs.h> #include <epan/to_str.h> -#define DEFAULT_UDP_PORT 11273 +#define DEFAULT_UDP_PORT 11273 /* Not IANA registered */ void proto_register_vuze_dht(void); @@ -307,9 +306,6 @@ static gint ett_vuze_dht_network_coordinate = -1; static dissector_handle_t vuze_dht_handle; -/* port use */ -static guint global_vuze_dht_udp_port = DEFAULT_UDP_PORT; - void proto_reg_handoff_vuze_dht(void); /* --- Address format -------------- @@ -1532,47 +1528,19 @@ proto_register_vuze_dht(void) &ett_vuze_dht_network_coordinate }; - module_t *vuze_dht_module; - /* Register protocol */ - proto_vuze_dht = proto_register_protocol ( - "Vuze DHT Protocol", /* name */ - "Vuze-DHT", /* short name */ - "vuze-dht" /* abbrev */ - ); + proto_vuze_dht = proto_register_protocol ( "Vuze DHT Protocol", "Vuze-DHT", "vuze-dht" ); proto_register_field_array(proto_vuze_dht, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); vuze_dht_handle = register_dissector("vuze-dht", dissect_vuze_dht, proto_vuze_dht); - - /* Register our configuration options */ - vuze_dht_module = prefs_register_protocol(proto_vuze_dht, proto_reg_handoff_vuze_dht); - - prefs_register_uint_preference(vuze_dht_module, "udp_port", - "Vuze DHT Protocol UDP port", - "Set the UDP port for Vuze DHT Protocol.", - 10, &global_vuze_dht_udp_port); } void proto_reg_handoff_vuze_dht(void) { - static gboolean vuze_dht_prefs_initialized = FALSE; - static guint vuze_dht_udp_port; - - if (!vuze_dht_prefs_initialized) - { - vuze_dht_prefs_initialized = TRUE; - } - else - { - dissector_delete_uint("udp.port", vuze_dht_udp_port, vuze_dht_handle); - } - - /* Set our port number for future use */ - vuze_dht_udp_port = global_vuze_dht_udp_port; - dissector_add_uint("udp.port", global_vuze_dht_udp_port, vuze_dht_handle); + dissector_add_uint("udp.port", DEFAULT_UDP_PORT, vuze_dht_handle); } /* * Editor modelines |