diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:33 +0000 |
commit | 9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9 (patch) | |
tree | 2784370cda9bbf2da9114d70f05399c0b229d28c /epan/dissectors/packet-hci_mon.c | |
parent | Adding debian version 4.2.6-1. (diff) | |
download | wireshark-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-hci_mon.c')
-rw-r--r-- | epan/dissectors/packet-hci_mon.c | 105 |
1 files changed, 59 insertions, 46 deletions
diff --git a/epan/dissectors/packet-hci_mon.c b/epan/dissectors/packet-hci_mon.c index 1f5d2394..969c8b99 100644 --- a/epan/dissectors/packet-hci_mon.c +++ b/epan/dissectors/packet-hci_mon.c @@ -19,42 +19,43 @@ #include "packet-bluetooth.h" -static int proto_hci_mon = -1; - -static int hf_adapter_id = -1; -static int hf_opcode = -1; -static int hf_type = -1; -static int hf_bus = -1; -static int hf_bd_addr = -1; -static int hf_name = -1; -static int hf_manufacturer = -1; -static int hf_system_note = -1; -static int hf_priority = -1; -static int hf_ident_length = -1; -static int hf_ident = -1; -static int hf_message = -1; -static int hf_cookie = -1; -static int hf_format = -1; -static int hf_version = -1; -static int hf_revision = -1; -static int hf_flags = -1; -static int hf_flags_trusted_socket = -1; -static int hf_command_length = -1; -static int hf_command = -1; -static int hf_event = -1; - -static gint ett_hci_mon = -1; -static gint ett_flags = -1; - -static expert_field ei_unknown_data = EI_INIT; - -static wmem_tree_t *adapter_to_disconnect_in_frame = NULL; +static int proto_hci_mon; + +static int hf_adapter_id; +static int hf_opcode; +static int hf_type; +static int hf_bus; +static int hf_bd_addr; +static int hf_name; +static int hf_manufacturer; +static int hf_system_note; +static int hf_priority; +static int hf_ident_length; +static int hf_ident; +static int hf_message; +static int hf_cookie; +static int hf_format; +static int hf_version; +static int hf_revision; +static int hf_flags; +static int hf_flags_trusted_socket; +static int hf_command_length; +static int hf_command; +static int hf_event; + +static int ett_hci_mon; +static int ett_flags; + +static expert_field ei_unknown_data; + +static wmem_tree_t *adapter_to_disconnect_in_frame; static dissector_handle_t hci_mon_handle; static dissector_handle_t bthci_cmd_handle; static dissector_handle_t bthci_evt_handle; static dissector_handle_t bthci_acl_handle; static dissector_handle_t bthci_sco_handle; +static dissector_handle_t bthci_iso_handle; #define OPCODE_NEW_INDEX 0 #define OPCODE_DELETE_INDEX 1 @@ -74,6 +75,8 @@ static dissector_handle_t bthci_sco_handle; #define OPCODE_CONTROL_CLOSE 15 #define OPCODE_CONTROL_COMMAND 16 #define OPCODE_CONTROL_EVENT 17 +#define OPCODE_ISO_TX_PACKET 18 +#define OPCODE_ISO_RX_PACKET 19 static const value_string opcode_vals[] = { { OPCODE_NEW_INDEX, "New Index" }, @@ -94,6 +97,8 @@ static const value_string opcode_vals[] = { { OPCODE_CONTROL_CLOSE, "Control Close" }, { OPCODE_CONTROL_COMMAND, "Control Command" }, { OPCODE_CONTROL_EVENT, "Control Event" }, + { OPCODE_ISO_TX_PACKET, "ISO Tx Packet" }, + { OPCODE_ISO_RX_PACKET, "ISO Rx Packet" }, { 0, NULL } }; value_string_ext(hci_mon_opcode_vals_ext) = VALUE_STRING_EXT_INIT(opcode_vals); @@ -227,25 +232,25 @@ static value_string_ext(event_vals_ext) = VALUE_STRING_EXT_INIT(event_vals); void proto_register_hci_mon(void); void proto_reg_handoff_hci_mon(void); -static gint +static int dissect_hci_mon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_tree *hci_mon_item; proto_item *hci_mon_tree; proto_item *sub_item; - gint offset = 0; - guint16 opcode; - guint16 adapter_id; + int offset = 0; + uint16_t opcode; + uint16_t adapter_id; bluetooth_data_t *bluetooth_data; tvbuff_t *next_tvb; - guint32 *adapter_disconnect_in_frame; + uint32_t *adapter_disconnect_in_frame; wmem_tree_t *subtree; wmem_tree_key_t key[4]; - guint32 k_interface_id; - guint32 k_adapter_id; - guint32 k_frame_number; - guint32 ident_length; - guint32 command_length; + uint32_t k_interface_id; + uint32_t k_adapter_id; + uint32_t k_frame_number; + uint32_t ident_length; + uint32_t command_length; static int * const flags_fields[] = { &hf_flags_trusted_socket, NULL @@ -314,14 +319,14 @@ dissect_hci_mon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) key[1].key = &k_adapter_id; if (!pinfo->fd->visited && opcode == 0x01) { /* Delete Index */ - guint32 *disconnect_in_frame; + uint32_t *disconnect_in_frame; key[2].length = 1; key[2].key = &k_frame_number; key[3].length = 0; key[3].key = NULL; - disconnect_in_frame = wmem_new(wmem_file_scope(), guint32); + disconnect_in_frame = wmem_new(wmem_file_scope(), uint32_t); if (disconnect_in_frame) { *disconnect_in_frame = pinfo->num; @@ -334,7 +339,7 @@ dissect_hci_mon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) key[2].key = NULL; subtree = (wmem_tree_t *) wmem_tree_lookup32_array(adapter_to_disconnect_in_frame, key); - adapter_disconnect_in_frame = (subtree) ? (guint32 *) wmem_tree_lookup32_le(subtree, k_frame_number) : NULL; + adapter_disconnect_in_frame = (subtree) ? (uint32_t *) wmem_tree_lookup32_le(subtree, k_frame_number) : NULL; if (adapter_disconnect_in_frame) { bluetooth_data->adapter_disconnect_in_frame = adapter_disconnect_in_frame; } else { @@ -353,7 +358,7 @@ dissect_hci_mon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) proto_tree_add_item(hci_mon_tree, hf_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - offset = dissect_bd_addr(hf_bd_addr, pinfo, hci_mon_tree, tvb, offset, TRUE, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL); + offset = dissect_bd_addr(hf_bd_addr, pinfo, hci_mon_tree, tvb, offset, true, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL); proto_tree_add_item(hci_mon_tree, hf_name, tvb, offset, 8, ENC_NA | ENC_ASCII); offset += 8; @@ -397,7 +402,7 @@ dissect_hci_mon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) break; case OPCODE_INDEX_INFO: - offset = dissect_bd_addr(hf_bd_addr, pinfo, hci_mon_tree, tvb, offset, TRUE, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL); + offset = dissect_bd_addr(hf_bd_addr, pinfo, hci_mon_tree, tvb, offset, true, bluetooth_data->interface_id, bluetooth_data->adapter_id, NULL); proto_tree_add_item(hci_mon_tree, hf_manufacturer, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -493,6 +498,13 @@ dissect_hci_mon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) /* XXX - dissect the payload of the event */ break; + + case OPCODE_ISO_TX_PACKET: + case OPCODE_ISO_RX_PACKET: + call_dissector_with_data(bthci_iso_handle, next_tvb, pinfo, tree, bluetooth_data); + offset = tvb_reported_length(tvb); + + break; } if (tvb_reported_length_remaining(tvb, offset) > 0) { @@ -626,7 +638,7 @@ proto_register_hci_mon(void) { &ei_unknown_data, { "hci_mon.unknown_data", PI_PROTOCOL, PI_WARN, "Unknown data", EXPFILL }}, }; - static gint *ett[] = { + static int *ett[] = { &ett_hci_mon, &ett_flags }; @@ -654,6 +666,7 @@ proto_reg_handoff_hci_mon(void) bthci_evt_handle = find_dissector_add_dependency("bthci_evt", proto_hci_mon); bthci_acl_handle = find_dissector_add_dependency("bthci_acl", proto_hci_mon); bthci_sco_handle = find_dissector_add_dependency("bthci_sco", proto_hci_mon); + bthci_iso_handle = find_dissector_add_dependency("bthci_iso_data", proto_hci_mon); dissector_add_uint("bluetooth.encap", WTAP_ENCAP_BLUETOOTH_LINUX_MONITOR, hci_mon_handle); } |