MSWSP: add two more Property Sets
[wireshark-wip.git] / epan / dissectors / packet-bluetooth-hci.h
bloba7671fedd00c1ce7755a34d90f8ac21520335905
1 /* packet-bluetooth-hci.h
3 * $Id$
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #ifndef __PACKET_BLUETOOTH_HCI_H__
25 #define __PACKET_BLUETOOTH_HCI_H__
27 #include <epan/wmem/wmem.h>
29 #define HCI_H4_TYPE_CMD 0x01
30 #define HCI_H4_TYPE_ACL 0x02
31 #define HCI_H4_TYPE_SCO 0x03
32 #define HCI_H4_TYPE_EVT 0x04
34 #define HCI_OGF_LINK_CONTROL 0x01
35 #define HCI_OGF_LINK_POLICY 0x02
36 #define HCI_OGF_HOST_CONTROLLER 0x03
37 #define HCI_OGF_INFORMATIONAL 0x04
38 #define HCI_OGF_STATUS 0x05
39 #define HCI_OGF_TESTING 0x06
40 #define HCI_OGF_LOW_ENERGY 0x08
41 #define HCI_OGF_LOGO_TESTING 0x3e
42 #define HCI_OGF_VENDOR_SPECIFIC 0x3f
44 #define DID_VENDOR_ID_SOURCE_BLUETOOTH_SIG 1
45 #define DID_VENDOR_ID_SOURCE_USB_FORUM 2
47 extern value_string_ext bthci_cmd_opcode_vals_ext;
48 extern value_string_ext bthci_ogf_vals_ext;
49 extern value_string_ext bthci_cmd_ocf_link_control_vals_ext;
50 extern value_string_ext bthci_cmd_ocf_link_policy_vals_ext;
51 extern value_string_ext bthci_cmd_ocf_host_controller_and_baseband_vals_ext;
52 extern value_string_ext bthci_cmd_ocf_informational_vals_ext;
53 extern value_string_ext bthci_cmd_ocf_status_vals_ext;
54 extern value_string_ext bthci_cmd_ocf_testing_vals_ext;
55 extern value_string_ext bthci_cmd_ocf_low_energy_vals_ext;
57 extern value_string_ext bthci_cmd_input_coding_vals_ext;
58 extern value_string_ext bthci_cmd_input_data_format_vals_ext;
59 extern value_string_ext bthci_cmd_input_sample_size_vals_ext;
60 extern value_string_ext bthci_cmd_air_coding_format_vals_ext;
61 extern value_string_ext bthci_cmd_status_vals_ext;
62 extern value_string_ext bthci_cmd_service_class_type_vals_ext;
63 extern value_string_ext bthci_cmd_eir_data_type_vals_ext;
64 extern value_string_ext bthci_cmd_auth_req_vals_ext;
65 extern value_string_ext bthci_cmd_appearance_vals_ext;
66 extern value_string_ext bthci_evt_comp_id_ext;
68 extern value_string_ext bthci_cmd_cod_major_device_class_vals_ext;
69 extern value_string_ext bthci_cmd_cod_minor_device_class_computer_vals_ext;
70 extern value_string_ext bthci_cmd_cod_minor_device_class_phone_vals_ext;
71 extern value_string_ext bthci_cmd_cod_minor_device_class_lan_net_load_factor_vals_ext;
72 extern value_string_ext bthci_cmd_cod_minor_device_class_lan_net_type_vals_ext;
73 extern value_string_ext bthci_cmd_cod_minor_device_class_audio_video_vals_ext;
74 extern value_string_ext bthci_cmd_cod_minor_device_class_peripheral_class_vals_ext;
75 extern value_string_ext bthci_cmd_cod_minor_device_class_peripheral_type_vals_ext;
76 extern value_string_ext bthci_cmd_cod_minor_device_class_imaging_type_vals_ext;
77 extern value_string_ext bthci_cmd_cod_minor_device_class_wearable_vals_ext;
78 extern value_string_ext bthci_cmd_cod_minor_device_class_toy_vals_ext;
79 extern value_string_ext bthci_cmd_cod_minor_device_class_health_vals_ext;
81 extern const value_string bthci_cmd_io_capability_vals[];
82 extern const value_string bthci_cmd_oob_data_present_vals[];
83 extern const value_string bthci_cmd_address_types_vals[];
84 extern const value_string bthci_cmd_scan_enable_values[];
85 extern const value_string bthci_cmd_page_scan_modes[];
86 extern const value_string bthci_cmd_page_scan_repetition_modes[];
87 extern const value_string bthci_cmd_page_scan_period_modes[];
88 extern const value_string bthci_cmd_notification_types[];
91 /* We support Bluetooth over various interfaces, interface_id and adapter_id
92 is used to decode further payload. Case: there is a host. Host has X
93 interfaces. Each interface has Y adapter. Each adapter has ACL handle or
94 L2CAP CID. ACL handle has L2CAP CID and/or L2CAP PSM. L2CAP CID or
95 L2CAP PSM has RFCOMM channel or other end-protocol like OBEX, AVRCP, HID,
96 AVDTP, BNEP etc. RFCOMM channel has end-protocol like OBEX, HFP, etc.
97 Important note: correct payload decoding should store needed data using
98 key contain interface_id, adapter_id, ..., last_channel_type (for example
99 RFCOMM channel, transaction_id, frame number etc. ) */
100 #define HCI_INTERFACE_H1 0
101 #define HCI_INTERFACE_H4 1
102 #define HCI_INTERFACE_USB 2
103 #define HCI_INTERFACE_AMP 3
105 #define HCI_ADAPTER_DEFAULT 0
107 /* chandle_to_bdaddr_table: interface_id + adapter_id + connection_handle + frame_number -> bd_addr[6] */
108 /* bdaddr_to_name_table: bd_addr[6] + frame_number -> name */
109 /* localhost_bdaddr: interface_id + adapter_id + frame_number -> bd_addr[6] */
110 /* localhost_name: interface_id + adapter_id + frame_number -> name */
111 typedef struct _hci_data_t {
112 guint32 interface_id;
113 guint32 adapter_id;
114 wmem_tree_t *chandle_to_bdaddr_table;
115 wmem_tree_t *bdaddr_to_name_table;
116 wmem_tree_t *localhost_bdaddr;
117 wmem_tree_t *localhost_name;
118 } hci_data_t;
120 typedef struct _remote_bdaddr_t {
121 guint32 interface_id;
122 guint32 adapter_id;
123 guint16 chandle;
124 guint8 bd_addr[6];
125 } remote_bdaddr_t;
127 typedef struct _device_name_t {
128 guint32 bd_addr_oui;
129 guint32 bd_addr_id;
130 gchar *name;
131 } device_name_t;
133 typedef struct _localhost_bdaddr_entry_t {
134 guint32 interface_id;
135 guint32 adapter_id;
136 guint8 bd_addr[6];
137 } localhost_bdaddr_entry_t;
139 typedef struct _localhost_name_entry_t {
140 guint32 interface_id;
141 guint32 adapter_id;
142 gchar *name;
143 } localhost_name_entry_t;
145 #endif