diff options
author | David Perry <boolean263@protonmail.com> | 2022-08-19 22:53:58 +0000 |
---|---|---|
committer | AndersBroman <a.broman58@gmail.com> | 2022-08-19 22:53:58 +0000 |
commit | d0c8efe8890fb1e45529f784753725caebf71ae8 (patch) | |
tree | a9a6d9d12f69dff32e6e583dd30f7b2456cb4a93 /epan/dissectors/packet-ieee8021ah.c | |
parent | b809e73f7c7976040e7982efed8154e837808f34 (diff) |
Use `register_dissector()` for more protocols
Diffstat (limited to 'epan/dissectors/packet-ieee8021ah.c')
-rw-r--r-- | epan/dissectors/packet-ieee8021ah.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ieee8021ah.c b/epan/dissectors/packet-ieee8021ah.c index 251089d381..cc127990e9 100644 --- a/epan/dissectors/packet-ieee8021ah.c +++ b/epan/dissectors/packet-ieee8021ah.c @@ -23,6 +23,8 @@ void proto_register_ieee8021ah(void); void proto_reg_handoff_ieee8021ah(void); +static dissector_handle_t ieee8021ah_handle; +static dissector_handle_t ieee8021ad_handle; static dissector_handle_t ethertype_handle; static capture_dissector_handle_t ipx_cap_handle; @@ -396,10 +398,14 @@ proto_register_ieee8021ah(void) /* dot1ah */ proto_ieee8021ah = proto_register_protocol("IEEE 802.1ah", "IEEE 802.1AH", "ieee8021ah"); + ieee8021ah_handle = register_dissector("ieee8021ah", dissect_ieee8021ah, + proto_ieee8021ah); proto_register_field_array(proto_ieee8021ah, hf, array_length(hf)); proto_ieee8021ad = proto_register_protocol("IEEE 802.1ad", "IEEE 802.1AD", "ieee8021ad"); + ieee8021ad_handle = register_dissector("ieee8021ad", dissect_ieee8021ad, + proto_ieee8021ad); proto_register_field_array(proto_ieee8021ad, hf_1ad, array_length(hf_1ad)); /* register subtree array for both */ @@ -418,16 +424,10 @@ void proto_reg_handoff_ieee8021ah(void) { static gboolean prefs_initialized = FALSE; - static dissector_handle_t ieee8021ah_handle; static unsigned int old_ieee8021ah_ethertype; static capture_dissector_handle_t ieee8021ah_cap_handle; if (!prefs_initialized){ - dissector_handle_t ieee8021ad_handle; - ieee8021ah_handle = create_dissector_handle(dissect_ieee8021ah, - proto_ieee8021ah); - ieee8021ad_handle = create_dissector_handle(dissect_ieee8021ad, - proto_ieee8021ad); dissector_add_uint("ethertype", ETHERTYPE_IEEE_802_1AD, ieee8021ad_handle); ethertype_handle = find_dissector_add_dependency("ethertype", proto_ieee8021ah); find_dissector_add_dependency("ethertype", proto_ieee8021ad); |