aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rdp.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-09-03 22:22:50 -0400
committerMichael Mann <mmann78@netscape.net>2016-09-16 14:58:24 +0000
commit3120536012bc85361e2e5cd204bd4aa91fb67ff6 (patch)
tree40a44f24258a339540591cfdcd95f7d2b8237c95 /epan/dissectors/packet-rdp.c
parentd67c1db3f2b16185d7cff250e098f48d94883f0e (diff)
Have TPKT support a TCP port range preference instead of having "subdissectors?" register their own.
There are a number of dissectors who are subdissectors of TPKT (and OSITP) that are not called by TCP dissector directly, yet can possibly register a TCP port "on the behalf" of TPKT. Just allow TPKT to support a range of ports to possibly include these protocols. Remove the preferences from these dissectors, but add backwards compatibility for the preferences by hooking into set_prefs and have the preferences just hook into Decode As functionality directly. Change-Id: Ic1b4959d39607f2b6b20fa6508da8d87d04cf098 Reviewed-on: https://code.wireshark.org/review/17476 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-rdp.c')
-rw-r--r--epan/dissectors/packet-rdp.c38
1 files changed, 5 insertions, 33 deletions
diff --git a/epan/dissectors/packet-rdp.c b/epan/dissectors/packet-rdp.c
index 52e0d8bf93..535b6f147b 100644
--- a/epan/dissectors/packet-rdp.c
+++ b/epan/dissectors/packet-rdp.c
@@ -40,13 +40,8 @@
#define PSNAME "RDP"
#define PFNAME "rdp"
-
-static guint global_rdp_tcp_port = 3389;
-static dissector_handle_t tpkt_handle;
-
void proto_register_rdp(void);
void proto_reg_handoff_rdp(void);
-static void prefs_register_rdp(void);
static int proto_rdp = -1;
@@ -3316,48 +3311,25 @@ proto_register_rdp(void) {
/* Register our configuration options for RDP, particularly our port */
- rdp_module = prefs_register_protocol(proto_rdp, prefs_register_rdp);
+ rdp_module = prefs_register_protocol(proto_rdp, NULL);
- prefs_register_uint_preference(rdp_module, "tcp.port", "RDP TCP Port",
- "Set the port for RDP operations (if other"
- " than the default of 3389)",
- 10, &global_rdp_tcp_port);
+ prefs_register_obsolete_preference(rdp_module, "tcp.port");
+ prefs_register_static_text_preference(rdp_module, "tcp_port_info",
+ "The TCP ports used by the RDP protocol should be added to the TPKT preference \"TPKT TCP ports\", or by selecting \"TPKT\" as the \"Transport\" protocol in the \"Decode As\" dialog.",
+ "RDP TCP Port preference moved information");
}
void
proto_reg_handoff_rdp(void)
{
-
- /* remember the tpkt handler for change in preferences */
- tpkt_handle = find_dissector("tpkt");
-
heur_dissector_add("cotp_cr", dissect_rdp_cr, "RDP", "rdp_cr", proto_rdp, HEURISTIC_ENABLE);
heur_dissector_add("cotp_cc", dissect_rdp_cc, "RDP", "rdp_cc", proto_rdp, HEURISTIC_ENABLE);
- prefs_register_rdp();
-
register_t124_ns_dissector("Duca", dissect_rdp_ClientData, proto_rdp);
register_t124_ns_dissector("McDn", dissect_rdp_ServerData, proto_rdp);
}
-static void
-prefs_register_rdp(void) {
-
- static guint tcp_port = 0;
-
- /* de-register the old port */
- /* port 102 is registered by TPKT - don't undo this! */
- if ((tcp_port > 0) && (tcp_port != 102) && tpkt_handle)
- dissector_delete_uint("tcp.port", tcp_port, tpkt_handle);
-
- /* Set our port number for future use */
- tcp_port = global_rdp_tcp_port;
-
- if ((tcp_port > 0) && (tcp_port != 102) && tpkt_handle)
- dissector_add_uint("tcp.port", tcp_port, tpkt_handle);
-}
-
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*