aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ecmp.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-10-05 16:33:54 -0400
committerMichael Mann <mmann78@netscape.net>2016-10-13 02:51:18 +0000
commit2eb7b05b8c9c6408268f0d1e81f0a18a02610f1c (patch)
treebd0a909e3d506ea2e61c446aa8a809b6f728af3b /epan/dissectors/packet-ecmp.c
parent4d8581d7e15fe4a80a53496b83a853271fc674b6 (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-ecmp.c')
-rw-r--r--epan/dissectors/packet-ecmp.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/epan/dissectors/packet-ecmp.c b/epan/dissectors/packet-ecmp.c
index 9352c81f47..adcdbfe158 100644
--- a/epan/dissectors/packet-ecmp.c
+++ b/epan/dissectors/packet-ecmp.c
@@ -51,9 +51,6 @@ static int proto_modbus = -1;
/* These are the handles of our subdissectors */
static dissector_handle_t modbus_handle = NULL;
-/*stores the port number for our protocol (ECMP)*/
-static const guint16 global_ecmp_port = 6160;
-
/*smallest size of a packet, number of bytes*/
static const gint ecmp_min_packet_size = 6;
@@ -3565,18 +3562,14 @@ void proto_register_ecmp (void)
/* Wireshark literally scans this file (packet-ecmp.c) to find this function */
void proto_reg_handoff_ecmp(void)
{
- static gboolean initialized = FALSE;
- static dissector_handle_t ecmp_tcp_handle, ecmp_udp_handle;
+ dissector_handle_t ecmp_tcp_handle, ecmp_udp_handle;
- if (!initialized) {
- ecmp_tcp_handle = create_dissector_handle(dissect_ecmp_tcp, proto_ecmp);
- ecmp_udp_handle = create_dissector_handle(dissect_ecmp_udp, proto_ecmp);
+ ecmp_tcp_handle = create_dissector_handle(dissect_ecmp_tcp, proto_ecmp);
+ ecmp_udp_handle = create_dissector_handle(dissect_ecmp_udp, proto_ecmp);
- /* Cyclic frames are over UDP and non-cyclic are over TCP */
- dissector_add_uint("udp.port", global_ecmp_port, ecmp_udp_handle);
- dissector_add_uint_with_preference("tcp.port", ECMP_TCP_PORT, ecmp_tcp_handle);
- initialized = TRUE;
- }
+ /* Cyclic frames are over UDP and non-cyclic are over TCP */
+ dissector_add_uint_with_preference("udp.port", ECMP_TCP_PORT, ecmp_udp_handle);
+ dissector_add_uint_with_preference("tcp.port", ECMP_TCP_PORT, ecmp_tcp_handle);
/* Modbus dissector hooks */
modbus_handle = find_dissector_add_dependency("modbus", proto_ecmp);