summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-kdp.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-kdp.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 '')
-rw-r--r--epan/dissectors/packet-kdp.c104
1 files changed, 52 insertions, 52 deletions
diff --git a/epan/dissectors/packet-kdp.c b/epan/dissectors/packet-kdp.c
index e714bebe..727b617a 100644
--- a/epan/dissectors/packet-kdp.c
+++ b/epan/dissectors/packet-kdp.c
@@ -21,35 +21,35 @@ static dissector_handle_t kdp_handle;
#define KDP_PORT 19948 /* Not IANA registered */
#define BUFFER_SIZE 80
-static int proto_kdp = -1;
-static gint ett_kdp = -1;
-static gint ett_kdp_flags = -1;
-
-static int hf_kdp_version = -1;
-static int hf_kdp_headerlen = -1;
-static int hf_kdp_flags = -1;
-static int hf_kdp_errors = -1;
-static int hf_kdp_destflowid = -1;
-static int hf_kdp_srcflowid = -1;
-static int hf_kdp_sequence = -1;
-static int hf_kdp_ack = -1;
-static int hf_kdp_maxsegmentsize = -1;
-static int hf_kdp_optionnumber = -1;
-static int hf_kdp_optionlen = -1;
-static int hf_kdp_option1 = -1;
-static int hf_kdp_option2 = -1;
-static int hf_kdp_option3 = -1;
-static int hf_kdp_option4 = -1;
-static int hf_kdp_option5 = -1;
-static int hf_kdp_option6 = -1;
-static int hf_kdp_option7 = -1;
-static int hf_kdp_option8 = -1;
-static int hf_kdp_option9 = -1;
-static int hf_kdp_option_unknown = -1;
-static int hf_kdp_fragment = -1;
-static int hf_kdp_fragtotal = -1;
-static int hf_kdp_body = -1;
-static int hf_kdp_xml_body = -1;
+static int proto_kdp;
+static int ett_kdp;
+static int ett_kdp_flags;
+
+static int hf_kdp_version;
+static int hf_kdp_headerlen;
+static int hf_kdp_flags;
+static int hf_kdp_errors;
+static int hf_kdp_destflowid;
+static int hf_kdp_srcflowid;
+static int hf_kdp_sequence;
+static int hf_kdp_ack;
+static int hf_kdp_maxsegmentsize;
+static int hf_kdp_optionnumber;
+static int hf_kdp_optionlen;
+static int hf_kdp_option1;
+static int hf_kdp_option2;
+static int hf_kdp_option3;
+static int hf_kdp_option4;
+static int hf_kdp_option5;
+static int hf_kdp_option6;
+static int hf_kdp_option7;
+static int hf_kdp_option8;
+static int hf_kdp_option9;
+static int hf_kdp_option_unknown;
+static int hf_kdp_fragment;
+static int hf_kdp_fragtotal;
+static int hf_kdp_body;
+static int hf_kdp_xml_body;
#define KDP_DROP_FLAG (1 << 0)
#define KDP_SYN_FLAG (1 << 1)
@@ -58,26 +58,26 @@ static int hf_kdp_xml_body = -1;
#define KDP_BCST_FLAG (1 << 4)
#define KDP_DUP_FLAG (1 << 5)
-static int hf_kdp_drop_flag = -1;
-static int hf_kdp_syn_flag = -1;
-static int hf_kdp_ack_flag = -1;
-static int hf_kdp_rst_flag = -1;
-static int hf_kdp_bcst_flag = -1;
-static int hf_kdp_dup_flag = -1;
+static int hf_kdp_drop_flag;
+static int hf_kdp_syn_flag;
+static int hf_kdp_ack_flag;
+static int hf_kdp_rst_flag;
+static int hf_kdp_bcst_flag;
+static int hf_kdp_dup_flag;
static int dissect_kdp(tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree, void* data _U_) {
proto_item *ti;
proto_tree *kdp_tree;
- guint body_len;
- guint8 version;
- guint8 header_len = 0;
- guint8 packet_flags = 0;
- guint8 packet_errors = 0;
- guint32 sequence_number = G_MAXUINT32;
- guint32 ack_number = G_MAXUINT32;
- guint32 src_flowid = G_MAXUINT32;
+ unsigned body_len;
+ uint8_t version;
+ uint8_t header_len = 0;
+ uint8_t packet_flags = 0;
+ uint8_t packet_errors = 0;
+ uint32_t sequence_number = UINT32_MAX;
+ uint32_t ack_number = UINT32_MAX;
+ uint32_t src_flowid = UINT32_MAX;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "KDP");
col_clear(pinfo->cinfo, COL_INFO);
@@ -85,22 +85,22 @@ static int dissect_kdp(tvbuff_t *tvb,
ti = proto_tree_add_item(tree, proto_kdp, tvb, 0, -1, ENC_NA);
kdp_tree = proto_item_add_subtree(ti, ett_kdp);
- version = tvb_get_guint8(tvb, 0);
+ version = tvb_get_uint8(tvb, 0);
if (version != 2) {
/* Version other than 2 is really SDDP in UDP */
proto_tree_add_item(kdp_tree, hf_kdp_version, tvb, 0, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(kdp_tree, hf_kdp_xml_body, tvb, 0, -1, ENC_ASCII);
} else {
proto_tree *flags_tree;
- header_len = tvb_get_guint8(tvb, 1) * 4;
+ header_len = tvb_get_uint8(tvb, 1) * 4;
body_len = tvb_reported_length(tvb);
if (header_len > body_len) {
body_len = 0; /* malformed packet */
} else {
body_len = body_len - header_len;
}
- packet_flags = tvb_get_guint8(tvb, 2);
- packet_errors = tvb_get_guint8(tvb, 3);
+ packet_flags = tvb_get_uint8(tvb, 2);
+ packet_errors = tvb_get_uint8(tvb, 3);
proto_tree_add_item(kdp_tree, hf_kdp_version, tvb, 0, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(kdp_tree, hf_kdp_headerlen, tvb, 1, 1, ENC_BIG_ENDIAN);
ti = proto_tree_add_item(kdp_tree, hf_kdp_flags, tvb, 2, 1, ENC_BIG_ENDIAN);
@@ -144,15 +144,15 @@ static int dissect_kdp(tvbuff_t *tvb,
}
while (offset < ((body_len > 0) ? header_len - 4 : header_len)) {
- guint8 option_number;
- guint8 option_len = 0;
+ uint8_t option_number;
+ uint8_t option_len = 0;
- option_number = tvb_get_guint8(tvb, offset);
+ option_number = tvb_get_uint8(tvb, offset);
proto_tree_add_item(kdp_tree, hf_kdp_optionnumber, tvb, offset, 1, ENC_BIG_ENDIAN);
offset = offset + 1;
if (option_number > 0) {
- option_len = tvb_get_guint8(tvb, offset);
+ option_len = tvb_get_uint8(tvb, offset);
proto_tree_add_item(kdp_tree, hf_kdp_optionlen, tvb, offset, 1, ENC_BIG_ENDIAN);
offset = offset + 1;
}
@@ -381,7 +381,7 @@ void proto_register_kdp(void) {
};
/* Setup protocol subtree array */
- static gint *ett[] = {
+ static int *ett[] = {
&ett_kdp, &ett_kdp_flags
};