aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorDavid Perry <boolean263@protonmail.com>2022-08-09 18:50:08 +0000
committerGerald Combs <gerald@wireshark.org>2022-08-09 18:50:08 +0000
commit43d499ca45b6a32d64ec201fb6e9eefa6efd9c08 (patch)
treebb9300433466470da19c718222d91014381f951d /plugins
parent33a34aeec181446ffdcc5e15727c0585450a133e (diff)
Use `register_dissector()` for more protocols
Diffstat (limited to 'plugins')
-rw-r--r--plugins/epan/profinet/packet-pn-rt.c7
-rw-r--r--plugins/epan/unistim/packet-unistim.c7
-rw-r--r--plugins/epan/wimaxmacphy/packet-wimaxmacphy.c5
3 files changed, 8 insertions, 11 deletions
diff --git a/plugins/epan/profinet/packet-pn-rt.c b/plugins/epan/profinet/packet-pn-rt.c
index 9979e54db6..252123e365 100644
--- a/plugins/epan/profinet/packet-pn-rt.c
+++ b/plugins/epan/profinet/packet-pn-rt.c
@@ -33,6 +33,8 @@ void proto_reg_handoff_pn_rt(void);
static int proto_pn_rt = -1;
static gboolean pnio_desegment = TRUE;
+static dissector_handle_t pn_rt_handle;
+
/* Define many header fields for pn-rt */
static int hf_pn_rt_frame_id = -1;
static int hf_pn_rt_cycle_counter = -1;
@@ -1142,6 +1144,7 @@ proto_register_pn_rt(void)
proto_pn_rt = proto_register_protocol("PROFINET Real-Time Protocol",
"PN-RT", "pn_rt");
+ pn_rt_handle = register_dissector("pn_rt", dissect_pn_rt, proto_pn_rt);
proto_register_field_array(proto_pn_rt, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -1177,10 +1180,6 @@ proto_register_pn_rt(void)
void
proto_reg_handoff_pn_rt(void)
{
- dissector_handle_t pn_rt_handle;
-
- pn_rt_handle = create_dissector_handle(dissect_pn_rt, proto_pn_rt);
-
dissector_add_uint("ethertype", ETHERTYPE_PROFINET, pn_rt_handle);
dissector_add_uint_with_preference("udp.port", PROFINET_UDP_PORT, pn_rt_handle);
diff --git a/plugins/epan/unistim/packet-unistim.c b/plugins/epan/unistim/packet-unistim.c
index 493f2a481a..ab5f198a4b 100644
--- a/plugins/epan/unistim/packet-unistim.c
+++ b/plugins/epan/unistim/packet-unistim.c
@@ -32,6 +32,8 @@
void proto_register_unistim(void);
+static dissector_handle_t unistim_handle;
+
static unistim_info_t *uinfo;
static int unistim_tap = -1;
@@ -3835,6 +3837,7 @@ proto_register_unistim(void){
expert_module_t* expert_unistim;
proto_unistim=proto_register_protocol("UNISTIM Protocol", "UNISTIM", "unistim");
+ unistim_handle=register_dissector("unistim", dissect_unistim,proto_unistim);
proto_register_subtree_array(ett,array_length(ett));
proto_register_field_array(proto_unistim,hf,array_length(hf));
@@ -3846,10 +3849,6 @@ proto_register_unistim(void){
void
proto_reg_handoff_unistim(void) {
-
- dissector_handle_t unistim_handle;
-
- unistim_handle=create_dissector_handle(dissect_unistim,proto_unistim);
dissector_add_for_decode_as_with_preference("udp.port", unistim_handle);
}
diff --git a/plugins/epan/wimaxmacphy/packet-wimaxmacphy.c b/plugins/epan/wimaxmacphy/packet-wimaxmacphy.c
index f42c03fccf..b0723b6ab4 100644
--- a/plugins/epan/wimaxmacphy/packet-wimaxmacphy.c
+++ b/plugins/epan/wimaxmacphy/packet-wimaxmacphy.c
@@ -20,6 +20,7 @@
/* Initialize the protocol and registered fields */
+static dissector_handle_t wimaxmacphy_handle;
static int proto_wimaxmacphy = -1;
static int hf_wimaxmacphy_hdr_phy_entity_id = -1;
static int hf_wimaxmacphy_hdr_message_segmentation = -1;
@@ -5412,6 +5413,7 @@ proto_register_wimaxmacphy(void)
"WiMAX MAC-PHY over Ethernet",
"WiMAX MAC-PHY",
"wimaxmacphy");
+ wimaxmacphy_handle = register_dissector("wimaxmacphy", dissect_wimaxmacphy, proto_wimaxmacphy);
/* Required function calls to register the header fields and subtrees
* used */
@@ -5424,9 +5426,6 @@ proto_register_wimaxmacphy(void)
void
proto_reg_handoff_wimaxmacphy(void)
{
- dissector_handle_t wimaxmacphy_handle;
-
- wimaxmacphy_handle = create_dissector_handle(dissect_wimaxmacphy, proto_wimaxmacphy);
dissector_add_for_decode_as_with_preference("udp.port", wimaxmacphy_handle);
}