aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-enttec.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-enttec.c')
-rw-r--r--epan/dissectors/packet-enttec.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/epan/dissectors/packet-enttec.c b/epan/dissectors/packet-enttec.c
index 4b55e6b085..fcd9745682 100644
--- a/epan/dissectors/packet-enttec.c
+++ b/epan/dissectors/packet-enttec.c
@@ -36,7 +36,7 @@
/* Define UDP/TCP ports for ENTTEC */
-#define UDP_PORT_ENTTEC 0x0D05
+#define UDP_PORT_ENTTEC 0x0D05 /* Not IANA registered */
#define TCP_PORT_ENTTEC 0x0D05 /* Not IANA registered */
@@ -107,8 +107,6 @@ static int ett_enttec = -1;
* for enttec
*/
-static guint global_udp_port_enttec = UDP_PORT_ENTTEC;
-
static gint global_disp_chan_val_type = 0;
static gint global_disp_col_count = 16;
static gint global_disp_chan_nr_type = 0;
@@ -544,12 +542,7 @@ proto_register_enttec(void)
proto_register_field_array(proto_enttec,hf,array_length(hf));
proto_register_subtree_array(ett,array_length(ett));
- enttec_module = prefs_register_protocol(proto_enttec,
- proto_reg_handoff_enttec);
- prefs_register_uint_preference(enttec_module, "udp_port",
- "ENTTEC UDP Port",
- "The UDP port on which ENTTEC packets will be sent",
- 10,&global_udp_port_enttec);
+ enttec_module = prefs_register_protocol(proto_enttec, NULL);
prefs_register_enum_preference(enttec_module, "dmx_disp_chan_val_type",
"DMX Display channel value type",
@@ -573,22 +566,13 @@ proto_register_enttec(void)
/* The registration hand-off routing */
void
proto_reg_handoff_enttec(void) {
- static gboolean enttec_initialized = FALSE;
- static dissector_handle_t enttec_udp_handle, enttec_tcp_handle;
- static guint udp_port_enttec;
-
- if(!enttec_initialized) {
- enttec_udp_handle = create_dissector_handle(dissect_enttec_udp,proto_enttec);
- enttec_tcp_handle = create_dissector_handle(dissect_enttec_tcp,proto_enttec);
- dissector_add_uint_with_preference("tcp.port",TCP_PORT_ENTTEC,enttec_tcp_handle);
- enttec_initialized = TRUE;
- } else {
- dissector_delete_uint("udp.port",udp_port_enttec,enttec_udp_handle);
- }
+ dissector_handle_t enttec_udp_handle, enttec_tcp_handle;
- udp_port_enttec = global_udp_port_enttec;
+ enttec_udp_handle = create_dissector_handle(dissect_enttec_udp,proto_enttec);
+ enttec_tcp_handle = create_dissector_handle(dissect_enttec_tcp,proto_enttec);
- dissector_add_uint("udp.port",global_udp_port_enttec,enttec_udp_handle);
+ dissector_add_uint_with_preference("tcp.port",TCP_PORT_ENTTEC,enttec_tcp_handle);
+ dissector_add_uint_with_preference("udp.port",UDP_PORT_ENTTEC,enttec_udp_handle);
}
/*