summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-btl2cap.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-btl2cap.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-btl2cap.c')
-rw-r--r--epan/dissectors/packet-btl2cap.c886
1 files changed, 444 insertions, 442 deletions
diff --git a/epan/dissectors/packet-btl2cap.c b/epan/dissectors/packet-btl2cap.c
index 46a2e627..3e2e6c94 100644
--- a/epan/dissectors/packet-btl2cap.c
+++ b/epan/dissectors/packet-btl2cap.c
@@ -24,6 +24,8 @@
#include <epan/decode_as.h>
#include <epan/proto_data.h>
#include <epan/reassemble.h>
+#include <epan/unit_strings.h>
+
#include <wiretap/wtap.h>
#include "packet-bluetooth.h"
@@ -32,131 +34,131 @@
#include "packet-btl2cap.h"
/* Initialize the protocol and registered fields */
-int proto_btl2cap = -1;
-
-static int hf_btl2cap_length = -1;
-static int hf_btl2cap_cid = -1;
-static int hf_btl2cap_payload = -1;
-static int hf_btl2cap_command = -1;
-static int hf_btl2cap_cmd_code = -1;
-static int hf_btl2cap_cmd_ident = -1;
-static int hf_btl2cap_cmd_length = -1;
-static int hf_btl2cap_cmd_data = -1;
-static int hf_btl2cap_psm = -1;
-static int hf_btl2cap_psm_dynamic = -1;
-static int hf_btl2cap_scid = -1;
-static int hf_btl2cap_dcid = -1;
-static int hf_btl2cap_icid = -1;
-static int hf_btl2cap_controller = -1;
-static int hf_btl2cap_dcontroller = -1;
-static int hf_btl2cap_result = -1;
-static int hf_btl2cap_move_result = -1;
-static int hf_btl2cap_move_confirmation_result = -1;
-static int hf_btl2cap_status = -1;
-static int hf_btl2cap_rej_reason = -1;
-static int hf_btl2cap_sig_mtu = -1;
-static int hf_btl2cap_info_mtu = -1;
-static int hf_btl2cap_info_flowcontrol = -1;
-static int hf_btl2cap_info_retransmission = -1;
-static int hf_btl2cap_info_bidirqos = -1;
-static int hf_btl2cap_info_enh_retransmission = -1;
-static int hf_btl2cap_info_streaming = -1;
-static int hf_btl2cap_info_fcs = -1;
-static int hf_btl2cap_info_flow_spec = -1;
-static int hf_btl2cap_info_fixedchan = -1;
-static int hf_btl2cap_info_fixedchans = -1;
-static int hf_btl2cap_info_fixedchans_null = -1;
-static int hf_btl2cap_info_fixedchans_signal = -1;
-static int hf_btl2cap_info_fixedchans_connless = -1;
-static int hf_btl2cap_info_fixedchans_amp_man = -1;
-static int hf_btl2cap_info_fixedchans_rfu = -1;
-static int hf_btl2cap_info_fixedchans_smp = -1;
-static int hf_btl2cap_info_fixedchans_amp_test = -1;
-static int hf_btl2cap_info_window = -1;
-static int hf_btl2cap_info_unicast = -1;
-static int hf_btl2cap_info_type = -1;
-static int hf_btl2cap_info_result = -1;
-static int hf_btl2cap_configuration_result = -1;
-static int hf_btl2cap_info_extfeatures = -1;
-static int hf_btl2cap_option = -1;
-static int hf_btl2cap_option_type = -1;
-static int hf_btl2cap_option_length = -1;
-static int hf_btl2cap_option_mtu = -1;
-static int hf_btl2cap_option_flushTO = -1;
-static int hf_btl2cap_option_flush_to_us = -1;
-static int hf_btl2cap_option_flags = -1;
-static int hf_btl2cap_option_service_type = -1;
-static int hf_btl2cap_option_tokenrate = -1;
-static int hf_btl2cap_option_tokenbucketsize = -1;
-static int hf_btl2cap_option_peakbandwidth = -1;
-static int hf_btl2cap_option_latency = -1;
-static int hf_btl2cap_option_delayvariation = -1;
-static int hf_btl2cap_option_retransmissionmode = -1;
-static int hf_btl2cap_option_txwindow = -1;
-static int hf_btl2cap_option_maxtransmit = -1;
-static int hf_btl2cap_option_retransmittimeout = -1;
-static int hf_btl2cap_option_monitortimeout = -1;
-static int hf_btl2cap_option_mps = -1;
-static int hf_btl2cap_option_fcs = -1;
-static int hf_btl2cap_option_window = -1;
-static int hf_btl2cap_option_identifier = -1;
-static int hf_btl2cap_option_sdu_size = -1;
-static int hf_btl2cap_option_sdu_arrival_time = -1;
-static int hf_btl2cap_option_access_latency = -1;
-static int hf_btl2cap_control = -1;
-static int hf_btl2cap_control_sar = -1;
-static int hf_btl2cap_control_reqseq = -1;
-static int hf_btl2cap_control_txseq = -1;
-static int hf_btl2cap_control_retransmissiondisable = -1;
-static int hf_btl2cap_control_supervisory = -1;
-static int hf_btl2cap_control_type = -1;
-static int hf_btl2cap_fcs = -1;
-static int hf_btl2cap_sdulength = -1;
-static int hf_btl2cap_continuation_to = -1;
-static int hf_btl2cap_reassembled_in = -1;
-static int hf_btl2cap_min_interval = -1;
-static int hf_btl2cap_max_interval = -1;
-static int hf_btl2cap_slave_latency = -1;
-static int hf_btl2cap_timeout_multiplier = -1;
-static int hf_btl2cap_conn_param_result = -1;
-static int hf_btl2cap_credits = -1;
-static int hf_btl2cap_initial_credits = -1;
-static int hf_btl2cap_le_result = -1;
-static int hf_btl2cap_le_psm = -1;
-static int hf_btl2cap_flags_reserved = -1;
-static int hf_btl2cap_flags_continuation = -1;
-static int hf_btl2cap_data = -1;
-static int hf_btl2cap_service = -1;
-static int hf_btl2cap_connect_in_frame = -1;
-static int hf_btl2cap_disconnect_in_frame = -1;
-
-static int hf_btl2cap_le_sdu_fragments = -1;
-static int hf_btl2cap_le_sdu_fragment = -1;
-static int hf_btl2cap_le_sdu_fragment_overlap = -1;
-static int hf_btl2cap_le_sdu_fragment_overlap_conflicts = -1;
-static int hf_btl2cap_le_sdu_fragment_multiple_tails = -1;
-static int hf_btl2cap_le_sdu_fragment_too_long_fragment = -1;
-static int hf_btl2cap_le_sdu_fragment_error = -1;
-static int hf_btl2cap_le_sdu_fragment_count = -1;
-static int hf_btl2cap_le_sdu_reassembled_in = -1;
-static int hf_btl2cap_le_sdu_reassembled_length = -1;
-
-static int hf_btl2cap_le_sdu_length = -1;
+int proto_btl2cap;
+
+static int hf_btl2cap_length;
+static int hf_btl2cap_cid;
+static int hf_btl2cap_payload;
+static int hf_btl2cap_command;
+static int hf_btl2cap_cmd_code;
+static int hf_btl2cap_cmd_ident;
+static int hf_btl2cap_cmd_length;
+static int hf_btl2cap_cmd_data;
+static int hf_btl2cap_psm;
+static int hf_btl2cap_psm_dynamic;
+static int hf_btl2cap_scid;
+static int hf_btl2cap_dcid;
+static int hf_btl2cap_icid;
+static int hf_btl2cap_controller;
+static int hf_btl2cap_dcontroller;
+static int hf_btl2cap_result;
+static int hf_btl2cap_move_result;
+static int hf_btl2cap_move_confirmation_result;
+static int hf_btl2cap_status;
+static int hf_btl2cap_rej_reason;
+static int hf_btl2cap_sig_mtu;
+static int hf_btl2cap_info_mtu;
+static int hf_btl2cap_info_flowcontrol;
+static int hf_btl2cap_info_retransmission;
+static int hf_btl2cap_info_bidirqos;
+static int hf_btl2cap_info_enh_retransmission;
+static int hf_btl2cap_info_streaming;
+static int hf_btl2cap_info_fcs;
+static int hf_btl2cap_info_flow_spec;
+static int hf_btl2cap_info_fixedchan;
+static int hf_btl2cap_info_fixedchans;
+static int hf_btl2cap_info_fixedchans_null;
+static int hf_btl2cap_info_fixedchans_signal;
+static int hf_btl2cap_info_fixedchans_connless;
+static int hf_btl2cap_info_fixedchans_amp_man;
+static int hf_btl2cap_info_fixedchans_rfu;
+static int hf_btl2cap_info_fixedchans_smp;
+static int hf_btl2cap_info_fixedchans_amp_test;
+static int hf_btl2cap_info_window;
+static int hf_btl2cap_info_unicast;
+static int hf_btl2cap_info_type;
+static int hf_btl2cap_info_result;
+static int hf_btl2cap_configuration_result;
+static int hf_btl2cap_info_extfeatures;
+static int hf_btl2cap_option;
+static int hf_btl2cap_option_type;
+static int hf_btl2cap_option_length;
+static int hf_btl2cap_option_mtu;
+static int hf_btl2cap_option_flushTO;
+static int hf_btl2cap_option_flush_to_us;
+static int hf_btl2cap_option_flags;
+static int hf_btl2cap_option_service_type;
+static int hf_btl2cap_option_tokenrate;
+static int hf_btl2cap_option_tokenbucketsize;
+static int hf_btl2cap_option_peakbandwidth;
+static int hf_btl2cap_option_latency;
+static int hf_btl2cap_option_delayvariation;
+static int hf_btl2cap_option_retransmissionmode;
+static int hf_btl2cap_option_txwindow;
+static int hf_btl2cap_option_maxtransmit;
+static int hf_btl2cap_option_retransmittimeout;
+static int hf_btl2cap_option_monitortimeout;
+static int hf_btl2cap_option_mps;
+static int hf_btl2cap_option_fcs;
+static int hf_btl2cap_option_window;
+static int hf_btl2cap_option_identifier;
+static int hf_btl2cap_option_sdu_size;
+static int hf_btl2cap_option_sdu_arrival_time;
+static int hf_btl2cap_option_access_latency;
+static int hf_btl2cap_control;
+static int hf_btl2cap_control_sar;
+static int hf_btl2cap_control_reqseq;
+static int hf_btl2cap_control_txseq;
+static int hf_btl2cap_control_retransmissiondisable;
+static int hf_btl2cap_control_supervisory;
+static int hf_btl2cap_control_type;
+static int hf_btl2cap_fcs;
+static int hf_btl2cap_sdulength;
+static int hf_btl2cap_continuation_to;
+static int hf_btl2cap_reassembled_in;
+static int hf_btl2cap_min_interval;
+static int hf_btl2cap_max_interval;
+static int hf_btl2cap_peripheral_latency;
+static int hf_btl2cap_timeout_multiplier;
+static int hf_btl2cap_conn_param_result;
+static int hf_btl2cap_credits;
+static int hf_btl2cap_initial_credits;
+static int hf_btl2cap_le_result;
+static int hf_btl2cap_le_psm;
+static int hf_btl2cap_flags_reserved;
+static int hf_btl2cap_flags_continuation;
+static int hf_btl2cap_data;
+static int hf_btl2cap_service;
+static int hf_btl2cap_connect_in_frame;
+static int hf_btl2cap_disconnect_in_frame;
+
+static int hf_btl2cap_le_sdu_fragments;
+static int hf_btl2cap_le_sdu_fragment;
+static int hf_btl2cap_le_sdu_fragment_overlap;
+static int hf_btl2cap_le_sdu_fragment_overlap_conflicts;
+static int hf_btl2cap_le_sdu_fragment_multiple_tails;
+static int hf_btl2cap_le_sdu_fragment_too_long_fragment;
+static int hf_btl2cap_le_sdu_fragment_error;
+static int hf_btl2cap_le_sdu_fragment_count;
+static int hf_btl2cap_le_sdu_reassembled_in;
+static int hf_btl2cap_le_sdu_reassembled_length;
+
+static int hf_btl2cap_le_sdu_length;
/* Initialize the subtree pointers */
-static gint ett_btl2cap = -1;
-static gint ett_btl2cap_cmd = -1;
-static gint ett_btl2cap_option = -1;
-static gint ett_btl2cap_extfeatures = -1;
-static gint ett_btl2cap_fixedchans = -1;
-static gint ett_btl2cap_control = -1;
-static gint ett_btl2cap_le_sdu_fragment = -1;
-static gint ett_btl2cap_le_sdu_fragments = -1;
-
-static expert_field ei_btl2cap_parameter_mismatch = EI_INIT;
-static expert_field ei_btl2cap_sdulength_bad = EI_INIT;
-static expert_field ei_btl2cap_length_bad = EI_INIT;
-static expert_field ei_btl2cap_unknown_command_code = EI_INIT;
+static int ett_btl2cap;
+static int ett_btl2cap_cmd;
+static int ett_btl2cap_option;
+static int ett_btl2cap_extfeatures;
+static int ett_btl2cap_fixedchans;
+static int ett_btl2cap_control;
+static int ett_btl2cap_le_sdu_fragment;
+static int ett_btl2cap_le_sdu_fragments;
+
+static expert_field ei_btl2cap_parameter_mismatch;
+static expert_field ei_btl2cap_sdulength_bad;
+static expert_field ei_btl2cap_length_bad;
+static expert_field ei_btl2cap_unknown_command_code;
/* Initialize dissector table */
static dissector_table_t l2cap_psm_dissector_table;
@@ -190,34 +192,34 @@ static wmem_tree_t *cid_to_psm_table;
#define L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE 0xff
typedef struct _config_data_t {
- guint8 mode;
- guint8 txwindow;
+ uint8_t mode;
+ uint8_t txwindow;
wmem_tree_t *start_fragments; /* indexed by pinfo->num */
/* Used for LE frame reassembly */
- guint segmentation_started : 1; /* 0 = No, 1 = Yes */
- guint segment_len_rem; /* The remaining segment length, used to find last segment */
+ unsigned segmentation_started : 1; /* 0 = No, 1 = Yes */
+ unsigned segment_len_rem; /* The remaining segment length, used to find last segment */
} config_data_t;
typedef struct _sdu_reassembly_t
{
- guint8 *reassembled;
- guint8 seq;
- guint32 first_frame;
- guint32 last_frame;
- guint16 tot_len;
+ uint8_t *reassembled;
+ uint8_t seq;
+ uint32_t first_frame;
+ uint32_t last_frame;
+ uint16_t tot_len;
int cur_off; /* counter used by reassembly */
} sdu_reassembly_t;
typedef struct _psm_data_t {
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
- guint32 local_cid;
- guint32 remote_cid;
- guint16 psm;
- gboolean local_service;
- guint32 connect_in_frame;
- guint32 disconnect_in_frame;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
+ uint32_t local_cid;
+ uint32_t remote_cid;
+ uint16_t psm;
+ bool local_service;
+ uint32_t connect_in_frame;
+ uint32_t disconnect_in_frame;
config_data_t in;
config_data_t out;
} psm_data_t;
@@ -225,8 +227,8 @@ typedef struct _psm_data_t {
typedef struct _btl2cap_frame_data_t
{
/* LE frames info */
- guint first_fragment : 1; /* 0 = No, 1 = First or only fragment*/
- guint more_fragments : 1; /* 0 = Last fragment, 1 = more fragments*/
+ unsigned first_fragment : 1; /* 0 = No, 1 = First or only fragment*/
+ unsigned more_fragments : 1; /* 0 = Last fragment, 1 = more fragments*/
} btl2cap_frame_data_t;
static const value_string command_code_vals[] = {
@@ -480,69 +482,69 @@ static const fragment_items btl2cap_le_sdu_frag_items = {
};
-static void btl2cap_cid_prompt(packet_info *pinfo, gchar* result)
+static void btl2cap_cid_prompt(packet_info *pinfo, char* result)
{
- guint16 *value_data;
+ uint16_t *value_data;
- value_data = (guint16 *) p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_CID);
+ value_data = (uint16_t *) p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_CID);
if (value_data)
- snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "L2CAP CID 0x%04x as", (guint) *value_data);
+ snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "L2CAP CID 0x%04x as", (unsigned) *value_data);
else
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown L2CAP CID");
}
-static gpointer btl2cap_cid_value(packet_info *pinfo)
+static void *btl2cap_cid_value(packet_info *pinfo)
{
- guint16 *value_data;
+ uint16_t *value_data;
- value_data = (guint16 *) p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_CID);
+ value_data = (uint16_t *) p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_CID);
if (value_data)
- return GUINT_TO_POINTER((gulong)*value_data);
+ return GUINT_TO_POINTER((unsigned long)*value_data);
return NULL;
}
-static void btl2cap_psm_prompt(packet_info *pinfo, gchar* result)
+static void btl2cap_psm_prompt(packet_info *pinfo, char* result)
{
- guint16 *value_data;
+ uint16_t *value_data;
- value_data = (guint16 *) p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM);
+ value_data = (uint16_t *) p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM);
if (value_data)
- snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "L2CAP PSM 0x%04x as", (guint) *value_data);
+ snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "L2CAP PSM 0x%04x as", (unsigned) *value_data);
else
snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown L2CAP PSM");
}
-static gpointer btl2cap_psm_value(packet_info *pinfo)
+static void *btl2cap_psm_value(packet_info *pinfo)
{
- guint16 *value_data;
+ uint16_t *value_data;
- value_data = (guint16 *) p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM);
+ value_data = (uint16_t *) p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM);
if (value_data)
- return GUINT_TO_POINTER((gulong)*value_data);
+ return GUINT_TO_POINTER((unsigned long)*value_data);
return NULL;
}
-static guint16
-get_service_uuid(packet_info *pinfo, btl2cap_data_t *l2cap_data, guint16 psm, gboolean is_local_psm)
+static uint16_t
+get_service_uuid(packet_info *pinfo, btl2cap_data_t *l2cap_data, uint16_t psm, bool is_local_psm)
{
wmem_tree_key_t key[10];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_sdp_psm;
- guint32 k_direction;
- guint32 k_bd_addr_oui;
- guint32 k_bd_addr_id;
- guint32 k_service_type;
- guint32 k_service_channel;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 remote_bd_addr_oui;
- guint32 remote_bd_addr_id;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_sdp_psm;
+ uint32_t k_direction;
+ uint32_t k_bd_addr_oui;
+ uint32_t k_bd_addr_id;
+ uint32_t k_service_type;
+ uint32_t k_service_channel;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t remote_bd_addr_oui;
+ uint32_t remote_bd_addr_id;
service_info_t *service_info;
interface_id = l2cap_data->interface_id;
@@ -612,7 +614,7 @@ get_service_uuid(packet_info *pinfo, btl2cap_data_t *l2cap_data, guint16 psm, gb
static int
dissect_comrej(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
{
- guint16 reason;
+ uint16_t reason;
reason = tvb_get_letohs(tvb, offset);
proto_tree_add_item(tree, hf_btl2cap_rej_reason, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -645,19 +647,19 @@ dissect_comrej(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tr
static int
dissect_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo,
- proto_tree *tree, proto_tree *command_tree, gboolean is_ch_request,
+ proto_tree *tree, proto_tree *command_tree, bool is_ch_request,
bthci_acl_data_t *acl_data, btl2cap_data_t *l2cap_data)
{
- guint16 scid;
- guint16 psm;
- const gchar *psm_str = "<NONE>";
+ uint16_t scid;
+ uint16_t psm;
+ const char *psm_str = "<NONE>";
psm = tvb_get_letohs(tvb, offset);
if (p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM ) == NULL) {
- guint16 *value_data;
+ uint16_t *value_data;
- value_data = wmem_new(wmem_file_scope(), guint16);
+ value_data = wmem_new(wmem_file_scope(), uint16_t);
*value_data = psm;
p_add_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM, value_data);
@@ -668,11 +670,11 @@ dissect_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo,
psm_str = val_to_str_const(psm, psm_vals, "Unknown PSM");
} else {
proto_item *item;
- guint16 uuid;
+ uint16_t uuid;
item = proto_tree_add_item(command_tree, hf_btl2cap_psm_dynamic, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- uuid = get_service_uuid(pinfo, l2cap_data, psm, (pinfo->p2p_dir == P2P_DIR_RECV) ? TRUE : FALSE);
+ uuid = get_service_uuid(pinfo, l2cap_data, psm, (pinfo->p2p_dir == P2P_DIR_RECV) ? true : false);
if (uuid) {
psm_str = val_to_str_ext_const(uuid, &bluetooth_uuid_vals_ext, "Unknown PSM");
proto_item_append_text(item, " (%s)", psm_str);
@@ -693,14 +695,14 @@ dissect_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (!pinfo->fd->visited) {
wmem_tree_key_t key[6];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
psm_data_t *psm_data;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
@@ -725,7 +727,7 @@ dissect_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo,
psm_data->remote_cid = BTL2CAP_UNKNOWN_CID;
}
psm_data->psm = psm;
- psm_data->local_service = (pinfo->p2p_dir == P2P_DIR_RECV) ? TRUE : FALSE;
+ psm_data->local_service = (pinfo->p2p_dir == P2P_DIR_RECV) ? true : false;
psm_data->in.start_fragments = wmem_tree_new(wmem_file_scope());
psm_data->out.start_fragments = wmem_tree_new(wmem_file_scope());
psm_data->interface_id = k_interface_id;
@@ -752,18 +754,18 @@ dissect_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (l2cap_data) {
proto_item *sub_item;
- guint32 bt_uuid = 0;
- guint32 disconnect_in_frame = 0;
+ uint32_t bt_uuid = 0;
+ uint32_t disconnect_in_frame = 0;
psm_data_t *psm_data;
wmem_tree_key_t key[6];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
interface_id = pinfo->rec->rec_header.packet_header.interface_id;
@@ -817,13 +819,13 @@ dissect_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
static int
dissect_le_credit_based_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo,
- proto_tree *tree, proto_tree *command_tree, guint16 cid, guint8 cmd_ident,
+ proto_tree *tree, proto_tree *command_tree, uint16_t cid, uint8_t cmd_ident,
bthci_acl_data_t *acl_data, btl2cap_data_t *l2cap_data)
{
proto_item *psm_item;
- guint32 psm;
- guint32 scid;
+ uint32_t psm;
+ uint32_t scid;
proto_tree_add_item_ret_uint(command_tree, hf_btl2cap_le_psm, tvb, offset, 2, ENC_LITTLE_ENDIAN, &psm);
@@ -847,18 +849,18 @@ dissect_le_credit_based_connrequest(tvbuff_t *tvb, int offset, packet_info *pinf
if (!pinfo->fd->visited) {
wmem_tree_key_t key[8];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_cmd_ident;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_cmd_ident;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
psm_data_t *psm_data;
- guint32 key_cid;
- guint32 cid_index;
+ uint32_t key_cid;
+ uint32_t cid_index;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
interface_id = pinfo->rec->rec_header.packet_header.interface_id;
@@ -889,7 +891,7 @@ dissect_le_credit_based_connrequest(tvbuff_t *tvb, int offset, packet_info *pinf
}
psm_data->psm = psm;
- psm_data->local_service = (pinfo->p2p_dir == P2P_DIR_RECV) ? TRUE : FALSE;
+ psm_data->local_service = (pinfo->p2p_dir == P2P_DIR_RECV) ? true : false;
psm_data->in.mode = L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE;
psm_data->in.start_fragments = wmem_tree_new(wmem_file_scope());
psm_data->out.mode = L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE;
@@ -931,18 +933,18 @@ dissect_le_credit_based_connrequest(tvbuff_t *tvb, int offset, packet_info *pinf
if (l2cap_data) {
proto_item *sub_item;
- guint32 bt_uuid = 0;
- guint32 disconnect_in_frame = 0;
+ uint32_t bt_uuid = 0;
+ uint32_t disconnect_in_frame = 0;
psm_data_t *psm_data;
wmem_tree_key_t key[6];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
interface_id = pinfo->rec->rec_header.packet_header.interface_id;
@@ -997,9 +999,9 @@ dissect_le_credit_based_connrequest(tvbuff_t *tvb, int offset, packet_info *pinf
static int
dissect_le_credit_based_connresponse(tvbuff_t *tvb, int offset, packet_info *pinfo,
- proto_tree *tree, guint16 cid, guint8 cmd_ident, bthci_acl_data_t *acl_data)
+ proto_tree *tree, uint16_t cid, uint8_t cmd_ident, bthci_acl_data_t *acl_data)
{
- guint32 dcid;
+ uint32_t dcid;
proto_tree_add_item_ret_uint(tree, hf_btl2cap_dcid, tvb, offset, 2, ENC_LITTLE_ENDIAN, &dcid);
offset += 2;
@@ -1020,17 +1022,17 @@ dissect_le_credit_based_connresponse(tvbuff_t *tvb, int offset, packet_info *pin
if (pinfo->fd->visited == 0) {
psm_data_t *psm_data;
wmem_tree_key_t key[8];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_cmd_ident;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
- guint32 key_cid;
- guint32 cid_index;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_cmd_ident;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
+ uint32_t key_cid;
+ uint32_t cid_index;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
interface_id = pinfo->rec->rec_header.packet_header.interface_id;
@@ -1105,14 +1107,14 @@ dissect_le_credit_based_connresponse(tvbuff_t *tvb, int offset, packet_info *pin
}
static int
dissect_l2cap_credit_based_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo,
- proto_tree *tree, proto_tree *command_tree, guint16 cid, guint8 cmd_ident,
- guint16 length, bthci_acl_data_t *acl_data, btl2cap_data_t *l2cap_data)
+ proto_tree *tree, proto_tree *command_tree, uint16_t cid, uint8_t cmd_ident,
+ uint16_t length, bthci_acl_data_t *acl_data, btl2cap_data_t *l2cap_data)
{
proto_item *psm_item;
- guint32 psm;
- guint32 scid;
- guint32 cid_index;
+ uint32_t psm;
+ uint32_t scid;
+ uint32_t cid_index;
proto_tree_add_item_ret_uint(command_tree, hf_btl2cap_le_psm, tvb, offset, 2, ENC_LITTLE_ENDIAN, &psm);
if (psm < 0x80) {
@@ -1137,17 +1139,17 @@ dissect_l2cap_credit_based_connrequest(tvbuff_t *tvb, int offset, packet_info *p
if (!pinfo->fd->visited) {
wmem_tree_key_t key[8];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_cmd_ident;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_cmd_ident;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
psm_data_t *psm_data;
- guint32 key_cid;
+ uint32_t key_cid;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
interface_id = pinfo->rec->rec_header.packet_header.interface_id;
@@ -1177,7 +1179,7 @@ dissect_l2cap_credit_based_connrequest(tvbuff_t *tvb, int offset, packet_info *p
}
psm_data->psm = psm;
- psm_data->local_service = (pinfo->p2p_dir == P2P_DIR_RECV) ? TRUE : FALSE;
+ psm_data->local_service = (pinfo->p2p_dir == P2P_DIR_RECV) ? true : false;
psm_data->in.mode = L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE;
psm_data->in.start_fragments = wmem_tree_new(wmem_file_scope());
psm_data->out.mode = L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE;
@@ -1219,18 +1221,18 @@ dissect_l2cap_credit_based_connrequest(tvbuff_t *tvb, int offset, packet_info *p
if (l2cap_data) {
proto_item *sub_item;
- guint32 bt_uuid = 0;
- guint32 disconnect_in_frame = 0;
+ uint32_t bt_uuid = 0;
+ uint32_t disconnect_in_frame = 0;
psm_data_t *psm_data;
wmem_tree_key_t key[6];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
interface_id = pinfo->rec->rec_header.packet_header.interface_id;
@@ -1287,11 +1289,11 @@ dissect_l2cap_credit_based_connrequest(tvbuff_t *tvb, int offset, packet_info *p
static int
dissect_l2cap_credit_based_connresponse(tvbuff_t *tvb, int offset, packet_info *pinfo,
- proto_tree *tree, guint16 cid, guint8 cmd_ident, guint16 length,
+ proto_tree *tree, uint16_t cid, uint8_t cmd_ident, uint16_t length,
bthci_acl_data_t *acl_data)
{
- guint32 dcid;
- guint32 cid_index;
+ uint32_t dcid;
+ uint32_t cid_index;
proto_tree_add_item(tree, hf_btl2cap_option_mtu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
@@ -1313,16 +1315,16 @@ dissect_l2cap_credit_based_connresponse(tvbuff_t *tvb, int offset, packet_info *
if (pinfo->fd->visited == 0) {
psm_data_t *psm_data;
wmem_tree_key_t key[8];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_cmd_ident;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
- guint32 key_cid;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_cmd_ident;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
+ uint32_t key_cid;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
interface_id = pinfo->rec->rec_header.packet_header.interface_id;
@@ -1398,14 +1400,14 @@ dissect_l2cap_credit_based_connresponse(tvbuff_t *tvb, int offset, packet_info *
static int
dissect_movechanrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
- guint16 icid;
- guint8 ctrl_id;
+ uint16_t icid;
+ uint8_t ctrl_id;
icid = tvb_get_letohs(tvb, offset);
proto_tree_add_item(tree, hf_btl2cap_icid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- ctrl_id = tvb_get_guint8(tvb, offset);
+ ctrl_id = tvb_get_uint8(tvb, offset);
proto_tree_add_item(tree, hf_btl2cap_dcontroller, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
@@ -1420,7 +1422,7 @@ dissect_options(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *t
{
proto_item *ti_option;
proto_tree *ti_option_subtree;
- guint8 option_type, option_length;
+ uint8_t option_type, option_length;
if (config_data) {
config_data->mode = L2CAP_BASIC_MODE;
@@ -1428,8 +1430,8 @@ dissect_options(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *t
}
while (length > 0) {
- option_type = tvb_get_guint8(tvb, offset);
- option_length = tvb_get_guint8(tvb, offset + 1);
+ option_type = tvb_get_uint8(tvb, offset);
+ option_length = tvb_get_uint8(tvb, offset + 1);
ti_option = proto_tree_add_none_format(tree,
hf_btl2cap_option, tvb,
@@ -1484,8 +1486,8 @@ dissect_options(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *t
case 0x04: /* Retransmission and Flow Control*/
if (config_data)
{
- config_data->mode = tvb_get_guint8(tvb, offset);
- config_data->txwindow = tvb_get_guint8(tvb, offset + 1);
+ config_data->mode = tvb_get_uint8(tvb, offset);
+ config_data->txwindow = tvb_get_uint8(tvb, offset + 1);
}
proto_tree_add_item(ti_option_subtree, hf_btl2cap_option_retransmissionmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
@@ -1559,9 +1561,9 @@ dissect_options(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *t
static int
dissect_configrequest(tvbuff_t *tvb, int offset, packet_info *pinfo,
- proto_tree *tree, guint16 length, bthci_acl_data_t *acl_data)
+ proto_tree *tree, uint16_t length, bthci_acl_data_t *acl_data)
{
- guint16 dcid;
+ uint16_t dcid;
dcid = tvb_get_letohs(tvb, offset);
@@ -1578,15 +1580,15 @@ dissect_configrequest(tvbuff_t *tvb, int offset, packet_info *pinfo,
psm_data_t *psm_data;
config_data_t *config_data;
wmem_tree_key_t key[6];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
- guint32 cid;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
+ uint32_t cid;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
interface_id = pinfo->rec->rec_header.packet_header.interface_id;
@@ -1650,7 +1652,7 @@ dissect_configrequest(tvbuff_t *tvb, int offset, packet_info *pinfo,
static int
dissect_inforequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
- guint16 info_type;
+ uint16_t info_type;
info_type = tvb_get_letohs(tvb, offset);
proto_tree_add_item(tree, hf_btl2cap_info_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -1663,7 +1665,7 @@ dissect_inforequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t
static int
dissect_inforesponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
- guint16 info_type, result;
+ uint16_t info_type, result;
info_type = tvb_get_letohs(tvb, offset);
proto_tree_add_item(tree, hf_btl2cap_info_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -1680,7 +1682,7 @@ dissect_inforesponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *
if (tvb_reported_length_remaining(tvb, offset) > 0) {
proto_item *ti_features;
proto_tree *ti_features_subtree;
- guint32 features;
+ uint32_t features;
switch (info_type) {
case 0x0001: /* Connectionless MTU */
@@ -1760,10 +1762,10 @@ dissect_inforesponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *
static int
dissect_configresponse(tvbuff_t *tvb, int offset, packet_info *pinfo,
- proto_tree *tree, guint16 length, bthci_acl_data_t *acl_data)
+ proto_tree *tree, uint16_t length, bthci_acl_data_t *acl_data)
{
- guint16 scid;
- guint16 result;
+ uint16_t scid;
+ uint16_t result;
scid = tvb_get_letohs(tvb, offset);
@@ -1786,15 +1788,15 @@ dissect_configresponse(tvbuff_t *tvb, int offset, packet_info *pinfo,
psm_data_t *psm_data;
config_data_t *config_data;
wmem_tree_key_t key[6];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
- guint32 cid;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
+ uint32_t cid;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
interface_id = pinfo->rec->rec_header.packet_header.interface_id;
@@ -1849,7 +1851,7 @@ static int
dissect_connresponse(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, bthci_acl_data_t *acl_data)
{
- guint16 scid, dcid, result;
+ uint16_t scid, dcid, result;
dcid = tvb_get_letohs(tvb, offset);
proto_tree_add_item(tree, hf_btl2cap_dcid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -1877,15 +1879,15 @@ dissect_connresponse(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (pinfo->fd->visited == 0) {
psm_data_t *psm_data;
wmem_tree_key_t key[6];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
- guint32 cid;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
+ uint32_t cid;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
interface_id = pinfo->rec->rec_header.packet_header.interface_id;
@@ -1965,7 +1967,7 @@ dissect_chanresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *
static int
dissect_movechanresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
- guint16 icid, result;
+ uint16_t icid, result;
icid = tvb_get_letohs(tvb, offset);
proto_tree_add_item(tree, hf_btl2cap_icid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -1984,7 +1986,7 @@ dissect_movechanresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
static int
dissect_movechanconfirmation(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
- guint16 icid, result;
+ uint16_t icid, result;
icid = tvb_get_letohs(tvb, offset);
proto_tree_add_item(tree, hf_btl2cap_icid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -2003,7 +2005,7 @@ dissect_movechanconfirmation(tvbuff_t *tvb, int offset, packet_info *pinfo, prot
static int
dissect_movechanconfirmationresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
- guint16 icid;
+ uint16_t icid;
icid = tvb_get_letohs(tvb, offset);
proto_tree_add_item(tree, hf_btl2cap_icid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -2017,7 +2019,7 @@ static int
dissect_connparamrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
proto_item *item;
- guint16 max_interval, slave_latency;
+ uint16_t max_interval, peripheral_latency;
item = proto_tree_add_item(tree, hf_btl2cap_min_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset) * 1.25);
@@ -2026,11 +2028,11 @@ dissect_connparamrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset) * 1.25);
max_interval = tvb_get_letohs(tvb, offset);
offset += 2;
- item = proto_tree_add_item(tree, hf_btl2cap_slave_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- slave_latency = tvb_get_letohs(tvb, offset);
+ item = proto_tree_add_item(tree, hf_btl2cap_peripheral_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
+ peripheral_latency = tvb_get_letohs(tvb, offset);
- if(slave_latency >= 500 || max_interval == 0 ||
- slave_latency > 10.0 * tvb_get_letohs(tvb, offset + 2) / (max_interval *1.25))
+ if(peripheral_latency >= 500 || max_interval == 0 ||
+ peripheral_latency > 10.0 * tvb_get_letohs(tvb, offset + 2) / (max_interval *1.25))
expert_add_info(pinfo, item, &ei_btl2cap_parameter_mismatch);
offset += 2;
@@ -2044,7 +2046,7 @@ dissect_connparamrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
static int
dissect_connparamresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
- guint16 result;
+ uint16_t result;
result = tvb_get_letohs(tvb, offset);
proto_tree_add_item(tree, hf_btl2cap_conn_param_result, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -2059,12 +2061,12 @@ dissect_connparamresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t
static int
dissect_disconnrequestresponse(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, proto_tree *command_tree, bthci_acl_data_t *acl_data, btl2cap_data_t *l2cap_data,
- gboolean is_request)
+ bool is_request)
{
- guint16 scid;
- guint16 dcid;
- guint psm = 0;
- const gchar *service_name = "Unknown";
+ uint16_t scid;
+ uint16_t dcid;
+ unsigned psm = 0;
+ const char *service_name = "Unknown";
dcid = tvb_get_letohs(tvb, offset);
proto_tree_add_item(command_tree, hf_btl2cap_dcid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -2077,16 +2079,16 @@ dissect_disconnrequestresponse(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (!pinfo->fd->visited) {
psm_data_t *psm_data;
wmem_tree_key_t key[6];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
- guint32 key_scid;
- guint32 key_dcid;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
+ uint32_t key_scid;
+ uint32_t key_dcid;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
interface_id = pinfo->rec->rec_header.packet_header.interface_id;
@@ -2166,19 +2168,19 @@ dissect_disconnrequestresponse(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (l2cap_data) {
proto_item *sub_item;
- guint32 bt_uuid = 0;
- guint32 connect_in_frame = 0;
+ uint32_t bt_uuid = 0;
+ uint32_t connect_in_frame = 0;
psm_data_t *psm_data;
wmem_tree_key_t key[6];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
- guint32 key_dcid;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
+ uint32_t key_dcid;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
interface_id = pinfo->rec->rec_header.packet_header.interface_id;
@@ -2266,8 +2268,8 @@ dissect_disconnrequestresponse(tvbuff_t *tvb, int offset, packet_info *pinfo,
static int
dissect_b_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- proto_tree *btl2cap_tree, guint16 cid, guint16 psm,
- gboolean is_local_psm, guint16 length, int offset, btl2cap_data_t *l2cap_data)
+ proto_tree *btl2cap_tree, uint16_t cid, uint16_t psm,
+ bool is_local_psm, uint16_t length, int offset, btl2cap_data_t *l2cap_data)
{
tvbuff_t *next_tvb;
@@ -2277,13 +2279,13 @@ dissect_b_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (psm) {
proto_item *psm_item;
- guint16 bt_uuid;
+ uint16_t bt_uuid;
bluetooth_uuid_t uuid;
if (p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM ) == NULL) {
- guint16 *value_data;
+ uint16_t *value_data;
- value_data = wmem_new(wmem_file_scope(), guint16);
+ value_data = wmem_new(wmem_file_scope(), uint16_t);
*value_data = psm;
p_add_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM, value_data);
@@ -2297,7 +2299,7 @@ dissect_b_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
uuid.data[1] = bt_uuid & 0xFF;
if (bt_uuid && p_get_proto_data(pinfo->pool, pinfo, proto_bluetooth, PROTO_DATA_BLUETOOTH_SERVICE_UUID) == NULL) {
- gchar *value_data;
+ char *value_data;
value_data = wmem_strdup(wmem_file_scope(), print_numeric_bluetooth_uuid(pinfo->pool, &uuid));
@@ -2316,8 +2318,8 @@ dissect_b_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item_set_generated(psm_item);
/* call next dissector */
- if (!dissector_try_uint_new(l2cap_cid_dissector_table, (guint32) cid, next_tvb, pinfo, tree, TRUE, l2cap_data)) {
- if (!dissector_try_uint_new(l2cap_psm_dissector_table, (guint32) psm, next_tvb, pinfo, tree, TRUE, l2cap_data)) {
+ if (!dissector_try_uint_new(l2cap_cid_dissector_table, (uint32_t) cid, next_tvb, pinfo, tree, true, l2cap_data)) {
+ if (!dissector_try_uint_new(l2cap_psm_dissector_table, (uint32_t) psm, next_tvb, pinfo, tree, true, l2cap_data)) {
/* not a known fixed PSM, try to find a registered service to a dynamic PSM */
if (!dissector_try_string(bluetooth_uuid_table, print_numeric_bluetooth_uuid(pinfo->pool, &uuid), next_tvb, pinfo, tree, l2cap_data)) {
/* unknown protocol. declare as data */
@@ -2327,7 +2329,7 @@ dissect_b_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
offset = tvb_captured_length(tvb);
} else {
- if (!dissector_try_uint_new(l2cap_cid_dissector_table, (guint32) cid, next_tvb, pinfo, tree, TRUE, l2cap_data))
+ if (!dissector_try_uint_new(l2cap_cid_dissector_table, (uint32_t) cid, next_tvb, pinfo, tree, true, l2cap_data))
proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, tvb, offset, length, ENC_NA);
offset = tvb_captured_length(tvb);
}
@@ -2340,9 +2342,9 @@ dissect_b_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*/
static int
dissect_le_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- proto_tree *btl2cap_tree, guint16 cid, guint16 psm, gboolean is_local_psm,
- guint16 length, int offset, config_data_t *config_data, btl2cap_data_t *l2cap_data,
- gboolean is_retransmit)
+ proto_tree *btl2cap_tree, uint16_t cid, uint16_t psm, bool is_local_psm,
+ uint16_t length, int offset, config_data_t *config_data, btl2cap_data_t *l2cap_data,
+ bool is_retransmit)
{
tvbuff_t *new_tvb = NULL;
@@ -2363,7 +2365,7 @@ dissect_le_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
} else {
/* First Frame in this SDU, SDU length is present */
- guint16 sdu_length;
+ uint16_t sdu_length;
sdu_length = tvb_get_letohs(tvb, offset);
btl2cap_frame_data->first_fragment = 1;
@@ -2395,12 +2397,12 @@ dissect_le_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (psm) {
proto_item *psm_item;
- guint16 bt_uuid;
+ uint16_t bt_uuid;
if (p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM) == NULL) {
- guint16 *value_data;
+ uint16_t *value_data;
- value_data = wmem_new(wmem_file_scope(), guint16);
+ value_data = wmem_new(wmem_file_scope(), uint16_t);
*value_data = psm;
p_add_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM, value_data);
@@ -2414,7 +2416,7 @@ dissect_le_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
uuid.data[1] = bt_uuid & 0xFF;
if (bt_uuid && p_get_proto_data(pinfo->pool, pinfo, proto_bluetooth, PROTO_DATA_BLUETOOTH_SERVICE_UUID) == NULL) {
- gchar *value_data;
+ char *value_data;
value_data = wmem_strdup(wmem_file_scope(), print_numeric_bluetooth_uuid(pinfo->pool, &uuid));
@@ -2437,11 +2439,11 @@ dissect_le_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 2;
length = length - 2;
}
- pinfo->fragmented = TRUE;
+ pinfo->fragmented = true;
frag_btl2cap_le_sdu = fragment_add_seq_next(&btl2cap_le_sdu_reassembly_table,
tvb, offset,
pinfo,
- cid, /* guint32 ID for fragments belonging together */
+ cid, /* uint32_t ID for fragments belonging together */
NULL, /* data* */
length, /* Fragment length */
btl2cap_frame_data->more_fragments); /* More fragments */
@@ -2455,8 +2457,8 @@ dissect_le_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (new_tvb) {
if (psm) {
- if (!dissector_try_uint_new(l2cap_cid_dissector_table, (guint32)cid, new_tvb, pinfo, tree, TRUE, l2cap_data)) {
- if (!dissector_try_uint_new(l2cap_psm_dissector_table, (guint32)psm, new_tvb, pinfo, tree, TRUE, l2cap_data)) {
+ if (!dissector_try_uint_new(l2cap_cid_dissector_table, (uint32_t)cid, new_tvb, pinfo, tree, true, l2cap_data)) {
+ if (!dissector_try_uint_new(l2cap_psm_dissector_table, (uint32_t)psm, new_tvb, pinfo, tree, true, l2cap_data)) {
/* not a known fixed PSM, try to find a registered service to a dynamic PSM */
if (!dissector_try_string(bluetooth_uuid_table, print_numeric_bluetooth_uuid(pinfo->pool, &uuid), new_tvb, pinfo, tree, l2cap_data)) {
/* unknown protocol. declare as data */
@@ -2466,7 +2468,7 @@ dissect_le_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
} else {
/* call next dissector */
- if (!dissector_try_uint_new(l2cap_cid_dissector_table, (guint32)cid, new_tvb, pinfo, tree, TRUE, l2cap_data)) {
+ if (!dissector_try_uint_new(l2cap_cid_dissector_table, (uint32_t)cid, new_tvb, pinfo, tree, true, l2cap_data)) {
proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, tvb, offset, length, ENC_NA);
}
}
@@ -2476,21 +2478,21 @@ dissect_le_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_set_str(pinfo->cinfo, COL_INFO, "L2CAP LE Fragment");
proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, tvb, offset, length, ENC_NA);
- return tvb_captured_length(tvb);;
+ return tvb_captured_length(tvb);
}
static int
dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- proto_tree *btl2cap_tree, psm_data_t *psm_data, guint16 length,
- gint offset, config_data_t *config_data, btl2cap_data_t *l2cap_data)
+ proto_tree *btl2cap_tree, psm_data_t *psm_data, uint16_t length,
+ int offset, config_data_t *config_data, btl2cap_data_t *l2cap_data)
{
tvbuff_t *next_tvb = NULL;
- guint16 control, segment;
- guint16 sdulen;
+ uint16_t control, segment;
+ uint16_t sdulen;
proto_item* ti_control;
proto_tree* ti_control_subtree;
sdu_reassembly_t *mfp = NULL;
- guint16 psm = (psm_data ? psm_data->psm : 0);
+ uint16_t psm = (psm_data ? psm_data->psm : 0);
control = tvb_get_letohs(tvb, offset);
segment = (control & 0xC000) >> 14;
@@ -2552,7 +2554,7 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
mfp->first_frame = pinfo->num;
mfp->last_frame = 0;
mfp->tot_len = sdulen;
- mfp->reassembled = (guint8 *) wmem_alloc(wmem_file_scope(), sdulen);
+ mfp->reassembled = (uint8_t *) wmem_alloc(wmem_file_scope(), sdulen);
tvb_memcpy(tvb, mfp->reassembled, offset, sdulen);
mfp->cur_off = sdulen;
wmem_tree_insert32(config_data->start_fragments, pinfo->num, mfp);
@@ -2592,7 +2594,7 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
if (segment == 0x02 && mfp != NULL && mfp->last_frame == pinfo->num) {
- next_tvb = tvb_new_child_real_data(tvb, (guint8 *)mfp->reassembled, mfp->tot_len, mfp->tot_len);
+ next_tvb = tvb_new_child_real_data(tvb, (uint8_t *)mfp->reassembled, mfp->tot_len, mfp->tot_len);
add_new_data_source(pinfo, next_tvb, "Reassembled L2CAP");
}
/*pass up to higher layer if we have a complete packet*/
@@ -2602,13 +2604,13 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (next_tvb) {
if (psm) {
proto_item *psm_item;
- guint16 bt_uuid;
+ uint16_t bt_uuid;
bluetooth_uuid_t uuid;
if (p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM ) == NULL) {
- guint16 *value_data;
+ uint16_t *value_data;
- value_data = wmem_new(wmem_file_scope(), guint16);
+ value_data = wmem_new(wmem_file_scope(), uint16_t);
*value_data = psm;
p_add_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM, value_data);
@@ -2622,7 +2624,7 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
uuid.data[1] = bt_uuid & 0xFF;
if (bt_uuid && p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BLUETOOTH_SERVICE_UUID) == NULL) {
- gchar *value_data;
+ char *value_data;
value_data = wmem_strdup(wmem_file_scope(), print_numeric_bluetooth_uuid(pinfo->pool, &uuid));
@@ -2640,7 +2642,7 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item_set_generated(psm_item);
/* call next dissector */
- if (!dissector_try_uint_new(l2cap_psm_dissector_table, (guint32) psm, next_tvb, pinfo, tree, TRUE, l2cap_data)) {
+ if (!dissector_try_uint_new(l2cap_psm_dissector_table, (uint32_t) psm, next_tvb, pinfo, tree, true, l2cap_data)) {
/* not a known fixed PSM, try to find a registered service to a dynamic PSM */
if (!dissector_try_string(bluetooth_uuid_table, print_numeric_bluetooth_uuid(pinfo->pool, &uuid), next_tvb, pinfo, tree, l2cap_data)) {
/* unknown protocol. declare as data */
@@ -2660,11 +2662,11 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
static int
dissect_s_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, proto_tree *btl2cap_tree,
- guint16 psm _U_, guint16 length _U_, int offset, config_data_t *config_data _U_)
+ uint16_t psm _U_, uint16_t length _U_, int offset, config_data_t *config_data _U_)
{
proto_item *ti_control;
proto_tree *ti_control_subtree;
- guint16 control;
+ uint16_t control;
control = tvb_get_letohs(tvb, offset);
@@ -2699,27 +2701,27 @@ dissect_s_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, proto_t
return offset;
}
-static gint
+static int
dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- gint offset = 0;
+ int offset = 0;
proto_item *ti;
proto_tree *btl2cap_tree;
proto_item *length_item;
- guint16 length;
- guint16 cid;
- guint16 psm;
- guint16 control;
+ uint16_t length;
+ uint16_t cid;
+ uint16_t psm;
+ uint16_t control;
tvbuff_t *next_tvb = NULL;
psm_data_t *psm_data;
bthci_acl_data_t *acl_data;
btl2cap_data_t *l2cap_data;
- gboolean dir_in_col = TRUE;
+ bool dir_in_col = true;
acl_data = (bthci_acl_data_t *) data;
if ((acl_data) && (acl_data->is_btle)) {
- dir_in_col = FALSE;
+ dir_in_col = false;
}
ti = proto_tree_add_item(tree, proto_btl2cap, tvb, offset, -1, ENC_NA);
btl2cap_tree = proto_item_add_subtree(ti, ett_btl2cap);
@@ -2755,9 +2757,9 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
cid = tvb_get_letohs(tvb, offset);
proto_tree_add_item(btl2cap_tree, hf_btl2cap_cid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
if (p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_CID ) == NULL) {
- guint16 *value_data;
+ uint16_t *value_data;
- value_data = wmem_new(wmem_file_scope(), guint16);
+ value_data = wmem_new(wmem_file_scope(), uint16_t);
*value_data = cid;
p_add_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_CID, value_data);
@@ -2791,7 +2793,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
l2cap_data->cid = cid;
l2cap_data->local_cid = BTL2CAP_UNKNOWN_CID;
l2cap_data->remote_cid = BTL2CAP_UNKNOWN_CID;
- l2cap_data->is_local_psm = FALSE;
+ l2cap_data->is_local_psm = false;
l2cap_data->psm = 0;
if (cid == BTL2CAP_FIXED_CID_SIGNAL || cid == BTL2CAP_FIXED_CID_LE_SIGNAL) {
@@ -2800,10 +2802,10 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_item *ti_command;
proto_tree *btl2cap_cmd_tree;
- guint8 cmd_code;
- guint8 cmd_ident;
- guint16 cmd_length;
- const gchar *cmd_str;
+ uint8_t cmd_code;
+ uint8_t cmd_ident;
+ uint16_t cmd_length;
+ const char *cmd_str;
ti_command = proto_tree_add_none_format(btl2cap_tree,
hf_btl2cap_command, tvb,
@@ -2811,11 +2813,11 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
"Command: ");
btl2cap_cmd_tree = proto_item_add_subtree(ti_command, ett_btl2cap_cmd);
- cmd_code = tvb_get_guint8(tvb, offset);
+ cmd_code = tvb_get_uint8(tvb, offset);
proto_tree_add_item(btl2cap_cmd_tree, hf_btl2cap_cmd_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
- cmd_ident = tvb_get_guint8(tvb, offset);
+ cmd_ident = tvb_get_uint8(tvb, offset);
proto_tree_add_item(btl2cap_cmd_tree, hf_btl2cap_cmd_ident, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
@@ -2834,7 +2836,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
case 0x02: /* Connection Request */
- offset = dissect_connrequest(tvb, offset, pinfo, btl2cap_tree, btl2cap_cmd_tree, FALSE, acl_data, l2cap_data);
+ offset = dissect_connrequest(tvb, offset, pinfo, btl2cap_tree, btl2cap_cmd_tree, false, acl_data, l2cap_data);
break;
case 0x03: /* Connection Response */
@@ -2850,11 +2852,11 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
case 0x06: /* Disconnect Request */
- offset = dissect_disconnrequestresponse(tvb, offset, pinfo, btl2cap_tree, btl2cap_cmd_tree, acl_data, l2cap_data, TRUE);
+ offset = dissect_disconnrequestresponse(tvb, offset, pinfo, btl2cap_tree, btl2cap_cmd_tree, acl_data, l2cap_data, true);
break;
case 0x07: /* Disconnect Response */
- offset = dissect_disconnrequestresponse(tvb, offset, pinfo, btl2cap_tree, btl2cap_cmd_tree, acl_data, l2cap_data, FALSE);
+ offset = dissect_disconnrequestresponse(tvb, offset, pinfo, btl2cap_tree, btl2cap_cmd_tree, acl_data, l2cap_data, false);
break;
case 0x08: /* Echo Request */
@@ -2876,7 +2878,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
case 0x0c: /* Create Channel Request */
- offset = dissect_connrequest(tvb, offset, pinfo, btl2cap_tree, btl2cap_cmd_tree, TRUE, acl_data, l2cap_data);
+ offset = dissect_connrequest(tvb, offset, pinfo, btl2cap_tree, btl2cap_cmd_tree, true, acl_data, l2cap_data);
break;
case 0x0d: /* Create Channel Response */
@@ -2962,9 +2964,9 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
l2cap_data->disconnect_in_frame = &bluetooth_max_disconnect_in_frame;
if (p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM ) == NULL) {
- guint16 *value_data;
+ uint16_t *value_data;
- value_data = wmem_new(wmem_file_scope(), guint16);
+ value_data = wmem_new(wmem_file_scope(), uint16_t);
*value_data = psm;
p_add_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM, value_data);
@@ -2976,12 +2978,12 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
/* call next dissector */
- if (!dissector_try_uint_new(l2cap_psm_dissector_table, (guint32) psm, next_tvb, pinfo, tree, TRUE, l2cap_data)) {
+ if (!dissector_try_uint_new(l2cap_psm_dissector_table, (uint32_t) psm, next_tvb, pinfo, tree, true, l2cap_data)) {
/* not a known fixed PSM, try to find a registered service to a dynamic PSM */
- guint16 bt_uuid;
+ uint16_t bt_uuid;
bluetooth_uuid_t uuid;
- bt_uuid = get_service_uuid(pinfo, l2cap_data, psm, (pinfo->p2p_dir == P2P_DIR_RECV) ? TRUE : FALSE );
+ bt_uuid = get_service_uuid(pinfo, l2cap_data, psm, (pinfo->p2p_dir == P2P_DIR_RECV) ? true : false );
uuid.size = 2;
uuid.bt_uuid = bt_uuid;
@@ -2989,7 +2991,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
uuid.data[1] = bt_uuid & 0xFF;
if (bt_uuid && p_get_proto_data(pinfo->pool, pinfo, proto_bluetooth, PROTO_DATA_BLUETOOTH_SERVICE_UUID ) == NULL) {
- gchar* value_data;
+ char* value_data;
value_data = wmem_strdup(wmem_file_scope(), print_numeric_bluetooth_uuid(pinfo->pool, &uuid));
@@ -3034,8 +3036,8 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
next_tvb = tvb_new_subset_length_caplen(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
}
/* call next dissector */
- if (next_tvb && !dissector_try_uint_new(l2cap_cid_dissector_table, (guint32) cid,
- next_tvb, pinfo, tree, TRUE, l2cap_data)) {
+ if (next_tvb && !dissector_try_uint_new(l2cap_cid_dissector_table, (uint32_t) cid,
+ next_tvb, pinfo, tree, true, l2cap_data)) {
/* unknown protocol. declare as data */
proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, tvb, offset, length, ENC_NA);
}
@@ -3043,15 +3045,15 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
else /* if (cid > BTL2CAP_FIXED_CID_LAST) */ { /* Connection oriented channel */
wmem_tree_key_t key[6];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
- guint32 key_cid;
+ uint32_t k_interface_id;
+ uint32_t k_adapter_id;
+ uint32_t k_chandle;
+ uint32_t k_cid;
+ uint32_t k_frame_number;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t chandle;
+ uint32_t key_cid;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID)
interface_id = pinfo->rec->rec_header.packet_header.interface_id;
@@ -3091,7 +3093,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
config_data_t *config_data;
proto_item *sub_item;
- guint32 bt_uuid;
+ uint32_t bt_uuid;
psm = psm_data->psm;
l2cap_data->local_cid = psm_data->local_cid;
@@ -3105,12 +3107,12 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
else
config_data = &(psm_data->out);
- if (psm_data->connect_in_frame > 0 && psm_data->connect_in_frame < G_MAXUINT32) {
+ if (psm_data->connect_in_frame > 0 && psm_data->connect_in_frame < UINT32_MAX) {
sub_item = proto_tree_add_uint(btl2cap_tree, hf_btl2cap_connect_in_frame, tvb, 0, 0, psm_data->connect_in_frame);
proto_item_set_generated(sub_item);
}
- if (psm_data->disconnect_in_frame > 0 && psm_data->disconnect_in_frame < G_MAXUINT32) {
+ if (psm_data->disconnect_in_frame > 0 && psm_data->disconnect_in_frame < UINT32_MAX) {
sub_item = proto_tree_add_uint(btl2cap_tree, hf_btl2cap_disconnect_in_frame, tvb, 0, 0, psm_data->disconnect_in_frame);
proto_item_set_generated(sub_item);
}
@@ -3124,7 +3126,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (config_data->mode == L2CAP_BASIC_MODE) {
offset = dissect_b_frame(tvb, pinfo, tree, btl2cap_tree, cid, psm, psm_data->local_service, length, offset, l2cap_data);
} else if (config_data->mode == L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE) {
- gboolean is_retransmit = FALSE;
+ bool is_retransmit = false;
if (acl_data) {
is_retransmit = acl_data->is_btle_retransmit;
}
@@ -3139,7 +3141,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
} else {
psm = 0;
- offset = dissect_b_frame(tvb, pinfo, tree, btl2cap_tree, cid, psm, FALSE, length, offset, l2cap_data);
+ offset = dissect_b_frame(tvb, pinfo, tree, btl2cap_tree, cid, psm, false, length, offset, l2cap_data);
}
}
@@ -3573,9 +3575,9 @@ proto_register_btl2cap(void)
FT_UINT16, BASE_DEC, NULL, 0,
NULL, HFILL }
},
- { &hf_btl2cap_slave_latency,
- { "Slave Latency", "btl2cap.slave_latency",
- FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_ll_connection_event, 0,
+ { &hf_btl2cap_peripheral_latency,
+ { "Peripheral Latency", "btl2cap.peripheral_latency",
+ FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_ll_connection_event), 0,
NULL, HFILL }
},
{ &hf_btl2cap_timeout_multiplier,
@@ -3687,7 +3689,7 @@ proto_register_btl2cap(void)
};
/* Setup protocol subtree array */
- static gint *ett[] = {
+ static int *ett[] = {
&ett_btl2cap,
&ett_btl2cap_cmd,
&ett_btl2cap_option,