aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cipmotion.c
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 /epan/dissectors/packet-cipmotion.c
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 'epan/dissectors/packet-cipmotion.c')
-rw-r--r--epan/dissectors/packet-cipmotion.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/epan/dissectors/packet-cipmotion.c b/epan/dissectors/packet-cipmotion.c
index 42e4ea87bb..fc6f7118ff 100644
--- a/epan/dissectors/packet-cipmotion.c
+++ b/epan/dissectors/packet-cipmotion.c
@@ -260,6 +260,8 @@ static gint ett_group_sync = -1;
static gint ett_axis_status_set = -1;
static gint ett_command_control = -1;
+static dissector_handle_t cipmotion_handle;
+
/* These are the BITMASKS for the Time Data Set header field */
#define TIME_DATA_SET_TIME_STAMP 0x1
#define TIME_DATA_SET_TIME_OFFSET 0x2
@@ -2921,16 +2923,12 @@ proto_register_cipmotion(void)
/* Register the subtrees for the protocol dissection */
proto_register_subtree_array(cip_subtree, array_length(cip_subtree));
- register_dissector( "cipmotion", dissect_cipmotion, proto_cipmotion);
+ cipmotion_handle = register_dissector("cipmotion", dissect_cipmotion, proto_cipmotion);
}
void proto_reg_handoff_cipmotion(void)
{
- dissector_handle_t cipmotion_handle;
-
- /* Create and register dissector for I/O data handling */
- cipmotion_handle = create_dissector_handle( dissect_cipmotion, proto_cipmotion );
- dissector_add_for_decode_as("enip.io", cipmotion_handle );
+ dissector_add_for_decode_as("enip.io", cipmotion_handle);
}
/*