diff options
Diffstat (limited to 'epan/dissectors/asn1/h501/packet-h501-template.c')
-rw-r--r-- | epan/dissectors/asn1/h501/packet-h501-template.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/epan/dissectors/asn1/h501/packet-h501-template.c b/epan/dissectors/asn1/h501/packet-h501-template.c index ab7538d1d5..d7f0969c96 100644 --- a/epan/dissectors/asn1/h501/packet-h501-template.c +++ b/epan/dissectors/asn1/h501/packet-h501-template.c @@ -51,8 +51,7 @@ static int ett_h501 = -1; static dissector_handle_t h501_pdu_handle; /* Preferences */ -#define H501_TCP_PORT 2099 -static guint h501_udp_port = 2099; +#define H501_PORT 2099 static gboolean h501_desegment_tcp = TRUE; void proto_reg_handoff_h501(void); @@ -111,11 +110,7 @@ void proto_register_h501(void) { h501_pdu_handle = register_dissector(PFNAME, dissect_h501_pdu, proto_h501); - h501_module = prefs_register_protocol(proto_h501, proto_reg_handoff_h501); - prefs_register_uint_preference(h501_module, "udp.port", - "UDP port", - "Port to be decoded as h501", - 10, &h501_udp_port); + h501_module = prefs_register_protocol(proto_h501, NULL); prefs_register_bool_preference(h501_module, "desegment", "Desegment H.501 over TCP", "Desegment H.501 messages that span more TCP segments", @@ -126,23 +121,12 @@ void proto_register_h501(void) { /*--- proto_reg_handoff_h501 -------------------------------------------*/ void proto_reg_handoff_h501(void) { - static gboolean h501_prefs_initialized = FALSE; - static dissector_handle_t h501_udp_handle; - static dissector_handle_t h501_tcp_handle; - static guint saved_h501_udp_port; - - if (!h501_prefs_initialized) { - h501_udp_handle = create_dissector_handle(dissect_h501_udp, proto_h501); - h501_tcp_handle = create_dissector_handle(dissect_h501_tcp, proto_h501); - dissector_add_uint_with_preference("tcp.port", H501_TCP_PORT, h501_tcp_handle); - h501_prefs_initialized = TRUE; - } else { - dissector_delete_uint("udp.port", saved_h501_udp_port, h501_udp_handle); - } - - /* Set our port number for future use */ - saved_h501_udp_port = h501_udp_port; - dissector_add_uint("udp.port", saved_h501_udp_port, h501_udp_handle); + dissector_handle_t h501_udp_handle; + dissector_handle_t h501_tcp_handle; + h501_udp_handle = create_dissector_handle(dissect_h501_udp, proto_h501); + h501_tcp_handle = create_dissector_handle(dissect_h501_tcp, proto_h501); + dissector_add_uint_with_preference("tcp.port", H501_PORT, h501_tcp_handle); + dissector_add_uint_with_preference("udp.port", H501_PORT, h501_udp_handle); } |