summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bthid.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:33 +0000
commit9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9 (patch)
tree2784370cda9bbf2da9114d70f05399c0b229d28c /epan/dissectors/packet-bthid.c
parentAdding debian version 4.2.6-1. (diff)
downloadwireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.tar.xz
wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-bthid.c')
-rw-r--r--epan/dissectors/packet-bthid.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/epan/dissectors/packet-bthid.c b/epan/dissectors/packet-bthid.c
index 99bfe519..c3c8371d 100644
--- a/epan/dissectors/packet-bthid.c
+++ b/epan/dissectors/packet-bthid.c
@@ -19,34 +19,34 @@
#include "packet-btl2cap.h"
#include "packet-btsdp.h"
-static int proto_bthid = -1;
-static int hf_bthid_transaction_type = -1;
-static int hf_bthid_parameter_reserved = -1;
-static int hf_bthid_parameter_reserved_31 = -1;
-static int hf_bthid_parameter_reserved_32 = -1;
-static int hf_bthid_parameter_reserved_2 = -1;
-static int hf_bthid_parameter_result_code = -1;
-static int hf_bthid_parameter_control_operation = -1;
-static int hf_bthid_parameter_size = -1;
-static int hf_bthid_protocol = -1;
-static int hf_bthid_idle_rate = -1;
-static int hf_bthid_parameter_report_type = -1;
-static int hf_bthid_report_id = -1;
-static int hf_bthid_buffer_size = -1;
-static int hf_bthid_protocol_code = -1;
-static int hf_bthid_data = -1;
-
-static gint ett_bthid = -1;
-
-static expert_field ei_bthid_parameter_control_operation_deprecated = EI_INIT;
-static expert_field ei_bthid_transaction_type_deprecated = EI_INIT;
+static int proto_bthid;
+static int hf_bthid_transaction_type;
+static int hf_bthid_parameter_reserved;
+static int hf_bthid_parameter_reserved_31;
+static int hf_bthid_parameter_reserved_32;
+static int hf_bthid_parameter_reserved_2;
+static int hf_bthid_parameter_result_code;
+static int hf_bthid_parameter_control_operation;
+static int hf_bthid_parameter_size;
+static int hf_bthid_protocol;
+static int hf_bthid_idle_rate;
+static int hf_bthid_parameter_report_type;
+static int hf_bthid_report_id;
+static int hf_bthid_buffer_size;
+static int hf_bthid_protocol_code;
+static int hf_bthid_data;
+
+static int ett_bthid;
+
+static expert_field ei_bthid_parameter_control_operation_deprecated;
+static expert_field ei_bthid_transaction_type_deprecated;
static dissector_handle_t bthid_handle;
static dissector_handle_t usb_hid_boot_keyboard_input_report_handle;
static dissector_handle_t usb_hid_boot_keyboard_output_report_handle;
static dissector_handle_t usb_hid_boot_mouse_input_report_handle;
-static gboolean show_deprecated = FALSE;
+static bool show_deprecated;
static const value_string transaction_type_vals[] = {
{ 0x00, "HANDSHAKE" },
@@ -119,14 +119,14 @@ static const value_string protocol_code_vals[] = {
void proto_register_bthid(void);
void proto_reg_handoff_bthid(void);
-static gint
+static int
dissect_hid_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- gint offset, guint report_type)
+ int offset, unsigned report_type)
{
unsigned int protocol_code;
proto_tree_add_item(tree, hf_bthid_protocol_code, tvb, offset, 1, ENC_BIG_ENDIAN);
- protocol_code = tvb_get_guint8(tvb, offset);
+ protocol_code = tvb_get_uint8(tvb, offset);
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str_const(protocol_code, protocol_code_vals, "unknown type"));
offset += 1;
@@ -157,12 +157,12 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
{
proto_item *ti;
proto_tree *bthid_tree;
- gint offset = 0;
- guint transaction_type;
- guint parameter;
- guint protocol;
- guint idle_rate;
- guint8 control_operation;
+ int offset = 0;
+ unsigned transaction_type;
+ unsigned parameter;
+ unsigned protocol;
+ unsigned idle_rate;
+ uint8_t control_operation;
proto_item *pitem;
ti = proto_tree_add_item(tree, proto_bthid, tvb, offset, -1, ENC_NA);
@@ -184,7 +184,7 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
}
pitem = proto_tree_add_item(bthid_tree, hf_bthid_transaction_type, tvb, offset, 1, ENC_BIG_ENDIAN);
- transaction_type = tvb_get_guint8(tvb, offset);
+ transaction_type = tvb_get_uint8(tvb, offset);
parameter = transaction_type & 0x0F;
transaction_type = transaction_type >> 4;
@@ -198,7 +198,7 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
break;
case 0x01: /* HID_CONTROL */
pitem = proto_tree_add_item(bthid_tree, hf_bthid_parameter_control_operation, tvb, offset, 1, ENC_BIG_ENDIAN);
- control_operation = tvb_get_guint8(tvb, offset);
+ control_operation = tvb_get_uint8(tvb, offset);
col_append_fstr(pinfo->cinfo, COL_INFO, " - Control Operation: %s", val_to_str_const(parameter, control_operation_vals, "reserved"));
if (control_operation < 3 && show_deprecated)
expert_add_info(pinfo, pitem, &ei_bthid_parameter_control_operation_deprecated);
@@ -246,7 +246,7 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
offset += 1;
proto_tree_add_item(bthid_tree, hf_bthid_protocol, tvb, offset, 1, ENC_BIG_ENDIAN);
- protocol = tvb_get_guint8(tvb, offset) & 0x01;
+ protocol = tvb_get_uint8(tvb, offset) & 0x01;
offset += 1;
col_append_fstr(pinfo->cinfo, COL_INFO, " - Protocol: %s",
@@ -270,7 +270,7 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
offset += 1;
pitem = proto_tree_add_item(bthid_tree, hf_bthid_idle_rate, tvb, offset, 1, ENC_BIG_ENDIAN);
- idle_rate = tvb_get_guint8(tvb, offset);
+ idle_rate = tvb_get_uint8(tvb, offset);
proto_item_append_text(pitem, " (%u.%03u ms)", idle_rate * 4 / 1000, idle_rate * 4 % 1000);
col_append_fstr(pinfo->cinfo, COL_INFO, " - Idle Rate: %u.%03u ms", idle_rate*4/1000, idle_rate*4%1000);
offset += 1;
@@ -379,7 +379,7 @@ proto_register_bthid(void)
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_bthid
};