aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-01-13 02:16:04 +0100
committerAnders Broman <a.broman58@gmail.com>2016-01-13 11:36:29 +0000
commitbf0f5a982bc0666b6fa8d70c8d64cb1f07ab12ad (patch)
tree1a6adb34aa0b0b7b59e5f1f2fedfda9014e9769d /plugins
parent4f4769adf626ec2601e3488efbc2e2d57d55762c (diff)
Use result of register_dissector
Assign result of `register_dissector(..., func, proto)` to FOO_handle and remove `FOO_handle = create_dissector_handle(func, proto)`. Found by looking for files named packet-FOO.c having the above create_dissector_handle pattern. Some files (with different dissect routines for the two functions) remain unchanged. Change-Id: Ifbed8202c6dbc63a1dae9acc03313980ffbbbb90 Reviewed-on: https://code.wireshark.org/review/13247 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/wimaxasncp/packet-wimaxasncp.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/plugins/wimaxasncp/packet-wimaxasncp.c b/plugins/wimaxasncp/packet-wimaxasncp.c
index bafb2fc0d7..28e8a7d349 100644
--- a/plugins/wimaxasncp/packet-wimaxasncp.c
+++ b/plugins/wimaxasncp/packet-wimaxasncp.c
@@ -138,6 +138,7 @@ static wimaxasncp_dict_tlv_t wimaxasncp_tlv_not_found =
NULL, NULL, NULL
};
+static dissector_handle_t wimaxasncp_handle;
static dissector_handle_t eap_handle;
/* ------------------------------------------------------------------------- */
@@ -3404,7 +3405,7 @@ proto_register_wimaxasncp(void)
/* Register this dissector by name */
- register_dissector("wimaxasncp", dissect_wimaxasncp, proto_wimaxasncp);
+ wimaxasncp_handle = register_dissector("wimaxasncp", dissect_wimaxasncp, proto_wimaxasncp);
/* Register preferences module (See Section 2.6 for more on
* preferences) */
@@ -3460,21 +3461,11 @@ void
proto_reg_handoff_wimaxasncp(void)
{
static gboolean inited = FALSE;
- static dissector_handle_t wimaxasncp_handle;
static int currentPort = -1;
if (!inited)
{
- /* Use create_dissector_handle() to indicate that
- * dissect_wimaxasncp() returns the number of bytes it dissected (or
- * 0 if it thinks the packet does not belong to WiMAX ASN Control
- * Plane).
- */
- wimaxasncp_handle = create_dissector_handle(
- dissect_wimaxasncp,
- proto_wimaxasncp);
-
/* Find the EAP dissector */
eap_handle = find_dissector("eap");