summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sparkplug.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
commita86c5f7cae7ec9a3398300555a0b644689d946a1 (patch)
tree39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/dissectors/packet-sparkplug.c
parentReleasing progress-linux version 4.2.6-1~progress7.99u1. (diff)
downloadwireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz
wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-sparkplug.c')
-rw-r--r--epan/dissectors/packet-sparkplug.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/epan/dissectors/packet-sparkplug.c b/epan/dissectors/packet-sparkplug.c
index 5a111093..d844db96 100644
--- a/epan/dissectors/packet-sparkplug.c
+++ b/epan/dissectors/packet-sparkplug.c
@@ -30,26 +30,26 @@ void proto_reg_handoff_sparkplug(void);
void proto_register_sparkplug(void);
/* Initialize the protocol field */
-static int proto_sparkplugb = -1;
+static int proto_sparkplugb;
/* Initialize the subtree pointers */
-static gint ett_sparkplugb = -1;
-static gint ett_sparkplugb_namespace = -1;
+static int ett_sparkplugb;
+static int ett_sparkplugb_namespace;
/* The handle to the protobuf dissector */
-dissector_handle_t protobuf_handle = NULL;
+dissector_handle_t protobuf_handle;
/* The hf items */
-static int hf_sparkplugb_namespace = -1;
-static int hf_sparkplugb_groupid = -1;
-static int hf_sparkplugb_messagetype = -1;
-static int hf_sparkplugb_edgenodeid = -1;
-static int hf_sparkplugb_deviceid = -1;
+static int hf_sparkplugb_namespace;
+static int hf_sparkplugb_groupid;
+static int hf_sparkplugb_messagetype;
+static int hf_sparkplugb_edgenodeid;
+static int hf_sparkplugb_deviceid;
/* The expert info items */
-static expert_field ei_sparkplugb_missing_groupid = EI_INIT;
-static expert_field ei_sparkplugb_missing_messagetype = EI_INIT;
-static expert_field ei_sparkplugb_missing_edgenodeid = EI_INIT;
+static expert_field ei_sparkplugb_missing_groupid;
+static expert_field ei_sparkplugb_missing_messagetype;
+static expert_field ei_sparkplugb_missing_edgenodeid;
static gboolean
dissect_sparkplugb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
@@ -101,7 +101,7 @@ dissect_sparkplugb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
return FALSE;
}
- /* Adjust the info colum text with the message type */
+ /* Adjust the info column text with the message type */
current_element += 1;
if (current_element[0]) {
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, current_element[0]);
@@ -140,11 +140,16 @@ dissect_sparkplugb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
return TRUE;
}
+static bool dissect_sparkplugb_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data)
+{
+ return (bool)dissect_sparkplugb(tvb, pinfo, parent_tree, data);
+}
+
void proto_register_sparkplug(void)
{
expert_module_t* expert_sparkplugb;
- static gint *ett[] = {
+ static int *ett[] = {
&ett_sparkplugb,
&ett_sparkplugb_namespace
};
@@ -179,6 +184,6 @@ void proto_reg_handoff_sparkplug(void)
protobuf_handle = find_dissector_add_dependency("protobuf", proto_sparkplugb);
/* register as heuristic dissector with MQTT */
- heur_dissector_add("mqtt.topic", dissect_sparkplugb, "SparkplugB over MQTT",
+ heur_dissector_add("mqtt.topic", dissect_sparkplugb_heur, "SparkplugB over MQTT",
"sparkplugb_mqtt", proto_sparkplugb, HEURISTIC_ENABLE);
}