10#ifndef __PACKET_BLUETOOTH_H__
11#define __PACKET_BLUETOOTH_H__
14#include "packet-usb.h"
15#include "packet-ubertooth.h"
21#define PROTO_DATA_BLUETOOTH_SERVICE_UUID 0
22#define PROTO_DATA_BLUETOOTH_EIR_AD_APPLE 1
24#define BLUETOOTH_DATA_SRC 0
25#define BLUETOOTH_DATA_DST 1
27#define HCI_H4_TYPE_CMD 0x01
28#define HCI_H4_TYPE_ACL 0x02
29#define HCI_H4_TYPE_SCO 0x03
30#define HCI_H4_TYPE_EVT 0x04
31#define HCI_H4_TYPE_ISO 0x05
33#define HCI_OGF_LINK_CONTROL 0x01
34#define HCI_OGF_LINK_POLICY 0x02
35#define HCI_OGF_HOST_CONTROLLER 0x03
36#define HCI_OGF_INFORMATIONAL 0x04
37#define HCI_OGF_STATUS 0x05
38#define HCI_OGF_TESTING 0x06
39#define HCI_OGF_LOW_ENERGY 0x08
40#define HCI_OGF_LOGO_TESTING 0x3e
41#define HCI_OGF_VENDOR_SPECIFIC 0x3f
43#define HCI_VENDOR_DEFAULT 0
45#define DID_VENDOR_ID_SOURCE_BLUETOOTH_SIG 1
46#define DID_VENDOR_ID_SOURCE_USB_FORUM 2
48#define ACCESS_ADDRESS_ADVERTISING 0x8e89bed6
50extern int proto_bluetooth;
54#define STATUS_SUCCESS 0x00
56#define UUID_GATT_PRIMARY_SERVICE_DECLARATION 0x2800
57#define UUID_GATT_SECONDARY_SERVICE_DECLARATION 0x2801
58#define UUID_GATT_INCLUDE_DECLARATION 0x2802
59#define UUID_GATT_CHARACTERISTIC_DECLARATION 0x2803
77#define HCI_INTERFACE_DEFAULT 0
78#define HCI_ADAPTER_DEFAULT 0
86} bt_protocol_data_type;
97 uint32_t interface_id;
99 uint32_t *adapter_disconnect_in_frame;
111 bt_protocol_data_type previous_protocol_data_type;
117 ubertooth_data_t *ubertooth_data;
118 } previous_protocol_data;
122#define BT_LINK_TYPE_UNKNOWN 0
123#define BT_LINK_TYPE_ACL 1
124#define BT_LINK_TYPE_SCO 2
125#define BT_LINK_TYPE_LL 3
126#define BT_LINK_TYPE_ISO 4
129 uint32_t connect_in_frame;
130 uint32_t disconnect_in_frame;
135 uint32_t interface_id;
142 uint32_t bd_addr_oui;
149 uint32_t change_in_frame;
154 uint32_t change_in_frame;
159 uint32_t change_in_frame;
160} stream_connection_handle_pair_t;
167#define ROLE_UNKNOWN 0
168#define ROLE_CENTRAL 1
169#define ROLE_PERIPHERAL 2
172 uint32_t interface_id;
175} localhost_bdaddr_entry_t;
178 uint32_t interface_id;
181} localhost_name_entry_t;
184 uint32_t interface_id;
186} bluetooth_tap_data_t;
189 uint16_t manufacturer;
190 uint16_t hci_revision;
191 uint16_t lmp_subversion;
192 uint32_t change_in_frame;
202enum bluetooth_device_type {
203 BLUETOOTH_DEVICE_BD_ADDR,
204 BLUETOOTH_DEVICE_NAME,
205 BLUETOOTH_DEVICE_LOCAL_ADAPTER,
206 BLUETOOTH_DEVICE_LOCAL_VERSION,
207 BLUETOOTH_DEVICE_REMOTE_VERSION,
208 BLUETOOTH_DEVICE_RESET,
209 BLUETOOTH_DEVICE_SCAN,
210 BLUETOOTH_DEVICE_VOICE_SETTING,
211 BLUETOOTH_DEVICE_AUTHENTICATION,
212 BLUETOOTH_DEVICE_ENCRYPTION,
213 BLUETOOTH_DEVICE_CLASS_OF_DEVICE,
214 BLUETOOTH_DEVICE_SIMPLE_PAIRING_MODE,
215 BLUETOOTH_DEVICE_PAGE_TIMEOUT,
216 BLUETOOTH_DEVICE_INQUIRY_MODE,
217 BLUETOOTH_DEVICE_MTUS,
218 BLUETOOTH_DEVICE_LE_MTU
222 uint32_t interface_id;
228 enum bluetooth_device_type type;
233 uint16_t hci_revision;
235 uint16_t lmp_subversion;
236 uint16_t manufacturer;
240 uint16_t lmp_subversion;
241 uint16_t manufacturer;
244 uint16_t page_timeout;
245 uint8_t authentication;
247 uint32_t class_of_device;
248 uint16_t voice_setting;
249 uint8_t simple_pairing_mode;
250 uint8_t inquiry_mode;
254 uint16_t acl_packets;
255 uint16_t sco_packets;
260 uint16_t acl_packets;
261 uint16_t iso_packets;
264} bluetooth_device_tap_t;
266enum bluetooth_hci_summary_type {
267 BLUETOOTH_HCI_SUMMARY_OPCODE,
268 BLUETOOTH_HCI_SUMMARY_EVENT_OPCODE,
269 BLUETOOTH_HCI_SUMMARY_EVENT,
270 BLUETOOTH_HCI_SUMMARY_SUBEVENT,
271 BLUETOOTH_HCI_SUMMARY_VENDOR_OPCODE,
272 BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT_OPCODE,
273 BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT,
274 BLUETOOTH_HCI_SUMMARY_STATUS,
275 BLUETOOTH_HCI_SUMMARY_STATUS_PENDING,
276 BLUETOOTH_HCI_SUMMARY_REASON,
277 BLUETOOTH_HCI_SUMMARY_HARDWARE_ERROR
281 uint32_t interface_id;
290 uint8_t hardware_error;
293 enum bluetooth_hci_summary_type type;
294} bluetooth_hci_summary_tap_t;
297 uint32_t interface_id;
301} bluetooth_eir_ad_data_t;
305 uint32_t apple_os_flag;
306 uint32_t ios_13_flag;
307} bluetooth_eir_ad_apple_data_t;
309extern int bluetooth_device_tap;
310extern int bluetooth_hci_summary_tap;
314extern dissector_table_t bluetooth_uuid_table;
316WS_DLL_PUBLIC
void bluetooth_add_custom_uuid(
const char *uuid,
const char *label,
bool long_attr);
317WS_DLL_PUBLIC
bool bluetooth_get_custom_uuid_long_attr(
const bluetooth_uuid_t *uuid);
318WS_DLL_PUBLIC
const char* bluetooth_get_custom_uuid_description(
const bluetooth_uuid_t *uuid);
320WS_DLL_PUBLIC value_string_ext bluetooth_uuid_vals_ext;
321WS_DLL_PUBLIC value_string_ext bluetooth_company_id_vals_ext;
326 const char *short_name;
328} btatt_handle_strings_t;
330WS_DLL_PUBLIC
const btatt_handle_strings_t btatt_handle_strings[];
332extern uint32_t bluetooth_max_disconnect_in_frame;
334extern int dissect_bd_addr(
int hf_bd_addr,
packet_info *pinfo, proto_tree *tree,
335 tvbuff_t *tvb,
int offset,
bool is_local_bd_addr,
336 uint32_t interface_id, uint32_t adapter_id, uint8_t *bdaddr);
338extern void bluetooth_unit_0p625_ms(
char *buf, uint32_t value);
339extern void bluetooth_unit_1p25_ms(
char *buf, uint32_t value);
340extern void bluetooth_unit_0p01_sec(
char *buf, uint32_t value);
341extern void bluetooth_unit_0p125_ms(
char *buf, uint32_t value);
343extern bluetooth_uuid_t get_bluetooth_uuid(tvbuff_t *tvb,
int offset,
int size);
344extern bluetooth_uuid_t get_bluetooth_uuid_be(tvbuff_t *tvb,
int offset,
int size);
345WS_DLL_PUBLIC
const char *try_print_bluetooth_uuid(
const bluetooth_uuid_t *uuid);
346WS_DLL_PUBLIC
const char *print_bluetooth_uuid(
const bluetooth_uuid_t *uuid);
347WS_DLL_PUBLIC
const char *print_numeric_bluetooth_uuid(
wmem_allocator_t *pool,
const bluetooth_uuid_t *uuid);
349WS_DLL_PUBLIC
const value_string bluetooth_procedure_count_special[];
350WS_DLL_PUBLIC
const value_string bluetooth_not_supported_0x00_special[];
351WS_DLL_PUBLIC
const value_string bluetooth_not_used_0xff_special[];
354extern void save_local_device_name_from_eir_ad(tvbuff_t *tvb,
int offset,
355 packet_info *pinfo, uint8_t size, bluetooth_data_t *bluetooth_data);
357WS_DLL_PUBLIC bluetooth_data_t *
358dissect_bluetooth_common(tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree);
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
struct _wmem_tree_t wmem_tree_t
Opaque type representing a red-black tree in the wmem system.
Definition wmem_tree.h:49
struct _wmem_allocator_t wmem_allocator_t
Definition wmem_core.h:44
Definition packet-bluetooth.h:96
Definition packet-bluetooth.h:221
Definition packet-bluetooth.h:304
Definition packet-bluetooth.h:296
Definition packet-bluetooth.h:280
Definition packet-bluetooth.h:183
Definition packet-bluetooth.h:323
Definition packet-bluetooth.h:128
Definition packet-bluetooth.h:152
Definition packet-bluetooth.h:162
Definition packet-bluetooth.h:141
Definition packet-bluetooth.h:147
Definition packet-bluetooth.h:188
Definition packet-bluetooth.h:171
Definition packet-bluetooth.h:177
Definition packet-bluetooth.h:134
Definition packet-bluetooth.h:157
Definition packet-bluetooth.h:196
Pseudo-header for Bluetooth HCI capture files carrying direction and channel metadata.
Definition wtap.h:1185
Pseudo-header for Linux Bluetooth Monitor (WTAP_ENCAP_BLUETOOTH_LINUX_MONITOR) capture files.
Definition wtap.h:1199
struct _value_string value_string
Mapping between a 32-bit integer value and its string representation.