diff options
author | Michael Mann <mmann78@netscape.net> | 2016-10-05 16:33:54 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-10-13 02:51:18 +0000 |
commit | 2eb7b05b8c9c6408268f0d1e81f0a18a02610f1c (patch) | |
tree | bd0a909e3d506ea2e61c446aa8a809b6f728af3b /plugins/wimaxasncp | |
parent | 4d8581d7e15fe4a80a53496b83a853271fc674b6 (diff) | |
download | wireshark-2eb7b05b8c9c6408268f0d1e81f0a18a02610f1c.tar.gz |
Convert most UDP dissectors to use "auto" preferences.
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67,
convert dissectors that use "udp.port".
More cleanup done on dissectors that use both TCP and UDP dissector
tables, so that less preference callbacks exist.
Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3
Reviewed-on: https://code.wireshark.org/review/18120
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 'plugins/wimaxasncp')
-rw-r--r-- | plugins/wimaxasncp/packet-wimaxasncp.c | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/plugins/wimaxasncp/packet-wimaxasncp.c b/plugins/wimaxasncp/packet-wimaxasncp.c index 1c829f3c4c..27d06c81e8 100644 --- a/plugins/wimaxasncp/packet-wimaxasncp.c +++ b/plugins/wimaxasncp/packet-wimaxasncp.c @@ -87,7 +87,6 @@ static gboolean debug_enabled = FALSE; /* Default WiMAX ASN control protocol port */ #define WIMAXASNCP_DEF_UDP_PORT 2231 -static guint global_wimaxasncp_udp_port = WIMAXASNCP_DEF_UDP_PORT; /* Initialize the subtree pointers */ @@ -3396,20 +3395,12 @@ proto_register_wimaxasncp(void) */ /* Register the protocol name and description */ - proto_wimaxasncp = proto_register_protocol( - "WiMAX ASN Control Plane Protocol", - "WiMAX ASN CP", - "wimaxasncp"); - + proto_wimaxasncp = proto_register_protocol("WiMAX ASN Control Plane Protocol", "WiMAX ASN CP", "wimaxasncp"); /* Register this dissector by name */ wimaxasncp_handle = register_dissector("wimaxasncp", dissect_wimaxasncp, proto_wimaxasncp); - /* Register preferences module (See Section 2.6 for more on - * preferences) */ - wimaxasncp_module = prefs_register_protocol( - proto_wimaxasncp, - proto_reg_handoff_wimaxasncp); + wimaxasncp_module = prefs_register_protocol(proto_wimaxasncp, NULL); /* Register preferences */ prefs_register_bool_preference( @@ -3427,13 +3418,6 @@ proto_register_wimaxasncp(void) "Print debug output to the console.", &debug_enabled); - prefs_register_uint_preference( - wimaxasncp_module, - "udp.wimax_port", - "UDP Port for WiMAX ASN Control Plane Protocol", - "Set UDP port for WiMAX ASN Control Plane Protocol", - 10, &global_wimaxasncp_udp_port); - prefs_register_enum_preference( wimaxasncp_module, "nwg_version", @@ -3458,27 +3442,10 @@ proto_register_wimaxasncp(void) void proto_reg_handoff_wimaxasncp(void) { - static gboolean inited = FALSE; - static int currentPort = -1; - - if (!inited) - { - - /* Find the EAP dissector */ - eap_handle = find_dissector_add_dependency("eap", proto_wimaxasncp); - - inited = TRUE; - } - - if (currentPort != -1) - { - /* Remove any previous registered port */ - dissector_delete_uint("udp.port", currentPort, wimaxasncp_handle); - } + /* Find the EAP dissector */ + eap_handle = find_dissector_add_dependency("eap", proto_wimaxasncp); - /* Add the new one from preferences */ - currentPort = global_wimaxasncp_udp_port; - dissector_add_uint("udp.port", currentPort, wimaxasncp_handle); + dissector_add_uint_with_preference("udp.port", WIMAXASNCP_DEF_UDP_PORT, wimaxasncp_handle); } |