aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tpkt.c
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2022-08-07 09:28:32 -0400
committerAndersBroman <a.broman58@gmail.com>2022-08-09 06:21:05 +0000
commit203cd2cba90014acf1452f8eaf502d5c5f7fd9a2 (patch)
tree743d421202779f5e79099f7296b91174fdbe53b3 /epan/dissectors/packet-tpkt.c
parent862803de5cb903ce8b286bc3ec28ef903dd5b49a (diff)
prefs: More cleanup, auto prefs
Remove callback function from pref registrations for dissectors that don't need a callback. In other dissectors, move registration that only needs to be done once inside the check for initialization, avoiding some console messages when preferences are changed ("Duplicate dissectors (anonymous) and (anonymous) for protocol...") and the like. Add a couple auto preferences for dissectors missed in previous waves. Ping #14319
Diffstat (limited to 'epan/dissectors/packet-tpkt.c')
-rw-r--r--epan/dissectors/packet-tpkt.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/epan/dissectors/packet-tpkt.c b/epan/dissectors/packet-tpkt.c
index 8dc0cb09a1..41635cb5ac 100644
--- a/epan/dissectors/packet-tpkt.c
+++ b/epan/dissectors/packet-tpkt.c
@@ -55,7 +55,6 @@ static dissector_handle_t osi_tp_handle;
static dissector_handle_t tpkt_handle;
#define DEFAULT_TPKT_PORT_RANGE "102"
-static range_t *tpkt_tcp_port_range;
/*
* Check whether this could be a TPKT-encapsulated PDU.
@@ -675,20 +674,13 @@ proto_register_tpkt(void)
proto_register_subtree_array(ett, array_length(ett));
tpkt_handle = register_dissector("tpkt", dissect_tpkt, proto_tpkt);
- tpkt_module = prefs_register_protocol(proto_tpkt, proto_reg_handoff_tpkt);
+ tpkt_module = prefs_register_protocol(proto_tpkt, NULL);
prefs_register_bool_preference(tpkt_module, "desegment",
"Reassemble TPKT messages spanning multiple TCP segments",
"Whether the TPKT dissector should reassemble messages spanning multiple TCP segments. "
"To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
&tpkt_desegment);
- range_convert_str(wmem_epan_scope(), &tpkt_tcp_port_range, DEFAULT_TPKT_PORT_RANGE, MAX_TCP_PORT);
-
- prefs_register_range_preference(tpkt_module, "tcp.ports", "TPKT TCP ports",
- "TCP ports to be decoded as TPKT (default: "
- DEFAULT_TPKT_PORT_RANGE ")",
- &tpkt_tcp_port_range, MAX_TCP_PORT);
-
/* heuristic dissectors for premable CredSSP before RDP and Fast-Path RDP packets */
tpkt_heur_subdissector_list = register_heur_dissector_list("tpkt", proto_tpkt);
@@ -698,17 +690,9 @@ proto_register_tpkt(void)
void
proto_reg_handoff_tpkt(void)
{
- static range_t *port_range = NULL;
-
osi_tp_handle = find_dissector("ositp");
dissector_add_uint_range_with_preference("tcp.port", TCP_PORT_TPKT_RANGE, tpkt_handle);
- dissector_delete_uint_range("tcp.port", port_range, tpkt_handle);
- wmem_free(wmem_epan_scope(), port_range);
-
- port_range = range_copy(wmem_epan_scope(), tpkt_tcp_port_range);
- dissector_add_uint_range("tcp.port", port_range, tpkt_handle);
-
/* ssl_dissector_add registers TLS as the dissector for TCP for the
* given port. We can't use it, since on port 3389 TPKT (for RDP) can be
* over TLS or directly over TCP, depending on the RDP security settings.