aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/p1/packet-p1-template.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/asn1/p1/packet-p1-template.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/asn1/p1/packet-p1-template.c')
-rw-r--r--epan/dissectors/asn1/p1/packet-p1-template.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/epan/dissectors/asn1/p1/packet-p1-template.c b/epan/dissectors/asn1/p1/packet-p1-template.c
index 0158854de2..70591dd391 100644
--- a/epan/dissectors/asn1/p1/packet-p1-template.c
+++ b/epan/dissectors/asn1/p1/packet-p1-template.c
@@ -46,10 +46,6 @@
#define PSNAME "P1"
#define PFNAME "p1"
-static guint global_p1_tcp_port = 102;
-static dissector_handle_t tpkt_handle;
-static void prefs_register_p1(void); /* forward declaration for use in preferences registration */
-
/* Initialize the protocol and registered fields */
static int proto_p1 = -1;
static int proto_p3 = -1;
@@ -381,12 +377,13 @@ void proto_register_p1(void) {
/* Register our configuration options for P1, particularly our port */
- p1_module = prefs_register_protocol_subtree("OSI/X.400", proto_p1, prefs_register_p1);
+ p1_module = prefs_register_protocol_subtree("OSI/X.400", proto_p1, NULL);
+
+ prefs_register_obsolete_preference(p1_module, "tcp.port");
- prefs_register_uint_preference(p1_module, "tcp.port", "P1 TCP Port",
- "Set the port for P1 operations (if other"
- " than the default of 102)",
- 10, &global_p1_tcp_port);
+ prefs_register_static_text_preference(p1_module, "tcp_port_info",
+ "The TCP ports used by the P1 protocol should be added to the TPKT preference \"TPKT TCP ports\", or by selecting \"TPKT\" as the \"Transport\" protocol in the \"Decode As\" dialog.",
+ "P1 TCP Port preference moved information");
register_ber_syntax_dissector("P1 Message", proto_p1, dissect_p1_mts_apdu);
#include "packet-p1-syn-reg.c"
@@ -413,9 +410,6 @@ void proto_reg_handoff_p1(void) {
register_rtse_oid_dissector_handle(id_as_mts_rtse, NULL, 0, "id-as-mts-rtse", TRUE);
register_rtse_oid_dissector_handle(id_as_msse, NULL, 0, "id-as-msse", TRUE);
- /* remember the tpkt handler for change in preferences */
- tpkt_handle = find_dissector("tpkt");
-
/* APPLICATION CONTEXT */
oid_add_from_string("id-ac-mts-access-88", id_ac_mts_access_88);
@@ -439,24 +433,6 @@ void proto_reg_handoff_p1(void) {
}
-static void
-prefs_register_p1(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_p1_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
*