diff options
author | Peter Wu <peter@lekensteyn.nl> | 2016-01-13 02:16:04 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-01-13 11:36:29 +0000 |
commit | bf0f5a982bc0666b6fa8d70c8d64cb1f07ab12ad (patch) | |
tree | 1a6adb34aa0b0b7b59e5f1f2fedfda9014e9769d /epan/dissectors/packet-stanag4607.c | |
parent | 4f4769adf626ec2601e3488efbc2e2d57d55762c (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-stanag4607.c')
-rw-r--r-- | epan/dissectors/packet-stanag4607.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/epan/dissectors/packet-stanag4607.c b/epan/dissectors/packet-stanag4607.c index d317e32c7f..7db08f952c 100644 --- a/epan/dissectors/packet-stanag4607.c +++ b/epan/dissectors/packet-stanag4607.c @@ -155,6 +155,8 @@ static expert_field ei_bad_length = EI_INIT; static expert_field ei_too_short = EI_INIT; static expert_field ei_bad_packet_size = EI_INIT; +static dissector_handle_t stanag4607_handle; + static const value_string stanag4607_class_vals[] = { { 1, "TOP SECRET" }, @@ -1634,17 +1636,13 @@ proto_register_stanag4607(void) expert_4607 = expert_register_protocol(proto_stanag4607); expert_register_field_array(expert_4607, ei, array_length(ei)); - register_dissector("STANAG 4607", dissect_stanag4607, proto_stanag4607); + stanag4607_handle = register_dissector("STANAG 4607", dissect_stanag4607, proto_stanag4607); /* prefs_register_protocol(proto_stanag4607, proto_reg_handoff_stanag4607); */ } void proto_reg_handoff_stanag4607(void) { - static dissector_handle_t stanag4607_handle; - - stanag4607_handle = create_dissector_handle(dissect_stanag4607, - proto_stanag4607); dissector_add_uint("wtap_encap", WTAP_ENCAP_STANAG_4607, stanag4607_handle); } |