summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-zep.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-zep.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-zep.c')
-rw-r--r--epan/dissectors/packet-zep.c53
1 files changed, 28 insertions, 25 deletions
diff --git a/epan/dissectors/packet-zep.c b/epan/dissectors/packet-zep.c
index b50e4e90..a7ce6c19 100644
--- a/epan/dissectors/packet-zep.c
+++ b/epan/dissectors/packet-zep.c
@@ -33,6 +33,9 @@
#include <epan/packet.h>
+#include <epan/tfs.h>
+#include <epan/unit_strings.h>
+#include <wsutil/array.h>
/* Function declarations */
void proto_reg_handoff_zep(void);
@@ -65,21 +68,21 @@ static const range_string type_rvals[] = {
static const true_false_string tfs_crc_lqi = { "CRC", "LQI" };
/* Initialize protocol and registered fields. */
-static int proto_zep = -1;
-static int hf_zep_version = -1;
-static int hf_zep_type = -1;
-static int hf_zep_channel_id = -1;
-static int hf_zep_device_id = -1;
-static int hf_zep_lqi_mode = -1;
-static int hf_zep_lqi = -1;
-static int hf_zep_timestamp = -1;
-static int hf_zep_seqno = -1;
-static int hf_zep_ieee_length = -1;
-static int hf_zep_protocol_id = -1;
-static int hf_zep_reserved_field = -1;
+static int proto_zep;
+static int hf_zep_version;
+static int hf_zep_type;
+static int hf_zep_channel_id;
+static int hf_zep_device_id;
+static int hf_zep_lqi_mode;
+static int hf_zep_lqi;
+static int hf_zep_timestamp;
+static int hf_zep_seqno;
+static int hf_zep_ieee_length;
+static int hf_zep_protocol_id;
+static int hf_zep_reserved_field;
/* Initialize protocol subtrees. */
-static gint ett_zep = -1;
+static int ett_zep;
/* Dissector handle */
static dissector_handle_t zep_handle;
@@ -106,12 +109,12 @@ static int dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
tvbuff_t *next_tvb;
proto_item *proto_root;
proto_tree *zep_tree;
- guint8 ieee_packet_len;
- guint8 zep_header_len;
- guint8 version;
- guint8 type;
- guint32 channel_id, seqno;
- gboolean lqi_mode = FALSE;
+ uint8_t ieee_packet_len;
+ uint8_t zep_header_len;
+ uint8_t version;
+ uint8_t type;
+ uint32_t channel_id, seqno;
+ bool lqi_mode = false;
dissector_handle_t next_dissector;
@@ -125,7 +128,7 @@ static int dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
}
/* Extract the protocol version from the ZEP header. */
- version = tvb_get_guint8(tvb, 2);
+ version = tvb_get_uint8(tvb, 2);
if (version == 1) {
/* Type indicates a ZEP_v1 packet. */
@@ -134,13 +137,13 @@ static int dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
return 0;
type = 0;
- ieee_packet_len = (tvb_get_guint8(tvb, ZEP_V1_HEADER_LEN - 1) & ZEP_LENGTH_MASK);
+ ieee_packet_len = (tvb_get_uint8(tvb, ZEP_V1_HEADER_LEN - 1) & ZEP_LENGTH_MASK);
}
else {
/* At the time of writing, v2 is the latest version of ZEP, assuming
* anything higher than v2 has identical format. */
- type = tvb_get_guint8(tvb, 3);
+ type = tvb_get_uint8(tvb, 3);
if (type == ZEP_V2_TYPE_ACK) {
/* ZEP Ack has only the seqno. */
zep_header_len = ZEP_V2_ACK_LEN;
@@ -152,7 +155,7 @@ static int dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
if (tvb_reported_length(tvb) < ZEP_V2_HEADER_LEN)
return 0;
- ieee_packet_len = (tvb_get_guint8(tvb, ZEP_V2_HEADER_LEN - 1) & ZEP_LENGTH_MASK);
+ ieee_packet_len = (tvb_get_uint8(tvb, ZEP_V2_HEADER_LEN - 1) & ZEP_LENGTH_MASK);
}
}
@@ -283,7 +286,7 @@ void proto_register_zep(void)
NULL, HFILL }},
{ &hf_zep_ieee_length,
- { "Length", "zep.length", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, ZEP_LENGTH_MASK,
+ { "Length", "zep.length", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_byte_bytes), ZEP_LENGTH_MASK,
"The length (in bytes) of the encapsulated IEEE 802.15.4 MAC frame.", HFILL }},
{ &hf_zep_protocol_id,
@@ -295,7 +298,7 @@ void proto_register_zep(void)
NULL, HFILL }},
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_zep
};