aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ehdlc.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-ehdlc.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-ehdlc.c')
-rw-r--r--epan/dissectors/packet-ehdlc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ehdlc.c b/epan/dissectors/packet-ehdlc.c
index 3f29b65e07..7ecd30ff16 100644
--- a/epan/dissectors/packet-ehdlc.c
+++ b/epan/dissectors/packet-ehdlc.c
@@ -60,6 +60,8 @@ static int hf_ehdlc_s_ftype = -1;
static int hf_ehdlc_ftype_i = -1;
static int hf_ehdlc_ftype_s_u_ext = -1;
+static dissector_handle_t ehdlc_handle;
+
/* Used only for U frames */
static const xdlc_cf_items ehdlc_cf_items = {
NULL,
@@ -313,19 +315,16 @@ proto_register_ehdlc(void)
proto_register_field_array(proto_ehdlc, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("ehdlc", dissect_ehdlc, proto_ehdlc);
+ ehdlc_handle = register_dissector("ehdlc", dissect_ehdlc, proto_ehdlc);
}
void
proto_reg_handoff_ehdlc(void)
{
- dissector_handle_t ehdlc_handle;
-
sub_handles[SUB_RSL] = find_dissector("gsm_abis_rsl");
sub_handles[SUB_OML] = find_dissector("gsm_abis_oml");
sub_handles[SUB_DATA] = find_dissector("data");
- ehdlc_handle = create_dissector_handle( dissect_ehdlc, proto_ehdlc );
dissector_add_uint("l2tp.pw_type", L2TPv3_PROTOCOL_ERICSSON, ehdlc_handle);
}