summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-arcnet.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-arcnet.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-arcnet.c')
-rw-r--r--epan/dissectors/packet-arcnet.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/epan/dissectors/packet-arcnet.c b/epan/dissectors/packet-arcnet.c
index c774f819..a1c83e4d 100644
--- a/epan/dissectors/packet-arcnet.c
+++ b/epan/dissectors/packet-arcnet.c
@@ -28,18 +28,18 @@ static capture_dissector_handle_t arcnet_cap_handle;
static capture_dissector_handle_t arcnet_cap_has_ex_handle;
/* Initialize the protocol and registered fields */
-static int proto_arcnet = -1;
-static int hf_arcnet_src = -1;
-static int hf_arcnet_dst = -1;
-static int hf_arcnet_offset = -1;
-static int hf_arcnet_protID = -1;
-static int hf_arcnet_exception_flag = -1;
-static int hf_arcnet_split_flag = -1;
-static int hf_arcnet_sequence = -1;
-static int hf_arcnet_padding = -1;
+static int proto_arcnet;
+static int hf_arcnet_src;
+static int hf_arcnet_dst;
+static int hf_arcnet_offset;
+static int hf_arcnet_protID;
+static int hf_arcnet_exception_flag;
+static int hf_arcnet_split_flag;
+static int hf_arcnet_sequence;
+static int hf_arcnet_padding;
/* Initialize the subtree pointers */
-static gint ett_arcnet = -1;
+static int ett_arcnet;
static int arcnet_address_type = -1;
@@ -49,24 +49,24 @@ static capture_dissector_handle_t ip_cap_handle;
static capture_dissector_handle_t arp_cap_handle;
/* Cache protocol for packet counting */
-static int proto_ipx = -1;
+static int proto_ipx;
static int arcnet_str_len(const address* addr _U_)
{
return 5;
}
-static int arcnet_to_str(const address* addr, gchar *buf, int buf_len _U_)
+static int arcnet_to_str(const address* addr, char *buf, int buf_len _U_)
{
*buf++ = '0';
*buf++ = 'x';
- buf = bytes_to_hexstr(buf, (const guint8 *)addr->data, 1);
+ buf = bytes_to_hexstr(buf, (const uint8_t *)addr->data, 1);
*buf = '\0'; /* NULL terminate */
return arcnet_str_len(addr);
}
-static const char* arcnet_col_filter_str(const address* addr _U_, gboolean is_src)
+static const char* arcnet_col_filter_str(const address* addr _U_, bool is_src)
{
if (is_src)
return "arcnet.src";
@@ -79,11 +79,11 @@ static int arcnet_len(void)
return 1;
}
-static gboolean
-capture_arcnet_common(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header, gboolean has_exception)
+static bool
+capture_arcnet_common(const unsigned char *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header, bool has_exception)
{
if (!BYTES_ARE_IN_FRAME(offset, len, 1)) {
- return FALSE;
+ return false;
}
switch (pd[offset]) {
@@ -121,7 +121,7 @@ capture_arcnet_common(const guchar *pd, int offset, int len, capture_packet_info
*/
offset++;
if (!BYTES_ARE_IN_FRAME(offset, len, 1)) {
- return FALSE;
+ return false;
}
if (has_exception && pd[offset] == 0xff) {
/* This is an exception packet. The flag value there is the
@@ -144,30 +144,30 @@ capture_arcnet_common(const guchar *pd, int offset, int len, capture_packet_info
break;
default:
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
-static gboolean
-capture_arcnet (const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
+static bool
+capture_arcnet (const unsigned char *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
{
- return capture_arcnet_common(pd, 4, len, cpinfo, pseudo_header, FALSE);
+ return capture_arcnet_common(pd, 4, len, cpinfo, pseudo_header, false);
}
-static gboolean
-capture_arcnet_has_exception(const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
+static bool
+capture_arcnet_has_exception(const unsigned char *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
{
- return capture_arcnet_common(pd, 2, len, cpinfo, pseudo_header, TRUE);
+ return capture_arcnet_common(pd, 2, len, cpinfo, pseudo_header, true);
}
static void
dissect_arcnet_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
- gboolean has_offset, gboolean has_exception)
+ bool has_offset, bool has_exception)
{
int offset = 0;
- guint8 dst, src, protID, split_flag;
+ uint8_t dst, src, protID, split_flag;
tvbuff_t *next_tvb;
proto_item *ti;
proto_tree *arcnet_tree;
@@ -176,8 +176,8 @@ dissect_arcnet_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
col_set_str(pinfo->cinfo, COL_INFO, "ARCNET");
- src = tvb_get_guint8 (tvb, 0);
- dst = tvb_get_guint8 (tvb, 1);
+ src = tvb_get_uint8 (tvb, 0);
+ dst = tvb_get_uint8 (tvb, 1);
set_address_tvb(&pinfo->dl_src, arcnet_address_type, 1, tvb, 0);
copy_address_shallow(&pinfo->src, &pinfo->dl_src);
set_address_tvb(&pinfo->dl_dst, arcnet_address_type, 1, tvb, 1);
@@ -198,7 +198,7 @@ dissect_arcnet_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
offset += 2;
}
- protID = tvb_get_guint8 (tvb, offset);
+ protID = tvb_get_uint8 (tvb, offset);
proto_tree_add_uint (arcnet_tree, hf_arcnet_protID, tvb, offset, 1, protID);
offset++;
@@ -238,7 +238,7 @@ dissect_arcnet_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
* as WinPcap, like PF_PACKET sockets, taps into the networking
* stack just as other protocols do.)
*/
- split_flag = tvb_get_guint8 (tvb, offset);
+ split_flag = tvb_get_uint8 (tvb, offset);
if (has_exception && split_flag == 0xff) {
/* This is an exception packet. The flag value there is the
"this is an exception flag" packet; the next two bytes
@@ -255,7 +255,7 @@ dissect_arcnet_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
offset++;
/* And after that comes the real split flag. */
- split_flag = tvb_get_guint8 (tvb, offset);
+ split_flag = tvb_get_uint8 (tvb, offset);
}
proto_tree_add_uint (arcnet_tree, hf_arcnet_split_flag, tvb, offset, 1,
@@ -289,7 +289,7 @@ dissect_arcnet_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
static int
dissect_arcnet (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
- dissect_arcnet_common (tvb, pinfo, tree, FALSE, TRUE);
+ dissect_arcnet_common (tvb, pinfo, tree, false, true);
return tvb_captured_length(tvb);
}
@@ -301,7 +301,7 @@ dissect_arcnet (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* da
static int
dissect_arcnet_linux (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
- dissect_arcnet_common (tvb, pinfo, tree, TRUE, FALSE);
+ dissect_arcnet_common (tvb, pinfo, tree, true, false);
return tvb_captured_length(tvb);
}
@@ -375,7 +375,7 @@ proto_register_arcnet (void)
};
/* Setup protocol subtree array */
- static gint *ett[] = {
+ static int *ett[] = {
&ett_arcnet,
};