aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ged125.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-10-07 16:25:01 -0400
committerMichael Mann <mmann78@netscape.net>2016-10-08 02:44:53 +0000
commit268841f3e00b7cf0f16c81dd2b3b952172130b8b (patch)
tree359e01cf5eba83308760531888713fe0ff0bc10b /epan/dissectors/packet-ged125.c
parent11d3224142c0531879fb8e415daf9639a4eace66 (diff)
Combine Decode As and port preferences for tcp.port dissector table.
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-ged125.c')
-rw-r--r--epan/dissectors/packet-ged125.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/epan/dissectors/packet-ged125.c b/epan/dissectors/packet-ged125.c
index 460958fae9..bea3b9bda1 100644
--- a/epan/dissectors/packet-ged125.c
+++ b/epan/dissectors/packet-ged125.c
@@ -155,7 +155,6 @@ static expert_field ei_ged125_TrunkCount_invalid = EI_INIT;
static dissector_handle_t ged125_handle;
/* Preferences */
-static guint global_tcp_port_ged125 = 0;
static gboolean ged125_desegment_body = TRUE;
#define GED125_FAILURE_CONF_VALUE 1
@@ -1756,10 +1755,6 @@ proto_register_ged125 (void)
ged125_module = prefs_register_protocol(proto_ged125, NULL);
- prefs_register_uint_preference(ged125_module, "tcp_port","GED125 TCP Port",
- "Set up the TCP port for GED125",
- 10, &global_tcp_port_ged125);
-
prefs_register_bool_preference(ged125_module, "desegment_body",
"Reassemble GED125 bodies spanning multiple TCP segments",
"Whether the GED125 dissector should desegment all messages spanning multiple TCP segments",
@@ -1769,17 +1764,8 @@ proto_register_ged125 (void)
void
proto_reg_handoff_ged125(void)
{
- static guint old_ged125_tcp_port = 0;
-
/* Register TCP port for dissection */
- if (old_ged125_tcp_port != 0 && old_ged125_tcp_port != global_tcp_port_ged125)
- dissector_delete_uint("tcp.port", old_ged125_tcp_port, ged125_handle);
-
-
- if (global_tcp_port_ged125 != 0 && old_ged125_tcp_port != global_tcp_port_ged125)
- dissector_add_uint("tcp.port", global_tcp_port_ged125, ged125_handle);
-
- old_ged125_tcp_port = global_tcp_port_ged125;
+ dissector_add_for_decode_as_with_preference("tcp.port", ged125_handle);
}
/*