File: | builds/wireshark/wireshark/epan/dissectors/packet-btle.c |
Warning: | line 4677, column 17 Value stored to 'btle_frame_info' is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* packet-btle.c |
2 | * Routines for Bluetooth Low Energy Link Layer dissection |
3 | * https://www.bluetooth.org/Technical/Specifications/adopted.htm |
4 | * |
5 | * Copyright 2013, Mike Ryan, mikeryan /at/ isecpartners /dot/ com |
6 | * Copyright 2013, Michal Labedzki for Tieto Corporation |
7 | * Copyright 2014, Christopher D. Kilgour, techie at whiterocker dot com |
8 | * Copyright 2017, Stig Bjorlykke for Nordic Semiconductor |
9 | * Copyright 2021, Thomas Sailer |
10 | * |
11 | * Wireshark - Network traffic analyzer |
12 | * By Gerald Combs <[email protected]> |
13 | * Copyright 1998 Gerald Combs |
14 | * |
15 | * SPDX-License-Identifier: GPL-2.0-or-later |
16 | */ |
17 | |
18 | #include "config.h" |
19 | |
20 | #include <epan/packet.h> |
21 | #include <epan/prefs.h> |
22 | #include <epan/expert.h> |
23 | #include <epan/proto_data.h> |
24 | #include <epan/reassemble.h> |
25 | #include <epan/tfs.h> |
26 | #include <epan/unit_strings.h> |
27 | |
28 | #include <wiretap/wtap.h> |
29 | |
30 | #include "packet-btle.h" |
31 | #include "packet-bthci_cmd.h" |
32 | #include "packet-bthci_acl.h" |
33 | |
34 | static int proto_btle; |
35 | static int proto_btle_rf; |
36 | static int proto_nordic_ble; |
37 | |
38 | static int hf_access_address; |
39 | static int hf_coding_indicator; |
40 | static int hf_crc; |
41 | static int hf_central_bd_addr; |
42 | static int hf_peripheral_bd_addr; |
43 | static int hf_length; |
44 | static int hf_advertising_header; |
45 | static int hf_advertising_header_pdu_type; |
46 | static int hf_advertising_header_ch_sel; |
47 | static int hf_advertising_header_rfu_1; |
48 | static int hf_advertising_header_rfu_2; |
49 | static int hf_advertising_header_rfu_3; |
50 | static int hf_advertising_header_rfu_4; |
51 | static int hf_advertising_header_randomized_tx; |
52 | static int hf_advertising_header_randomized_rx; |
53 | static int hf_advertising_header_length; |
54 | static int hf_advertising_address; |
55 | static int hf_initiator_addresss; |
56 | static int hf_target_addresss; |
57 | static int hf_scanning_address; |
58 | static int hf_scan_response_data; |
59 | static int hf_link_layer_data; |
60 | static int hf_link_layer_data_access_address; |
61 | static int hf_link_layer_data_crc_init; |
62 | static int hf_link_layer_data_window_size; |
63 | static int hf_link_layer_data_window_offset; |
64 | static int hf_link_layer_data_interval; |
65 | static int hf_link_layer_data_latency; |
66 | static int hf_link_layer_data_timeout; |
67 | static int hf_link_layer_data_channel_map; |
68 | static int hf_link_layer_data_hop; |
69 | static int hf_link_layer_data_sleep_clock_accuracy; |
70 | static int hf_extended_advertising_header; |
71 | static int hf_extended_advertising_header_length; |
72 | static int hf_extended_advertising_mode; |
73 | static int hf_extended_advertising_flags; |
74 | static int hf_extended_advertising_flags_adva; |
75 | static int hf_extended_advertising_flags_targeta; |
76 | static int hf_extended_advertising_flags_cte_info; |
77 | static int hf_extended_advertising_flags_advdatainfo; |
78 | static int hf_extended_advertising_flags_aux_ptr; |
79 | static int hf_extended_advertising_flags_sync_info; |
80 | static int hf_extended_advertising_flags_tx_power; |
81 | static int hf_extended_advertising_flags_reserved; |
82 | static int hf_extended_advertising_cte_info; |
83 | static int hf_extended_advertising_cte_info_time; |
84 | static int hf_extended_advertising_cte_info_rfu; |
85 | static int hf_extended_advertising_cte_info_type; |
86 | static int hf_extended_advertising_data_info; |
87 | static int hf_extended_advertising_data_info_did; |
88 | static int hf_extended_advertising_data_info_sid; |
89 | static int hf_extended_advertising_aux_ptr; |
90 | static int hf_extended_advertising_aux_ptr_channel; |
91 | static int hf_extended_advertising_aux_ptr_ca; |
92 | static int hf_extended_advertising_aux_ptr_offset_units; |
93 | static int hf_extended_advertising_aux_ptr_aux_offset; |
94 | static int hf_extended_advertising_aux_ptr_aux_phy; |
95 | static int hf_extended_advertising_sync_info; |
96 | static int hf_extended_advertising_sync_info_offset; |
97 | static int hf_extended_advertising_sync_info_offset_units; |
98 | static int hf_extended_advertising_sync_info_offset_adjust; |
99 | static int hf_extended_advertising_sync_info_reserved; |
100 | static int hf_extended_advertising_sync_info_interval; |
101 | static int hf_extended_advertising_sync_info_channel_map; |
102 | static int hf_extended_advertising_sync_info_sleep_clock_accuracy; |
103 | static int hf_extended_advertising_sync_info_access_address; |
104 | static int hf_extended_advertising_sync_info_crc_init; |
105 | static int hf_extended_advertising_sync_info_event_counter; |
106 | static int hf_extended_advertising_tx_power; |
107 | static int hf_extended_advertising_header_acad; |
108 | static int hf_extended_advertising_had_fragment; |
109 | static int hf_data_header; |
110 | static int hf_data_header_length; |
111 | static int hf_data_header_rfu; |
112 | static int hf_data_header_llid; |
113 | static int hf_data_header_llid_connectediso; |
114 | static int hf_data_header_llid_broadcastiso; |
115 | static int hf_data_header_more_data; |
116 | static int hf_data_header_cte_info_present; |
117 | static int hf_data_header_sequence_number; |
118 | static int hf_data_header_next_expected_sequence_number; |
119 | static int hf_data_header_rfu_57; |
120 | static int hf_data_header_rfu_67; |
121 | static int hf_data_header_close_isochronous_event; |
122 | static int hf_data_header_null_pdu_indicator; |
123 | static int hf_data_header_control_subevent_sequence_number; |
124 | static int hf_data_header_control_subevent_transmission_flag; |
125 | static int hf_data_header_cte_info; |
126 | static int hf_data_header_cte_info_time; |
127 | static int hf_data_header_cte_info_rfu; |
128 | static int hf_data_header_cte_info_type; |
129 | static int hf_control_opcode; |
130 | static int hf_l2cap_index; |
131 | static int hf_l2cap_fragment; |
132 | static int hf_connection_parameters_in; |
133 | static int hf_control_reject_opcode; |
134 | static int hf_control_error_code; |
135 | static int hf_control_unknown_type; |
136 | static int hf_control_version_number; |
137 | static int hf_control_company_id; |
138 | static int hf_control_subversion_number; |
139 | static int hf_control_feature_set; |
140 | static int hf_control_feature_set_le_encryption; |
141 | static int hf_control_feature_set_connection_parameters_request_procedure; |
142 | static int hf_control_feature_set_extended_reject_indication; |
143 | static int hf_control_feature_set_peripheral_initiated_features_exchange; |
144 | static int hf_control_feature_set_le_ping; |
145 | static int hf_control_feature_set_le_pkt_len_ext; |
146 | static int hf_control_feature_set_ll_privacy; |
147 | static int hf_control_feature_set_ext_scan_flt_pol; |
148 | static int hf_control_feature_set_le_2m_phy; |
149 | static int hf_control_feature_set_stable_modulation_index_transmitter; |
150 | static int hf_control_feature_set_stable_modulation_index_receiver; |
151 | static int hf_control_feature_set_le_coded_phy; |
152 | static int hf_control_feature_set_le_extended_advertising; |
153 | static int hf_control_feature_set_le_periodic_advertising; |
154 | static int hf_control_feature_set_channel_selection_algorithm_2; |
155 | static int hf_control_feature_set_le_power_class_1; |
156 | static int hf_control_feature_set_minimum_number_of_used_channels_procedure; |
157 | static int hf_control_feature_set_connection_cte_request; |
158 | static int hf_control_feature_set_connection_cte_response; |
159 | static int hf_control_feature_set_connectionless_cte_tx; |
160 | static int hf_control_feature_set_connectionless_cte_rx; |
161 | static int hf_control_feature_set_antenna_switching_tx_aod; |
162 | static int hf_control_feature_set_antenna_switching_rx_aoa; |
163 | static int hf_control_feature_set_cte_rx; |
164 | static int hf_control_feature_set_past_sender; |
165 | static int hf_control_feature_set_past_receiver; |
166 | static int hf_control_feature_set_sca_updates; |
167 | static int hf_control_feature_set_remote_public_key_validation; |
168 | static int hf_control_feature_set_cis_central; |
169 | static int hf_control_feature_set_cis_peripheral; |
170 | static int hf_control_feature_set_iso_broadcast; |
171 | static int hf_control_feature_set_synchronized_receiver; |
172 | static int hf_control_feature_set_connected_iso_host_support; |
173 | static int hf_control_feature_set_le_power_control_request1; |
174 | static int hf_control_feature_set_le_power_control_request2; |
175 | static int hf_control_feature_set_le_path_loss_monitoring; |
176 | static int hf_control_feature_set_le_periodic_adv_adi_support; |
177 | static int hf_control_feature_set_connection_subrating; |
178 | static int hf_control_feature_set_connection_subrating_host_support; |
179 | static int hf_control_feature_set_channel_classification; |
180 | static int hf_control_feature_set_adv_coding_selection; |
181 | static int hf_control_feature_set_adv_coding_selection_host_support; |
182 | static int hf_control_feature_set_decision_based_advertising_filtering; |
183 | static int hf_control_feature_set_periodic_adv_with_responses_advertiser; |
184 | static int hf_control_feature_set_periodic_adv_with_responses_scanner; |
185 | static int hf_control_feature_set_unsegmented_frame_mode; |
186 | static int hf_control_feature_set_channel_sounding; |
187 | static int hf_control_feature_set_channel_sounding_host_support; |
188 | static int hf_control_feature_set_channel_sounding_tone_quality_indication; |
189 | static int hf_control_feature_set_reserved_bits_page_7; |
190 | static int hf_control_feature_set_reserved_bits_page_8; |
191 | static int hf_control_feature_set_ll_extended_feature_set; |
192 | static int hf_control_feature_set_monitoring_advertisers; |
193 | static int hf_control_feature_set_frame_space_update; |
194 | static int hf_control_feature_set_reserved_bits_page_9; |
195 | static int hf_control_window_size; |
196 | static int hf_control_window_offset; |
197 | static int hf_control_interval; |
198 | static int hf_control_latency; |
199 | static int hf_control_timeout; |
200 | static int hf_control_instant; |
201 | static int hf_control_rfu_5; |
202 | static int hf_control_interval_min; |
203 | static int hf_control_interval_max; |
204 | static int hf_control_preferred_periodicity; |
205 | static int hf_control_reference_connection_event_count; |
206 | static int hf_control_offset_0; |
207 | static int hf_control_offset_1; |
208 | static int hf_control_offset_2; |
209 | static int hf_control_offset_3; |
210 | static int hf_control_offset_4; |
211 | static int hf_control_offset_5; |
212 | static int hf_control_channel_map; |
213 | static int hf_control_random_number; |
214 | static int hf_control_encrypted_diversifier; |
215 | static int hf_control_central_session_key_diversifier; |
216 | static int hf_control_central_session_initialization_vector; |
217 | static int hf_control_peripheral_session_key_diversifier; |
218 | static int hf_control_peripheral_session_initialization_vector; |
219 | static int hf_control_max_rx_octets; |
220 | static int hf_control_max_rx_time; |
221 | static int hf_control_max_tx_octets; |
222 | static int hf_control_max_tx_time; |
223 | static int hf_control_phys_sender_le_1m_phy; |
224 | static int hf_control_phys_sender_le_2m_phy; |
225 | static int hf_control_phys_sender_le_coded_phy; |
226 | static int hf_control_phys_update_le_1m_phy; |
227 | static int hf_control_phys_update_le_2m_phy; |
228 | static int hf_control_phys_update_le_coded_phy; |
229 | static int hf_control_phys_reserved_bits; |
230 | static int hf_control_tx_phys; |
231 | static int hf_control_rx_phys; |
232 | static int hf_control_c_to_p_phy; |
233 | static int hf_control_c_to_p_phy_le_1m_phy; |
234 | static int hf_control_c_to_p_phy_le_2m_phy; |
235 | static int hf_control_c_to_p_phy_le_coded_phy; |
236 | static int hf_control_c_to_p_phy_reserved_bits; |
237 | static int hf_control_p_to_c_phy; |
238 | static int hf_control_p_to_c_phy_le_1m_phy; |
239 | static int hf_control_p_to_c_phy_le_2m_phy; |
240 | static int hf_control_p_to_c_phy_le_coded_phy; |
241 | static int hf_control_p_to_c_phy_reserved_bits; |
242 | static int hf_control_phys; |
243 | static int hf_control_phys_le_1m_phy; |
244 | static int hf_control_phys_le_2m_phy; |
245 | static int hf_control_phys_le_coded_phy; |
246 | static int hf_control_min_used_channels; |
247 | static int hf_control_cte_min_len_req; |
248 | static int hf_control_cte_rfu; |
249 | static int hf_control_cte_type_req; |
250 | static int hf_control_sync_id; |
251 | static int hf_control_sync_info_offset; |
252 | static int hf_control_sync_info_offset_units; |
253 | static int hf_control_sync_info_offset_adjust; |
254 | static int hf_control_sync_info_reserved; |
255 | static int hf_control_sync_info_interval; |
256 | static int hf_control_sync_info_channel_map; |
257 | static int hf_control_sync_info_sleep_clock_accuracy; |
258 | static int hf_control_sync_info_access_address; |
259 | static int hf_control_sync_info_crc_init; |
260 | static int hf_control_sync_info_event_counter; |
261 | static int hf_control_sync_conn_event_count; |
262 | static int hf_control_sync_last_pa_event_counter; |
263 | static int hf_control_sync_sid; |
264 | static int hf_control_sync_atype; |
265 | static int hf_control_sync_sleep_clock_accuracy; |
266 | static int hf_control_sync_sync_conn_event_counter; |
267 | static int hf_control_sleep_clock_accuracy; |
268 | static int hf_control_cig_id; |
269 | static int hf_control_cis_id; |
270 | static int hf_control_max_sdu_c_to_p; |
271 | static int hf_control_rfu_1; |
272 | static int hf_control_framed; |
273 | static int hf_control_max_sdu_p_to_c; |
274 | static int hf_control_rfu_2; |
275 | static int hf_control_sdu_interval_c_to_p; |
276 | static int hf_control_rfu_3; |
277 | static int hf_control_sdu_interval_p_to_c; |
278 | static int hf_control_rfu_4; |
279 | static int hf_control_max_pdu_c_to_p; |
280 | static int hf_control_max_pdu_p_to_c; |
281 | static int hf_control_num_sub_events; |
282 | static int hf_control_sub_interval; |
283 | static int hf_control_bn_c_to_p; |
284 | static int hf_control_bn_p_to_c; |
285 | static int hf_control_ft_c_to_p; |
286 | static int hf_control_ft_p_to_c; |
287 | static int hf_control_iso_interval; |
288 | static int hf_control_cis_offset_min; |
289 | static int hf_control_cis_offset_max; |
290 | static int hf_control_conn_event_count; |
291 | static int hf_control_access_address; |
292 | static int hf_control_cis_offset; |
293 | static int hf_control_cig_sync_delay; |
294 | static int hf_control_cis_sync_delay; |
295 | static int hf_control_pwr_phy; |
296 | static int hf_control_pwr_phy_le_1m_phy; |
297 | static int hf_control_pwr_phy_le_2m_phy; |
298 | static int hf_control_pwr_phy_le_coded_s8_phy; |
299 | static int hf_control_pwr_phy_le_coded_s2_phy; |
300 | static int hf_control_pwr_phy_reserved_bits; |
301 | static int hf_control_delta; |
302 | static int hf_control_txpwr; |
303 | static int hf_control_pwrflags; |
304 | static int hf_control_pwrflags_min; |
305 | static int hf_control_pwrflags_max; |
306 | static int hf_control_pwrflags_reserved_bits; |
307 | static int hf_control_acceptable_power_reduction; |
308 | static int hf_control_subrate_factor_min; |
309 | static int hf_control_subrate_factor_max; |
310 | static int hf_control_max_latency; |
311 | static int hf_control_continuation_number; |
312 | static int hf_control_subrate_factor; |
313 | static int hf_control_subrate_base_event; |
314 | static int hf_control_channel_reporting_enable; |
315 | static int hf_control_channel_reporting_min_spacing; |
316 | static int hf_control_channel_reporting_max_delay; |
317 | static int hf_control_channel_classification; |
318 | static int hf_control_sync_info_rsp_access_address; |
319 | static int hf_control_sync_info_num_subevents; |
320 | static int hf_control_sync_info_subevent_interval; |
321 | static int hf_control_sync_info_response_slot_delay; |
322 | static int hf_control_sync_info_response_slot_spacing; |
323 | static int hf_big_control_opcode; |
324 | static int hf_isochronous_data; |
325 | static int hf_btle_l2cap_msg_fragments; |
326 | static int hf_btle_l2cap_msg_fragment; |
327 | static int hf_btle_l2cap_msg_fragment_overlap; |
328 | static int hf_btle_l2cap_msg_fragment_overlap_conflicts; |
329 | static int hf_btle_l2cap_msg_fragment_multiple_tails; |
330 | static int hf_btle_l2cap_msg_fragment_too_long_fragment; |
331 | static int hf_btle_l2cap_msg_fragment_error; |
332 | static int hf_btle_l2cap_msg_fragment_count; |
333 | static int hf_btle_l2cap_msg_reassembled_in; |
334 | static int hf_btle_l2cap_msg_reassembled_length; |
335 | static int hf_btle_ea_host_advertising_data_fragments; |
336 | static int hf_btle_ea_host_advertising_data_fragment; |
337 | static int hf_btle_ea_host_advertising_data_fragment_overlap; |
338 | static int hf_btle_ea_host_advertising_data_fragment_overlap_conflicts; |
339 | static int hf_btle_ea_host_advertising_data_fragment_multiple_tails; |
340 | static int hf_btle_ea_host_advertising_data_fragment_too_long_fragment; |
341 | static int hf_btle_ea_host_advertising_data_fragment_error; |
342 | static int hf_btle_ea_host_advertising_data_fragment_count; |
343 | static int hf_btle_ea_host_advertising_data_reassembled_in; |
344 | static int hf_btle_ea_host_advertising_data_reassembled_length; |
345 | |
346 | static int hf_request_in_frame; |
347 | static int hf_response_in_frame; |
348 | |
349 | static int ett_btle; |
350 | static int ett_advertising_header; |
351 | static int ett_link_layer_data; |
352 | static int ett_data_header; |
353 | static int ett_data_header_cte_info; |
354 | static int ett_features; |
355 | static int ett_tx_phys; |
356 | static int ett_rx_phys; |
357 | static int ett_c_to_p_phy; |
358 | static int ett_p_to_c_phy; |
359 | static int ett_phys; |
360 | static int ett_pwr_phy; |
361 | static int ett_cte; |
362 | static int ett_channel_map; |
363 | static int ett_scan_response_data; |
364 | static int ett_pwrflags; |
365 | static int ett_btle_l2cap_msg_fragment; |
366 | static int ett_btle_l2cap_msg_fragments; |
367 | static int ett_btle_ea_host_advertising_data_fragment; |
368 | static int ett_btle_ea_host_advertising_data_fragments; |
369 | static int ett_extended_advertising_header; |
370 | static int ett_extended_advertising_flags; |
371 | static int ett_extended_advertising_cte_info; |
372 | static int ett_extended_advertising_data_info; |
373 | static int ett_extended_advertising_aux_pointer; |
374 | static int ett_extended_advertising_sync_info; |
375 | static int ett_extended_advertising_acad; |
376 | |
377 | static int * const hfx_extended_advertising_flags[] = { |
378 | &hf_extended_advertising_flags_adva, |
379 | &hf_extended_advertising_flags_targeta, |
380 | &hf_extended_advertising_flags_cte_info, |
381 | &hf_extended_advertising_flags_advdatainfo, |
382 | &hf_extended_advertising_flags_aux_ptr, |
383 | &hf_extended_advertising_flags_sync_info, |
384 | &hf_extended_advertising_flags_tx_power, |
385 | &hf_extended_advertising_flags_reserved, |
386 | NULL((void*)0) |
387 | }; |
388 | |
389 | static int * const hfx_control_feature_set_1[] = { |
390 | &hf_control_feature_set_le_encryption, |
391 | &hf_control_feature_set_connection_parameters_request_procedure, |
392 | &hf_control_feature_set_extended_reject_indication, |
393 | &hf_control_feature_set_peripheral_initiated_features_exchange, |
394 | &hf_control_feature_set_le_ping, |
395 | &hf_control_feature_set_le_pkt_len_ext, |
396 | &hf_control_feature_set_ll_privacy, |
397 | &hf_control_feature_set_ext_scan_flt_pol, |
398 | NULL((void*)0) |
399 | }; |
400 | |
401 | static int * const hfx_control_feature_set_2[] = { |
402 | &hf_control_feature_set_le_2m_phy, |
403 | &hf_control_feature_set_stable_modulation_index_transmitter, |
404 | &hf_control_feature_set_stable_modulation_index_receiver, |
405 | &hf_control_feature_set_le_coded_phy, |
406 | &hf_control_feature_set_le_extended_advertising, |
407 | &hf_control_feature_set_le_periodic_advertising, |
408 | &hf_control_feature_set_channel_selection_algorithm_2, |
409 | &hf_control_feature_set_le_power_class_1, |
410 | NULL((void*)0) |
411 | }; |
412 | |
413 | static int * const hfx_control_feature_set_3[] = { |
414 | &hf_control_feature_set_minimum_number_of_used_channels_procedure, |
415 | &hf_control_feature_set_connection_cte_request, |
416 | &hf_control_feature_set_connection_cte_response, |
417 | &hf_control_feature_set_connectionless_cte_tx, |
418 | &hf_control_feature_set_connectionless_cte_rx, |
419 | &hf_control_feature_set_antenna_switching_tx_aod, |
420 | &hf_control_feature_set_antenna_switching_rx_aoa, |
421 | &hf_control_feature_set_cte_rx, |
422 | NULL((void*)0) |
423 | }; |
424 | |
425 | static int * const hfx_control_feature_set_4[] = { |
426 | &hf_control_feature_set_past_sender, |
427 | &hf_control_feature_set_past_receiver, |
428 | &hf_control_feature_set_sca_updates, |
429 | &hf_control_feature_set_remote_public_key_validation, |
430 | &hf_control_feature_set_cis_central, |
431 | &hf_control_feature_set_cis_peripheral, |
432 | &hf_control_feature_set_iso_broadcast, |
433 | &hf_control_feature_set_synchronized_receiver, |
434 | NULL((void*)0) |
435 | }; |
436 | |
437 | static int * const hfx_control_feature_set_5[] = { |
438 | &hf_control_feature_set_connected_iso_host_support, |
439 | &hf_control_feature_set_le_power_control_request1, |
440 | &hf_control_feature_set_le_power_control_request2, |
441 | &hf_control_feature_set_le_path_loss_monitoring, |
442 | &hf_control_feature_set_le_periodic_adv_adi_support, |
443 | &hf_control_feature_set_connection_subrating, |
444 | &hf_control_feature_set_connection_subrating_host_support, |
445 | &hf_control_feature_set_channel_classification, |
446 | NULL((void*)0) |
447 | }; |
448 | |
449 | static int *const hfx_control_feature_set_6[] = { |
450 | &hf_control_feature_set_adv_coding_selection, |
451 | &hf_control_feature_set_adv_coding_selection_host_support, |
452 | &hf_control_feature_set_decision_based_advertising_filtering, |
453 | &hf_control_feature_set_periodic_adv_with_responses_advertiser, |
454 | &hf_control_feature_set_periodic_adv_with_responses_scanner, |
455 | &hf_control_feature_set_unsegmented_frame_mode, |
456 | &hf_control_feature_set_channel_sounding, |
457 | &hf_control_feature_set_channel_sounding_host_support, |
458 | NULL((void*)0) |
459 | }; |
460 | |
461 | static int *const hfx_control_feature_set_7[] = { |
462 | &hf_control_feature_set_channel_sounding_tone_quality_indication, |
463 | &hf_control_feature_set_reserved_bits_page_7, |
464 | NULL((void*)0) |
465 | }; |
466 | |
467 | static int *const hfx_control_feature_set_8[] = { |
468 | &hf_control_feature_set_reserved_bits_page_8, |
469 | &hf_control_feature_set_ll_extended_feature_set, |
470 | NULL((void*)0) |
471 | }; |
472 | |
473 | static int * const hfx_control_phys_sender[] = { |
474 | &hf_control_phys_sender_le_1m_phy, |
475 | &hf_control_phys_sender_le_2m_phy, |
476 | &hf_control_phys_sender_le_coded_phy, |
477 | &hf_control_phys_reserved_bits, |
478 | NULL((void*)0) |
479 | }; |
480 | |
481 | static int * const hfx_control_phys_update[] = { |
482 | &hf_control_phys_update_le_1m_phy, |
483 | &hf_control_phys_update_le_2m_phy, |
484 | &hf_control_phys_update_le_coded_phy, |
485 | &hf_control_phys_reserved_bits, |
486 | NULL((void*)0) |
487 | }; |
488 | |
489 | static int * const hfx_control_c_to_p_phy[] = { |
490 | &hf_control_c_to_p_phy_le_1m_phy, |
491 | &hf_control_c_to_p_phy_le_2m_phy, |
492 | &hf_control_c_to_p_phy_le_coded_phy, |
493 | &hf_control_c_to_p_phy_reserved_bits, |
494 | NULL((void*)0) |
495 | }; |
496 | |
497 | static int * const hfx_control_p_to_c_phy[] = { |
498 | &hf_control_p_to_c_phy_le_1m_phy, |
499 | &hf_control_p_to_c_phy_le_2m_phy, |
500 | &hf_control_p_to_c_phy_le_coded_phy, |
501 | &hf_control_p_to_c_phy_reserved_bits, |
502 | NULL((void*)0) |
503 | }; |
504 | |
505 | static int * const hfx_control_phys[] = { |
506 | &hf_control_phys_le_1m_phy, |
507 | &hf_control_phys_le_2m_phy, |
508 | &hf_control_phys_le_coded_phy, |
509 | &hf_control_phys_reserved_bits, |
510 | NULL((void*)0) |
511 | }; |
512 | |
513 | static int * const hfx_control_pwr_phy[] = { |
514 | &hf_control_pwr_phy_le_1m_phy, |
515 | &hf_control_pwr_phy_le_2m_phy, |
516 | &hf_control_pwr_phy_le_coded_s8_phy, |
517 | &hf_control_pwr_phy_le_coded_s2_phy, |
518 | &hf_control_pwr_phy_reserved_bits, |
519 | NULL((void*)0) |
520 | }; |
521 | |
522 | static int * const hfx_control_cte[] = { |
523 | &hf_control_cte_min_len_req, |
524 | &hf_control_cte_rfu, |
525 | &hf_control_cte_type_req, |
526 | NULL((void*)0) |
527 | }; |
528 | |
529 | static int * const hfx_control_periodicsyncflags[] = { |
530 | &hf_control_sync_sid, |
531 | &hf_control_sync_atype, |
532 | &hf_control_sync_sleep_clock_accuracy, |
533 | NULL((void*)0) |
534 | }; |
535 | |
536 | static int * const hfx_control_pwrflags[] = { |
537 | &hf_control_pwrflags_min, |
538 | &hf_control_pwrflags_max, |
539 | &hf_control_pwrflags_reserved_bits, |
540 | NULL((void*)0) |
541 | }; |
542 | |
543 | static expert_field ei_unknown_data; |
544 | static expert_field ei_access_address_matched; |
545 | static expert_field ei_access_address_bit_errors; |
546 | static expert_field ei_access_address_illegal; |
547 | static expert_field ei_crc_cannot_be_determined; |
548 | static expert_field ei_crc_incorrect; |
549 | static expert_field ei_missing_fragment_start; |
550 | static expert_field ei_retransmit; |
551 | static expert_field ei_nack; |
552 | static expert_field ei_control_proc_overlapping; |
553 | static expert_field ei_control_proc_invalid_collision; |
554 | static expert_field ei_control_proc_wrong_seq; |
555 | static expert_field ei_control_proc_invalid_conflict_resolution; |
556 | |
557 | static dissector_handle_t btle_handle; |
558 | static dissector_handle_t btcommon_ad_handle; |
559 | static dissector_handle_t btcommon_le_channel_map_handle; |
560 | static dissector_handle_t btl2cap_handle; |
561 | |
562 | static wmem_tree_t *connection_info_tree; |
563 | static wmem_tree_t *periodic_adv_info_tree; |
564 | static wmem_tree_t *connectediso_connection_info_tree; |
565 | static wmem_tree_t *broadcastiso_connection_info_tree; |
566 | static wmem_tree_t *connection_parameter_info_tree; |
567 | static wmem_tree_t *adi_to_first_frame_tree; |
568 | static uint32_t l2cap_index; |
569 | |
570 | /* Reassembly */ |
571 | static reassembly_table btle_l2cap_msg_reassembly_table; |
572 | |
573 | static const fragment_items btle_l2cap_msg_frag_items = { |
574 | /* Fragment subtrees */ |
575 | &ett_btle_l2cap_msg_fragment, |
576 | &ett_btle_l2cap_msg_fragments, |
577 | /* Fragment fields */ |
578 | &hf_btle_l2cap_msg_fragments, |
579 | &hf_btle_l2cap_msg_fragment, |
580 | &hf_btle_l2cap_msg_fragment_overlap, |
581 | &hf_btle_l2cap_msg_fragment_overlap_conflicts, |
582 | &hf_btle_l2cap_msg_fragment_multiple_tails, |
583 | &hf_btle_l2cap_msg_fragment_too_long_fragment, |
584 | &hf_btle_l2cap_msg_fragment_error, |
585 | &hf_btle_l2cap_msg_fragment_count, |
586 | /* Reassembled in field */ |
587 | &hf_btle_l2cap_msg_reassembled_in, |
588 | /* Reassembled length field */ |
589 | &hf_btle_l2cap_msg_reassembled_length, |
590 | /* Reassembled data field */ |
591 | NULL((void*)0), |
592 | /* Tag */ |
593 | "BTLE L2CAP fragments" |
594 | }; |
595 | |
596 | /* Extended Advertising Host Advertising Data Reassembly */ |
597 | static reassembly_table btle_ea_host_advertising_data_reassembly_table; |
598 | |
599 | static const fragment_items btle_ea_host_advertising_data_frag_items = { |
600 | /* Fragment subtrees */ |
601 | &ett_btle_ea_host_advertising_data_fragment, |
602 | &ett_btle_ea_host_advertising_data_fragments, |
603 | /* Fragment fields */ |
604 | &hf_btle_ea_host_advertising_data_fragments, |
605 | &hf_btle_ea_host_advertising_data_fragment, |
606 | &hf_btle_ea_host_advertising_data_fragment_overlap, |
607 | &hf_btle_ea_host_advertising_data_fragment_overlap_conflicts, |
608 | &hf_btle_ea_host_advertising_data_fragment_multiple_tails, |
609 | &hf_btle_ea_host_advertising_data_fragment_too_long_fragment, |
610 | &hf_btle_ea_host_advertising_data_fragment_error, |
611 | &hf_btle_ea_host_advertising_data_fragment_count, |
612 | /* Reassembled in field */ |
613 | &hf_btle_ea_host_advertising_data_reassembled_in, |
614 | /* Reassembled length field */ |
615 | &hf_btle_ea_host_advertising_data_reassembled_length, |
616 | /* Reassembled data field */ |
617 | NULL((void*)0), |
618 | /* Tag */ |
619 | "BTLE EA HAD fragments" |
620 | }; |
621 | |
622 | typedef struct _ae_had_info_t { |
623 | unsigned fragment_counter; |
624 | uint32_t first_frame_num; |
625 | address adv_addr; |
626 | } ae_had_info_t; |
627 | |
628 | typedef struct _control_proc_info_t { |
629 | /* Sequence of frame numbers of the control procedure used for request/response matching. |
630 | * The first entry corresponds to the request, the remaining frames are responses. |
631 | * The longest sequence is needed for the encryption start procedure, |
632 | * which consists of 5 frames. */ |
633 | unsigned frames[5]; |
634 | |
635 | /* Opcode of the first control procedure packet. */ |
636 | uint8_t proc_opcode; |
637 | |
638 | /* The frame where the procedure completes. Set to 0 when not yet known. |
639 | * This is used to avoid adding another frame to the control procedure |
640 | * sequence after the procedure was aborted early. |
641 | * |
642 | * This frame number may be ignored in the case where an LL_UNKNOWN_RSP is |
643 | * received after a procedure involving only one packet, like the |
644 | * LL_MIN_USED_CHANNELS_IND. */ |
645 | unsigned last_frame; |
646 | |
647 | /* The frame number of the packet containing the instant value. |
648 | * If set to 0, there is no such frame. |
649 | * |
650 | * We need to store this frame number, as any event counter is |
651 | * a valid instant. */ |
652 | unsigned frame_with_instant_value; |
653 | |
654 | /* The event counter corresponding to the instant of the control procedure. */ |
655 | uint16_t instant; |
656 | } control_proc_info_t; |
657 | |
658 | /* Store information about a connection direction */ |
659 | typedef struct _direction_info_t { |
660 | unsigned prev_seq_num : 1; /* Previous sequence number for this direction */ |
661 | unsigned segmentation_started : 1; /* 0 = No, 1 = Yes */ |
662 | unsigned segment_len_rem; /* The remaining segment length, used to find last segment */ |
663 | uint32_t l2cap_index; /* Unique identifier for each L2CAP message */ |
664 | |
665 | wmem_tree_t *control_procs; /* Control procedures initiated from this direction. */ |
666 | } direction_info_t; |
667 | |
668 | typedef struct _connection_parameter_info_t { |
669 | uint32_t parameters_frame; |
670 | } connection_parameter_info_t; |
671 | |
672 | /* Store information about a connection */ |
673 | typedef struct _connection_info_t { |
674 | uint32_t crc_init; |
675 | |
676 | uint8_t central_bd_addr[6]; |
677 | uint8_t peripheral_bd_addr[6]; |
678 | |
679 | uint16_t connection_parameter_update_instant; |
680 | connection_parameter_info_t *connection_parameter_update_info; |
681 | |
682 | /* Connection information */ |
683 | /* Data used on the first pass to get info from previous frame, result will be in per_packet_data */ |
684 | unsigned first_data_frame_seen : 1; |
685 | direction_info_t direction_info[3]; /* UNKNOWN, CENTRAL_PERIPHERAL and PERIPHERAL_CENTRAL */ |
686 | } connection_info_t; |
687 | |
688 | |
689 | /* Store information about a connected ISO connection */ |
690 | typedef struct _connectediso_connection_info_t { |
691 | uint8_t central_bd_addr[6]; |
692 | uint8_t peripheral_bd_addr[6]; |
693 | } connectediso_connection_info_t; |
694 | |
695 | |
696 | /* Store information about a broadcast isochronous connection */ |
697 | typedef struct _broadcastiso_connection_info_t { |
698 | uint8_t central_bd_addr[6]; |
699 | } broadcastiso_connection_info_t; |
700 | |
701 | /* */ |
702 | typedef struct _btle_frame_info_t { |
703 | unsigned retransmit : 1; /* 0 = No, 1 = Retransmitted frame */ |
704 | unsigned ack : 1; /* 0 = Nack, 1 = Ack */ |
705 | unsigned more_fragments : 1; /* 0 = Last fragment, 1 = More fragments */ |
706 | unsigned missing_start : 1; /* 0 = No, 1 = Missing fragment start */ |
707 | uint32_t l2cap_index; /* Unique identifier for each L2CAP message */ |
708 | } btle_frame_info_t; |
709 | |
710 | static const value_string pdu_type_vals[] = { |
711 | { 0x00, "ADV_IND" }, |
712 | { 0x01, "ADV_DIRECT_IND" }, |
713 | { 0x02, "ADV_NONCONN_IND" }, |
714 | { 0x03, "SCAN_REQ" }, |
715 | { 0x04, "SCAN_RSP" }, |
716 | { 0x05, "CONNECT_IND" }, |
717 | { 0x06, "ADV_SCAN_IND" }, |
718 | { 0x07, "ADV_EXT_IND" }, |
719 | { 0x08, "AUX_CONNECT_RSP" }, |
720 | { 0x09, "ADV_DECISION_IND" }, |
721 | { 0, NULL((void*)0) } |
722 | }; |
723 | static value_string_ext pdu_type_vals_ext = VALUE_STRING_EXT_INIT(pdu_type_vals){ _try_val_to_str_ext_init, 0, (sizeof (pdu_type_vals) / sizeof ((pdu_type_vals)[0]))-1, pdu_type_vals, "pdu_type_vals" }; |
724 | |
725 | static const value_string aux_pdu_type_vals[] = { |
726 | { 0x03, "AUX_SCAN_REQ" }, |
727 | { 0x05, "AUX_CONNECT_REQ" }, |
728 | { 0x07, "AUX_COMMON" }, |
729 | { 0x08, "AUX_CONNECT_RSP" }, |
730 | { 0, NULL((void*)0)} |
731 | }; |
732 | static value_string_ext aux_pdu_type_vals_ext = VALUE_STRING_EXT_INIT(aux_pdu_type_vals){ _try_val_to_str_ext_init, 0, (sizeof (aux_pdu_type_vals) / sizeof ((aux_pdu_type_vals)[0]))-1, aux_pdu_type_vals, "aux_pdu_type_vals" }; |
733 | |
734 | static const value_string aux_pdu_common_vals[] = { |
735 | { 0, "AUX_ADV_IND" }, |
736 | { 1, "AUX_CHAIN_IND" }, |
737 | { 2, "AUX_SYNC_IND" }, |
738 | { 3, "AUX_SCAN_RSP" }, |
739 | { 0, NULL((void*)0)} |
740 | }; |
741 | static value_string_ext aux_pdu_common_vals_ext = VALUE_STRING_EXT_INIT(aux_pdu_common_vals){ _try_val_to_str_ext_init, 0, (sizeof (aux_pdu_common_vals) / sizeof ((aux_pdu_common_vals)[0]))-1, aux_pdu_common_vals, "aux_pdu_common_vals" }; |
742 | |
743 | static const value_string le_coding_indicators[] = |
744 | { |
745 | { 0, "FEC Block 2 coded using S=8" }, |
746 | { 1, "FEC Block 2 coded using S=2" }, |
747 | { 2, "Reserved" }, |
748 | { 3, "Reserved" }, |
749 | { 0, NULL((void*)0) } |
750 | }; |
751 | |
752 | static const value_string sleep_clock_accuracy_vals[] = { |
753 | { 0x00, "251 ppm to 500 ppm" }, |
754 | { 0x01, "151 ppm to 250 ppm" }, |
755 | { 0x02, "101 ppm to 150 ppm" }, |
756 | { 0x03, "76 ppm to 100 ppm" }, |
757 | { 0x04, "51 ppm to 75 ppm" }, |
758 | { 0x05, "31 ppm to 50 ppm" }, |
759 | { 0x06, "21 ppm to 30 ppm" }, |
760 | { 0x07, "0 ppm to 20 ppm" }, |
761 | { 0, NULL((void*)0) } |
762 | }; |
763 | static value_string_ext sleep_clock_accuracy_vals_ext = VALUE_STRING_EXT_INIT(sleep_clock_accuracy_vals){ _try_val_to_str_ext_init, 0, (sizeof (sleep_clock_accuracy_vals ) / sizeof ((sleep_clock_accuracy_vals)[0]))-1, sleep_clock_accuracy_vals , "sleep_clock_accuracy_vals" }; |
764 | |
765 | static const value_string llid_codes_vals[] = { |
766 | { 0x01, "Continuation fragment of an L2CAP message, or an Empty PDU" }, |
767 | { 0x02, "Start of an L2CAP message or a complete L2CAP message with no fragmentation" }, |
768 | { 0x03, "Control PDU" }, |
769 | { 0, NULL((void*)0) } |
770 | }; |
771 | static value_string_ext llid_codes_vals_ext = VALUE_STRING_EXT_INIT(llid_codes_vals){ _try_val_to_str_ext_init, 0, (sizeof (llid_codes_vals) / sizeof ((llid_codes_vals)[0]))-1, llid_codes_vals, "llid_codes_vals" }; |
772 | |
773 | static const value_string llid_connectediso_codes_vals[] = { |
774 | { 0x00, "Unframed CIS Data PDU; end fragment of an SDU or a complete SDU" }, |
775 | { 0x01, "Unframed CIS Data PDU; start or continuation fragment of an SDU" }, |
776 | { 0x02, "Framed CIS Data PDU; one or more segments of an SDU" }, |
777 | { 0, NULL((void*)0) } |
778 | }; |
779 | static value_string_ext llid_connectediso_codes_vals_ext = VALUE_STRING_EXT_INIT(llid_connectediso_codes_vals){ _try_val_to_str_ext_init, 0, (sizeof (llid_connectediso_codes_vals ) / sizeof ((llid_connectediso_codes_vals)[0]))-1, llid_connectediso_codes_vals , "llid_connectediso_codes_vals" }; |
780 | |
781 | static const value_string llid_broadcastiso_codes_vals[] = { |
782 | { 0x00, "Unframed BIS Data PDU; end fragment of an SDU or a complete SDU" }, |
783 | { 0x01, "Unframed BIS Data PDU; start or continuation fragment of an SDU" }, |
784 | { 0x02, "Framed BIS Data PDU; one or more segments of an SDU" }, |
785 | { 0x03, "BIG Control PDU" }, |
786 | { 0, NULL((void*)0) } |
787 | }; |
788 | static value_string_ext llid_broadcastiso_codes_vals_ext = VALUE_STRING_EXT_INIT(llid_broadcastiso_codes_vals){ _try_val_to_str_ext_init, 0, (sizeof (llid_broadcastiso_codes_vals ) / sizeof ((llid_broadcastiso_codes_vals)[0]))-1, llid_broadcastiso_codes_vals , "llid_broadcastiso_codes_vals" }; |
789 | |
790 | typedef enum |
791 | { |
792 | LL_CTRL_OPCODE_CONNECTION_UPDATE_IND = 0x00, |
793 | LL_CTRL_OPCODE_CHANNEL_MAP_IND = 0x01, |
794 | LL_CTRL_OPCODE_TERMINATE_IND = 0x02, |
795 | LL_CTRL_OPCODE_ENC_REQ = 0x03, |
796 | LL_CTRL_OPCODE_ENC_RSP = 0x04, |
797 | LL_CTRL_OPCODE_START_ENC_REQ = 0x05, |
798 | LL_CTRL_OPCODE_START_ENC_RSP = 0x06, |
799 | LL_CTRL_OPCODE_UNKNOWN_RSP = 0x07, |
800 | LL_CTRL_OPCODE_FEATURE_REQ = 0x08, |
801 | LL_CTRL_OPCODE_FEATURE_RSP = 0x09, |
802 | LL_CTRL_OPCODE_PAUSE_ENC_REQ = 0x0A, |
803 | LL_CTRL_OPCODE_PAUSE_ENC_RSP = 0x0B, |
804 | LL_CTRL_OPCODE_VERSION_IND = 0x0C, |
805 | LL_CTRL_OPCODE_REJECT_IND = 0x0D, |
806 | LL_CTRL_OPCODE_PERIPHERAL_FEATURE_REQ = 0x0E, |
807 | LL_CTRL_OPCODE_CONNECTION_PARAM_REQ = 0x0F, |
808 | LL_CTRL_OPCODE_CONNECTION_PARAM_RSP = 0x10, |
809 | LL_CTRL_OPCODE_REJECT_EXT_IND = 0x11, |
810 | LL_CTRL_OPCODE_PING_REQ = 0x12, |
811 | LL_CTRL_OPCODE_PING_RSP = 0x13, |
812 | LL_CTRL_OPCODE_LENGTH_REQ = 0x14, |
813 | LL_CTRL_OPCODE_LENGTH_RSP = 0x15, |
814 | LL_CTRL_OPCODE_PHY_REQ = 0x16, |
815 | LL_CTRL_OPCODE_PHY_RSP = 0x17, |
816 | LL_CTRL_OPCODE_PHY_UPDATE_IND = 0x18, |
817 | LL_CTRL_OPCODE_MIN_USED_CHANNELS_IND = 0x19, |
818 | LL_CTRL_OPCODE_CTE_REQ = 0x1A, |
819 | LL_CTRL_OPCODE_CTE_RSP = 0x1B, |
820 | LL_CTRL_OPCODE_PERIODIC_SYNC_IND = 0x1C, |
821 | LL_CTRL_OPCODE_CLOCK_ACCURACY_REQ = 0x1D, |
822 | LL_CTRL_OPCODE_CLOCK_ACCURACY_RSP = 0x1E, |
823 | LL_CTRL_OPCODE_CIS_REQ = 0x1F, |
824 | LL_CTRL_OPCODE_CIS_RSP = 0x20, |
825 | LL_CTRL_OPCODE_CIS_IND = 0x21, |
826 | LL_CTRL_OPCODE_CIS_TERMINATE_IND = 0x22, |
827 | LL_CTRL_OPCODE_POWER_CONTROL_REQ = 0x23, |
828 | LL_CTRL_OPCODE_POWER_CONTROL_RSP = 0x24, |
829 | LL_CTRL_OPCODE_POWER_CHANGE_IND = 0x25, |
830 | LL_CTRL_OPCODE_SUBRATE_REQ = 0x26, |
831 | LL_CTRL_OPCODE_SUBRATE_IND = 0x27, |
832 | LL_CTRL_OPCODE_CHANNEL_REPORTING_IND = 0x28, |
833 | LL_CTRL_OPCODE_CHANNEL_STATUS_IND = 0x29, |
834 | LL_CTRL_OPCODE_PERIODIC_SYNC_WR_IND = 0x2A, |
835 | LL_CTRL_OPCODE_LL_FEATURE_EXT_REQ = 0x2B, |
836 | LL_CTRL_OPCODE_LL_FEATURE_EXT_RSP = 0x2C, |
837 | LL_CTRL_OPCODE_LL_CS_SEC_RSP = 0x2D, |
838 | LL_CTRL_OPCODE_LL_CS_CAPABILITIES_REQ = 0x2E, |
839 | LL_CTRL_OPCODE_LL_CS_CAPABILITIES_RSP = 0x2F, |
840 | LL_CTRL_OPCODE_LL_CS_CONFIG_REQ = 0x30, |
841 | LL_CTRL_OPCODE_LL_CS_CONFIG_RSP = 0x31, |
842 | LL_CTRL_OPCODE_LL_CS_REQ = 0x32, |
843 | LL_CTRL_OPCODE_LL_CS_RSP = 0x33, |
844 | LL_CTRL_OPCODE_LL_CS_IND = 0x34, |
845 | LL_CTRL_OPCODE_LL_CS_TERMINATE_REQ = 0x35, |
846 | LL_CTRL_OPCODE_LL_CS_FAE_REQ = 0x36, |
847 | LL_CTRL_OPCODE_LL_CS_FAE_RSP = 0x37, |
848 | LL_CTRL_OPCODE_LL_CS_CHANNEL_MAP_IND = 0x38, |
849 | LL_CTRL_OPCODE_LL_CS_SEQ_REQ = 0x39, |
850 | LL_CTRL_OPCODE_LL_CS_TERMINATE_RSP = 0x3A, |
851 | LL_CTRL_OPCODE_LL_FRAME_SPACE_REQ = 0x3B, |
852 | LL_CTRL_OPCODE_LL_FRAME_SPACE_RSP = 0x3C, |
853 | } ll_ctrl_proc_opcodes_t; |
854 | |
855 | static const value_string control_opcode_vals[] = { |
856 | { LL_CTRL_OPCODE_CONNECTION_UPDATE_IND, "LL_CONNECTION_UPDATE_IND" }, |
857 | { LL_CTRL_OPCODE_CHANNEL_MAP_IND, "LL_CHANNEL_MAP_IND" }, |
858 | { LL_CTRL_OPCODE_TERMINATE_IND, "LL_TERMINATE_IND" }, |
859 | { LL_CTRL_OPCODE_ENC_REQ, "LL_ENC_REQ" }, |
860 | { LL_CTRL_OPCODE_ENC_RSP, "LL_ENC_RSP" }, |
861 | { LL_CTRL_OPCODE_START_ENC_REQ, "LL_START_ENC_REQ" }, |
862 | { LL_CTRL_OPCODE_START_ENC_RSP, "LL_START_ENC_RSP" }, |
863 | { LL_CTRL_OPCODE_UNKNOWN_RSP, "LL_UNKNOWN_RSP" }, |
864 | { LL_CTRL_OPCODE_FEATURE_REQ, "LL_FEATURE_REQ" }, |
865 | { LL_CTRL_OPCODE_FEATURE_RSP, "LL_FEATURE_RSP" }, |
866 | { LL_CTRL_OPCODE_PAUSE_ENC_REQ, "LL_PAUSE_ENC_REQ" }, |
867 | { LL_CTRL_OPCODE_PAUSE_ENC_RSP, "LL_PAUSE_ENC_RSP" }, |
868 | { LL_CTRL_OPCODE_VERSION_IND, "LL_VERSION_IND" }, |
869 | { LL_CTRL_OPCODE_REJECT_IND, "LL_REJECT_IND" }, |
870 | { LL_CTRL_OPCODE_PERIPHERAL_FEATURE_REQ, "LL_PERIPHERAL_FEATURE_REQ" }, |
871 | { LL_CTRL_OPCODE_CONNECTION_PARAM_REQ, "LL_CONNECTION_PARAM_REQ" }, |
872 | { LL_CTRL_OPCODE_CONNECTION_PARAM_RSP, "LL_CONNECTION_PARAM_RSP" }, |
873 | { LL_CTRL_OPCODE_REJECT_EXT_IND, "LL_REJECT_EXT_IND" }, |
874 | { LL_CTRL_OPCODE_PING_REQ, "LL_PING_REQ" }, |
875 | { LL_CTRL_OPCODE_PING_RSP, "LL_PING_RSP" }, |
876 | { LL_CTRL_OPCODE_LENGTH_REQ, "LL_LENGTH_REQ" }, |
877 | { LL_CTRL_OPCODE_LENGTH_RSP, "LL_LENGTH_RSP" }, |
878 | { LL_CTRL_OPCODE_PHY_REQ, "LL_PHY_REQ" }, |
879 | { LL_CTRL_OPCODE_PHY_RSP, "LL_PHY_RSP" }, |
880 | { LL_CTRL_OPCODE_PHY_UPDATE_IND, "LL_PHY_UPDATE_IND" }, |
881 | { LL_CTRL_OPCODE_MIN_USED_CHANNELS_IND, "LL_MIN_USED_CHANNELS_IND" }, |
882 | { LL_CTRL_OPCODE_CTE_REQ, "LL_CTE_REQ" }, |
883 | { LL_CTRL_OPCODE_CTE_RSP, "LL_CTE_RSP" }, |
884 | { LL_CTRL_OPCODE_PERIODIC_SYNC_IND, "LL_PERIODIC_SYNC_IND" }, |
885 | { LL_CTRL_OPCODE_CLOCK_ACCURACY_REQ, "LL_CLOCK_ACCURACY_REQ" }, |
886 | { LL_CTRL_OPCODE_CLOCK_ACCURACY_RSP, "LL_CLOCK_ACCURACY_RSP" }, |
887 | { LL_CTRL_OPCODE_CIS_REQ, "LL_CIS_REQ" }, |
888 | { LL_CTRL_OPCODE_CIS_RSP, "LL_CIS_RSP" }, |
889 | { LL_CTRL_OPCODE_CIS_IND, "LL_CIS_IND" }, |
890 | { LL_CTRL_OPCODE_CIS_TERMINATE_IND, "LL_CIS_TERMINATE_IND" }, |
891 | { LL_CTRL_OPCODE_POWER_CONTROL_REQ, "LL_POWER_CONTROL_REQ" }, |
892 | { LL_CTRL_OPCODE_POWER_CONTROL_RSP, "LL_POWER_CONTROL_RSP" }, |
893 | { LL_CTRL_OPCODE_POWER_CHANGE_IND, "LL_POWER_CHANGE_IND" }, |
894 | { LL_CTRL_OPCODE_SUBRATE_REQ, "LL_SUBRATE_REQ" }, |
895 | { LL_CTRL_OPCODE_SUBRATE_IND, "LL_SUBRATE_IND" }, |
896 | { LL_CTRL_OPCODE_CHANNEL_REPORTING_IND, "LL_CHANNEL_REPORTING_IND" }, |
897 | { LL_CTRL_OPCODE_CHANNEL_STATUS_IND, "LL_CHANNEL_STATUS_IND" }, |
898 | { LL_CTRL_OPCODE_PERIODIC_SYNC_WR_IND, "LL_PERIODIC_SYNC_WR_IND" }, |
899 | { LL_CTRL_OPCODE_LL_FEATURE_EXT_REQ, "LL_CTRL_OPCODE_LL_FEATURE_EXT_REQ" }, |
900 | { LL_CTRL_OPCODE_LL_FEATURE_EXT_RSP, "LL_CTRL_OPCODE_LL_FEATURE_EXT_RSP" }, |
901 | { LL_CTRL_OPCODE_LL_CS_SEC_RSP, "LL_CTRL_OPCODE_LL_CS_SEC_RSP" }, |
902 | { LL_CTRL_OPCODE_LL_CS_CAPABILITIES_REQ, "LL_CTRL_OPCODE_LL_CS_CAPABILITIES_REQ" }, |
903 | { LL_CTRL_OPCODE_LL_CS_CAPABILITIES_RSP, "LL_CTRL_OPCODE_LL_CS_CAPABILITIES_RSP" }, |
904 | { LL_CTRL_OPCODE_LL_CS_CONFIG_REQ, "LL_CTRL_OPCODE_LL_CS_CONFIG_REQ" }, |
905 | { LL_CTRL_OPCODE_LL_CS_CONFIG_RSP, "LL_CTRL_OPCODE_LL_CS_CONFIG_RSP" }, |
906 | { LL_CTRL_OPCODE_LL_CS_REQ, "LL_CTRL_OPCODE_LL_CS_REQ" }, |
907 | { LL_CTRL_OPCODE_LL_CS_RSP, "LL_CTRL_OPCODE_LL_CS_RSP" }, |
908 | { LL_CTRL_OPCODE_LL_CS_IND, "LL_CTRL_OPCODE_LL_CS_IND" }, |
909 | { LL_CTRL_OPCODE_LL_CS_TERMINATE_REQ, "LL_CTRL_OPCODE_LL_CS_TERMINATE_REQ" }, |
910 | { LL_CTRL_OPCODE_LL_CS_FAE_REQ, "LL_CTRL_OPCODE_LL_CS_FAE_REQ" }, |
911 | { LL_CTRL_OPCODE_LL_CS_FAE_RSP, "LL_CTRL_OPCODE_LL_CS_FAE_RSP" }, |
912 | { LL_CTRL_OPCODE_LL_CS_CHANNEL_MAP_IND, "LL_CTRL_OPCODE_LL_CS_CHANNEL_MAP_IND" }, |
913 | { LL_CTRL_OPCODE_LL_CS_SEQ_REQ, "LL_CTRL_OPCODE_LL_CS_SEQ_REQ" }, |
914 | { LL_CTRL_OPCODE_LL_CS_TERMINATE_RSP, "LL_CTRL_OPCODE_LL_CS_TERMINATE_RSP" }, |
915 | { LL_CTRL_OPCODE_LL_FRAME_SPACE_REQ, "LL_CTRL_OPCODE_LL_FRAME_SPACE_REQ" }, |
916 | { LL_CTRL_OPCODE_LL_FRAME_SPACE_RSP, "LL_CTRL_OPCODE_LL_FRAME_SPACE_RSP" }, |
917 | { 0, NULL((void*)0) } |
918 | }; |
919 | static value_string_ext control_opcode_vals_ext = VALUE_STRING_EXT_INIT(control_opcode_vals){ _try_val_to_str_ext_init, 0, (sizeof (control_opcode_vals) / sizeof ((control_opcode_vals)[0]))-1, control_opcode_vals, "control_opcode_vals" }; |
920 | |
921 | static const value_string big_control_opcode_vals[] = { |
922 | { 0x00, "BIG_CHANNEL_MAP_IND" }, |
923 | { 0x01, "BIG_TERMINATE_IND" }, |
924 | { 0, NULL((void*)0) } |
925 | }; |
926 | static value_string_ext big_control_opcode_vals_ext = VALUE_STRING_EXT_INIT(big_control_opcode_vals){ _try_val_to_str_ext_init, 0, (sizeof (big_control_opcode_vals ) / sizeof ((big_control_opcode_vals)[0]))-1, big_control_opcode_vals , "big_control_opcode_vals" }; |
927 | |
928 | /* Taken from https://www.bluetooth.com/specifications/assigned-numbers/link-layer/ */ |
929 | static const value_string ll_version_number_vals[] = { |
930 | { 0x06, "4.0"}, |
931 | { 0x07, "4.1" }, |
932 | { 0x08, "4.2" }, |
933 | { 0x09, "5.0" }, |
934 | { 0x0A, "5.1" }, |
935 | { 0x0B, "5.2" }, |
936 | { 0x0C, "5.3" }, |
937 | { 0x0D, "5.4" }, |
938 | { 0x0E, "6.0" }, |
939 | { 0, NULL((void*)0) } |
940 | }; |
941 | static value_string_ext ll_version_number_vals_ext = VALUE_STRING_EXT_INIT(ll_version_number_vals){ _try_val_to_str_ext_init, 0, (sizeof (ll_version_number_vals ) / sizeof ((ll_version_number_vals)[0]))-1, ll_version_number_vals , "ll_version_number_vals" }; |
942 | |
943 | static const value_string advertising_mode_vals[] = { |
944 | { 0x00, "Non-connectable Non-scannable" }, |
945 | { 0x01, "Connectable Non-scannable" }, |
946 | { 0x02, "Non-connectable Scannable"}, |
947 | { 0x03, "Reserved for future use"}, |
948 | { 0, NULL((void*)0)}, |
949 | }; |
950 | static value_string_ext advertising_mode_vals_ext = VALUE_STRING_EXT_INIT(advertising_mode_vals){ _try_val_to_str_ext_init, 0, (sizeof (advertising_mode_vals ) / sizeof ((advertising_mode_vals)[0]))-1, advertising_mode_vals , "advertising_mode_vals" }; |
951 | |
952 | static const value_string le_phys[] = |
953 | { |
954 | { 0, "LE 1M" }, |
955 | { 1, "LE 2M" }, |
956 | { 2, "LE Coded" }, |
957 | { 3, "Reserved" }, |
958 | { 4, "Reserved" }, |
959 | { 5, "Reserved" }, |
960 | { 6, "Reserved" }, |
961 | { 7, "Reserved" }, |
962 | { 0, NULL((void*)0) } |
963 | }; |
964 | |
965 | static const value_string le_cte_type_vals[] = { |
966 | { 0, "AoA Constant Tone Extension" }, |
967 | { 1, "AoD Constant Tone Extension with 1 usec slots" }, |
968 | { 2, "AoD Constant Tone Extension with 2 usec slots" }, |
969 | { 3, "Reserved for future use" }, |
970 | { 0, NULL((void*)0) } |
971 | }; |
972 | |
973 | static const true_false_string tfs_ca = { |
974 | "0 ppm to 50 ppm", |
975 | "51 ppm to 500 ppm" |
976 | }; |
977 | |
978 | static const true_false_string tfs_offset_units = { |
979 | "300 usec", |
980 | "30 usec" |
981 | }; |
982 | |
983 | static const true_false_string tfs_offset_adjust = { |
984 | "Adjusted 2.4576 seconds", |
985 | "No adjust" |
986 | }; |
987 | |
988 | static const true_false_string tfs_ch_sel = { |
989 | "#2", |
990 | "#1" |
991 | }; |
992 | |
993 | static const true_false_string tfs_random_public = { |
994 | "Random", |
995 | "Public" |
996 | }; |
997 | |
998 | void proto_register_btle(void); |
999 | void proto_reg_handoff_btle(void); |
1000 | |
1001 | static bool_Bool btle_detect_retransmit = true1; |
1002 | |
1003 | static void |
1004 | btle_init(void) |
1005 | { |
1006 | l2cap_index = 0; |
1007 | } |
1008 | |
1009 | /* |
1010 | * Implements Bluetooth Vol 6, Part B, Section 3.1.1 (ref Figure 3.2) |
1011 | * |
1012 | * At entry: tvb is entire BTLE packet without preamble |
1013 | * payload_len is the Length field from the BTLE PDU header |
1014 | * crc_init as defined in the specifications |
1015 | * |
1016 | * This implementation operates on nibbles and is therefore |
1017 | * endian-neutral. |
1018 | */ |
1019 | static uint32_t |
1020 | btle_crc(tvbuff_t *tvb, const uint8_t payload_len, const uint32_t crc_init) |
1021 | { |
1022 | static const uint16_t btle_crc_next_state_flips[256] = { |
1023 | 0x0000, 0x32d8, 0x196c, 0x2bb4, 0x0cb6, 0x3e6e, 0x15da, 0x2702, |
1024 | 0x065b, 0x3483, 0x1f37, 0x2def, 0x0aed, 0x3835, 0x1381, 0x2159, |
1025 | 0x065b, 0x3483, 0x1f37, 0x2def, 0x0aed, 0x3835, 0x1381, 0x2159, |
1026 | 0x0000, 0x32d8, 0x196c, 0x2bb4, 0x0cb6, 0x3e6e, 0x15da, 0x2702, |
1027 | 0x0cb6, 0x3e6e, 0x15da, 0x2702, 0x0000, 0x32d8, 0x196c, 0x2bb4, |
1028 | 0x0aed, 0x3835, 0x1381, 0x2159, 0x065b, 0x3483, 0x1f37, 0x2def, |
1029 | 0x0aed, 0x3835, 0x1381, 0x2159, 0x065b, 0x3483, 0x1f37, 0x2def, |
1030 | 0x0cb6, 0x3e6e, 0x15da, 0x2702, 0x0000, 0x32d8, 0x196c, 0x2bb4, |
1031 | 0x196c, 0x2bb4, 0x0000, 0x32d8, 0x15da, 0x2702, 0x0cb6, 0x3e6e, |
1032 | 0x1f37, 0x2def, 0x065b, 0x3483, 0x1381, 0x2159, 0x0aed, 0x3835, |
1033 | 0x1f37, 0x2def, 0x065b, 0x3483, 0x1381, 0x2159, 0x0aed, 0x3835, |
1034 | 0x196c, 0x2bb4, 0x0000, 0x32d8, 0x15da, 0x2702, 0x0cb6, 0x3e6e, |
1035 | 0x15da, 0x2702, 0x0cb6, 0x3e6e, 0x196c, 0x2bb4, 0x0000, 0x32d8, |
1036 | 0x1381, 0x2159, 0x0aed, 0x3835, 0x1f37, 0x2def, 0x065b, 0x3483, |
1037 | 0x1381, 0x2159, 0x0aed, 0x3835, 0x1f37, 0x2def, 0x065b, 0x3483, |
1038 | 0x15da, 0x2702, 0x0cb6, 0x3e6e, 0x196c, 0x2bb4, 0x0000, 0x32d8, |
1039 | 0x32d8, 0x0000, 0x2bb4, 0x196c, 0x3e6e, 0x0cb6, 0x2702, 0x15da, |
1040 | 0x3483, 0x065b, 0x2def, 0x1f37, 0x3835, 0x0aed, 0x2159, 0x1381, |
1041 | 0x3483, 0x065b, 0x2def, 0x1f37, 0x3835, 0x0aed, 0x2159, 0x1381, |
1042 | 0x32d8, 0x0000, 0x2bb4, 0x196c, 0x3e6e, 0x0cb6, 0x2702, 0x15da, |
1043 | 0x3e6e, 0x0cb6, 0x2702, 0x15da, 0x32d8, 0x0000, 0x2bb4, 0x196c, |
1044 | 0x3835, 0x0aed, 0x2159, 0x1381, 0x3483, 0x065b, 0x2def, 0x1f37, |
1045 | 0x3835, 0x0aed, 0x2159, 0x1381, 0x3483, 0x065b, 0x2def, 0x1f37, |
1046 | 0x3e6e, 0x0cb6, 0x2702, 0x15da, 0x32d8, 0x0000, 0x2bb4, 0x196c, |
1047 | 0x2bb4, 0x196c, 0x32d8, 0x0000, 0x2702, 0x15da, 0x3e6e, 0x0cb6, |
1048 | 0x2def, 0x1f37, 0x3483, 0x065b, 0x2159, 0x1381, 0x3835, 0x0aed, |
1049 | 0x2def, 0x1f37, 0x3483, 0x065b, 0x2159, 0x1381, 0x3835, 0x0aed, |
1050 | 0x2bb4, 0x196c, 0x32d8, 0x0000, 0x2702, 0x15da, 0x3e6e, 0x0cb6, |
1051 | 0x2702, 0x15da, 0x3e6e, 0x0cb6, 0x2bb4, 0x196c, 0x32d8, 0x0000, |
1052 | 0x2159, 0x1381, 0x3835, 0x0aed, 0x2def, 0x1f37, 0x3483, 0x065b, |
1053 | 0x2159, 0x1381, 0x3835, 0x0aed, 0x2def, 0x1f37, 0x3483, 0x065b, |
1054 | 0x2702, 0x15da, 0x3e6e, 0x0cb6, 0x2bb4, 0x196c, 0x32d8, 0x0000 |
1055 | }; |
1056 | int offset = 4; /* skip AA, CRC applies over PDU */ |
1057 | uint32_t state = crc_init; |
1058 | uint8_t bytes_to_go = 2+payload_len; /* PDU includes header and payload */ |
1059 | while( bytes_to_go-- ) { |
1060 | uint8_t byte = tvb_get_uint8(tvb, offset++); |
1061 | uint8_t nibble = (byte & 0xf); |
1062 | uint8_t byte_index = ((state >> 16) & 0xf0) | nibble; |
1063 | state = ((state << 4) ^ btle_crc_next_state_flips[byte_index]) & 0xffffff; |
1064 | nibble = ((byte >> 4) & 0xf); |
1065 | byte_index = ((state >> 16) & 0xf0) | nibble; |
1066 | state = ((state << 4) ^ btle_crc_next_state_flips[byte_index]) & 0xffffff; |
1067 | } |
1068 | return state; |
1069 | } |
1070 | |
1071 | static const char * adv_pdu_type_str_get(const btle_context_t *btle_context, uint32_t pdu_type, bool_Bool is_periodic_adv) |
1072 | { |
1073 | if (is_periodic_adv) { |
1074 | return "AUX_SYNC_IND"; |
1075 | } else if (!btle_context || !(btle_context->channel < 37)) { |
1076 | return val_to_str_ext_const(pdu_type, &pdu_type_vals_ext, "Unknown"); |
1077 | } else if (pdu_type == 0x07 && btle_context->aux_pdu_type_valid) { |
1078 | return val_to_str_ext_const(btle_context->aux_pdu_type, &aux_pdu_common_vals_ext, "Unknown"); |
1079 | } else { |
1080 | return val_to_str_ext_const(pdu_type, &aux_pdu_type_vals_ext, "Unknown"); |
1081 | } |
1082 | } |
1083 | |
1084 | /* |
1085 | * Reverses the bits in each byte of a 32-bit word. |
1086 | * |
1087 | * Needed because CRCs are transmitted in bit-reversed order compared |
1088 | * to the rest of the BTLE packet. See BT spec, Vol 6, Part B, |
1089 | * Section 1.2. |
1090 | */ |
1091 | static uint32_t |
1092 | reverse_bits_per_byte(const uint32_t val) |
1093 | { |
1094 | static const uint8_t nibble_rev[16] = { |
1095 | 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe, |
1096 | 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf |
1097 | }; |
1098 | uint32_t retval = 0; |
1099 | unsigned byte_index; |
1100 | for (byte_index=0; byte_index<4; byte_index++) { |
1101 | unsigned shiftA = byte_index*8; |
1102 | unsigned shiftB = shiftA+4; |
1103 | retval |= (nibble_rev[((val >> shiftA) & 0xf)] << shiftB); |
1104 | retval |= (nibble_rev[((val >> shiftB) & 0xf)] << shiftA); |
1105 | } |
1106 | return retval; |
1107 | } |
1108 | |
1109 | static int |
1110 | dissect_feature_set(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1111 | { |
1112 | proto_item *sub_item; |
1113 | proto_tree *sub_tree; |
1114 | |
1115 | sub_item = proto_tree_add_item(btle_tree, hf_control_feature_set, tvb, offset, 8, ENC_LITTLE_ENDIAN0x80000000); |
1116 | sub_tree = proto_item_add_subtree(sub_item, ett_features); |
1117 | |
1118 | proto_tree_add_bitmask_list(sub_tree, tvb, offset, 1, hfx_control_feature_set_1, ENC_NA0x00000000); |
1119 | offset += 1; |
1120 | |
1121 | proto_tree_add_bitmask_list(sub_tree, tvb, offset, 1, hfx_control_feature_set_2, ENC_NA0x00000000); |
1122 | offset += 1; |
1123 | |
1124 | proto_tree_add_bitmask_list(sub_tree, tvb, offset, 1, hfx_control_feature_set_3, ENC_NA0x00000000); |
1125 | offset += 1; |
1126 | |
1127 | proto_tree_add_bitmask_list(sub_tree, tvb, offset, 1, hfx_control_feature_set_4, ENC_NA0x00000000); |
1128 | offset += 1; |
1129 | |
1130 | proto_tree_add_bitmask_list(sub_tree, tvb, offset, 1, hfx_control_feature_set_5, ENC_NA0x00000000); |
1131 | offset += 1; |
1132 | |
1133 | proto_tree_add_bitmask_list(sub_tree, tvb, offset, 1, hfx_control_feature_set_6, ENC_NA0x00000000); |
1134 | offset += 1; |
1135 | |
1136 | proto_tree_add_bitmask_list(sub_tree, tvb, offset, 1, hfx_control_feature_set_7, ENC_NA0x00000000); |
1137 | offset += 1; |
1138 | |
1139 | proto_tree_add_bitmask_list(sub_tree, tvb, offset, 1, hfx_control_feature_set_8, ENC_NA0x00000000); |
1140 | offset += 1; |
1141 | |
1142 | return offset; |
1143 | } |
1144 | |
1145 | static int |
1146 | dissect_conn_param_req_rsp(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1147 | { |
1148 | proto_tree_add_item(btle_tree, hf_control_interval_min, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1149 | offset += 2; |
1150 | |
1151 | proto_tree_add_item(btle_tree, hf_control_interval_max, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1152 | offset += 2; |
1153 | |
1154 | proto_tree_add_item(btle_tree, hf_control_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1155 | offset += 2; |
1156 | |
1157 | proto_tree_add_item(btle_tree, hf_control_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1158 | offset += 2; |
1159 | |
1160 | proto_tree_add_item(btle_tree, hf_control_preferred_periodicity, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
1161 | offset += 1; |
1162 | |
1163 | proto_tree_add_item(btle_tree, hf_control_reference_connection_event_count, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1164 | offset += 2; |
1165 | |
1166 | proto_tree_add_item(btle_tree, hf_control_offset_0, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1167 | offset += 2; |
1168 | |
1169 | proto_tree_add_item(btle_tree, hf_control_offset_1, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1170 | offset += 2; |
1171 | |
1172 | proto_tree_add_item(btle_tree, hf_control_offset_2, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1173 | offset += 2; |
1174 | |
1175 | proto_tree_add_item(btle_tree, hf_control_offset_3, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1176 | offset += 2; |
1177 | |
1178 | proto_tree_add_item(btle_tree, hf_control_offset_4, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1179 | offset += 2; |
1180 | |
1181 | proto_tree_add_item(btle_tree, hf_control_offset_5, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1182 | offset += 2; |
1183 | |
1184 | return offset; |
1185 | } |
1186 | |
1187 | static int |
1188 | dissect_length_req_rsp(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1189 | { |
1190 | proto_tree_add_item(btle_tree, hf_control_max_rx_octets, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1191 | offset += 2; |
1192 | |
1193 | proto_tree_add_item(btle_tree, hf_control_max_rx_time, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1194 | offset += 2; |
1195 | |
1196 | proto_tree_add_item(btle_tree, hf_control_max_tx_octets, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1197 | offset += 2; |
1198 | |
1199 | proto_tree_add_item(btle_tree, hf_control_max_tx_time, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1200 | offset += 2; |
1201 | |
1202 | return offset; |
1203 | } |
1204 | |
1205 | static int |
1206 | dissect_phy_req_rsp(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1207 | { |
1208 | proto_tree_add_bitmask(btle_tree, tvb, offset, hf_control_tx_phys, ett_tx_phys, hfx_control_phys_sender, ENC_NA0x00000000); |
1209 | offset += 1; |
1210 | |
1211 | proto_tree_add_bitmask(btle_tree, tvb, offset, hf_control_rx_phys, ett_rx_phys, hfx_control_phys_sender, ENC_NA0x00000000); |
1212 | offset += 1; |
1213 | |
1214 | return offset; |
1215 | } |
1216 | |
1217 | static int |
1218 | dissect_periodic_sync_ind(tvbuff_t *tvb, proto_tree *btle_tree, int offset, packet_info *pinfo, uint32_t interface_id, uint32_t adapter_id) |
1219 | { |
1220 | uint32_t sync_offset, interval; |
1221 | int reserved_offset; |
1222 | uint16_t sf; |
1223 | uint8_t bd_addr[6]; |
1224 | proto_item *item; |
1225 | proto_item *sub_item; |
1226 | proto_tree *sub_tree; |
1227 | |
1228 | /* ID */ |
1229 | proto_tree_add_item(btle_tree, hf_control_sync_id, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1230 | offset += 2; |
1231 | |
1232 | /* Sync Info */ |
1233 | sf = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN0x80000000); |
1234 | |
1235 | item = proto_tree_add_item_ret_uint(btle_tree, hf_control_sync_info_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &sync_offset); |
1236 | proto_tree_add_item(btle_tree, hf_control_sync_info_offset_units, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1237 | proto_tree_add_item(btle_tree, hf_control_sync_info_offset_adjust, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1238 | proto_tree_add_item(btle_tree, hf_control_sync_info_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1239 | if (sync_offset > 0) { |
1240 | proto_item_append_text(item, " (%u usec)", sync_offset * ((sf & 0x2000) != 0 ? 300 : 30) + ((sf & 0x4000) != 0 ? 2457600 : 0)); |
1241 | } else { |
1242 | proto_item_append_text(item, " Cannot be represented"); |
1243 | } |
1244 | offset += 2; |
1245 | |
1246 | item = proto_tree_add_item_ret_uint(btle_tree, hf_control_sync_info_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &interval); |
1247 | proto_item_append_text(item, " (%g msec)", interval * 1.25); |
1248 | offset += 2; |
1249 | |
1250 | sub_item = proto_tree_add_item(btle_tree, hf_control_sync_info_channel_map, tvb, offset, 5, ENC_NA0x00000000); |
1251 | sub_tree = proto_item_add_subtree(sub_item, ett_channel_map); |
1252 | |
1253 | call_dissector_with_data(btcommon_le_channel_map_handle, tvb_new_subset_length(tvb, offset, 5), pinfo, sub_tree, &reserved_offset); |
1254 | proto_tree_add_item(btle_tree, hf_control_sync_info_sleep_clock_accuracy, tvb, reserved_offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
1255 | offset += 5; |
1256 | |
1257 | proto_tree_add_item(btle_tree, hf_control_sync_info_access_address, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000); |
1258 | offset += 4; |
1259 | |
1260 | proto_tree_add_item(btle_tree, hf_control_sync_info_crc_init, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
1261 | offset += 3; |
1262 | |
1263 | proto_tree_add_item(btle_tree, hf_control_sync_info_event_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1264 | offset += 2; |
1265 | |
1266 | /* connEv */ |
1267 | proto_tree_add_item(btle_tree, hf_control_sync_conn_event_count, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1268 | offset += 2; |
1269 | |
1270 | proto_tree_add_item(btle_tree, hf_control_sync_last_pa_event_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1271 | offset += 2; |
1272 | |
1273 | proto_tree_add_bitmask_list(btle_tree, tvb, offset, 1, hfx_control_periodicsyncflags, ENC_NA0x00000000); |
1274 | offset += 1; |
1275 | |
1276 | proto_tree_add_bitmask(btle_tree, tvb, offset, hf_control_phys, ett_phys, hfx_control_phys, ENC_NA0x00000000); |
1277 | offset += 1; |
1278 | |
1279 | offset = dissect_bd_addr(hf_advertising_address, pinfo, btle_tree, tvb, offset, true1, interface_id, adapter_id, bd_addr); |
1280 | |
1281 | proto_tree_add_item(btle_tree, hf_control_sync_sync_conn_event_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1282 | offset += 2; |
1283 | |
1284 | return offset; |
1285 | } |
1286 | |
1287 | static int |
1288 | dissect_cis_req(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1289 | { |
1290 | uint32_t interval; |
1291 | proto_item *item; |
1292 | |
1293 | proto_tree_add_item(btle_tree, hf_control_cig_id, tvb, offset, 1, ENC_NA0x00000000); |
1294 | offset += 1; |
1295 | |
1296 | proto_tree_add_item(btle_tree, hf_control_cis_id, tvb, offset, 1, ENC_NA0x00000000); |
1297 | offset += 1; |
1298 | |
1299 | proto_tree_add_bitmask(btle_tree, tvb, offset, hf_control_c_to_p_phy, ett_c_to_p_phy, hfx_control_c_to_p_phy, ENC_NA0x00000000); |
1300 | offset += 1; |
1301 | |
1302 | proto_tree_add_bitmask(btle_tree, tvb, offset, hf_control_p_to_c_phy, ett_p_to_c_phy, hfx_control_p_to_c_phy, ENC_NA0x00000000); |
1303 | offset += 1; |
1304 | |
1305 | proto_tree_add_item(btle_tree, hf_control_max_sdu_c_to_p, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1306 | proto_tree_add_item(btle_tree, hf_control_rfu_1, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1307 | proto_tree_add_item(btle_tree, hf_control_framed, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1308 | offset += 2; |
1309 | |
1310 | proto_tree_add_item(btle_tree, hf_control_max_sdu_p_to_c, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1311 | proto_tree_add_item(btle_tree, hf_control_rfu_2, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1312 | offset += 2; |
1313 | |
1314 | proto_tree_add_item(btle_tree, hf_control_sdu_interval_c_to_p, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
1315 | proto_tree_add_item(btle_tree, hf_control_rfu_3, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
1316 | offset += 3; |
1317 | |
1318 | proto_tree_add_item(btle_tree, hf_control_sdu_interval_p_to_c, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
1319 | proto_tree_add_item(btle_tree, hf_control_rfu_4, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
1320 | offset += 3; |
1321 | |
1322 | proto_tree_add_item(btle_tree, hf_control_max_pdu_c_to_p, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1323 | offset += 2; |
1324 | |
1325 | proto_tree_add_item(btle_tree, hf_control_max_pdu_p_to_c, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1326 | offset += 2; |
1327 | |
1328 | proto_tree_add_item(btle_tree, hf_control_num_sub_events, tvb, offset, 1, ENC_NA0x00000000); |
1329 | offset += 1; |
1330 | |
1331 | proto_tree_add_item(btle_tree, hf_control_sub_interval, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
1332 | offset += 3; |
1333 | |
1334 | proto_tree_add_item(btle_tree, hf_control_bn_c_to_p, tvb, offset, 1, ENC_NA0x00000000); |
1335 | proto_tree_add_item(btle_tree, hf_control_bn_p_to_c, tvb, offset, 1, ENC_NA0x00000000); |
1336 | offset += 1; |
1337 | |
1338 | proto_tree_add_item(btle_tree, hf_control_ft_c_to_p, tvb, offset, 1, ENC_NA0x00000000); |
1339 | offset += 1; |
1340 | |
1341 | proto_tree_add_item(btle_tree, hf_control_ft_p_to_c, tvb, offset, 1, ENC_NA0x00000000); |
1342 | offset += 1; |
1343 | |
1344 | item = proto_tree_add_item_ret_uint(btle_tree, hf_control_iso_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &interval); |
1345 | proto_item_append_text(item, " (%g msec)", interval * 1.25); |
1346 | offset += 2; |
1347 | |
1348 | proto_tree_add_item(btle_tree, hf_control_cis_offset_min, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
1349 | offset += 3; |
1350 | |
1351 | proto_tree_add_item(btle_tree, hf_control_cis_offset_max, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
1352 | offset += 3; |
1353 | |
1354 | proto_tree_add_item(btle_tree, hf_control_conn_event_count, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1355 | offset += 2; |
1356 | |
1357 | return offset; |
1358 | } |
1359 | |
1360 | static int |
1361 | dissect_cis_rsp(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1362 | { |
1363 | proto_tree_add_item(btle_tree, hf_control_cis_offset_min, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
1364 | offset += 3; |
1365 | |
1366 | proto_tree_add_item(btle_tree, hf_control_cis_offset_max, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
1367 | offset += 3; |
1368 | |
1369 | proto_tree_add_item(btle_tree, hf_control_conn_event_count, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1370 | offset += 2; |
1371 | |
1372 | return offset; |
1373 | } |
1374 | |
1375 | static int |
1376 | dissect_cis_ind(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1377 | { |
1378 | proto_tree_add_item(btle_tree, hf_control_access_address, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000); |
1379 | offset += 4; |
1380 | |
1381 | proto_tree_add_item(btle_tree, hf_control_cis_offset, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
1382 | offset += 3; |
1383 | |
1384 | proto_tree_add_item(btle_tree, hf_control_cig_sync_delay, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
1385 | offset += 3; |
1386 | |
1387 | proto_tree_add_item(btle_tree, hf_control_cis_sync_delay, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
1388 | offset += 3; |
1389 | |
1390 | proto_tree_add_item(btle_tree, hf_control_conn_event_count, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1391 | offset += 2; |
1392 | |
1393 | return offset; |
1394 | } |
1395 | |
1396 | static int |
1397 | dissect_cis_terminate_ind(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1398 | { |
1399 | proto_tree_add_item(btle_tree, hf_control_cig_id, tvb, offset, 1, ENC_NA0x00000000); |
1400 | offset += 1; |
1401 | |
1402 | proto_tree_add_item(btle_tree, hf_control_cis_id, tvb, offset, 1, ENC_NA0x00000000); |
1403 | offset += 1; |
1404 | |
1405 | proto_tree_add_item(btle_tree, hf_control_error_code, tvb, offset, 1, ENC_NA0x00000000); |
1406 | offset += 1; |
1407 | |
1408 | return offset; |
1409 | } |
1410 | |
1411 | static int |
1412 | dissect_power_control_req(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1413 | { |
1414 | proto_tree_add_bitmask(btle_tree, tvb, offset, hf_control_pwr_phy, ett_pwr_phy, hfx_control_pwr_phy, ENC_NA0x00000000); |
1415 | offset += 1; |
1416 | |
1417 | proto_tree_add_item(btle_tree, hf_control_delta, tvb, offset, 1, ENC_NA0x00000000); |
1418 | offset += 1; |
1419 | |
1420 | proto_tree_add_item(btle_tree, hf_control_txpwr, tvb, offset, 1, ENC_NA0x00000000); |
1421 | offset += 1; |
1422 | |
1423 | return offset; |
1424 | } |
1425 | |
1426 | |
1427 | static int |
1428 | dissect_power_control_rsp(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1429 | { |
1430 | proto_tree_add_bitmask(btle_tree, tvb, offset, hf_control_pwrflags, ett_pwrflags, hfx_control_pwrflags, ENC_NA0x00000000); |
1431 | offset += 1; |
1432 | |
1433 | proto_tree_add_item(btle_tree, hf_control_delta, tvb, offset, 1, ENC_NA0x00000000); |
1434 | offset += 1; |
1435 | |
1436 | proto_tree_add_item(btle_tree, hf_control_txpwr, tvb, offset, 1, ENC_NA0x00000000); |
1437 | offset += 1; |
1438 | |
1439 | proto_tree_add_item(btle_tree, hf_control_acceptable_power_reduction, tvb, offset, 1, ENC_NA0x00000000); |
1440 | offset += 1; |
1441 | |
1442 | return offset; |
1443 | } |
1444 | |
1445 | static int |
1446 | dissect_power_control_ind(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1447 | { |
1448 | proto_tree_add_bitmask(btle_tree, tvb, offset, hf_control_pwr_phy, ett_pwr_phy, hfx_control_pwr_phy, ENC_NA0x00000000); |
1449 | offset += 1; |
1450 | |
1451 | proto_tree_add_bitmask(btle_tree, tvb, offset, hf_control_pwrflags, ett_pwrflags, hfx_control_pwrflags, ENC_NA0x00000000); |
1452 | offset += 1; |
1453 | |
1454 | proto_tree_add_item(btle_tree, hf_control_delta, tvb, offset, 1, ENC_NA0x00000000); |
1455 | offset += 1; |
1456 | |
1457 | proto_tree_add_item(btle_tree, hf_control_txpwr, tvb, offset, 1, ENC_NA0x00000000); |
1458 | offset += 1; |
1459 | |
1460 | return offset; |
1461 | } |
1462 | |
1463 | static int |
1464 | dissect_subrate_req(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1465 | { |
1466 | proto_tree_add_item(btle_tree, hf_control_subrate_factor_min, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1467 | offset += 2; |
1468 | |
1469 | proto_tree_add_item(btle_tree, hf_control_subrate_factor_max, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1470 | offset += 2; |
1471 | |
1472 | proto_tree_add_item(btle_tree, hf_control_max_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1473 | offset += 2; |
1474 | |
1475 | proto_tree_add_item(btle_tree, hf_control_continuation_number, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1476 | offset += 2; |
1477 | |
1478 | proto_tree_add_item(btle_tree, hf_control_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1479 | offset += 2; |
1480 | |
1481 | return offset; |
1482 | } |
1483 | |
1484 | static int |
1485 | dissect_subrate_ind(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1486 | { |
1487 | proto_tree_add_item(btle_tree, hf_control_subrate_factor, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1488 | offset += 2; |
1489 | |
1490 | proto_tree_add_item(btle_tree, hf_control_subrate_base_event, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1491 | offset += 2; |
1492 | |
1493 | proto_tree_add_item(btle_tree, hf_control_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1494 | offset += 2; |
1495 | |
1496 | proto_tree_add_item(btle_tree, hf_control_continuation_number, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1497 | offset += 2; |
1498 | |
1499 | proto_tree_add_item(btle_tree, hf_control_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
1500 | offset += 2; |
1501 | |
1502 | return offset; |
1503 | } |
1504 | |
1505 | static int |
1506 | dissect_channel_reporting_ind(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1507 | { |
1508 | proto_tree_add_item(btle_tree, hf_control_channel_reporting_enable, tvb, offset, 1, ENC_NA0x00000000); |
1509 | offset += 1; |
1510 | |
1511 | proto_tree_add_item(btle_tree, hf_control_channel_reporting_min_spacing, tvb, offset, 1, ENC_NA0x00000000); |
1512 | offset += 1; |
1513 | |
1514 | proto_tree_add_item(btle_tree, hf_control_channel_reporting_max_delay, tvb, offset, 1, ENC_NA0x00000000); |
1515 | offset += 1; |
1516 | |
1517 | return offset; |
1518 | } |
1519 | |
1520 | static int |
1521 | dissect_channel_status_ind(tvbuff_t *tvb, proto_tree *btle_tree, int offset) |
1522 | { |
1523 | proto_tree_add_item(btle_tree, hf_control_channel_classification, tvb, offset, 10, ENC_NA0x00000000); |
1524 | offset += 10; |
1525 | |
1526 | return offset; |
1527 | } |
1528 | |
1529 | |
1530 | static int |
1531 | dissect_periodic_sync_wr_ind(tvbuff_t *tvb, proto_tree *btle_tree, int offset, packet_info *pinfo, uint32_t interface_id, uint32_t adapter_id) |
1532 | { |
1533 | /* The first part of LL_PERIODIC_SYNC_WR_IND is identical to LL_PERIODIC_SYNC_IND */ |
1534 | offset += dissect_periodic_sync_ind(tvb, btle_tree, offset, pinfo, interface_id, adapter_id); |
1535 | |
1536 | proto_tree_add_item(btle_tree, hf_control_sync_info_rsp_access_address, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000); |
1537 | offset += 4; |
1538 | |
1539 | proto_tree_add_item(btle_tree, hf_control_sync_info_num_subevents, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
1540 | offset += 1; |
1541 | |
1542 | proto_tree_add_item(btle_tree, hf_control_sync_info_subevent_interval, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
1543 | offset += 1; |
1544 | |
1545 | proto_tree_add_item(btle_tree, hf_control_sync_info_response_slot_delay, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
1546 | offset += 1; |
1547 | |
1548 | proto_tree_add_item(btle_tree, hf_control_sync_info_response_slot_spacing, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
1549 | offset += 1; |
1550 | |
1551 | return offset; |
1552 | } |
1553 | |
1554 | static int |
1555 | dissect_ctrl_pdu_without_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *btle_tree, int offset) |
1556 | { |
1557 | if (tvb_reported_length_remaining(tvb, offset) > 3) { |
1558 | proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_reported_length_remaining(tvb, offset) - 3); |
1559 | offset += tvb_reported_length_remaining(tvb, offset) - 3; |
1560 | } |
1561 | |
1562 | return offset; |
1563 | } |
1564 | |
1565 | static int |
1566 | dissect_crc(tvbuff_t *tvb, |
1567 | proto_tree *btle_tree, |
1568 | int offset, |
1569 | packet_info *pinfo, |
1570 | uint32_t length, |
1571 | const connection_info_t *connection_info, |
1572 | const btle_context_t *btle_context, |
1573 | uint32_t access_address) |
1574 | { |
1575 | /* BT spec Vol 6, Part B, Section 1.2: CRC is big endian and bits in byte are flipped */ |
1576 | uint32_t packet_crc = reverse_bits_per_byte(tvb_get_ntoh24(tvb, offset)); |
1577 | proto_item *sub_item = proto_tree_add_uint(btle_tree, hf_crc, tvb, offset, 3, packet_crc); |
1578 | |
1579 | if (btle_context && btle_context->crc_checked_at_capture) { |
1580 | if (!btle_context->crc_valid_at_capture) { |
1581 | expert_add_info(pinfo, sub_item, &ei_crc_incorrect); |
1582 | } |
1583 | } else if ((access_address == ACCESS_ADDRESS_ADVERTISING0x8e89bed6) || connection_info) { |
1584 | /* CRC can be calculated */ |
1585 | uint32_t crc_init; |
1586 | |
1587 | if (access_address == ACCESS_ADDRESS_ADVERTISING0x8e89bed6) { |
1588 | crc_init = 0x555555; |
1589 | } else { |
1590 | crc_init = connection_info->crc_init; |
1591 | } |
1592 | |
1593 | uint32_t crc = btle_crc(tvb, length, crc_init); |
1594 | if (packet_crc != crc) { |
1595 | expert_add_info(pinfo, sub_item, &ei_crc_incorrect); |
1596 | } |
1597 | } else { |
1598 | expert_add_info(pinfo, sub_item, &ei_crc_cannot_be_determined); |
1599 | } |
1600 | |
1601 | return 3; |
1602 | } |
1603 | |
1604 | /* Checks if it is possible to add the frame at the given index |
1605 | * to the given control procedure context. |
1606 | * |
1607 | * It does not care if the procedure is already marked as completed. |
1608 | * Therefore this function can be used to add an LL_UNKNOWN_RSP to |
1609 | * a completed connection parameter update procedure. |
1610 | */ |
1611 | static bool_Bool |
1612 | control_proc_can_add_frame_even_if_complete(packet_info *pinfo, |
1613 | control_proc_info_t *last_control_proc_info, |
1614 | uint8_t proc_opcode, |
1615 | unsigned frame_num) |
1616 | { |
1617 | if (frame_num == 0) |
1618 | return false0; /* This function must be used to add a frame to an ongoing procedure */ |
1619 | |
1620 | /* We need to check if the control procedure has been initiated. */ |
1621 | if (!last_control_proc_info) |
1622 | return false0; |
1623 | |
1624 | /* And that the new frame belongs to this control procedure */ |
1625 | if (last_control_proc_info->proc_opcode != proc_opcode) |
1626 | return false0; |
1627 | |
1628 | /* Previous frame has not yet been added. */ |
1629 | if (last_control_proc_info->frames[frame_num - 1] == 0) |
1630 | return false0; |
1631 | |
1632 | /* We need to check if we can add this frame at this index |
1633 | * in the control procedure sequence. */ |
1634 | |
1635 | /* The first time we visit the frame, we just need to check that the |
1636 | * spot is empty. */ |
1637 | if (!pinfo->fd->visited && last_control_proc_info->frames[frame_num]) |
1638 | return false0; /* Another opcode has already been added to the procedure at this index */ |
1639 | |
1640 | /* At later visits, we need to check that we are not replacing the frame with |
1641 | * another frame. */ |
1642 | if (pinfo->fd->visited && (last_control_proc_info->frames[frame_num] != pinfo->num)) |
1643 | return false0; |
1644 | |
1645 | return true1; |
1646 | } |
1647 | |
1648 | static bool_Bool |
1649 | control_proc_is_complete(uint32_t frame_num, control_proc_info_t const *last_control_proc_info) |
1650 | { |
1651 | if (last_control_proc_info->last_frame != 0 && |
1652 | frame_num > last_control_proc_info->last_frame) |
1653 | return true1; |
1654 | |
1655 | return false0; |
1656 | } |
1657 | |
1658 | static bool_Bool |
1659 | control_proc_can_add_frame(packet_info *pinfo, |
1660 | control_proc_info_t *last_control_proc_info, |
1661 | uint8_t proc_opcode, |
1662 | unsigned frame_num) |
1663 | { |
1664 | if (!control_proc_can_add_frame_even_if_complete(pinfo, |
1665 | last_control_proc_info, |
1666 | proc_opcode, |
1667 | frame_num)) |
1668 | return false0; |
1669 | |
1670 | /* We check that we are not adding a frame to a completed procedure. */ |
1671 | if (control_proc_is_complete(pinfo->num, last_control_proc_info)) |
1672 | return false0; |
1673 | |
1674 | return true1; |
1675 | } |
1676 | |
1677 | static void |
1678 | control_proc_complete_if_instant_reached(unsigned frame_num, |
1679 | uint16_t event_counter, |
1680 | control_proc_info_t *last_control_proc_info) |
1681 | { |
1682 | /* We need to check if the control procedure has been initiated. */ |
1683 | if (!last_control_proc_info) |
1684 | return; |
1685 | |
1686 | if (control_proc_is_complete(frame_num, last_control_proc_info)) |
1687 | return; |
1688 | |
1689 | /* The instant can only be reached if the current frame is after |
1690 | * the one containing the instant value. */ |
1691 | if ((last_control_proc_info->frame_with_instant_value == 0)|| |
1692 | (frame_num < last_control_proc_info->frame_with_instant_value)) |
1693 | return; |
1694 | |
1695 | if (last_control_proc_info->instant == event_counter) { |
1696 | /* Frame matches event counter, mark procedure as complete. */ |
1697 | last_control_proc_info->last_frame = frame_num; |
1698 | } |
1699 | } |
1700 | |
1701 | static bool_Bool |
1702 | control_proc_contains_instant(uint8_t proc_opcode) |
1703 | { |
1704 | switch (proc_opcode) |
1705 | { |
1706 | case LL_CTRL_OPCODE_CONNECTION_UPDATE_IND: |
1707 | case LL_CTRL_OPCODE_CHANNEL_MAP_IND: |
1708 | case LL_CTRL_OPCODE_CONNECTION_PARAM_REQ: |
1709 | case LL_CTRL_OPCODE_PHY_REQ: |
1710 | return true1; |
1711 | default: |
1712 | return false0; |
1713 | } |
1714 | } |
1715 | |
1716 | /* Returns true if this frame contains an collision violating the specification. |
1717 | * |
1718 | * See Core_v5.2, Vol 6, Part B, Section 5.3 */ |
1719 | static bool_Bool |
1720 | control_proc_invalid_collision(packet_info const *pinfo, |
1721 | control_proc_info_t const *control_proc_other, |
1722 | uint8_t proc_opcode) |
1723 | { |
1724 | if (!control_proc_other) |
1725 | return false0; |
1726 | |
1727 | if (control_proc_is_complete(pinfo->num, control_proc_other)) |
1728 | return false0; |
1729 | |
1730 | /* Both procedures must contain an instant to be marked as incompatible. */ |
1731 | if (!control_proc_contains_instant(control_proc_other->proc_opcode) || |
1732 | !control_proc_contains_instant(proc_opcode)) |
1733 | return false0; |
1734 | |
1735 | /* From the Core Spec: |
1736 | * |
1737 | * If the peer has already sent at least one PDU as part of procedure A, the |
1738 | * device should immediately exit the Connection State and transition to the |
1739 | * Standby State. |
1740 | * |
1741 | * That is, if there exists are response in the other procedure at this point in |
1742 | * time, there is a procedure violation. |
1743 | */ |
1744 | if (control_proc_other->frames[1] && (control_proc_other->frames[1] < pinfo->num)) |
1745 | return true1; |
1746 | else |
1747 | return false0; |
1748 | } |
1749 | |
1750 | /* Mark the start of a new control procedure. |
1751 | * At first visit it will create a new control procedure context. |
1752 | * Otherwise it will update the existing context. |
1753 | * |
1754 | * If there is already an ongoing control procedure context, control procedure |
1755 | * contexts will not be created or modified. |
1756 | * |
1757 | * It returns the procedure context in case it exists, otherwise NULL. |
1758 | */ |
1759 | static control_proc_info_t * |
1760 | control_proc_start(tvbuff_t *tvb, |
1761 | packet_info *pinfo, |
1762 | proto_tree *btle_tree, |
1763 | proto_item *control_proc_item, |
1764 | wmem_tree_t *control_proc_tree, |
1765 | control_proc_info_t const *control_proc_other_direction, |
1766 | uint8_t opcode) |
1767 | { |
1768 | if (control_proc_invalid_collision(pinfo, |
1769 | control_proc_other_direction, |
1770 | opcode)) { |
1771 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_invalid_collision); |
1772 | } |
1773 | |
1774 | control_proc_info_t *proc_info; |
1775 | if (!pinfo->fd->visited) { |
1776 | /* Check the if there is an existing ongoing procedure. */ |
1777 | proc_info = (control_proc_info_t *)wmem_tree_lookup32_le(control_proc_tree, pinfo->num); |
1778 | if (proc_info && proc_info->last_frame == 0) { |
1779 | /* Control procedure violation - initiating new procedure before previous was complete */ |
1780 | return NULL((void*)0); |
1781 | } else { |
1782 | /* Create a new control procedure context. */ |
1783 | proc_info = wmem_new0(wmem_file_scope(), control_proc_info_t)((control_proc_info_t*)wmem_alloc0((wmem_file_scope()), sizeof (control_proc_info_t))); |
1784 | memset(proc_info, 0, sizeof(control_proc_info_t)); |
1785 | proc_info->frames[0] = pinfo->num; |
1786 | proc_info->proc_opcode = opcode; |
1787 | wmem_tree_insert32(control_proc_tree, pinfo->num, proc_info); |
1788 | } |
1789 | } else { |
1790 | /* Match the responses with this request. */ |
1791 | proc_info = (control_proc_info_t *)wmem_tree_lookup32(control_proc_tree, pinfo->num); |
1792 | |
1793 | if (proc_info && proc_info->proc_opcode == opcode) { |
1794 | proto_item *sub_item; |
1795 | for (unsigned i = 1; i < array_length(proc_info->frames)(sizeof (proc_info->frames) / sizeof (proc_info->frames )[0]); i++) { |
1796 | if (proc_info->frames[i]) { |
1797 | sub_item = proto_tree_add_uint(btle_tree, hf_response_in_frame, tvb, 0, 0, proc_info->frames[i]); |
1798 | proto_item_set_generated(sub_item); |
1799 | } |
1800 | } |
1801 | } else { |
1802 | /* The found control procedure does not match the last one. |
1803 | * This indicates a protocol violation. */ |
1804 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_overlapping); |
1805 | |
1806 | return NULL((void*)0); |
1807 | } |
1808 | } |
1809 | |
1810 | return proc_info; |
1811 | } |
1812 | |
1813 | /* Adds a frame to a control procedure context */ |
1814 | static void control_proc_add_frame(tvbuff_t *tvb, |
1815 | packet_info *pinfo, |
1816 | proto_tree *btle_tree, |
1817 | uint8_t opcode, |
1818 | uint32_t direction, |
1819 | control_proc_info_t *last_control_proc_info, |
1820 | control_proc_info_t const *control_proc_other_direction, |
1821 | unsigned frame_num) |
1822 | { |
1823 | proto_item *item; |
1824 | |
1825 | last_control_proc_info->frames[frame_num] = pinfo->num; |
1826 | |
1827 | item = proto_tree_add_uint(btle_tree, hf_request_in_frame, tvb, 0, 0, |
1828 | last_control_proc_info->frames[0]); |
1829 | proto_item_set_generated(item); |
1830 | |
1831 | if (control_proc_other_direction && |
1832 | !control_proc_is_complete(pinfo->num, control_proc_other_direction) && |
1833 | control_proc_contains_instant(last_control_proc_info->proc_opcode) && |
1834 | control_proc_contains_instant(control_proc_other_direction->proc_opcode)) { |
1835 | if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1 && |
1836 | opcode != LL_CTRL_OPCODE_REJECT_IND && |
1837 | opcode != LL_CTRL_OPCODE_REJECT_EXT_IND) { |
1838 | /* Continuing a control procedure when the peer has initiated an incompatible control procedure. |
1839 | * The central should have aborted the peripheral initiated procedure. |
1840 | * See Core_V5.2, Vol 6, Part B, Section 5.3. |
1841 | */ |
1842 | expert_add_info(pinfo, item, &ei_control_proc_invalid_conflict_resolution); |
1843 | } |
1844 | } |
1845 | } |
1846 | |
1847 | /* Adds a frame to a control procedure context. |
1848 | * Marks this frame as the last control procedure packet. */ |
1849 | static void control_proc_add_last_frame(tvbuff_t *tvb, |
1850 | packet_info *pinfo, |
1851 | proto_tree *btle_tree, |
1852 | uint8_t opcode, |
1853 | uint32_t direction, |
1854 | control_proc_info_t *last_control_proc_info, |
1855 | control_proc_info_t const *control_proc_other_direction, |
1856 | unsigned frame_num) |
1857 | { |
1858 | control_proc_add_frame(tvb, |
1859 | pinfo, |
1860 | btle_tree, |
1861 | opcode, |
1862 | direction, |
1863 | last_control_proc_info, |
1864 | control_proc_other_direction, |
1865 | frame_num); |
1866 | last_control_proc_info->last_frame = pinfo->num; |
1867 | } |
1868 | |
1869 | /* Adds a frame containing an instant to a control procedure context |
1870 | * Marks this frame as the last control procedure packet if the event counter is not available */ |
1871 | static void control_proc_add_frame_with_instant(tvbuff_t *tvb, |
1872 | packet_info *pinfo, |
1873 | proto_tree *btle_tree, |
1874 | const btle_context_t *btle_context, |
1875 | uint8_t opcode, |
1876 | uint32_t direction, |
1877 | control_proc_info_t *last_control_proc_info, |
1878 | control_proc_info_t const *control_proc_other_direction, |
1879 | unsigned frame_num, |
1880 | uint16_t instant) |
1881 | { |
1882 | if (btle_context && btle_context->event_counter_valid) { |
1883 | control_proc_add_frame(tvb, |
1884 | pinfo, |
1885 | btle_tree, |
1886 | opcode, |
1887 | direction, |
1888 | last_control_proc_info, |
1889 | control_proc_other_direction, |
1890 | frame_num); |
1891 | last_control_proc_info->instant = instant; |
1892 | last_control_proc_info->frame_with_instant_value = pinfo->num; |
1893 | } else { |
1894 | /* Event counter is not available, assume the procedure completes now. */ |
1895 | control_proc_add_last_frame(tvb, |
1896 | pinfo, |
1897 | btle_tree, |
1898 | opcode, |
1899 | direction, |
1900 | last_control_proc_info, |
1901 | control_proc_other_direction, |
1902 | frame_num); |
1903 | } |
1904 | } |
1905 | |
1906 | static void |
1907 | dissect_ad_eir(tvbuff_t *tvb, uint32_t interface_id, uint32_t adapter_id, uint32_t frame_number, uint8_t *src_bd_addr, packet_info *pinfo, proto_tree *tree) |
1908 | { |
1909 | bluetooth_eir_ad_data_t *ad_data = wmem_new0(pinfo->pool, bluetooth_eir_ad_data_t)((bluetooth_eir_ad_data_t*)wmem_alloc0((pinfo->pool), sizeof (bluetooth_eir_ad_data_t))); |
1910 | ad_data->interface_id = interface_id; |
1911 | ad_data->adapter_id = adapter_id; |
1912 | call_dissector_with_data(btcommon_ad_handle, tvb, pinfo, tree, ad_data); |
1913 | if (pinfo->fd->visited) |
1914 | return; |
1915 | for (int offset = 0;; ) { |
1916 | unsigned remain = tvb_reported_length_remaining(tvb, offset); |
1917 | unsigned length; |
1918 | uint8_t opcode; |
1919 | if (remain < 1) |
1920 | break; |
1921 | length = tvb_get_uint8(tvb, offset); |
1922 | ++offset; |
1923 | if (length <= 0) |
1924 | continue; |
1925 | --remain; |
1926 | if (remain < length) |
1927 | break; |
1928 | opcode = tvb_get_uint8(tvb, offset); |
1929 | if (opcode == 0x2c && length >= 34) { |
1930 | unsigned seed_access_address = tvb_get_uint32(tvb, offset + 14, ENC_LITTLE_ENDIAN0x80000000); |
1931 | uint32_t trunc_seed_access_address = seed_access_address & 0x0041ffff; |
1932 | broadcastiso_connection_info_t *nconnection_info; |
1933 | wmem_tree_key_t key[5]; |
1934 | |
1935 | key[0].length = 1; |
1936 | key[0].key = &interface_id; |
1937 | key[1].length = 1; |
1938 | key[1].key = &adapter_id; |
1939 | key[2].length = 1; |
1940 | key[2].key = &trunc_seed_access_address; |
1941 | key[3].length = 1; |
1942 | key[3].key = &frame_number; |
1943 | key[4].length = 0; |
1944 | key[4].key = NULL((void*)0); |
1945 | |
1946 | nconnection_info = wmem_new0(wmem_file_scope(), broadcastiso_connection_info_t)((broadcastiso_connection_info_t*)wmem_alloc0((wmem_file_scope ()), sizeof(broadcastiso_connection_info_t))); |
1947 | |
1948 | if (src_bd_addr) |
1949 | memcpy(nconnection_info->central_bd_addr, src_bd_addr, 6); |
1950 | |
1951 | wmem_tree_insert32_array(broadcastiso_connection_info_tree, key, nconnection_info); |
1952 | } |
1953 | offset += length; |
1954 | } |
1955 | } |
1956 | |
1957 | static uint8_t |
1958 | guess_btle_pdu_type_from_access(uint32_t interface_id, |
1959 | uint32_t adapter_id, |
1960 | uint32_t access_address) |
1961 | { |
1962 | wmem_tree_key_t key[5]; |
1963 | wmem_tree_t *wmem_tree; |
1964 | uint32_t broadcast_iso_seed_access_address = access_address & 0x0041ffff; |
1965 | |
1966 | /* No context to provide us with physical channel pdu type, make an assumption from the access address */ |
1967 | if (access_address == ACCESS_ADDRESS_ADVERTISING0x8e89bed6) { |
1968 | return BTLE_PDU_TYPE_ADVERTISING1; |
1969 | } |
1970 | |
1971 | /* Check if it is a connection context. */ |
1972 | key[0].length = 1; |
1973 | key[0].key = &interface_id; |
1974 | key[1].length = 1; |
1975 | key[1].key = &adapter_id; |
1976 | key[2].length = 1; |
1977 | key[2].key = &access_address; |
1978 | key[3].length = 0; |
1979 | key[3].key = NULL((void*)0); |
1980 | |
1981 | wmem_tree = (wmem_tree_t *) wmem_tree_lookup32_array(connection_info_tree, key); |
1982 | if (wmem_tree) { |
1983 | /* Connection. */ |
1984 | return BTLE_PDU_TYPE_DATA2; |
1985 | } |
1986 | |
1987 | wmem_tree = (wmem_tree_t *) wmem_tree_lookup32_array(periodic_adv_info_tree, key); |
1988 | if (wmem_tree) { |
1989 | /* Periodic advertiser. */ |
1990 | return BTLE_PDU_TYPE_ADVERTISING1; |
1991 | } |
1992 | |
1993 | key[2].key = &broadcast_iso_seed_access_address; |
1994 | wmem_tree = (wmem_tree_t *) wmem_tree_lookup32_array(broadcastiso_connection_info_tree, key); |
1995 | if (wmem_tree) { |
1996 | /* Broadcast ISO. */ |
1997 | return BTLE_PDU_TYPE_BROADCASTISO4; |
1998 | } |
1999 | |
2000 | /* Default to data. */ |
2001 | return BTLE_PDU_TYPE_DATA2; |
2002 | } |
2003 | |
2004 | static const btle_context_t * get_btle_context(packet_info *pinfo, |
2005 | void *data, |
2006 | uint32_t *adapter_id_out, |
2007 | uint32_t *interface_id_out) |
2008 | { |
2009 | const btle_context_t * btle_context = NULL((void*)0); |
2010 | bluetooth_data_t *bluetooth_data = NULL((void*)0); |
2011 | ubertooth_data_t *ubertooth_data = NULL((void*)0); |
2012 | |
2013 | wmem_list_frame_t * list_data = wmem_list_frame_prev(wmem_list_tail(pinfo->layers)); |
2014 | if (list_data) { |
2015 | int previous_proto = GPOINTER_TO_INT(wmem_list_frame_data(list_data))((gint) (glong) (wmem_list_frame_data(list_data))); |
2016 | |
2017 | if ((previous_proto == proto_btle_rf)||(previous_proto == proto_nordic_ble)) { |
2018 | btle_context = (const btle_context_t *) data; |
2019 | bluetooth_data = btle_context->previous_protocol_data.bluetooth_data; |
2020 | } else if (previous_proto == proto_bluetooth) { |
2021 | bluetooth_data = (bluetooth_data_t *) data; |
2022 | } |
2023 | |
2024 | if (bluetooth_data && bluetooth_data->previous_protocol_data_type == BT_PD_UBERTOOTH_DATA) { |
2025 | ubertooth_data = bluetooth_data->previous_protocol_data.ubertooth_data; |
2026 | } |
2027 | } |
2028 | |
2029 | if (bluetooth_data) |
2030 | *interface_id_out = bluetooth_data->interface_id; |
2031 | else if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID0x00000004) |
2032 | *interface_id_out = pinfo->rec->rec_header.packet_header.interface_id; |
2033 | else |
2034 | *interface_id_out = HCI_INTERFACE_DEFAULT0; |
2035 | |
2036 | if (ubertooth_data) |
2037 | *adapter_id_out = ubertooth_data->bus_id << 8 | ubertooth_data->device_address; |
2038 | else if (bluetooth_data) |
2039 | *adapter_id_out = bluetooth_data->adapter_id; |
2040 | else |
2041 | *adapter_id_out = HCI_ADAPTER_DEFAULT0; |
2042 | |
2043 | return btle_context; |
2044 | } |
2045 | |
2046 | static int |
2047 | dissect_btle_adv(tvbuff_t *tvb, |
2048 | packet_info *pinfo, |
2049 | proto_tree *btle_tree, |
2050 | const btle_context_t *btle_context, |
2051 | uint32_t adapter_id, |
2052 | uint32_t interface_id, |
2053 | uint32_t access_address) |
2054 | { |
2055 | proto_item *sub_item; |
2056 | proto_tree *sub_tree; |
2057 | int offset = 0; |
2058 | uint32_t length; |
2059 | tvbuff_t *next_tvb; |
2060 | uint8_t *dst_bd_addr; |
2061 | uint8_t *src_bd_addr; |
2062 | static const uint8_t broadcast_addr[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; |
2063 | connection_info_t *connection_info = NULL((void*)0); |
2064 | wmem_tree_t *wmem_tree; |
2065 | wmem_tree_key_t key[5], ae_had_key[4]; |
2066 | |
2067 | uint32_t connection_access_address; |
2068 | |
2069 | proto_item *item; |
2070 | unsigned item_value; |
2071 | |
2072 | proto_item *advertising_header_item; |
2073 | proto_tree *advertising_header_tree; |
2074 | proto_item *link_layer_data_item; |
2075 | proto_tree *link_layer_data_tree; |
2076 | uint8_t header, pdu_type; |
2077 | bool_Bool ch_sel_valid = false0, tx_add_valid = false0, rx_add_valid = false0; |
2078 | bool_Bool is_periodic_adv = false0; |
2079 | |
2080 | src_bd_addr = (uint8_t *) wmem_alloc(pinfo->pool, 6); |
2081 | dst_bd_addr = (uint8_t *) wmem_alloc(pinfo->pool, 6); |
2082 | |
2083 | key[0].length = 1; |
2084 | key[0].key = &interface_id; |
2085 | key[1].length = 1; |
2086 | key[1].key = &adapter_id; |
2087 | key[2].length = 1; |
2088 | key[2].key = &access_address; |
2089 | key[3].length = 0; |
2090 | key[3].key = NULL((void*)0); |
2091 | |
2092 | wmem_tree = (wmem_tree_t *) wmem_tree_lookup32_array(connection_info_tree, key); |
2093 | if (!wmem_tree) { |
2094 | /* Check periodic advertising tree */ |
2095 | wmem_tree = (wmem_tree_t *) wmem_tree_lookup32_array(periodic_adv_info_tree, key); |
2096 | if (wmem_tree) { |
2097 | is_periodic_adv = true1; |
2098 | } |
2099 | } |
2100 | |
2101 | if (wmem_tree) { |
2102 | connection_info = (connection_info_t *) wmem_tree_lookup32_le(wmem_tree, pinfo->num); |
2103 | if (connection_info) { |
2104 | set_address(&pinfo->net_src, AT_ETHER, 6, connection_info->central_bd_addr); |
2105 | copy_address_shallow(&pinfo->dl_src, &pinfo->net_src); |
2106 | copy_address_shallow(&pinfo->src, &pinfo->net_src); |
2107 | memcpy(src_bd_addr, connection_info->central_bd_addr, 6); |
2108 | } |
2109 | } |
2110 | |
2111 | advertising_header_item = proto_tree_add_item(btle_tree, hf_advertising_header, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
2112 | advertising_header_tree = proto_item_add_subtree(advertising_header_item, ett_advertising_header); |
2113 | |
2114 | header = tvb_get_uint8(tvb, offset); |
2115 | pdu_type = header & 0x0F; |
2116 | |
2117 | switch (pdu_type) { |
2118 | case 0x00: /* ADV_IND */ |
2119 | ch_sel_valid = true1; |
2120 | /* Fallthrough */ |
2121 | case 0x02: /* ADV_NONCONN_IND */ |
2122 | case 0x06: /* ADV_SCAN_IND */ |
2123 | case 0x04: /* SCAN_RSP */ |
2124 | tx_add_valid = true1; |
2125 | break; |
2126 | case 0x07: /* ADV_EXT_IND / AUX_ADV_IND / AUX_SYNC_IND / AUX_CHAIN_IND / AUX_SCAN_RSP */ |
2127 | case 0x08: /* AUX_CONNECT_RSP */ |
2128 | case 0x09: /* ADV_DECISION_IND */ |
2129 | { |
2130 | /* 0 + header, 1 = len, 2 = ext_len/adv-mode, 3 = flags */ |
2131 | uint8_t ext_header_flags = tvb_get_uint8(tvb, offset + 3); |
2132 | |
2133 | ch_sel_valid = false0; |
2134 | tx_add_valid = (ext_header_flags & 0x01) != 0; |
2135 | rx_add_valid = (ext_header_flags & 0x02) != 0; |
2136 | break; |
2137 | } |
2138 | case 0x01: /* ADV_DIRECT_IND */ |
2139 | case 0x05: /* CONNECT_IND or AUX_CONNECT_REQ */ |
2140 | if (btle_context && btle_context->channel >= 37) { |
2141 | /* CONNECT_IND */ |
2142 | ch_sel_valid = true1; |
2143 | } |
2144 | /* Fallthrough */ |
2145 | case 0x03: /* SCAN_REQ or AUX_SCAN_REQ */ |
2146 | tx_add_valid = true1; |
2147 | rx_add_valid = true1; |
2148 | break; |
2149 | } |
2150 | |
2151 | proto_item_append_text(advertising_header_item, " (PDU Type: %s", adv_pdu_type_str_get(btle_context, pdu_type, is_periodic_adv)); |
2152 | item = proto_tree_add_item(advertising_header_tree, hf_advertising_header_pdu_type, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2153 | proto_item_append_text(item, " %s", adv_pdu_type_str_get(btle_context, pdu_type, is_periodic_adv)); |
2154 | proto_tree_add_item(advertising_header_tree, hf_advertising_header_rfu_1, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2155 | |
2156 | if (ch_sel_valid) { |
2157 | proto_item_append_text(advertising_header_item, ", ChSel: %s", |
2158 | tfs_get_string(header & 0x20, &tfs_ch_sel)); |
2159 | proto_tree_add_item(advertising_header_tree, hf_advertising_header_ch_sel, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2160 | } else { |
2161 | proto_tree_add_item(advertising_header_tree, hf_advertising_header_rfu_2, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2162 | } |
2163 | |
2164 | if (tx_add_valid) { |
2165 | proto_item_append_text(advertising_header_item, ", TxAdd: %s", |
2166 | tfs_get_string(header & 0x40, &tfs_random_public)); |
2167 | proto_tree_add_item(advertising_header_tree, hf_advertising_header_randomized_tx, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2168 | } else { |
2169 | proto_tree_add_item(advertising_header_tree, hf_advertising_header_rfu_3, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2170 | } |
2171 | |
2172 | if (rx_add_valid) { |
2173 | proto_item_append_text(advertising_header_item, ", RxAdd: %s", |
2174 | tfs_get_string(header & 0x80, &tfs_random_public)); |
2175 | proto_tree_add_item(advertising_header_tree, hf_advertising_header_randomized_rx, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2176 | } else { |
2177 | proto_tree_add_item(advertising_header_tree, hf_advertising_header_rfu_4, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2178 | } |
2179 | |
2180 | proto_item_append_text(advertising_header_item, ")"); |
2181 | |
2182 | col_set_str(pinfo->cinfo, COL_INFO, adv_pdu_type_str_get(btle_context, pdu_type, is_periodic_adv)); |
2183 | |
2184 | offset += 1; |
2185 | |
2186 | proto_tree_add_item(advertising_header_tree, hf_advertising_header_length, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2187 | item = proto_tree_add_item_ret_uint(btle_tree, hf_length, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000, &length); |
2188 | proto_item_set_hidden(item); |
2189 | offset += 1; |
2190 | |
2191 | switch (pdu_type) { |
2192 | case 0x00: /* ADV_IND */ |
2193 | case 0x02: /* ADV_NONCONN_IND */ |
2194 | case 0x06: /* ADV_SCAN_IND */ |
2195 | offset = dissect_bd_addr(hf_advertising_address, pinfo, btle_tree, tvb, offset, true1, interface_id, adapter_id, src_bd_addr); |
2196 | |
2197 | set_address(&pinfo->net_src, AT_ETHER, 6, src_bd_addr); |
2198 | copy_address_shallow(&pinfo->dl_src, &pinfo->net_src); |
2199 | copy_address_shallow(&pinfo->src, &pinfo->net_src); |
2200 | |
2201 | set_address(&pinfo->net_dst, AT_ETHER, 6, broadcast_addr); |
2202 | copy_address_shallow(&pinfo->dl_dst, &pinfo->net_dst); |
2203 | copy_address_shallow(&pinfo->dst, &pinfo->net_dst); |
2204 | |
2205 | if (!pinfo->fd->visited) { |
2206 | address *addr; |
2207 | |
2208 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_src, sizeof(address)); |
2209 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_src.data, pinfo->dl_src.len); |
2210 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_SRC0, addr); |
2211 | |
2212 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_dst, sizeof(address)); |
2213 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_dst.data, pinfo->dl_dst.len); |
2214 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_DST1, addr); |
2215 | } |
2216 | |
2217 | if (tvb_reported_length_remaining(tvb, offset) > 3) { |
2218 | next_tvb = tvb_new_subset_length(tvb, offset, tvb_reported_length_remaining(tvb, offset) - 3); |
2219 | dissect_ad_eir(next_tvb, interface_id, adapter_id, pinfo->num, src_bd_addr, pinfo, btle_tree); |
2220 | } |
2221 | |
2222 | offset += tvb_reported_length_remaining(tvb, offset) - 3; |
2223 | |
2224 | break; |
2225 | case 0x01: /* ADV_DIRECT_IND */ |
2226 | offset = dissect_bd_addr(hf_advertising_address, pinfo, btle_tree, tvb, offset, true1, interface_id, adapter_id, src_bd_addr); |
2227 | offset = dissect_bd_addr(hf_target_addresss, pinfo, btle_tree, tvb, offset, false0, interface_id, adapter_id, dst_bd_addr); |
2228 | |
2229 | set_address(&pinfo->net_src, AT_ETHER, 6, src_bd_addr); |
2230 | copy_address_shallow(&pinfo->dl_src, &pinfo->net_src); |
2231 | copy_address_shallow(&pinfo->src, &pinfo->net_src); |
2232 | |
2233 | set_address(&pinfo->net_dst, AT_ETHER, 6, dst_bd_addr); |
2234 | copy_address_shallow(&pinfo->dl_dst, &pinfo->net_dst); |
2235 | copy_address_shallow(&pinfo->dst, &pinfo->net_dst); |
2236 | |
2237 | if (!pinfo->fd->visited) { |
2238 | address *addr; |
2239 | |
2240 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_src, sizeof(address)); |
2241 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_src.data, pinfo->dl_src.len); |
2242 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_SRC0, addr); |
2243 | |
2244 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_dst, sizeof(address)); |
2245 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_dst.data, pinfo->dl_dst.len); |
2246 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_DST1, addr); |
2247 | } |
2248 | |
2249 | break; |
2250 | case 0x03: /* SCAN_REQ */ |
2251 | offset = dissect_bd_addr(hf_scanning_address, pinfo, btle_tree, tvb, offset, true1, interface_id, adapter_id, src_bd_addr); |
2252 | offset = dissect_bd_addr(hf_advertising_address, pinfo, btle_tree, tvb, offset, false0, interface_id, adapter_id, dst_bd_addr); |
2253 | |
2254 | set_address(&pinfo->net_src, AT_ETHER, 6, src_bd_addr); |
2255 | copy_address_shallow(&pinfo->dl_src, &pinfo->net_src); |
2256 | copy_address_shallow(&pinfo->src, &pinfo->net_src); |
2257 | |
2258 | set_address(&pinfo->net_dst, AT_ETHER, 6, dst_bd_addr); |
2259 | copy_address_shallow(&pinfo->dl_dst, &pinfo->net_dst); |
2260 | copy_address_shallow(&pinfo->dst, &pinfo->net_dst); |
2261 | |
2262 | if (!pinfo->fd->visited) { |
2263 | address *addr; |
2264 | |
2265 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_src, sizeof(address)); |
2266 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_src.data, pinfo->dl_src.len); |
2267 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_SRC0, addr); |
2268 | |
2269 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_dst, sizeof(address)); |
2270 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_dst.data, pinfo->dl_dst.len); |
2271 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_DST1, addr); |
2272 | } |
2273 | |
2274 | break; |
2275 | case 0x04: /* SCAN_RSP */ |
2276 | offset = dissect_bd_addr(hf_advertising_address, pinfo, btle_tree, tvb, offset, true1, interface_id, adapter_id, src_bd_addr); |
2277 | |
2278 | set_address(&pinfo->net_src, AT_ETHER, 6, src_bd_addr); |
2279 | copy_address_shallow(&pinfo->dl_src, &pinfo->net_src); |
2280 | copy_address_shallow(&pinfo->src, &pinfo->net_src); |
2281 | |
2282 | set_address(&pinfo->net_dst, AT_ETHER, 6, broadcast_addr); |
2283 | copy_address_shallow(&pinfo->dl_dst, &pinfo->net_dst); |
2284 | copy_address_shallow(&pinfo->dst, &pinfo->net_dst); |
2285 | |
2286 | if (!pinfo->fd->visited) { |
2287 | address *addr; |
2288 | |
2289 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_src, sizeof(address)); |
2290 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_src.data, pinfo->dl_src.len); |
2291 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_SRC0, addr); |
2292 | |
2293 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_dst, sizeof(address)); |
2294 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_dst.data, pinfo->dl_dst.len); |
2295 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_DST1, addr); |
2296 | } |
2297 | |
2298 | sub_item = proto_tree_add_item(btle_tree, hf_scan_response_data, tvb, offset, tvb_reported_length_remaining(tvb, offset) - 3, ENC_NA0x00000000); |
2299 | sub_tree = proto_item_add_subtree(sub_item, ett_scan_response_data); |
2300 | |
2301 | if (tvb_reported_length_remaining(tvb, offset) > 3) { |
2302 | next_tvb = tvb_new_subset_length(tvb, offset, tvb_reported_length_remaining(tvb, offset) - 3); |
2303 | dissect_ad_eir(next_tvb, interface_id, adapter_id, pinfo->num, src_bd_addr, pinfo, sub_tree); |
2304 | } |
2305 | |
2306 | offset += tvb_reported_length_remaining(tvb, offset) - 3; |
2307 | |
2308 | break; |
2309 | case 0x05: /* CONNECT_IND */ |
2310 | { |
2311 | uint32_t connect_ind_crc_init; |
2312 | |
2313 | offset = dissect_bd_addr(hf_initiator_addresss, pinfo, btle_tree, tvb, offset, false0, interface_id, adapter_id, src_bd_addr); |
2314 | offset = dissect_bd_addr(hf_advertising_address, pinfo, btle_tree, tvb, offset, true1, interface_id, adapter_id, dst_bd_addr); |
2315 | |
2316 | set_address(&pinfo->net_src, AT_ETHER, 6, src_bd_addr); |
2317 | copy_address_shallow(&pinfo->dl_src, &pinfo->net_src); |
2318 | copy_address_shallow(&pinfo->src, &pinfo->net_src); |
2319 | |
2320 | set_address(&pinfo->net_dst, AT_ETHER, 6, dst_bd_addr); |
2321 | copy_address_shallow(&pinfo->dl_dst, &pinfo->net_dst); |
2322 | copy_address_shallow(&pinfo->dst, &pinfo->net_dst); |
2323 | |
2324 | if (!pinfo->fd->visited) { |
2325 | address *addr; |
2326 | |
2327 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_src, sizeof(address)); |
2328 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_src.data, pinfo->dl_src.len); |
2329 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_SRC0, addr); |
2330 | |
2331 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_dst, sizeof(address)); |
2332 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_dst.data, pinfo->dl_dst.len); |
2333 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_DST1, addr); |
2334 | } |
2335 | |
2336 | link_layer_data_item = proto_tree_add_item(btle_tree, hf_link_layer_data, tvb, offset, 22, ENC_NA0x00000000); |
2337 | link_layer_data_tree = proto_item_add_subtree(link_layer_data_item, ett_link_layer_data); |
2338 | |
2339 | proto_tree_add_item(link_layer_data_tree, hf_link_layer_data_access_address, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000); |
2340 | connection_access_address = tvb_get_letohl(tvb, offset); |
2341 | offset += 4; |
2342 | |
2343 | proto_tree_add_item_ret_uint(link_layer_data_tree, hf_link_layer_data_crc_init, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000, &connect_ind_crc_init); |
2344 | offset += 3; |
2345 | |
2346 | item = proto_tree_add_item_ret_uint(link_layer_data_tree, hf_link_layer_data_window_size, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000, &item_value); |
2347 | proto_item_append_text(item, " (%g msec)", item_value*1.25); |
2348 | offset += 1; |
2349 | |
2350 | item = proto_tree_add_item_ret_uint(link_layer_data_tree, hf_link_layer_data_window_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &item_value); |
2351 | proto_item_append_text(item, " (%g msec)", item_value*1.25); |
2352 | offset += 2; |
2353 | |
2354 | item = proto_tree_add_item_ret_uint(link_layer_data_tree, hf_link_layer_data_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &item_value); |
2355 | proto_item_append_text(item, " (%g msec)", item_value*1.25); |
2356 | offset += 2; |
2357 | |
2358 | proto_tree_add_item(link_layer_data_tree, hf_link_layer_data_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
2359 | offset += 2; |
2360 | |
2361 | item = proto_tree_add_item_ret_uint(link_layer_data_tree, hf_link_layer_data_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &item_value); |
2362 | proto_item_append_text(item, " (%u msec)", item_value*10); |
2363 | offset += 2; |
2364 | |
2365 | sub_item = proto_tree_add_item(link_layer_data_tree, hf_link_layer_data_channel_map, tvb, offset, 5, ENC_NA0x00000000); |
2366 | sub_tree = proto_item_add_subtree(sub_item, ett_channel_map); |
2367 | |
2368 | call_dissector(btcommon_le_channel_map_handle, tvb_new_subset_length(tvb, offset, 5), pinfo, sub_tree); |
2369 | offset += 5; |
2370 | |
2371 | proto_tree_add_item(link_layer_data_tree, hf_link_layer_data_hop, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2372 | proto_tree_add_item(link_layer_data_tree, hf_link_layer_data_sleep_clock_accuracy, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2373 | offset += 1; |
2374 | |
2375 | if (!pinfo->fd->visited) { |
2376 | connection_parameter_info_t *connection_parameter_info; |
2377 | |
2378 | key[0].length = 1; |
2379 | key[0].key = &interface_id; |
2380 | key[1].length = 1; |
2381 | key[1].key = &adapter_id; |
2382 | key[2].length = 1; |
2383 | key[2].key = &connection_access_address; |
2384 | key[3].length = 1; |
2385 | key[3].key = &pinfo->num; |
2386 | key[4].length = 0; |
2387 | key[4].key = NULL((void*)0); |
2388 | |
2389 | connection_info = wmem_new0(wmem_file_scope(), connection_info_t)((connection_info_t*)wmem_alloc0((wmem_file_scope()), sizeof( connection_info_t))); |
2390 | connection_info->crc_init = connect_ind_crc_init; |
2391 | |
2392 | memcpy(connection_info->central_bd_addr, src_bd_addr, 6); |
2393 | memcpy(connection_info->peripheral_bd_addr, dst_bd_addr, 6); |
2394 | |
2395 | /* We don't create control procedure context trees for BTLE_DIR_UNKNOWN, |
2396 | * as the direction must be known for request/response matching. */ |
2397 | connection_info->direction_info[BTLE_DIR_CENTRAL_PERIPHERAL1].control_procs = |
2398 | wmem_tree_new(wmem_file_scope()); |
2399 | connection_info->direction_info[BTLE_DIR_PERIPHERAL_CENTRAL2].control_procs = |
2400 | wmem_tree_new(wmem_file_scope()); |
2401 | |
2402 | wmem_tree_insert32_array(connection_info_tree, key, connection_info); |
2403 | |
2404 | connection_parameter_info = wmem_new0(wmem_file_scope(), connection_parameter_info_t)((connection_parameter_info_t*)wmem_alloc0((wmem_file_scope() ), sizeof(connection_parameter_info_t))); |
2405 | connection_parameter_info->parameters_frame = pinfo->num; |
2406 | |
2407 | key[3].length = 1; |
2408 | key[3].key = &pinfo->num; |
2409 | wmem_tree_insert32_array(connection_parameter_info_tree, key, connection_parameter_info); |
2410 | } |
2411 | |
2412 | break; |
2413 | } |
2414 | case 0x07: /* ADV_EXT_IND / AUX_ADV_IND / AUX_SYNC_IND / AUX_CHAIN_IND / AUX_SCAN_RSP */ |
2415 | case 0x08: /* AUX_CONNECT_RSP */ |
2416 | case 0x09: /* ADV_DECISION_IND */ |
2417 | { |
2418 | uint8_t tmp, ext_header_len, flags, acad_len; |
2419 | proto_item *ext_header_item, *ext_flags_item; |
2420 | proto_tree *ext_header_tree, *ext_flags_tree; |
2421 | uint32_t adi; |
2422 | bool_Bool adi_present = false0; |
2423 | bool_Bool aux_pointer_present = false0; |
2424 | |
2425 | tmp = tvb_get_uint8(tvb, offset); |
2426 | ext_header_len = acad_len = tmp & 0x3F; |
2427 | |
2428 | ext_header_item = proto_tree_add_item(btle_tree, hf_extended_advertising_header, tvb, offset, ext_header_len + 1, ENC_NA0x00000000); |
2429 | ext_header_tree = proto_item_add_subtree(ext_header_item, ett_extended_advertising_header); |
2430 | |
2431 | proto_tree_add_item(ext_header_tree, hf_extended_advertising_header_length, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2432 | proto_tree_add_item(ext_header_tree, hf_extended_advertising_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2433 | offset += 1; |
2434 | |
2435 | if (ext_header_len > 0) { |
2436 | ext_flags_item = proto_tree_add_item(ext_header_tree, hf_extended_advertising_flags, tvb, offset, 1, ENC_NA0x00000000); |
2437 | ext_flags_tree = proto_item_add_subtree(ext_flags_item, ett_extended_advertising_flags); |
2438 | |
2439 | proto_tree_add_bitmask_list(ext_flags_tree, tvb, offset, 1, hfx_extended_advertising_flags, ENC_NA0x00000000); |
2440 | flags = tvb_get_uint8(tvb, offset); |
2441 | offset += 1; |
2442 | |
2443 | acad_len -= 1; |
2444 | } else { |
2445 | flags = 0; |
2446 | } |
2447 | |
2448 | if (flags & 0x01) { |
2449 | /* Advertiser Address */ |
2450 | offset = dissect_bd_addr(hf_advertising_address, pinfo, ext_header_tree, tvb, offset, true1, interface_id, adapter_id, src_bd_addr); |
2451 | set_address(&pinfo->net_src, AT_ETHER, 6, src_bd_addr); |
2452 | copy_address_shallow(&pinfo->dl_src, &pinfo->net_src); |
2453 | copy_address_shallow(&pinfo->src, &pinfo->net_src); |
2454 | |
2455 | acad_len -= 6; |
2456 | } else if (!connection_info) { |
2457 | const char * anon_str = "Anonymous"; |
2458 | clear_address(&pinfo->dl_src); |
2459 | set_address(&pinfo->net_src, AT_STRINGZ, sizeof(*anon_str), anon_str); |
2460 | copy_address_shallow(&pinfo->src, &pinfo->net_src); |
2461 | } |
2462 | |
2463 | if (flags & 0x02) { |
2464 | /* Target Address */ |
2465 | offset = dissect_bd_addr(hf_target_addresss, pinfo, ext_header_tree, tvb, offset, false0, interface_id, adapter_id, dst_bd_addr); |
2466 | set_address(&pinfo->net_dst, AT_ETHER, 6, dst_bd_addr); |
2467 | copy_address_shallow(&pinfo->dl_dst, &pinfo->net_dst); |
2468 | copy_address_shallow(&pinfo->dst, &pinfo->net_dst); |
2469 | |
2470 | acad_len -= 6; |
2471 | } else { |
2472 | set_address(&pinfo->net_dst, AT_ETHER, 6, broadcast_addr); |
2473 | copy_address_shallow(&pinfo->dl_dst, &pinfo->net_dst); |
2474 | copy_address_shallow(&pinfo->dst, &pinfo->net_dst); |
2475 | } |
2476 | |
2477 | if (flags & 0x04) { |
2478 | uint32_t cte_time; |
2479 | |
2480 | /* CTE Info */ |
2481 | sub_item = proto_tree_add_item(ext_header_tree, hf_extended_advertising_cte_info, tvb, offset, 1, ENC_NA0x00000000); |
2482 | sub_tree = proto_item_add_subtree(sub_item, ett_extended_advertising_cte_info); |
2483 | |
2484 | item = proto_tree_add_item_ret_uint(sub_tree, hf_extended_advertising_cte_info_time, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000, &cte_time); |
2485 | proto_item_append_text(item, " (%u usec)", cte_time * 8); |
2486 | proto_tree_add_item(sub_tree, hf_extended_advertising_cte_info_rfu, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2487 | proto_tree_add_item(sub_tree, hf_extended_advertising_cte_info_type, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2488 | offset += 1; |
2489 | |
2490 | acad_len -= 1; |
2491 | } |
2492 | |
2493 | if (flags & 0x08) { |
2494 | /* AdvDataInfo */ |
2495 | sub_item = proto_tree_add_item_ret_uint(ext_header_tree, hf_extended_advertising_data_info, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &adi); |
2496 | sub_tree = proto_item_add_subtree(sub_item, ett_extended_advertising_data_info); |
2497 | |
2498 | proto_tree_add_item(sub_tree, hf_extended_advertising_data_info_did, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
2499 | proto_tree_add_item(sub_tree, hf_extended_advertising_data_info_sid, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
2500 | offset += 2; |
2501 | adi_present = true1; |
2502 | |
2503 | acad_len -= 2; |
2504 | } |
2505 | |
2506 | if (flags & 0x10) { |
2507 | uint32_t aux_offset; |
2508 | |
2509 | /* Aux Pointer */ |
2510 | sub_item = proto_tree_add_item(ext_header_tree, hf_extended_advertising_aux_ptr, tvb, offset, 3, ENC_NA0x00000000); |
2511 | sub_tree = proto_item_add_subtree(sub_item, ett_extended_advertising_aux_pointer); |
2512 | |
2513 | proto_tree_add_item(sub_tree, hf_extended_advertising_aux_ptr_channel, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2514 | proto_tree_add_item(sub_tree, hf_extended_advertising_aux_ptr_ca, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2515 | proto_tree_add_item(sub_tree, hf_extended_advertising_aux_ptr_offset_units, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2516 | tmp = tvb_get_uint8(tvb, offset); |
2517 | offset += 1; |
2518 | |
2519 | item = proto_tree_add_item_ret_uint(sub_tree, hf_extended_advertising_aux_ptr_aux_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &aux_offset); |
2520 | proto_tree_add_item(sub_tree, hf_extended_advertising_aux_ptr_aux_phy, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
2521 | proto_item_append_text(item, " (%u usec)", aux_offset * ((tmp & 0x80) != 0 ? 300 : 30)); |
2522 | offset += 2; |
2523 | aux_pointer_present = true1; |
2524 | |
2525 | acad_len -= 3; |
2526 | } |
2527 | |
2528 | if (flags & 0x20) { |
2529 | uint32_t sync_offset, interval; |
2530 | proto_item *sync_info_item; |
2531 | proto_tree *sync_info_tree; |
2532 | int reserved_offset; |
2533 | uint16_t sf; |
2534 | |
2535 | /* Sync Info */ |
2536 | sync_info_item = proto_tree_add_item(ext_header_tree, hf_extended_advertising_sync_info, tvb, offset, 18, ENC_NA0x00000000); |
2537 | sync_info_tree = proto_item_add_subtree(sync_info_item, ett_extended_advertising_sync_info); |
2538 | |
2539 | if (!pinfo->fd->visited) { |
2540 | connection_parameter_info_t *connection_parameter_info; |
2541 | |
2542 | connection_access_address = tvb_get_uint32(tvb, offset + 9, ENC_LITTLE_ENDIAN0x80000000); |
2543 | |
2544 | key[0].length = 1; |
2545 | key[0].key = &interface_id; |
2546 | key[1].length = 1; |
2547 | key[1].key = &adapter_id; |
2548 | key[2].length = 1; |
2549 | key[2].key = &connection_access_address; |
2550 | key[3].length = 1; |
2551 | key[3].key = &pinfo->num; |
2552 | key[4].length = 0; |
2553 | key[4].key = NULL((void*)0); |
2554 | |
2555 | connection_info = wmem_new0(wmem_file_scope(), connection_info_t)((connection_info_t*)wmem_alloc0((wmem_file_scope()), sizeof( connection_info_t))); |
2556 | |
2557 | if (flags & 0x01) |
2558 | memcpy(connection_info->central_bd_addr, src_bd_addr, 6); |
2559 | |
2560 | /* We don't create control procedure context trees for BTLE_DIR_UNKNOWN, |
2561 | * as the direction must be known for request/response matching. */ |
2562 | connection_info->direction_info[BTLE_DIR_CENTRAL_PERIPHERAL1].control_procs = |
2563 | wmem_tree_new(wmem_file_scope()); |
2564 | connection_info->direction_info[BTLE_DIR_PERIPHERAL_CENTRAL2].control_procs = |
2565 | wmem_tree_new(wmem_file_scope()); |
2566 | |
2567 | wmem_tree_insert32_array(periodic_adv_info_tree, key, connection_info); |
2568 | |
2569 | connection_parameter_info = wmem_new0(wmem_file_scope(), connection_parameter_info_t)((connection_parameter_info_t*)wmem_alloc0((wmem_file_scope() ), sizeof(connection_parameter_info_t))); |
2570 | connection_parameter_info->parameters_frame = pinfo->num; |
2571 | |
2572 | key[3].length = 1; |
2573 | key[3].key = &pinfo->num; |
2574 | wmem_tree_insert32_array(connection_parameter_info_tree, key, connection_parameter_info); |
2575 | } |
2576 | |
2577 | sf = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN0x80000000); |
2578 | |
2579 | item = proto_tree_add_item_ret_uint(sync_info_tree, hf_extended_advertising_sync_info_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &sync_offset); |
2580 | proto_tree_add_item(sync_info_tree, hf_extended_advertising_sync_info_offset_units, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
2581 | proto_tree_add_item(sync_info_tree, hf_extended_advertising_sync_info_offset_adjust, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
2582 | proto_tree_add_item(sync_info_tree, hf_extended_advertising_sync_info_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
2583 | if (sync_offset > 0) { |
2584 | proto_item_append_text(item, " (%u usec)", sync_offset * ((sf & 0x2000) != 0 ? 300 : 30) + ((sf & 0x4000) != 0 ? 2457600 : 0)); |
2585 | } else { |
2586 | proto_item_append_text(item, " Cannot be represented"); |
2587 | } |
2588 | offset += 2; |
2589 | |
2590 | item = proto_tree_add_item_ret_uint(sync_info_tree, hf_extended_advertising_sync_info_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &interval); |
2591 | proto_item_append_text(item, " (%g msec)", interval * 1.25); |
2592 | offset += 2; |
2593 | |
2594 | sub_item = proto_tree_add_item(sync_info_tree, hf_extended_advertising_sync_info_channel_map, tvb, offset, 5, ENC_NA0x00000000); |
2595 | sub_tree = proto_item_add_subtree(sub_item, ett_channel_map); |
2596 | |
2597 | call_dissector_with_data(btcommon_le_channel_map_handle, tvb_new_subset_length(tvb, offset, 5), pinfo, sub_tree, &reserved_offset); |
2598 | proto_tree_add_item(sync_info_tree, hf_extended_advertising_sync_info_sleep_clock_accuracy, tvb, offset + reserved_offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2599 | offset += 5; |
2600 | |
2601 | proto_tree_add_item(sync_info_tree, hf_extended_advertising_sync_info_access_address, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000); |
2602 | offset += 4; |
2603 | |
2604 | proto_tree_add_item(sync_info_tree, hf_extended_advertising_sync_info_crc_init, tvb, offset, 3, ENC_LITTLE_ENDIAN0x80000000); |
2605 | offset += 3; |
2606 | |
2607 | proto_tree_add_item(sync_info_tree, hf_extended_advertising_sync_info_event_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
2608 | offset += 2; |
2609 | |
2610 | acad_len -= 18; |
2611 | } |
2612 | |
2613 | if (flags & 0x40) { |
2614 | /* Tx Power */ |
2615 | proto_tree_add_item(ext_header_tree, hf_extended_advertising_tx_power, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2616 | offset += 1; |
2617 | |
2618 | acad_len -= 1; |
2619 | } |
2620 | |
2621 | if (acad_len > 0) { |
2622 | sub_item = proto_tree_add_item(ext_header_tree, hf_extended_advertising_header_acad, tvb, offset, acad_len, ENC_NA0x00000000); |
2623 | sub_tree = proto_item_add_subtree(sub_item, ett_extended_advertising_acad); |
2624 | |
2625 | /* Additional Controller Advertising Data */ |
2626 | next_tvb = tvb_new_subset_length(tvb, offset, acad_len); |
2627 | dissect_ad_eir(next_tvb, interface_id, adapter_id, pinfo->num, src_bd_addr, pinfo, sub_tree); |
2628 | |
2629 | offset += acad_len; |
2630 | } |
2631 | if (tvb_reported_length_remaining(tvb, offset) > 3) { |
2632 | bool_Bool ad_processed = false0; |
2633 | if (btle_context && |
2634 | (pdu_type == 0x07 || pdu_type == 0x09) && |
2635 | btle_context->aux_pdu_type_valid) { |
2636 | bool_Bool ad_reassembled = false0; |
2637 | ae_had_info_t *ae_had_info = NULL((void*)0); |
2638 | |
2639 | switch (btle_context->aux_pdu_type) { |
2640 | case 0x00: /* AUX_ADV_IND */ |
2641 | case 0x02: /* AUX_SYNC_IND */ |
2642 | case 0x03: /* AUX_SCAN_RSP */ |
2643 | if (aux_pointer_present) { |
2644 | /* Beginning of new sequence of fragments */ |
2645 | if (!pinfo->fd->visited && adi_present) { |
2646 | ae_had_info = wmem_new0(wmem_file_scope(), ae_had_info_t)((ae_had_info_t*)wmem_alloc0((wmem_file_scope()), sizeof(ae_had_info_t ))); |
2647 | ae_had_info->first_frame_num=pinfo->num; |
2648 | |
2649 | if (flags & 0x01) { |
2650 | /* Copy Advertiser Address to reassemble AUX_CHAIN_IND */ |
2651 | copy_address_wmem(wmem_file_scope(), &ae_had_info->adv_addr, &pinfo->src); |
2652 | } |
2653 | |
2654 | ae_had_key[0].length = 1; |
2655 | ae_had_key[0].key = &interface_id; |
2656 | ae_had_key[1].length = 1; |
2657 | ae_had_key[1].key = &adapter_id; |
2658 | ae_had_key[2].length = 1; |
2659 | ae_had_key[2].key = &adi; |
2660 | ae_had_key[3].length = 0; |
2661 | ae_had_key[3].key = NULL((void*)0); |
2662 | |
2663 | wmem_tree_insert32_array(adi_to_first_frame_tree, ae_had_key, ae_had_info); |
2664 | |
2665 | fragment_add_seq(&btle_ea_host_advertising_data_reassembly_table, |
2666 | tvb, offset, pinfo, |
2667 | ae_had_info->first_frame_num, NULL((void*)0), |
2668 | ae_had_info->fragment_counter, |
2669 | tvb_captured_length_remaining(tvb, offset) - 3, |
2670 | !ad_reassembled, 0); |
2671 | |
2672 | ae_had_info->fragment_counter++; |
2673 | } |
2674 | ad_processed = true1; |
2675 | } |
2676 | break; |
2677 | case 0x01: /* AUX_CHAIN_IND */ |
2678 | if (!aux_pointer_present) { |
2679 | /* Final fragment */ |
2680 | ad_reassembled = true1; |
2681 | } |
2682 | if (!pinfo->fd->visited && adi_present) { |
2683 | |
2684 | ae_had_key[0].length = 1; |
2685 | ae_had_key[0].key = &interface_id; |
2686 | ae_had_key[1].length = 1; |
2687 | ae_had_key[1].key = &adapter_id; |
2688 | ae_had_key[2].length = 1; |
2689 | ae_had_key[2].key = &adi; |
2690 | ae_had_key[3].length = 0; |
2691 | ae_had_key[3].key = NULL((void*)0); |
2692 | |
2693 | ae_had_info = (ae_had_info_t *) wmem_tree_lookup32_array(adi_to_first_frame_tree, ae_had_key); |
2694 | |
2695 | if (ae_had_info != NULL((void*)0)) { |
2696 | if (!(flags & 0x01) && (ae_had_info->adv_addr.len > 0)) { |
2697 | /* Copy Advertiser Address from AUX_ADV_IND if not present. */ |
2698 | copy_address_shallow(&pinfo->src, &ae_had_info->adv_addr); |
2699 | } |
2700 | |
2701 | fragment_add_seq(&btle_ea_host_advertising_data_reassembly_table, |
2702 | tvb, offset, pinfo, |
2703 | ae_had_info->first_frame_num, NULL((void*)0), |
2704 | ae_had_info->fragment_counter, |
2705 | tvb_captured_length_remaining(tvb, offset) - 3, |
2706 | !ad_reassembled, 0); |
2707 | |
2708 | ae_had_info->fragment_counter++; |
2709 | if (ad_reassembled == true1) { |
2710 | p_add_proto_data(wmem_file_scope(), pinfo, proto_btle, (uint32_t)(pinfo->curr_layer_num) << 8, ae_had_info); |
2711 | } |
2712 | } |
2713 | } |
2714 | ad_processed = true1; |
2715 | break; |
2716 | default: |
2717 | /* This field is 2 bits long, no special action needed */ |
2718 | break; |
2719 | } |
2720 | if (ad_processed) { |
2721 | if (pinfo->fd->visited) { |
2722 | /* Host Advertising Data fragment */ |
2723 | proto_tree_add_item(btle_tree, hf_extended_advertising_had_fragment, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3, ENC_NA0x00000000); |
2724 | if (ad_reassembled) { |
2725 | fragment_head *fd_head = NULL((void*)0); |
2726 | tvbuff_t *assembled_tvb = NULL((void*)0); |
2727 | |
2728 | ae_had_info = (ae_had_info_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_btle, (uint32_t)(pinfo->curr_layer_num) << 8); |
2729 | if (ae_had_info != NULL((void*)0)) { |
2730 | col_append_str(pinfo->cinfo, COL_INFO, " (EA HAD Reassembled)"); |
2731 | |
2732 | if (!(flags & 0x01) && (ae_had_info->adv_addr.len > 0)) { |
2733 | /* Copy Advertiser Address from AUX_ADV_IND if not present. */ |
2734 | copy_address_shallow(&pinfo->src, &ae_had_info->adv_addr); |
2735 | } |
2736 | |
2737 | fd_head = fragment_get(&btle_ea_host_advertising_data_reassembly_table, pinfo, ae_had_info->first_frame_num, NULL((void*)0)); |
2738 | assembled_tvb = process_reassembled_data( |
2739 | tvb, offset, pinfo, |
2740 | "Reassembled Host Advertising Data", fd_head, |
2741 | &btle_ea_host_advertising_data_frag_items, |
2742 | NULL((void*)0), btle_tree); |
2743 | |
2744 | if (assembled_tvb) { |
2745 | dissect_ad_eir(assembled_tvb, interface_id, adapter_id, pinfo->num, src_bd_addr, pinfo, btle_tree); |
2746 | } |
2747 | } |
2748 | } |
2749 | else { |
2750 | col_append_str(pinfo->cinfo, COL_INFO, " (EA HAD Fragment)"); |
2751 | } |
2752 | offset += tvb_captured_length_remaining(tvb, offset) - 3; |
2753 | } |
2754 | } |
2755 | } |
2756 | |
2757 | if (tvb_reported_length_remaining(tvb, offset) > 3) { |
2758 | /* Host Advertising Data */ |
2759 | next_tvb = tvb_new_subset_length(tvb, offset, tvb_reported_length_remaining(tvb, offset) - 3); |
2760 | |
2761 | if (btle_context && btle_context->aux_pdu_type_valid && btle_context->aux_pdu_type == 3) { |
2762 | /* AUX_SCAN_RSP */ |
2763 | sub_item = proto_tree_add_item(btle_tree, hf_scan_response_data, tvb, offset, tvb_reported_length_remaining(tvb, offset) - 3, ENC_NA0x00000000); |
2764 | sub_tree = proto_item_add_subtree(sub_item, ett_scan_response_data); |
2765 | |
2766 | dissect_ad_eir(next_tvb, interface_id, adapter_id, pinfo->num, src_bd_addr, pinfo, sub_tree); |
2767 | } |
2768 | else { |
2769 | dissect_ad_eir(next_tvb, interface_id, adapter_id, pinfo->num, src_bd_addr, pinfo, btle_tree); |
2770 | } |
2771 | |
2772 | offset += tvb_reported_length_remaining(tvb, offset) - 3; |
2773 | } |
2774 | } |
2775 | break; |
2776 | } |
2777 | default: |
2778 | if (tvb_reported_length_remaining(tvb, offset) > 3) { |
2779 | proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_reported_length_remaining(tvb, offset) - 3); |
2780 | offset += tvb_reported_length_remaining(tvb, offset) - 3; |
2781 | } |
2782 | } |
2783 | |
2784 | return offset; |
2785 | } |
2786 | |
2787 | static int |
2788 | dissect_btle_acl(tvbuff_t *tvb, |
2789 | packet_info *pinfo, |
2790 | proto_tree *tree, |
2791 | proto_tree *btle_tree, |
2792 | const btle_context_t *btle_context, |
2793 | uint32_t adapter_id, |
2794 | uint32_t interface_id, |
2795 | uint32_t access_address) |
2796 | { |
2797 | proto_item *sub_item; |
2798 | proto_tree *sub_tree; |
2799 | int offset = 0; |
2800 | uint32_t length; |
2801 | tvbuff_t *next_tvb; |
2802 | connection_info_t *connection_info = NULL((void*)0); |
2803 | wmem_tree_t *wmem_tree; |
2804 | wmem_tree_key_t key[5]; |
2805 | |
2806 | uint32_t connection_access_address; |
2807 | |
2808 | proto_item *item; |
2809 | unsigned item_value; |
2810 | |
2811 | proto_item *data_header_item, *seq_item, *control_proc_item; |
2812 | proto_tree *data_header_tree; |
2813 | uint8_t oct; |
2814 | uint8_t llid; |
2815 | uint8_t control_opcode; |
2816 | uint32_t direction = BTLE_DIR_UNKNOWN0; |
2817 | uint8_t other_direction = BTLE_DIR_UNKNOWN0; |
2818 | |
2819 | bool_Bool add_l2cap_index = false0; |
2820 | bool_Bool retransmit = false0; |
2821 | bool_Bool cte_info_present = false0; |
2822 | |
2823 | /* Holds the last initiated control procedures for a given direction. */ |
2824 | control_proc_info_t *last_control_proc[3] = {0}; |
2825 | |
2826 | if (btle_context) { |
2827 | direction = btle_context->direction; |
2828 | other_direction = (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) ? BTLE_DIR_CENTRAL_PERIPHERAL1 : BTLE_DIR_PERIPHERAL_CENTRAL2; |
2829 | } |
2830 | |
2831 | btle_frame_info_t *btle_frame_info = NULL((void*)0); |
2832 | fragment_head *frag_btl2cap_msg = NULL((void*)0); |
2833 | btle_frame_info_t empty_btle_frame_info = {0, 0, 0, 0, 0}; |
2834 | |
2835 | key[0].length = 1; |
2836 | key[0].key = &interface_id; |
2837 | key[1].length = 1; |
2838 | key[1].key = &adapter_id; |
2839 | key[2].length = 1; |
2840 | key[2].key = &access_address; |
2841 | key[3].length = 0; |
2842 | key[3].key = NULL((void*)0); |
2843 | |
2844 | oct = tvb_get_uint8(tvb, offset); |
2845 | wmem_tree = (wmem_tree_t *) wmem_tree_lookup32_array(connection_info_tree, key); |
2846 | if (wmem_tree) { |
2847 | connection_info = (connection_info_t *) wmem_tree_lookup32_le(wmem_tree, pinfo->num); |
2848 | if (connection_info) { |
2849 | char *str_addr_src, *str_addr_dst; |
2850 | /* longest possible string */ |
2851 | const size_t str_addr_len = sizeof("Peripheral_0x12345678"); |
2852 | |
2853 | str_addr_src = (char *) wmem_alloc(pinfo->pool, str_addr_len); |
2854 | str_addr_dst = (char *) wmem_alloc(pinfo->pool, str_addr_len); |
2855 | |
2856 | sub_item = proto_tree_add_ether(btle_tree, hf_central_bd_addr, tvb, 0, 0, connection_info->central_bd_addr); |
2857 | proto_item_set_generated(sub_item); |
2858 | |
2859 | sub_item = proto_tree_add_ether(btle_tree, hf_peripheral_bd_addr, tvb, 0, 0, connection_info->peripheral_bd_addr); |
2860 | proto_item_set_generated(sub_item); |
2861 | |
2862 | switch (direction) { |
2863 | case BTLE_DIR_CENTRAL_PERIPHERAL1: |
2864 | snprintf(str_addr_src, str_addr_len, "Central_0x%08x", access_address); |
2865 | snprintf(str_addr_dst, str_addr_len, "Peripheral_0x%08x", access_address); |
2866 | set_address(&pinfo->dl_src, AT_ETHER, sizeof(connection_info->central_bd_addr), connection_info->central_bd_addr); |
2867 | set_address(&pinfo->dl_dst, AT_ETHER, sizeof(connection_info->peripheral_bd_addr), connection_info->peripheral_bd_addr); |
2868 | break; |
2869 | case BTLE_DIR_PERIPHERAL_CENTRAL2: |
2870 | snprintf(str_addr_src, str_addr_len, "Peripheral_0x%08x", access_address); |
2871 | snprintf(str_addr_dst, str_addr_len, "Central_0x%08x", access_address); |
2872 | set_address(&pinfo->dl_src, AT_ETHER, sizeof(connection_info->peripheral_bd_addr), connection_info->peripheral_bd_addr); |
2873 | set_address(&pinfo->dl_dst, AT_ETHER, sizeof(connection_info->central_bd_addr), connection_info->central_bd_addr); |
2874 | break; |
2875 | default: |
2876 | /* BTLE_DIR_UNKNOWN */ |
2877 | snprintf(str_addr_src, str_addr_len, "Unknown_0x%08x", access_address); |
2878 | snprintf(str_addr_dst, str_addr_len, "Unknown_0x%08x", access_address); |
2879 | clear_address(&pinfo->dl_src); |
2880 | clear_address(&pinfo->dl_dst); |
2881 | break; |
2882 | } |
2883 | |
2884 | set_address(&pinfo->net_src, AT_STRINGZ, (int)strlen(str_addr_src)+1, str_addr_src); |
2885 | copy_address_shallow(&pinfo->src, &pinfo->net_src); |
2886 | |
2887 | set_address(&pinfo->net_dst, AT_STRINGZ, (int)strlen(str_addr_dst)+1, str_addr_dst); |
2888 | copy_address_shallow(&pinfo->dst, &pinfo->net_dst); |
2889 | |
2890 | /* Retrieve the last initiated control procedures. */ |
2891 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1] = |
2892 | (control_proc_info_t *)wmem_tree_lookup32_le(connection_info->direction_info[BTLE_DIR_CENTRAL_PERIPHERAL1].control_procs, pinfo->num); |
2893 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2] = |
2894 | (control_proc_info_t *)wmem_tree_lookup32_le(connection_info->direction_info[BTLE_DIR_PERIPHERAL_CENTRAL2].control_procs, pinfo->num); |
2895 | |
2896 | if (!pinfo->fd->visited && btle_context && btle_context->event_counter_valid) { |
2897 | control_proc_complete_if_instant_reached(pinfo->num, |
2898 | btle_context->event_counter, |
2899 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1]); |
2900 | control_proc_complete_if_instant_reached(pinfo->num, |
2901 | btle_context->event_counter, |
2902 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2]); |
2903 | } |
2904 | |
2905 | if (!pinfo->fd->visited) { |
2906 | address *addr; |
2907 | |
2908 | btle_frame_info = wmem_new0(wmem_file_scope(), btle_frame_info_t)((btle_frame_info_t*)wmem_alloc0((wmem_file_scope()), sizeof( btle_frame_info_t))); |
2909 | btle_frame_info->l2cap_index = connection_info->direction_info[direction].l2cap_index; |
2910 | |
2911 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_src, sizeof(address)); |
2912 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_src.data, pinfo->dl_src.len); |
2913 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_SRC0, addr); |
2914 | |
2915 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_dst, sizeof(address)); |
2916 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_dst.data, pinfo->dl_dst.len); |
2917 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_DST1, addr); |
2918 | |
2919 | if (!connection_info->first_data_frame_seen) { |
2920 | connection_info->first_data_frame_seen = 1; |
2921 | btle_frame_info->retransmit = 0; |
2922 | btle_frame_info->ack = 1; |
2923 | connection_info->direction_info[BTLE_DIR_CENTRAL_PERIPHERAL1].prev_seq_num = 0; |
2924 | connection_info->direction_info[BTLE_DIR_PERIPHERAL_CENTRAL2].prev_seq_num = 1; |
2925 | } |
2926 | else { |
2927 | uint8_t seq_num = !!(oct & 0x8), next_expected_seq_num = !!(oct & 0x4); |
2928 | |
2929 | if (seq_num != connection_info->direction_info[direction].prev_seq_num) { |
2930 | /* SN is not equal to previous packet (in same direction) SN */ |
2931 | btle_frame_info->retransmit = 0; |
2932 | } else { |
2933 | btle_frame_info->retransmit = 1; |
2934 | } |
2935 | connection_info->direction_info[direction].prev_seq_num = seq_num; |
2936 | |
2937 | if (next_expected_seq_num != connection_info->direction_info[other_direction].prev_seq_num) { |
2938 | /* NESN is not equal to previous packet (in other direction) SN */ |
2939 | btle_frame_info->ack = 1; |
2940 | } else { |
2941 | btle_frame_info->ack = 0; |
2942 | } |
2943 | } |
2944 | p_add_proto_data(wmem_file_scope(), pinfo, proto_btle, pinfo->curr_layer_num, btle_frame_info); |
2945 | } |
2946 | else { |
2947 | /* Not the first pass */ |
2948 | btle_frame_info = (btle_frame_info_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_btle, pinfo->curr_layer_num); |
2949 | } |
2950 | } |
2951 | } |
2952 | |
2953 | if (btle_frame_info == NULL((void*)0)) { |
2954 | btle_frame_info = &empty_btle_frame_info; |
2955 | } |
2956 | |
2957 | cte_info_present = (oct & 0x20) != 0; |
2958 | |
2959 | data_header_item = proto_tree_add_item(btle_tree, hf_data_header, tvb, offset, (cte_info_present) ? 3 : 2, ENC_NA0x00000000); |
2960 | data_header_tree = proto_item_add_subtree(data_header_item, ett_data_header); |
2961 | |
2962 | proto_tree_add_item(data_header_tree, hf_data_header_llid, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2963 | seq_item = proto_tree_add_item(data_header_tree, hf_data_header_next_expected_sequence_number, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2964 | |
2965 | if (direction != BTLE_DIR_UNKNOWN0) { |
2966 | /* Unable to check valid NESN without direction */ |
2967 | if (btle_frame_info->ack == 1) { |
2968 | proto_item_append_text(seq_item, " [ACK]"); |
2969 | } else { |
2970 | proto_item_append_text(seq_item, " [Request retransmit]"); |
2971 | expert_add_info(pinfo, seq_item, &ei_nack); |
2972 | } |
2973 | } |
2974 | |
2975 | seq_item = proto_tree_add_item(data_header_tree, hf_data_header_sequence_number, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2976 | |
2977 | if (direction != BTLE_DIR_UNKNOWN0) { |
2978 | /* Unable to check valid SN or retransmission without direction */ |
2979 | if (btle_frame_info->retransmit == 0) { |
2980 | proto_item_append_text(seq_item, " [OK]"); |
2981 | } |
2982 | else { |
2983 | proto_item_append_text(seq_item, " [Retransmit]"); |
2984 | if (btle_detect_retransmit) { |
2985 | expert_add_info(pinfo, seq_item, &ei_retransmit); |
2986 | retransmit = true1; |
2987 | } |
2988 | } |
2989 | } |
2990 | |
2991 | llid = oct & 0x03; |
2992 | |
2993 | proto_tree_add_item(data_header_tree, hf_data_header_more_data, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2994 | proto_tree_add_item(data_header_tree, hf_data_header_cte_info_present, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2995 | proto_tree_add_item(data_header_tree, hf_data_header_rfu, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
2996 | |
2997 | offset += 1; |
2998 | |
2999 | proto_tree_add_item(data_header_tree, hf_data_header_length, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
3000 | item = proto_tree_add_item_ret_uint(btle_tree, hf_length, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000, &length); |
3001 | proto_item_set_hidden(item); |
3002 | offset += 1; |
3003 | |
3004 | if (cte_info_present) { |
3005 | uint32_t cte_time; |
3006 | |
3007 | sub_item = proto_tree_add_item(data_header_tree, hf_data_header_cte_info, tvb, offset, 1, ENC_NA0x00000000); |
3008 | sub_tree = proto_item_add_subtree(sub_item, ett_data_header_cte_info); |
3009 | |
3010 | item = proto_tree_add_item_ret_uint(sub_tree, hf_data_header_cte_info_time, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000, &cte_time); |
3011 | proto_item_append_text(item, " (%u usec)", cte_time * 8); |
3012 | proto_tree_add_item(sub_tree, hf_data_header_cte_info_rfu, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
3013 | proto_tree_add_item(sub_tree, hf_data_header_cte_info_type, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
3014 | offset += 1; |
3015 | } |
3016 | |
3017 | switch (llid) { |
3018 | case 0x01: /* Continuation fragment of an L2CAP message, or an Empty PDU */ |
3019 | if (length > 0) { |
3020 | tvbuff_t *new_tvb = NULL((void*)0); |
3021 | |
3022 | pinfo->fragmented = true1; |
3023 | if (connection_info && !retransmit) { |
3024 | if (!pinfo->fd->visited) { |
3025 | if (connection_info->direction_info[direction].segmentation_started == 1) { |
3026 | if (connection_info->direction_info[direction].segment_len_rem >= length) { |
3027 | connection_info->direction_info[direction].segment_len_rem = connection_info->direction_info[direction].segment_len_rem - length; |
3028 | } else { |
3029 | /* |
3030 | * Missing fragment for previous L2CAP and fragment start for this. |
3031 | * Set more_fragments and increase l2cap_index to avoid reassembly. |
3032 | */ |
3033 | btle_frame_info->more_fragments = 1; |
3034 | btle_frame_info->missing_start = 1; |
3035 | btle_frame_info->l2cap_index = l2cap_index; |
3036 | connection_info->direction_info[direction].l2cap_index = l2cap_index; |
3037 | connection_info->direction_info[direction].segmentation_started = 0; |
3038 | l2cap_index++; |
3039 | } |
3040 | if (connection_info->direction_info[direction].segment_len_rem > 0) { |
3041 | btle_frame_info->more_fragments = 1; |
3042 | } |
3043 | else { |
3044 | btle_frame_info->more_fragments = 0; |
3045 | connection_info->direction_info[direction].segmentation_started = 0; |
3046 | connection_info->direction_info[direction].segment_len_rem = 0; |
3047 | } |
3048 | } else { |
3049 | /* |
3050 | * Missing fragment start. |
3051 | * Set more_fragments and increase l2cap_index to avoid reassembly. |
3052 | */ |
3053 | btle_frame_info->more_fragments = 1; |
3054 | btle_frame_info->missing_start = 1; |
3055 | btle_frame_info->l2cap_index = l2cap_index; |
3056 | connection_info->direction_info[direction].l2cap_index = l2cap_index; |
3057 | connection_info->direction_info[direction].segmentation_started = 0; |
3058 | l2cap_index++; |
3059 | } |
3060 | } |
3061 | |
3062 | add_l2cap_index = true1; |
3063 | |
3064 | frag_btl2cap_msg = fragment_add_seq_next(&btle_l2cap_msg_reassembly_table, |
3065 | tvb, offset, |
3066 | pinfo, |
3067 | btle_frame_info->l2cap_index, /* uint32_t ID for fragments belonging together */ |
3068 | NULL((void*)0), /* data* */ |
3069 | length, /* Fragment length */ |
3070 | btle_frame_info->more_fragments); /* More fragments */ |
3071 | |
3072 | new_tvb = process_reassembled_data(tvb, offset, pinfo, |
3073 | "Reassembled L2CAP", |
3074 | frag_btl2cap_msg, |
3075 | &btle_l2cap_msg_frag_items, |
3076 | NULL((void*)0), |
3077 | btle_tree); |
3078 | } |
3079 | |
3080 | if (new_tvb) { |
3081 | bthci_acl_data_t *acl_data; |
3082 | |
3083 | col_set_str(pinfo->cinfo, COL_INFO, "L2CAP Data"); |
3084 | |
3085 | acl_data = wmem_new(pinfo->pool, bthci_acl_data_t)((bthci_acl_data_t*)wmem_alloc((pinfo->pool), sizeof(bthci_acl_data_t ))); |
3086 | acl_data->interface_id = interface_id; |
3087 | acl_data->adapter_id = adapter_id; |
3088 | acl_data->chandle = 0; /* No connection handle at this layer */ |
3089 | acl_data->remote_bd_addr_oui = 0; |
3090 | acl_data->remote_bd_addr_id = 0; |
3091 | acl_data->is_btle = true1; |
3092 | acl_data->is_btle_retransmit = retransmit; |
3093 | acl_data->adapter_disconnect_in_frame = &bluetooth_max_disconnect_in_frame; |
3094 | acl_data->disconnect_in_frame = &bluetooth_max_disconnect_in_frame; |
3095 | |
3096 | next_tvb = tvb_new_subset_length(tvb, offset, length); |
3097 | if (next_tvb) { |
3098 | call_dissector_with_data(btl2cap_handle, new_tvb, pinfo, tree, acl_data); |
3099 | } |
3100 | offset += length; |
3101 | } |
3102 | else { |
3103 | col_set_str(pinfo->cinfo, COL_INFO, "L2CAP Fragment"); |
3104 | item = proto_tree_add_item(btle_tree, hf_l2cap_fragment, tvb, offset, length, ENC_NA0x00000000); |
3105 | if (btle_frame_info->missing_start) { |
3106 | expert_add_info(pinfo, item, &ei_missing_fragment_start); |
3107 | } |
3108 | offset += length; |
3109 | } |
3110 | } else { |
3111 | col_set_str(pinfo->cinfo, COL_INFO, "Empty PDU"); |
3112 | } |
3113 | |
3114 | break; |
3115 | case 0x02: /* Start of an L2CAP message or a complete L2CAP message with no fragmentation */ |
3116 | if (length > 0) { |
3117 | unsigned l2cap_len = tvb_get_letohs(tvb, offset); |
3118 | if (l2cap_len + 4 > length) { /* L2CAP PDU Length excludes the 4 octets header */ |
3119 | pinfo->fragmented = true1; |
3120 | if (connection_info && !retransmit) { |
3121 | if (!pinfo->fd->visited) { |
3122 | connection_info->direction_info[direction].segmentation_started = 1; |
3123 | /* The first two octets in the L2CAP PDU contain the length of the entire |
3124 | * L2CAP PDU in octets, excluding the Length and CID fields(4 octets). |
3125 | */ |
3126 | connection_info->direction_info[direction].segment_len_rem = l2cap_len + 4 - length; |
3127 | connection_info->direction_info[direction].l2cap_index = l2cap_index; |
3128 | btle_frame_info->more_fragments = 1; |
3129 | btle_frame_info->l2cap_index = l2cap_index; |
3130 | l2cap_index++; |
3131 | } |
3132 | |
3133 | add_l2cap_index = true1; |
3134 | |
3135 | frag_btl2cap_msg = fragment_add_seq_next(&btle_l2cap_msg_reassembly_table, |
3136 | tvb, offset, |
3137 | pinfo, |
3138 | btle_frame_info->l2cap_index, /* uint32_t ID for fragments belonging together */ |
3139 | NULL((void*)0), /* data* */ |
3140 | length, /* Fragment length */ |
3141 | btle_frame_info->more_fragments); /* More fragments */ |
3142 | |
3143 | process_reassembled_data(tvb, offset, pinfo, |
3144 | "Reassembled L2CAP", |
3145 | frag_btl2cap_msg, |
3146 | &btle_l2cap_msg_frag_items, |
3147 | NULL((void*)0), |
3148 | btle_tree); |
3149 | } |
3150 | |
3151 | col_set_str(pinfo->cinfo, COL_INFO, "L2CAP Fragment Start"); |
3152 | proto_tree_add_item(btle_tree, hf_l2cap_fragment, tvb, offset, length, ENC_NA0x00000000); |
3153 | offset += length; |
3154 | } else { |
3155 | bthci_acl_data_t *acl_data; |
3156 | if (connection_info) { |
3157 | /* Add a L2CAP index for completeness */ |
3158 | if (!pinfo->fd->visited) { |
3159 | btle_frame_info->l2cap_index = l2cap_index; |
3160 | l2cap_index++; |
3161 | } |
3162 | |
3163 | add_l2cap_index = true1; |
3164 | } |
3165 | |
3166 | col_set_str(pinfo->cinfo, COL_INFO, "L2CAP Data"); |
3167 | |
3168 | acl_data = wmem_new(pinfo->pool, bthci_acl_data_t)((bthci_acl_data_t*)wmem_alloc((pinfo->pool), sizeof(bthci_acl_data_t ))); |
3169 | acl_data->interface_id = interface_id; |
3170 | acl_data->adapter_id = adapter_id; |
3171 | acl_data->chandle = 0; /* No connection handle at this layer */ |
3172 | acl_data->remote_bd_addr_oui = 0; |
3173 | acl_data->remote_bd_addr_id = 0; |
3174 | acl_data->is_btle = true1; |
3175 | acl_data->is_btle_retransmit = retransmit; |
3176 | acl_data->adapter_disconnect_in_frame = &bluetooth_max_disconnect_in_frame; |
3177 | acl_data->disconnect_in_frame = &bluetooth_max_disconnect_in_frame; |
3178 | |
3179 | next_tvb = tvb_new_subset_length(tvb, offset, length); |
3180 | call_dissector_with_data(btl2cap_handle, next_tvb, pinfo, tree, acl_data); |
3181 | offset += length; |
3182 | } |
3183 | } |
3184 | break; |
3185 | case 0x03: /* Control PDU */ |
3186 | control_proc_item = proto_tree_add_item(btle_tree, hf_control_opcode, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
3187 | control_opcode = tvb_get_uint8(tvb, offset); |
3188 | offset += 1; |
3189 | |
3190 | col_add_fstr(pinfo->cinfo, COL_INFO, "Control Opcode: %s", |
3191 | val_to_str_ext_const(control_opcode, &control_opcode_vals_ext, "Unknown")); |
3192 | |
3193 | switch (control_opcode) { |
3194 | case LL_CTRL_OPCODE_CONNECTION_UPDATE_IND: |
3195 | item = proto_tree_add_item_ret_uint(btle_tree, hf_control_window_size, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000, &item_value); |
3196 | proto_item_append_text(item, " (%g msec)", item_value*1.25); |
3197 | offset += 1; |
3198 | |
3199 | item = proto_tree_add_item_ret_uint(btle_tree, hf_control_window_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &item_value); |
3200 | proto_item_append_text(item, " (%g msec)", item_value*1.25); |
3201 | offset += 2; |
3202 | |
3203 | item = proto_tree_add_item_ret_uint(btle_tree, hf_control_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &item_value); |
3204 | proto_item_append_text(item, " (%g msec)", item_value*1.25); |
3205 | offset += 2; |
3206 | |
3207 | proto_tree_add_item(btle_tree, hf_control_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
3208 | offset += 2; |
3209 | |
3210 | item = proto_tree_add_item_ret_uint(btle_tree, hf_control_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &item_value); |
3211 | proto_item_append_text(item, " (%u msec)", item_value*10); |
3212 | offset += 2; |
3213 | |
3214 | proto_tree_add_item_ret_uint(btle_tree, hf_control_instant, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &item_value); |
3215 | offset += 2; |
3216 | |
3217 | if (!pinfo->fd->visited) { |
3218 | if (connection_info) { |
3219 | connection_parameter_info_t *connection_parameter_info; |
3220 | |
3221 | connection_parameter_info = wmem_new0(wmem_file_scope(), connection_parameter_info_t)((connection_parameter_info_t*)wmem_alloc0((wmem_file_scope() ), sizeof(connection_parameter_info_t))); |
3222 | connection_parameter_info->parameters_frame = pinfo->num; |
3223 | |
3224 | if (btle_context && btle_context->event_counter_valid) { |
3225 | connection_info->connection_parameter_update_instant = item_value; |
3226 | connection_info->connection_parameter_update_info = connection_parameter_info; |
3227 | } else { |
3228 | /* We don't have event counter information needed to determine the exact time the new |
3229 | * connection parameters will be applied. |
3230 | * Instead just set it as active immediately. |
3231 | */ |
3232 | key[0].length = 1; |
3233 | key[0].key = &interface_id; |
3234 | key[1].length = 1; |
3235 | key[1].key = &adapter_id; |
3236 | key[2].length = 1; |
3237 | key[2].key = &access_address; |
3238 | key[3].length = 1; |
3239 | key[3].key = &pinfo->num; |
3240 | key[4].length = 0; |
3241 | key[4].key = NULL((void*)0); |
3242 | wmem_tree_insert32_array(connection_parameter_info_tree, key, connection_parameter_info); |
3243 | } |
3244 | } |
3245 | } |
3246 | |
3247 | if (connection_info && !btle_frame_info->retransmit) { |
3248 | /* The LL_CONNECTION_UPDATE_IND can only be sent from central to peripheral. |
3249 | * It can either be sent as the first packet of the connection update procedure, |
3250 | * or as the last packet in the connection parameter request procedure. */ |
3251 | if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
3252 | if (control_proc_can_add_frame(pinfo, |
3253 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3254 | LL_CTRL_OPCODE_CONNECTION_PARAM_REQ, 2)) { |
3255 | control_proc_add_last_frame(tvb, |
3256 | pinfo, |
3257 | btle_tree, |
3258 | control_opcode, |
3259 | direction, |
3260 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3261 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3262 | 2); |
3263 | } else if (control_proc_can_add_frame(pinfo, |
3264 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3265 | LL_CTRL_OPCODE_CONNECTION_PARAM_REQ, 1)) { |
3266 | control_proc_add_last_frame(tvb, |
3267 | pinfo, |
3268 | btle_tree, |
3269 | control_opcode, |
3270 | direction, |
3271 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3272 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3273 | 1); |
3274 | } else { |
3275 | control_proc_info_t *proc_info; |
3276 | proc_info = control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
3277 | connection_info->direction_info[direction].control_procs, |
3278 | last_control_proc[other_direction], |
3279 | control_opcode); |
3280 | |
3281 | if (proc_info) { |
3282 | if (btle_context && btle_context->event_counter_valid) { |
3283 | proc_info->instant = item_value; |
3284 | proc_info->frame_with_instant_value = pinfo->num; |
3285 | } else { |
3286 | /* Event counter is not available, assume the procedure completes now. */ |
3287 | proc_info->last_frame = pinfo->num; |
3288 | } |
3289 | } |
3290 | |
3291 | } |
3292 | } else if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
3293 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3294 | } |
3295 | } |
3296 | |
3297 | break; |
3298 | case LL_CTRL_OPCODE_CHANNEL_MAP_IND: |
3299 | sub_item = proto_tree_add_item(btle_tree, hf_control_channel_map, tvb, offset, 5, ENC_NA0x00000000); |
3300 | sub_tree = proto_item_add_subtree(sub_item, ett_channel_map); |
3301 | |
3302 | call_dissector(btcommon_le_channel_map_handle, tvb_new_subset_length(tvb, offset, 5), pinfo, sub_tree); |
3303 | offset += 5; |
3304 | |
3305 | proto_tree_add_item_ret_uint(btle_tree, hf_control_instant, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &item_value); |
3306 | offset += 2; |
3307 | |
3308 | if (connection_info && !btle_frame_info->retransmit) { |
3309 | /* The LL_CHANNEL_MAP_REQ can only be sent from central to peripheral. |
3310 | * It can either be sent as the first packet of the channel map update procedure, |
3311 | * or as the last packet in the minimum number of used channels procedure. */ |
3312 | if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
3313 | if (control_proc_can_add_frame(pinfo, |
3314 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3315 | LL_CTRL_OPCODE_MIN_USED_CHANNELS_IND, 1)) { |
3316 | control_proc_add_frame_with_instant(tvb, |
3317 | pinfo, |
3318 | btle_tree, |
3319 | btle_context, |
3320 | control_opcode, |
3321 | direction, |
3322 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3323 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3324 | 1, |
3325 | item_value); |
3326 | } else { |
3327 | control_proc_info_t *proc_info; |
3328 | proc_info = control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
3329 | connection_info->direction_info[direction].control_procs, |
3330 | last_control_proc[other_direction], |
3331 | control_opcode); |
3332 | |
3333 | if (proc_info) { |
3334 | if (btle_context && btle_context->event_counter_valid) { |
3335 | proc_info->instant = item_value; |
3336 | proc_info->frame_with_instant_value = pinfo->num; |
3337 | } else { |
3338 | /* Event counter is not available, assume the procedure completes now. */ |
3339 | proc_info->last_frame = pinfo->num; |
3340 | } |
3341 | } |
3342 | } |
3343 | } else if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
3344 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3345 | } |
3346 | } |
3347 | |
3348 | break; |
3349 | case LL_CTRL_OPCODE_TERMINATE_IND: |
3350 | proto_tree_add_item(btle_tree, hf_control_error_code, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
3351 | offset += 1; |
3352 | |
3353 | /* No need to mark procedure as started, as the procedure only consist |
3354 | * of one packet which may be sent at any time, */ |
3355 | |
3356 | break; |
3357 | case LL_CTRL_OPCODE_ENC_REQ: |
3358 | proto_tree_add_item(btle_tree, hf_control_random_number, tvb, offset, 8, ENC_LITTLE_ENDIAN0x80000000); |
3359 | offset += 8; |
3360 | |
3361 | proto_tree_add_item(btle_tree, hf_control_encrypted_diversifier, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
3362 | offset += 2; |
3363 | |
3364 | proto_tree_add_item(btle_tree, hf_control_central_session_key_diversifier, tvb, offset, 8, ENC_LITTLE_ENDIAN0x80000000); |
3365 | offset += 8; |
3366 | |
3367 | proto_tree_add_item(btle_tree, hf_control_central_session_initialization_vector, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000); |
3368 | offset += 4; |
3369 | |
3370 | if (connection_info && !btle_frame_info->retransmit) { |
3371 | /* The LL_ENC_REQ can only be sent from central to peripheral. */ |
3372 | if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
3373 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
3374 | connection_info->direction_info[BTLE_DIR_CENTRAL_PERIPHERAL1].control_procs, |
3375 | last_control_proc[other_direction], |
3376 | control_opcode); |
3377 | } else if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
3378 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3379 | } |
3380 | } |
3381 | |
3382 | break; |
3383 | case LL_CTRL_OPCODE_ENC_RSP: |
3384 | proto_tree_add_item(btle_tree, hf_control_peripheral_session_key_diversifier, tvb, offset, 8, ENC_LITTLE_ENDIAN0x80000000); |
3385 | offset += 8; |
3386 | |
3387 | proto_tree_add_item(btle_tree, hf_control_peripheral_session_initialization_vector, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000); |
3388 | offset += 4; |
3389 | |
3390 | if (connection_info && !btle_frame_info->retransmit) { |
3391 | /* The LL_ENC_REQ can only be sent from peripheral to central. */ |
3392 | if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
3393 | if (control_proc_can_add_frame(pinfo, |
3394 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3395 | LL_CTRL_OPCODE_ENC_REQ, 1)) { |
3396 | control_proc_add_frame(tvb, |
3397 | pinfo, |
3398 | btle_tree, |
3399 | control_opcode, |
3400 | direction, |
3401 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3402 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3403 | 1); |
3404 | } else { |
3405 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3406 | } |
3407 | } else if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
3408 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3409 | } |
3410 | } |
3411 | |
3412 | break; |
3413 | case LL_CTRL_OPCODE_START_ENC_REQ: |
3414 | offset = dissect_ctrl_pdu_without_data(tvb, pinfo, btle_tree, offset); |
3415 | if (connection_info && !btle_frame_info->retransmit) { |
3416 | /* The LL_START_ENC_REQ can only be sent from peripheral to central. */ |
3417 | if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
3418 | if (control_proc_can_add_frame(pinfo, |
3419 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3420 | LL_CTRL_OPCODE_ENC_REQ, 2)) { |
3421 | control_proc_add_frame(tvb, |
3422 | pinfo, |
3423 | btle_tree, |
3424 | control_opcode, |
3425 | direction, |
3426 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3427 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3428 | 2); |
3429 | } else { |
3430 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3431 | } |
3432 | } else if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
3433 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3434 | } |
3435 | } |
3436 | |
3437 | break; |
3438 | |
3439 | case LL_CTRL_OPCODE_START_ENC_RSP: |
3440 | offset = dissect_ctrl_pdu_without_data(tvb, pinfo, btle_tree, offset); |
3441 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
3442 | /* This is either frame 4 or 5 of the procedure */ |
3443 | if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1 && |
3444 | control_proc_can_add_frame(pinfo, |
3445 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3446 | LL_CTRL_OPCODE_ENC_REQ, 3)) { |
3447 | control_proc_add_frame(tvb, |
3448 | pinfo, |
3449 | btle_tree, |
3450 | control_opcode, |
3451 | direction, |
3452 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3453 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3454 | 3); |
3455 | } else if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2 && |
3456 | control_proc_can_add_frame(pinfo, |
3457 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3458 | LL_CTRL_OPCODE_ENC_REQ, 4)) { |
3459 | control_proc_add_last_frame(tvb, |
3460 | pinfo, |
3461 | btle_tree, |
3462 | control_opcode, |
3463 | direction, |
3464 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3465 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3466 | 4); |
3467 | } else { |
3468 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3469 | } |
3470 | } |
3471 | |
3472 | break; |
3473 | |
3474 | case LL_CTRL_OPCODE_UNKNOWN_RSP: |
3475 | proto_tree_add_item(btle_tree, hf_control_unknown_type, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
3476 | offset += 1; |
3477 | |
3478 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
3479 | /* LL_UNKNOWN_RSP can only be sent as the second frame of a procedure. */ |
3480 | if (last_control_proc[other_direction] && |
3481 | control_proc_can_add_frame_even_if_complete(pinfo, |
3482 | last_control_proc[other_direction], |
3483 | last_control_proc[other_direction]->proc_opcode, |
3484 | 1)) { |
3485 | control_proc_add_last_frame(tvb, |
3486 | pinfo, |
3487 | btle_tree, |
3488 | control_opcode, |
3489 | direction, |
3490 | last_control_proc[other_direction], |
3491 | last_control_proc[direction], |
3492 | 1); |
3493 | } else { |
3494 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3495 | } |
3496 | } |
3497 | |
3498 | break; |
3499 | case LL_CTRL_OPCODE_FEATURE_REQ: |
3500 | offset = dissect_feature_set(tvb, btle_tree, offset); |
3501 | if (connection_info && !btle_frame_info->retransmit) { |
3502 | /* The LL_FEATURE_REQ can only be sent from central to peripheral. */ |
3503 | if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
3504 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
3505 | connection_info->direction_info[direction].control_procs, |
3506 | last_control_proc[other_direction], |
3507 | control_opcode); |
3508 | } else if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
3509 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3510 | } |
3511 | } |
3512 | |
3513 | break; |
3514 | case LL_CTRL_OPCODE_FEATURE_RSP: |
3515 | offset = dissect_feature_set(tvb, btle_tree, offset); |
3516 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
3517 | if (control_proc_can_add_frame(pinfo, |
3518 | last_control_proc[other_direction], |
3519 | LL_CTRL_OPCODE_FEATURE_REQ, 1) || |
3520 | control_proc_can_add_frame(pinfo, |
3521 | last_control_proc[other_direction], |
3522 | LL_CTRL_OPCODE_PERIPHERAL_FEATURE_REQ, 1)) { |
3523 | control_proc_add_last_frame(tvb, |
3524 | pinfo, |
3525 | btle_tree, |
3526 | control_opcode, |
3527 | direction, |
3528 | last_control_proc[other_direction], |
3529 | last_control_proc[direction], |
3530 | 1); |
3531 | } else { |
3532 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3533 | } |
3534 | } |
3535 | |
3536 | break; |
3537 | case LL_CTRL_OPCODE_PAUSE_ENC_REQ: |
3538 | if (tvb_reported_length_remaining(tvb, offset) > 3) { |
3539 | proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_reported_length_remaining(tvb, offset) - 3); |
3540 | offset += tvb_reported_length_remaining(tvb, offset) - 3; |
3541 | } |
3542 | |
3543 | if (connection_info && !btle_frame_info->retransmit) { |
3544 | /* The LL_PAUSE_ENC_REQ can only be sent from central to peripheral. */ |
3545 | if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
3546 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
3547 | connection_info->direction_info[BTLE_DIR_CENTRAL_PERIPHERAL1].control_procs, |
3548 | last_control_proc[other_direction], |
3549 | control_opcode); |
3550 | } else if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
3551 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3552 | } |
3553 | } |
3554 | |
3555 | break; |
3556 | case LL_CTRL_OPCODE_PAUSE_ENC_RSP: |
3557 | offset = dissect_ctrl_pdu_without_data(tvb, pinfo, btle_tree, offset); |
3558 | |
3559 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
3560 | if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2 && |
3561 | control_proc_can_add_frame(pinfo, |
3562 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3563 | LL_CTRL_OPCODE_PAUSE_ENC_REQ, 1)) { |
3564 | control_proc_add_frame(tvb, |
3565 | pinfo, |
3566 | btle_tree, |
3567 | control_opcode, |
3568 | direction, |
3569 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3570 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3571 | 1); |
3572 | } else if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1 && |
3573 | control_proc_can_add_frame(pinfo, |
3574 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3575 | LL_CTRL_OPCODE_PAUSE_ENC_REQ, 2)) { |
3576 | control_proc_add_last_frame(tvb, |
3577 | pinfo, |
3578 | btle_tree, |
3579 | control_opcode, |
3580 | direction, |
3581 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3582 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3583 | 2); |
3584 | } else { |
3585 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3586 | } |
3587 | } |
3588 | |
3589 | break; |
3590 | case LL_CTRL_OPCODE_VERSION_IND: |
3591 | proto_tree_add_item(btle_tree, hf_control_version_number, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
3592 | offset += 1; |
3593 | |
3594 | proto_tree_add_item(btle_tree, hf_control_company_id, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
3595 | offset += 2; |
3596 | |
3597 | proto_tree_add_item(btle_tree, hf_control_subversion_number, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
3598 | offset += 2; |
3599 | |
3600 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
3601 | /* The LL_VERSION_IND can be sent as a request or response. |
3602 | * We first check if it is a response. */ |
3603 | if (control_proc_can_add_frame(pinfo, |
3604 | last_control_proc[other_direction], |
3605 | LL_CTRL_OPCODE_VERSION_IND, 1)) { |
3606 | control_proc_add_last_frame(tvb, |
3607 | pinfo, |
3608 | btle_tree, |
3609 | control_opcode, |
3610 | direction, |
3611 | last_control_proc[other_direction], |
3612 | last_control_proc[direction], |
3613 | 1); |
3614 | } else { |
3615 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
3616 | connection_info->direction_info[direction].control_procs, |
3617 | last_control_proc[other_direction], |
3618 | control_opcode); |
3619 | } |
3620 | } |
3621 | |
3622 | break; |
3623 | case LL_CTRL_OPCODE_REJECT_IND: |
3624 | proto_tree_add_item(btle_tree, hf_control_error_code, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
3625 | offset += 1; |
3626 | |
3627 | /* LL_REJECT_IND my be sent as: |
3628 | * - A response to the LL_ENQ_REQ from the central |
3629 | * - After the LL_ENC_RSP from the peripheral */ |
3630 | if (connection_info && !btle_frame_info->retransmit) { |
3631 | if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
3632 | if (control_proc_can_add_frame(pinfo, |
3633 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3634 | LL_CTRL_OPCODE_ENC_REQ, 1)) { |
3635 | control_proc_add_last_frame(tvb, |
3636 | pinfo, |
3637 | btle_tree, |
3638 | control_opcode, |
3639 | direction, |
3640 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3641 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3642 | 1); |
3643 | } else if (control_proc_can_add_frame(pinfo, |
3644 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3645 | LL_CTRL_OPCODE_ENC_REQ, 2)) { |
3646 | control_proc_add_last_frame(tvb, |
3647 | pinfo, |
3648 | btle_tree, |
3649 | control_opcode, |
3650 | direction, |
3651 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3652 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3653 | 2); |
3654 | } else { |
3655 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3656 | } |
3657 | } else if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
3658 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3659 | } |
3660 | } |
3661 | |
3662 | break; |
3663 | case LL_CTRL_OPCODE_PERIPHERAL_FEATURE_REQ: |
3664 | offset = dissect_feature_set(tvb, btle_tree, offset); |
3665 | if (connection_info && !btle_frame_info->retransmit) { |
3666 | /* The LL_PERIPHERAL_FEATURE_REQ can only be sent from peripheral to central. */ |
3667 | if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
3668 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
3669 | connection_info->direction_info[direction].control_procs, |
3670 | last_control_proc[other_direction], |
3671 | control_opcode); |
3672 | } else if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
3673 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3674 | } |
3675 | } |
3676 | break; |
3677 | |
3678 | case LL_CTRL_OPCODE_CONNECTION_PARAM_REQ: |
3679 | offset = dissect_conn_param_req_rsp(tvb, btle_tree, offset); |
3680 | if (connection_info && !btle_frame_info->retransmit) { |
3681 | if (direction != BTLE_DIR_UNKNOWN0) { |
3682 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
3683 | connection_info->direction_info[direction].control_procs, |
3684 | last_control_proc[other_direction], |
3685 | control_opcode); |
3686 | } |
3687 | } |
3688 | |
3689 | break; |
3690 | case LL_CTRL_OPCODE_CONNECTION_PARAM_RSP: |
3691 | offset = dissect_conn_param_req_rsp(tvb, btle_tree, offset); |
3692 | |
3693 | if (connection_info && !btle_frame_info->retransmit) { |
3694 | /* The LL_CONNECTION_PARAM_RSP can only be sent from peripheral to central |
3695 | * as a response to a central initiated procedure */ |
3696 | if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
3697 | if (control_proc_can_add_frame(pinfo, |
3698 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3699 | LL_CTRL_OPCODE_CONNECTION_PARAM_REQ, 1)) { |
3700 | control_proc_add_frame(tvb, |
3701 | pinfo, |
3702 | btle_tree, |
3703 | control_opcode, |
3704 | direction, |
3705 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3706 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3707 | 1); |
3708 | } else { |
3709 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3710 | } |
3711 | } else if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
3712 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3713 | } |
3714 | } |
3715 | |
3716 | break; |
3717 | case LL_CTRL_OPCODE_REJECT_EXT_IND: |
3718 | proto_tree_add_item(btle_tree, hf_control_reject_opcode, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
3719 | offset += 1; |
3720 | |
3721 | proto_tree_add_item(btle_tree, hf_control_error_code, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
3722 | offset += 1; |
3723 | |
3724 | /* LL_REJECT_EXT_IND my be sent as: |
3725 | * - A response to the LL_ENQ_REQ from the central |
3726 | * - After the LL_ENC_RSP from the peripheral |
3727 | * - As a response to LL_CONNECTION_PARAM_REQ |
3728 | * - As a response to LL_CONNECTION_PARAM_RSP |
3729 | * - As a response during the phy update procedure. |
3730 | * - As a response during the CTE request procedure. |
3731 | * - As a response to LL_CIS_REQ |
3732 | * - As a response to LL_CIS_RSP |
3733 | * - As a response to LL_POWER_CONTROL_REQ |
3734 | * - As a response to a LL_SUBRATE_REQ |
3735 | */ |
3736 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
3737 | if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2 && |
3738 | control_proc_can_add_frame(pinfo, |
3739 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3740 | LL_CTRL_OPCODE_ENC_REQ, 1)) { |
3741 | control_proc_add_last_frame(tvb, |
3742 | pinfo, |
3743 | btle_tree, |
3744 | control_opcode, |
3745 | direction, |
3746 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3747 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3748 | 1); |
3749 | } else if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2 && |
3750 | control_proc_can_add_frame(pinfo, |
3751 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3752 | LL_CTRL_OPCODE_ENC_REQ, 2)) { |
3753 | control_proc_add_last_frame(tvb, |
3754 | pinfo, |
3755 | btle_tree, |
3756 | control_opcode, |
3757 | direction, |
3758 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3759 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3760 | 2); |
3761 | } else if (control_proc_can_add_frame(pinfo, |
3762 | last_control_proc[other_direction], |
3763 | LL_CTRL_OPCODE_CONNECTION_PARAM_REQ, 1)) { |
3764 | control_proc_add_last_frame(tvb, |
3765 | pinfo, |
3766 | btle_tree, |
3767 | control_opcode, |
3768 | direction, |
3769 | last_control_proc[other_direction], |
3770 | last_control_proc[direction], |
3771 | 1); |
3772 | } else if (control_proc_can_add_frame(pinfo, |
3773 | last_control_proc[other_direction], |
3774 | LL_CTRL_OPCODE_PHY_REQ, 1)) { |
3775 | control_proc_add_last_frame(tvb, |
3776 | pinfo, |
3777 | btle_tree, |
3778 | control_opcode, |
3779 | direction, |
3780 | last_control_proc[other_direction], |
3781 | last_control_proc[direction], |
3782 | 1); |
3783 | } else if (control_proc_can_add_frame(pinfo, |
3784 | last_control_proc[other_direction], |
3785 | LL_CTRL_OPCODE_CTE_REQ, 1)) { |
3786 | control_proc_add_last_frame(tvb, |
3787 | pinfo, |
3788 | btle_tree, |
3789 | control_opcode, |
3790 | direction, |
3791 | last_control_proc[other_direction], |
3792 | last_control_proc[direction], |
3793 | 1); |
3794 | } else if (control_proc_can_add_frame(pinfo, |
3795 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3796 | LL_CTRL_OPCODE_CIS_REQ, 1)) { |
3797 | control_proc_add_last_frame(tvb, |
3798 | pinfo, |
3799 | btle_tree, |
3800 | control_opcode, |
3801 | direction, |
3802 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3803 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3804 | 1); |
3805 | } else if (control_proc_can_add_frame(pinfo, |
3806 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3807 | LL_CTRL_OPCODE_CIS_REQ, 2)) { |
3808 | control_proc_add_last_frame(tvb, |
3809 | pinfo, |
3810 | btle_tree, |
3811 | control_opcode, |
3812 | direction, |
3813 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3814 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3815 | 2); |
3816 | } else if (control_proc_can_add_frame(pinfo, |
3817 | last_control_proc[other_direction], |
3818 | LL_CTRL_OPCODE_POWER_CONTROL_REQ, 1)) { |
3819 | control_proc_add_last_frame(tvb, |
3820 | pinfo, |
3821 | btle_tree, |
3822 | control_opcode, |
3823 | direction, |
3824 | last_control_proc[other_direction], |
3825 | last_control_proc[direction], |
3826 | 1); |
3827 | } else if (control_proc_can_add_frame(pinfo, |
3828 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3829 | LL_CTRL_OPCODE_SUBRATE_REQ, 1)) { |
3830 | control_proc_add_last_frame(tvb, |
3831 | pinfo, |
3832 | btle_tree, |
3833 | control_opcode, |
3834 | direction, |
3835 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3836 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3837 | 1); |
3838 | } else { |
3839 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3840 | } |
3841 | } |
3842 | |
3843 | break; |
3844 | case LL_CTRL_OPCODE_PING_REQ: |
3845 | offset = dissect_ctrl_pdu_without_data(tvb, pinfo, btle_tree, offset); |
3846 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
3847 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
3848 | connection_info->direction_info[direction].control_procs, |
3849 | last_control_proc[other_direction], |
3850 | control_opcode); |
3851 | } |
3852 | break; |
3853 | case LL_CTRL_OPCODE_PING_RSP: |
3854 | offset = dissect_ctrl_pdu_without_data(tvb, pinfo, btle_tree, offset); |
3855 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
3856 | if (control_proc_can_add_frame(pinfo, |
3857 | last_control_proc[other_direction], |
3858 | LL_CTRL_OPCODE_PING_REQ, 1)) { |
3859 | control_proc_add_last_frame(tvb, |
3860 | pinfo, |
3861 | btle_tree, |
3862 | control_opcode, |
3863 | direction, |
3864 | last_control_proc[other_direction], |
3865 | last_control_proc[direction], |
3866 | 1); |
3867 | } else { |
3868 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3869 | } |
3870 | } |
3871 | break; |
3872 | |
3873 | case LL_CTRL_OPCODE_LENGTH_REQ: |
3874 | dissect_length_req_rsp(tvb, btle_tree, offset); |
3875 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
3876 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
3877 | connection_info->direction_info[direction].control_procs, |
3878 | last_control_proc[other_direction], |
3879 | control_opcode); |
3880 | } |
3881 | |
3882 | break; |
3883 | case LL_CTRL_OPCODE_LENGTH_RSP: |
3884 | dissect_length_req_rsp(tvb, btle_tree, offset); |
3885 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
3886 | if (control_proc_can_add_frame(pinfo, |
3887 | last_control_proc[other_direction], |
3888 | LL_CTRL_OPCODE_LENGTH_REQ, 1)) { |
3889 | control_proc_add_last_frame(tvb, |
3890 | pinfo, |
3891 | btle_tree, |
3892 | control_opcode, |
3893 | direction, |
3894 | last_control_proc[other_direction], |
3895 | last_control_proc[direction], |
3896 | 1); |
3897 | } else { |
3898 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3899 | } |
3900 | } |
3901 | break; |
3902 | case LL_CTRL_OPCODE_PHY_REQ: |
3903 | dissect_phy_req_rsp(tvb, btle_tree, offset); |
3904 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
3905 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
3906 | connection_info->direction_info[direction].control_procs, |
3907 | last_control_proc[other_direction], |
3908 | control_opcode); |
3909 | } |
3910 | |
3911 | break; |
3912 | case LL_CTRL_OPCODE_PHY_RSP: |
3913 | dissect_phy_req_rsp(tvb, btle_tree, offset); |
3914 | if (connection_info && !btle_frame_info->retransmit) { |
3915 | /* The LL_PHY_RSP can only be sent from peripheral to central. */ |
3916 | if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
3917 | if (control_proc_can_add_frame(pinfo, |
3918 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3919 | LL_CTRL_OPCODE_PHY_REQ, 1)) { |
3920 | control_proc_add_frame(tvb, |
3921 | pinfo, |
3922 | btle_tree, |
3923 | control_opcode, |
3924 | direction, |
3925 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3926 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3927 | 1); |
3928 | } else { |
3929 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3930 | } |
3931 | } else if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
3932 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3933 | } |
3934 | } |
3935 | |
3936 | break; |
3937 | case LL_CTRL_OPCODE_PHY_UPDATE_IND: |
3938 | { |
3939 | uint64_t phy_c_to_p, phy_p_to_c; |
3940 | |
3941 | item = proto_tree_add_bitmask_ret_uint64(btle_tree, tvb, offset, hf_control_c_to_p_phy, ett_c_to_p_phy, hfx_control_phys_update, ENC_NA0x00000000, &phy_c_to_p); |
3942 | if (phy_c_to_p == 0) { |
3943 | proto_item_append_text(item, ", No change"); |
3944 | } |
3945 | offset += 1; |
3946 | |
3947 | item = proto_tree_add_bitmask_ret_uint64(btle_tree, tvb, offset, hf_control_p_to_c_phy, ett_p_to_c_phy, hfx_control_phys_update, ENC_NA0x00000000, &phy_p_to_c); |
3948 | if (phy_p_to_c == 0) { |
3949 | proto_item_append_text(item, ", No change"); |
3950 | } |
3951 | offset += 1; |
3952 | |
3953 | if (phy_c_to_p != 0 && phy_p_to_c != 0) { |
3954 | proto_tree_add_item_ret_uint(btle_tree, hf_control_instant, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &item_value); |
3955 | } else { |
3956 | /* If both the PHY_C_TO_P and PHY_P_TO_C fields are zero then there is no |
3957 | * Instant and the Instant field is reserved for future use. |
3958 | */ |
3959 | proto_tree_add_item(btle_tree, hf_control_rfu_5, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000); |
3960 | } |
3961 | offset += 2; |
3962 | |
3963 | if (connection_info && !btle_frame_info->retransmit) { |
3964 | /* The LL_PHY_UPDATE_IND can only be sent from central to peripheral. */ |
3965 | if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
3966 | if (control_proc_can_add_frame(pinfo, |
3967 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3968 | LL_CTRL_OPCODE_PHY_REQ, 2)) { |
3969 | control_proc_add_frame_with_instant(tvb, |
3970 | pinfo, |
3971 | btle_tree, |
3972 | btle_context, |
3973 | control_opcode, |
3974 | direction, |
3975 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3976 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3977 | 2, |
3978 | item_value); |
3979 | } else if (control_proc_can_add_frame(pinfo, |
3980 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3981 | LL_CTRL_OPCODE_PHY_REQ, 1)){ |
3982 | control_proc_add_frame_with_instant(tvb, |
3983 | pinfo, |
3984 | btle_tree, |
3985 | btle_context, |
3986 | control_opcode, |
3987 | direction, |
3988 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
3989 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
3990 | 1, |
3991 | item_value); |
3992 | } else { |
3993 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3994 | } |
3995 | } else if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
3996 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
3997 | } |
3998 | } |
3999 | |
4000 | break; |
4001 | } |
4002 | case LL_CTRL_OPCODE_MIN_USED_CHANNELS_IND: |
4003 | proto_tree_add_bitmask(btle_tree, tvb, offset, hf_control_phys, ett_phys, hfx_control_phys, ENC_NA0x00000000); |
4004 | offset += 1; |
4005 | |
4006 | proto_tree_add_item(btle_tree, hf_control_min_used_channels, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4007 | offset += 1; |
4008 | |
4009 | if (connection_info && !btle_frame_info->retransmit) { |
4010 | /* The LL_MIN_USED_CHANNELS_IND can only be sent from peripheral to central. */ |
4011 | if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
4012 | control_proc_info_t *proc_info; |
4013 | proc_info = control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4014 | connection_info->direction_info[direction].control_procs, |
4015 | last_control_proc[other_direction], |
4016 | control_opcode); |
4017 | |
4018 | /* Procedure completes in the same frame. */ |
4019 | if (proc_info) { |
4020 | proc_info->last_frame = pinfo->num; |
4021 | } |
4022 | } else if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
4023 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4024 | } |
4025 | } |
4026 | break; |
4027 | case LL_CTRL_OPCODE_CTE_REQ: |
4028 | proto_tree_add_bitmask(btle_tree, tvb, offset, hf_control_phys, ett_cte, hfx_control_cte, ENC_NA0x00000000); |
4029 | offset += 1; |
4030 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4031 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4032 | connection_info->direction_info[direction].control_procs, |
4033 | last_control_proc[other_direction], |
4034 | control_opcode); |
4035 | } |
4036 | break; |
4037 | case LL_CTRL_OPCODE_CTE_RSP: |
4038 | offset = dissect_ctrl_pdu_without_data(tvb, pinfo, btle_tree, offset); |
4039 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4040 | if (control_proc_can_add_frame(pinfo, |
4041 | last_control_proc[other_direction], |
4042 | LL_CTRL_OPCODE_CTE_REQ, 1)) { |
4043 | control_proc_add_last_frame(tvb, |
4044 | pinfo, |
4045 | btle_tree, |
4046 | control_opcode, |
4047 | direction, |
4048 | last_control_proc[other_direction], |
4049 | last_control_proc[direction], |
4050 | 1); |
4051 | } else { |
4052 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4053 | } |
4054 | } |
4055 | break; |
4056 | case LL_CTRL_OPCODE_PERIODIC_SYNC_IND: |
4057 | offset = dissect_periodic_sync_ind(tvb, btle_tree, offset, pinfo, interface_id, adapter_id); |
4058 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4059 | control_proc_info_t *proc_info; |
4060 | proc_info = control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4061 | connection_info->direction_info[direction].control_procs, |
4062 | last_control_proc[other_direction], |
4063 | control_opcode); |
4064 | |
4065 | /* Procedure completes in the same frame. */ |
4066 | if (proc_info) { |
4067 | proc_info->last_frame = pinfo->num; |
4068 | } |
4069 | } |
4070 | break; |
4071 | case LL_CTRL_OPCODE_CLOCK_ACCURACY_REQ: |
4072 | proto_tree_add_item(btle_tree, hf_control_sleep_clock_accuracy, tvb, offset, 1, ENC_NA0x00000000); |
4073 | offset += 1; |
4074 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4075 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4076 | connection_info->direction_info[direction].control_procs, |
4077 | last_control_proc[other_direction], |
4078 | control_opcode); |
4079 | } |
4080 | break; |
4081 | case LL_CTRL_OPCODE_CLOCK_ACCURACY_RSP: |
4082 | proto_tree_add_item(btle_tree, hf_control_sleep_clock_accuracy, tvb, offset, 1, ENC_NA0x00000000); |
4083 | offset += 1; |
4084 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4085 | if (control_proc_can_add_frame(pinfo, |
4086 | last_control_proc[other_direction], |
4087 | LL_CTRL_OPCODE_CLOCK_ACCURACY_REQ, 1)) { |
4088 | control_proc_add_last_frame(tvb, |
4089 | pinfo, |
4090 | btle_tree, |
4091 | control_opcode, |
4092 | direction, |
4093 | last_control_proc[other_direction], |
4094 | last_control_proc[direction], |
4095 | 1); |
4096 | } else { |
4097 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4098 | } |
4099 | } |
4100 | break; |
4101 | case LL_CTRL_OPCODE_CIS_REQ: |
4102 | offset = dissect_cis_req(tvb, btle_tree, offset); |
4103 | if (connection_info && !btle_frame_info->retransmit) { |
4104 | if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
4105 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4106 | connection_info->direction_info[BTLE_DIR_CENTRAL_PERIPHERAL1].control_procs, |
4107 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
4108 | control_opcode); |
4109 | } else if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
4110 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4111 | } |
4112 | } |
4113 | break; |
4114 | case LL_CTRL_OPCODE_CIS_RSP: |
4115 | offset = dissect_cis_rsp(tvb, btle_tree, offset); |
4116 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4117 | if (control_proc_can_add_frame(pinfo, |
4118 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
4119 | LL_CTRL_OPCODE_CIS_REQ, 1)) { |
4120 | control_proc_add_frame(tvb, |
4121 | pinfo, |
4122 | btle_tree, |
4123 | control_opcode, |
4124 | direction, |
4125 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
4126 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
4127 | 1); |
4128 | } else { |
4129 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4130 | } |
4131 | } |
4132 | break; |
4133 | case LL_CTRL_OPCODE_CIS_IND: |
4134 | if (!pinfo->fd->visited) { |
4135 | connectediso_connection_info_t *nconnection_info; |
4136 | |
4137 | connection_access_address = tvb_get_uint32(tvb, offset, ENC_LITTLE_ENDIAN0x80000000); |
4138 | |
4139 | key[0].length = 1; |
4140 | key[0].key = &interface_id; |
4141 | key[1].length = 1; |
4142 | key[1].key = &adapter_id; |
4143 | key[2].length = 1; |
4144 | key[2].key = &connection_access_address; |
4145 | key[3].length = 1; |
4146 | key[3].key = &pinfo->num; |
4147 | key[4].length = 0; |
4148 | key[4].key = NULL((void*)0); |
4149 | |
4150 | nconnection_info = wmem_new0(wmem_file_scope(), connectediso_connection_info_t)((connectediso_connection_info_t*)wmem_alloc0((wmem_file_scope ()), sizeof(connectediso_connection_info_t))); |
4151 | if (connection_info) { |
4152 | memcpy(nconnection_info->central_bd_addr, connection_info->central_bd_addr, 6); |
4153 | memcpy(nconnection_info->peripheral_bd_addr, connection_info->peripheral_bd_addr, 6); |
4154 | } |
4155 | |
4156 | wmem_tree_insert32_array(connectediso_connection_info_tree, key, nconnection_info); |
4157 | } |
4158 | offset = dissect_cis_ind(tvb, btle_tree, offset); |
4159 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4160 | if (control_proc_can_add_frame(pinfo, |
4161 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
4162 | LL_CTRL_OPCODE_CIS_REQ, 2)) { |
4163 | control_proc_add_last_frame(tvb, |
4164 | pinfo, |
4165 | btle_tree, |
4166 | control_opcode, |
4167 | direction, |
4168 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
4169 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
4170 | 2); |
4171 | } else { |
4172 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4173 | } |
4174 | } |
4175 | break; |
4176 | case LL_CTRL_OPCODE_CIS_TERMINATE_IND: |
4177 | offset = dissect_cis_terminate_ind(tvb, btle_tree, offset); |
4178 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4179 | control_proc_info_t *proc_info; |
4180 | proc_info = control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4181 | connection_info->direction_info[direction].control_procs, |
4182 | last_control_proc[other_direction], |
4183 | control_opcode); |
4184 | |
4185 | /* Procedure completes in the same frame. */ |
4186 | if (proc_info) { |
4187 | proc_info->last_frame = pinfo->num; |
4188 | } |
4189 | } |
4190 | break; |
4191 | case LL_CTRL_OPCODE_POWER_CONTROL_REQ: |
4192 | offset = dissect_power_control_req(tvb, btle_tree, offset); |
4193 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4194 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4195 | connection_info->direction_info[direction].control_procs, |
4196 | last_control_proc[other_direction], |
4197 | control_opcode); |
4198 | } |
4199 | break; |
4200 | case LL_CTRL_OPCODE_POWER_CONTROL_RSP: |
4201 | offset = dissect_power_control_rsp(tvb, btle_tree, offset); |
4202 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4203 | if (control_proc_can_add_frame(pinfo, |
4204 | last_control_proc[other_direction], |
4205 | LL_CTRL_OPCODE_POWER_CONTROL_REQ, 1)) { |
4206 | control_proc_add_last_frame(tvb, |
4207 | pinfo, |
4208 | btle_tree, |
4209 | control_opcode, |
4210 | direction, |
4211 | last_control_proc[other_direction], |
4212 | last_control_proc[direction], |
4213 | 1); |
4214 | } else { |
4215 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4216 | } |
4217 | } |
4218 | break; |
4219 | case LL_CTRL_OPCODE_POWER_CHANGE_IND: |
4220 | offset = dissect_power_control_ind(tvb, btle_tree, offset); |
4221 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4222 | control_proc_info_t *proc_info; |
4223 | proc_info = control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4224 | connection_info->direction_info[direction].control_procs, |
4225 | last_control_proc[other_direction], |
4226 | control_opcode); |
4227 | |
4228 | /* Procedure completes in the same frame. */ |
4229 | if (proc_info) { |
4230 | proc_info->last_frame = pinfo->num; |
4231 | } |
4232 | } |
4233 | break; |
4234 | case LL_CTRL_OPCODE_SUBRATE_REQ: |
4235 | offset = dissect_subrate_req(tvb, btle_tree, offset); |
4236 | if (connection_info && !btle_frame_info->retransmit) { |
4237 | if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
4238 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4239 | connection_info->direction_info[BTLE_DIR_PERIPHERAL_CENTRAL2].control_procs, |
4240 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
4241 | control_opcode); |
4242 | } else if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
4243 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4244 | } |
4245 | } |
4246 | break; |
4247 | case LL_CTRL_OPCODE_SUBRATE_IND: |
4248 | offset = dissect_subrate_ind(tvb, btle_tree, offset); |
4249 | if (connection_info && !btle_frame_info->retransmit) { |
4250 | if (control_proc_can_add_frame(pinfo, |
4251 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
4252 | LL_CTRL_OPCODE_SUBRATE_REQ, 1)) { |
4253 | control_proc_add_last_frame(tvb, |
4254 | pinfo, |
4255 | btle_tree, |
4256 | control_opcode, |
4257 | direction, |
4258 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
4259 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
4260 | 1); |
4261 | } else if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
4262 | control_proc_info_t *proc_info; |
4263 | proc_info = control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4264 | connection_info->direction_info[BTLE_DIR_CENTRAL_PERIPHERAL1].control_procs, |
4265 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
4266 | control_opcode); |
4267 | |
4268 | /* Procedure completes in the same frame. */ |
4269 | if (proc_info) { |
4270 | proc_info->last_frame = pinfo->num; |
4271 | } |
4272 | } else { |
4273 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4274 | } |
4275 | } |
4276 | break; |
4277 | case LL_CTRL_OPCODE_CHANNEL_REPORTING_IND: |
4278 | offset = dissect_channel_reporting_ind(tvb, btle_tree, offset); |
4279 | if (connection_info && !btle_frame_info->retransmit) { |
4280 | if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
4281 | control_proc_info_t *proc_info; |
4282 | proc_info = control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4283 | connection_info->direction_info[BTLE_DIR_CENTRAL_PERIPHERAL1].control_procs, |
4284 | last_control_proc[BTLE_DIR_PERIPHERAL_CENTRAL2], |
4285 | control_opcode); |
4286 | |
4287 | /* Procedure completes in the same frame. */ |
4288 | if (proc_info) { |
4289 | proc_info->last_frame = pinfo->num; |
4290 | } |
4291 | } else if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
4292 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4293 | } |
4294 | } |
4295 | break; |
4296 | case LL_CTRL_OPCODE_CHANNEL_STATUS_IND: |
4297 | offset = dissect_channel_status_ind(tvb, btle_tree, offset); |
4298 | if (connection_info && !btle_frame_info->retransmit) { |
4299 | if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
4300 | control_proc_info_t *proc_info; |
4301 | proc_info = control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4302 | connection_info->direction_info[BTLE_DIR_PERIPHERAL_CENTRAL2].control_procs, |
4303 | last_control_proc[BTLE_DIR_CENTRAL_PERIPHERAL1], |
4304 | control_opcode); |
4305 | |
4306 | /* Procedure completes in the same frame. */ |
4307 | if (proc_info) { |
4308 | proc_info->last_frame = pinfo->num; |
4309 | } |
4310 | } else if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
4311 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4312 | } |
4313 | } |
4314 | break; |
4315 | case LL_CTRL_OPCODE_PERIODIC_SYNC_WR_IND: |
4316 | offset = dissect_periodic_sync_wr_ind(tvb, btle_tree, offset, pinfo, interface_id, adapter_id); |
4317 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4318 | control_proc_info_t *proc_info; |
4319 | proc_info = control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4320 | connection_info->direction_info[direction].control_procs, |
4321 | last_control_proc[other_direction], |
4322 | control_opcode); |
4323 | |
4324 | /* Procedure completes in the same frame. */ |
4325 | if (proc_info) { |
4326 | proc_info->last_frame = pinfo->num; |
4327 | } |
4328 | } |
4329 | break; |
4330 | case LL_CTRL_OPCODE_LL_FEATURE_EXT_REQ: |
4331 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4332 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4333 | connection_info->direction_info[direction].control_procs, |
4334 | last_control_proc[other_direction], |
4335 | control_opcode); |
4336 | } |
4337 | break; |
4338 | case LL_CTRL_OPCODE_LL_FEATURE_EXT_RSP: |
4339 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4340 | if (control_proc_can_add_frame(pinfo, |
4341 | last_control_proc[other_direction], |
4342 | LL_CTRL_OPCODE_LL_FEATURE_EXT_REQ, 1)) { |
4343 | control_proc_add_last_frame(tvb, |
4344 | pinfo, |
4345 | btle_tree, |
4346 | control_opcode, |
4347 | direction, |
4348 | last_control_proc[other_direction], |
4349 | last_control_proc[direction], |
4350 | 1); |
4351 | } else { |
4352 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4353 | } |
4354 | } |
4355 | break; |
4356 | case LL_CTRL_OPCODE_LL_CS_SEQ_REQ: |
4357 | if (connection_info && !btle_frame_info->retransmit) { |
4358 | /* The LL_CTRL_OPCODE_LL_CS_SEQ_REQ can only be sent from central to peripheral. */ |
4359 | if (direction == BTLE_DIR_CENTRAL_PERIPHERAL1) { |
4360 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4361 | connection_info->direction_info[BTLE_DIR_CENTRAL_PERIPHERAL1].control_procs, |
4362 | last_control_proc[other_direction], |
4363 | control_opcode); |
4364 | } else if (direction == BTLE_DIR_PERIPHERAL_CENTRAL2) { |
4365 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4366 | } |
4367 | } |
4368 | break; |
4369 | case LL_CTRL_OPCODE_LL_CS_SEC_RSP: |
4370 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4371 | if (control_proc_can_add_frame(pinfo, |
4372 | last_control_proc[other_direction], |
4373 | LL_CTRL_OPCODE_LL_CS_SEQ_REQ, 1)) { |
4374 | control_proc_add_last_frame(tvb, |
4375 | pinfo, |
4376 | btle_tree, |
4377 | control_opcode, |
4378 | direction, |
4379 | last_control_proc[other_direction], |
4380 | last_control_proc[direction], |
4381 | 1); |
4382 | } else { |
4383 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4384 | } |
4385 | } |
4386 | break; |
4387 | case LL_CTRL_OPCODE_LL_CS_CAPABILITIES_REQ: |
4388 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4389 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4390 | connection_info->direction_info[direction].control_procs, |
4391 | last_control_proc[other_direction], |
4392 | control_opcode); |
4393 | } |
4394 | break; |
4395 | case LL_CTRL_OPCODE_LL_CS_CAPABILITIES_RSP: |
4396 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4397 | if (control_proc_can_add_frame(pinfo, |
4398 | last_control_proc[other_direction], |
4399 | LL_CTRL_OPCODE_LL_CS_CAPABILITIES_REQ, 1)) { |
4400 | control_proc_add_last_frame(tvb, |
4401 | pinfo, |
4402 | btle_tree, |
4403 | control_opcode, |
4404 | direction, |
4405 | last_control_proc[other_direction], |
4406 | last_control_proc[direction], |
4407 | 1); |
4408 | } else { |
4409 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4410 | } |
4411 | } |
4412 | break; |
4413 | case LL_CTRL_OPCODE_LL_CS_CONFIG_REQ: |
4414 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4415 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4416 | connection_info->direction_info[direction].control_procs, |
4417 | last_control_proc[other_direction], |
4418 | control_opcode); |
4419 | } |
4420 | break; |
4421 | case LL_CTRL_OPCODE_LL_CS_CONFIG_RSP: |
4422 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4423 | if (control_proc_can_add_frame(pinfo, |
4424 | last_control_proc[other_direction], |
4425 | LL_CTRL_OPCODE_LL_CS_CONFIG_REQ, 1)) { |
4426 | control_proc_add_last_frame(tvb, |
4427 | pinfo, |
4428 | btle_tree, |
4429 | control_opcode, |
4430 | direction, |
4431 | last_control_proc[other_direction], |
4432 | last_control_proc[direction], |
4433 | 1); |
4434 | } else { |
4435 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4436 | } |
4437 | } |
4438 | break; |
4439 | case LL_CTRL_OPCODE_LL_CS_REQ: |
4440 | case LL_CTRL_OPCODE_LL_CS_RSP: |
4441 | case LL_CTRL_OPCODE_LL_CS_IND: |
4442 | /* TODO: Parse channel sounding start procedure PDUs and |
4443 | * procedure termination. */ |
4444 | break; |
4445 | case LL_CTRL_OPCODE_LL_CS_TERMINATE_REQ: |
4446 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4447 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4448 | connection_info->direction_info[direction].control_procs, |
4449 | last_control_proc[other_direction], |
4450 | control_opcode); |
4451 | } |
4452 | break; |
4453 | case LL_CTRL_OPCODE_LL_CS_TERMINATE_RSP: |
4454 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4455 | if (control_proc_can_add_frame(pinfo, |
4456 | last_control_proc[other_direction], |
4457 | LL_CTRL_OPCODE_LL_CS_TERMINATE_REQ, 1)) { |
4458 | control_proc_add_last_frame(tvb, |
4459 | pinfo, |
4460 | btle_tree, |
4461 | control_opcode, |
4462 | direction, |
4463 | last_control_proc[other_direction], |
4464 | last_control_proc[direction], |
4465 | 1); |
4466 | } else { |
4467 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4468 | } |
4469 | } |
4470 | break; |
4471 | case LL_CTRL_OPCODE_LL_CS_FAE_REQ: |
4472 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4473 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4474 | connection_info->direction_info[direction].control_procs, |
4475 | last_control_proc[other_direction], |
4476 | control_opcode); |
4477 | } |
4478 | break; |
4479 | case LL_CTRL_OPCODE_LL_CS_FAE_RSP: |
4480 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4481 | if (control_proc_can_add_frame(pinfo, |
4482 | last_control_proc[other_direction], |
4483 | LL_CTRL_OPCODE_LL_CS_FAE_REQ, 1)) { |
4484 | control_proc_add_last_frame(tvb, |
4485 | pinfo, |
4486 | btle_tree, |
4487 | control_opcode, |
4488 | direction, |
4489 | last_control_proc[other_direction], |
4490 | last_control_proc[direction], |
4491 | 1); |
4492 | } else { |
4493 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4494 | } |
4495 | } |
4496 | break; |
4497 | case LL_CTRL_OPCODE_LL_CS_CHANNEL_MAP_IND: |
4498 | /* TODO: Parse Channel Sounding Channel Map Update procedu PDU |
4499 | * and procedure termination. */ |
4500 | case LL_CTRL_OPCODE_LL_FRAME_SPACE_REQ: |
4501 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4502 | control_proc_start(tvb, pinfo, btle_tree, control_proc_item, |
4503 | connection_info->direction_info[direction].control_procs, |
4504 | last_control_proc[other_direction], |
4505 | control_opcode); |
4506 | } |
4507 | break; |
4508 | case LL_CTRL_OPCODE_LL_FRAME_SPACE_RSP: |
4509 | if (connection_info && !btle_frame_info->retransmit && direction != BTLE_DIR_UNKNOWN0) { |
4510 | if (control_proc_can_add_frame(pinfo, |
4511 | last_control_proc[other_direction], |
4512 | LL_CTRL_OPCODE_LL_FRAME_SPACE_REQ, 1)) { |
4513 | control_proc_add_last_frame(tvb, |
4514 | pinfo, |
4515 | btle_tree, |
4516 | control_opcode, |
4517 | direction, |
4518 | last_control_proc[other_direction], |
4519 | last_control_proc[direction], |
4520 | 1); |
4521 | } else { |
4522 | expert_add_info(pinfo, control_proc_item, &ei_control_proc_wrong_seq); |
4523 | } |
4524 | } |
4525 | break; |
4526 | default: |
4527 | offset = dissect_ctrl_pdu_without_data(tvb, pinfo, btle_tree, offset); |
4528 | break; |
4529 | } |
4530 | |
4531 | break; |
4532 | |
4533 | default: |
4534 | if (tvb_reported_length_remaining(tvb, offset) > 3) { |
4535 | proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_reported_length_remaining(tvb, offset) - 3); |
4536 | offset += tvb_reported_length_remaining(tvb, offset) - 3; |
4537 | } |
4538 | } |
4539 | |
4540 | if (add_l2cap_index) { |
4541 | item = proto_tree_add_uint(btle_tree, hf_l2cap_index, tvb, 0, 0, btle_frame_info->l2cap_index); |
4542 | proto_item_set_generated(item); |
4543 | } |
4544 | |
4545 | key[0].length = 1; |
4546 | key[0].key = &interface_id; |
4547 | key[1].length = 1; |
4548 | key[1].key = &adapter_id; |
4549 | key[2].length = 1; |
4550 | key[2].key = &access_address; |
4551 | key[3].length = 0; |
4552 | key[3].key = NULL((void*)0); |
4553 | wmem_tree = (wmem_tree_t *) wmem_tree_lookup32_array(connection_parameter_info_tree, key); |
4554 | if (wmem_tree) { |
4555 | connection_parameter_info_t *connection_parameter_info; |
4556 | |
4557 | if (connection_info && connection_info->connection_parameter_update_info != NULL((void*)0) && |
4558 | btle_context && btle_context->event_counter_valid) { |
4559 | if ( ((int16_t)btle_context->event_counter - connection_info->connection_parameter_update_instant) >= 0) { |
4560 | wmem_tree_insert32(wmem_tree, pinfo->num, connection_info->connection_parameter_update_info); |
4561 | connection_info->connection_parameter_update_info = NULL((void*)0); |
4562 | } |
4563 | } |
4564 | |
4565 | connection_parameter_info = (connection_parameter_info_t *) wmem_tree_lookup32_le(wmem_tree, pinfo->num); |
4566 | if (connection_parameter_info) { |
4567 | item = proto_tree_add_uint(btle_tree, hf_connection_parameters_in, tvb, 0, 0, connection_parameter_info->parameters_frame); |
4568 | proto_item_set_generated(item); |
4569 | } |
4570 | } |
4571 | |
4572 | return offset; |
4573 | } |
4574 | |
4575 | |
4576 | static int |
4577 | dissect_btle_connected_iso(tvbuff_t *tvb, |
4578 | packet_info *pinfo, |
4579 | proto_tree *btle_tree, |
4580 | const btle_context_t *btle_context, |
4581 | uint32_t adapter_id, |
4582 | uint32_t interface_id, |
4583 | uint32_t access_address) |
4584 | { |
4585 | proto_item *sub_item; |
4586 | int offset = 0; |
4587 | uint32_t length; |
4588 | connectediso_connection_info_t *connection_info = NULL((void*)0); |
4589 | wmem_tree_t *wmem_tree; |
4590 | wmem_tree_key_t key[5]; |
4591 | |
4592 | proto_item *item; |
4593 | |
4594 | proto_item *data_header_item; |
4595 | proto_tree *data_header_tree; |
4596 | uint8_t oct; |
4597 | uint8_t llid; |
4598 | uint32_t direction = BTLE_DIR_UNKNOWN0; |
4599 | |
4600 | if (btle_context) { |
4601 | direction = btle_context->direction; |
4602 | } |
4603 | |
4604 | btle_frame_info_t *btle_frame_info = NULL((void*)0); |
4605 | |
4606 | key[0].length = 1; |
4607 | key[0].key = &interface_id; |
4608 | key[1].length = 1; |
4609 | key[1].key = &adapter_id; |
4610 | key[2].length = 1; |
4611 | key[2].key = &access_address; |
4612 | key[3].length = 0; |
4613 | key[3].key = NULL((void*)0); |
4614 | |
4615 | oct = tvb_get_uint8(tvb, offset); |
4616 | wmem_tree = (wmem_tree_t *) wmem_tree_lookup32_array(connection_info_tree, key); |
4617 | if (wmem_tree) { |
4618 | connection_info = (connectediso_connection_info_t *) wmem_tree_lookup32_le(wmem_tree, pinfo->num); |
4619 | if (connection_info) { |
4620 | char *str_addr_src, *str_addr_dst; |
4621 | /* longest possible string */ |
4622 | const size_t str_addr_len = sizeof("Peripheral_0x12345678"); |
4623 | |
4624 | str_addr_src = (char *) wmem_alloc(pinfo->pool, str_addr_len); |
4625 | str_addr_dst = (char *) wmem_alloc(pinfo->pool, str_addr_len); |
4626 | |
4627 | sub_item = proto_tree_add_ether(btle_tree, hf_central_bd_addr, tvb, 0, 0, connection_info->central_bd_addr); |
4628 | proto_item_set_generated(sub_item); |
4629 | |
4630 | sub_item = proto_tree_add_ether(btle_tree, hf_peripheral_bd_addr, tvb, 0, 0, connection_info->peripheral_bd_addr); |
4631 | proto_item_set_generated(sub_item); |
4632 | |
4633 | switch (direction) { |
4634 | case BTLE_DIR_CENTRAL_PERIPHERAL1: |
4635 | snprintf(str_addr_src, str_addr_len, "Central_0x%08x", access_address); |
4636 | snprintf(str_addr_dst, str_addr_len, "Peripheral_0x%08x", access_address); |
4637 | set_address(&pinfo->dl_src, AT_ETHER, sizeof(connection_info->central_bd_addr), connection_info->central_bd_addr); |
4638 | set_address(&pinfo->dl_dst, AT_ETHER, sizeof(connection_info->peripheral_bd_addr), connection_info->peripheral_bd_addr); |
4639 | break; |
4640 | case BTLE_DIR_PERIPHERAL_CENTRAL2: |
4641 | snprintf(str_addr_src, str_addr_len, "Peripheral_0x%08x", access_address); |
4642 | snprintf(str_addr_dst, str_addr_len, "Central_0x%08x", access_address); |
4643 | set_address(&pinfo->dl_src, AT_ETHER, sizeof(connection_info->peripheral_bd_addr), connection_info->peripheral_bd_addr); |
4644 | set_address(&pinfo->dl_dst, AT_ETHER, sizeof(connection_info->central_bd_addr), connection_info->central_bd_addr); |
4645 | break; |
4646 | default: |
4647 | /* BTLE_DIR_UNKNOWN */ |
4648 | snprintf(str_addr_src, str_addr_len, "Unknown_0x%08x", access_address); |
4649 | snprintf(str_addr_dst, str_addr_len, "Unknown_0x%08x", access_address); |
4650 | clear_address(&pinfo->dl_src); |
4651 | clear_address(&pinfo->dl_dst); |
4652 | break; |
4653 | } |
4654 | |
4655 | set_address(&pinfo->net_src, AT_STRINGZ, (int)strlen(str_addr_src)+1, str_addr_src); |
4656 | copy_address_shallow(&pinfo->src, &pinfo->net_src); |
4657 | |
4658 | set_address(&pinfo->net_dst, AT_STRINGZ, (int)strlen(str_addr_dst)+1, str_addr_dst); |
4659 | copy_address_shallow(&pinfo->dst, &pinfo->net_dst); |
4660 | |
4661 | if (!pinfo->fd->visited) { |
4662 | address *addr; |
4663 | |
4664 | btle_frame_info = wmem_new0(wmem_file_scope(), btle_frame_info_t)((btle_frame_info_t*)wmem_alloc0((wmem_file_scope()), sizeof( btle_frame_info_t))); |
4665 | |
4666 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_src, sizeof(address)); |
4667 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_src.data, pinfo->dl_src.len); |
4668 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_SRC0, addr); |
4669 | |
4670 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_dst, sizeof(address)); |
4671 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_dst.data, pinfo->dl_dst.len); |
4672 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_DST1, addr); |
4673 | p_add_proto_data(wmem_file_scope(), pinfo, proto_btle, pinfo->curr_layer_num, btle_frame_info); |
4674 | } |
4675 | else { |
4676 | /* Not the first pass */ |
4677 | btle_frame_info = (btle_frame_info_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_btle, pinfo->curr_layer_num); |
Value stored to 'btle_frame_info' is never read | |
4678 | } |
4679 | } |
4680 | } |
4681 | |
4682 | data_header_item = proto_tree_add_item(btle_tree, hf_data_header, tvb, offset, 2, ENC_NA0x00000000); |
4683 | data_header_tree = proto_item_add_subtree(data_header_item, ett_data_header); |
4684 | |
4685 | proto_tree_add_item(data_header_tree, hf_data_header_llid_connectediso, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4686 | proto_tree_add_item(data_header_tree, hf_data_header_next_expected_sequence_number, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4687 | proto_tree_add_item(data_header_tree, hf_data_header_sequence_number, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4688 | |
4689 | llid = oct & 0x03; |
4690 | proto_tree_add_item(data_header_tree, hf_data_header_close_isochronous_event, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4691 | proto_tree_add_item(data_header_tree, hf_data_header_null_pdu_indicator, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4692 | proto_tree_add_item(data_header_tree, hf_data_header_rfu_57, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4693 | |
4694 | offset += 1; |
4695 | |
4696 | proto_tree_add_item(data_header_tree, hf_data_header_length, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4697 | item = proto_tree_add_item_ret_uint(btle_tree, hf_length, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000, &length); |
4698 | proto_item_set_hidden(item); |
4699 | offset += 1; |
4700 | |
4701 | switch (llid) { |
4702 | case 0x00: /* Unframed CIS Data PDU; end fragment of an SDU or a complete SDU */ |
4703 | case 0x01: /* Unframed CIS Data PDU; start or continuation fragment of an SDU */ |
4704 | case 0x02: /* Framed CIS Data PDU; one or more segments of an SDU */ |
4705 | proto_tree_add_item(btle_tree, hf_isochronous_data, tvb, offset, length, ENC_NA0x00000000); |
4706 | offset += length; |
4707 | break; |
4708 | |
4709 | default: |
4710 | if (tvb_reported_length_remaining(tvb, offset) > 3) { |
4711 | proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_reported_length_remaining(tvb, offset) - 3); |
4712 | offset += tvb_reported_length_remaining(tvb, offset) - 3; |
4713 | } |
4714 | } |
4715 | |
4716 | return offset; |
4717 | } |
4718 | |
4719 | |
4720 | static int |
4721 | dissect_btle_broadcast_iso(tvbuff_t *tvb, |
4722 | packet_info *pinfo, |
4723 | proto_tree *btle_tree, |
4724 | uint32_t adapter_id, |
4725 | uint32_t interface_id, |
4726 | uint32_t access_address) |
4727 | { |
4728 | proto_item *sub_item; |
4729 | proto_tree *sub_tree; |
4730 | int offset = 0; |
4731 | uint32_t length; |
4732 | static const uint8_t broadcast_addr[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; |
4733 | wmem_tree_t *wmem_tree; |
4734 | wmem_tree_key_t key[5]; |
4735 | |
4736 | proto_item *item; |
4737 | unsigned item_value; |
4738 | |
4739 | broadcastiso_connection_info_t *broadcastiso_connection_info = NULL((void*)0); |
4740 | uint32_t seed_access_address = access_address & 0x0041ffff; |
4741 | proto_item *data_header_item; |
4742 | proto_tree *data_header_tree; |
4743 | uint8_t llid; |
4744 | uint8_t control_opcode; |
4745 | |
4746 | key[0].length = 1; |
4747 | key[0].key = &interface_id; |
4748 | key[1].length = 1; |
4749 | key[1].key = &adapter_id; |
4750 | key[2].length = 1; |
4751 | key[2].key = &seed_access_address; |
4752 | key[3].length = 0; |
4753 | key[3].key = NULL((void*)0); |
4754 | |
4755 | wmem_tree = (wmem_tree_t *) wmem_tree_lookup32_array(broadcastiso_connection_info_tree, key); |
4756 | if (wmem_tree) { |
4757 | broadcastiso_connection_info = (broadcastiso_connection_info_t *) wmem_tree_lookup32_le(wmem_tree, pinfo->num); |
4758 | if (broadcastiso_connection_info) { |
4759 | char *str_addr_src; |
4760 | /* longest possible string */ |
4761 | const size_t str_addr_len = sizeof("Central_0x12345678"); |
4762 | |
4763 | str_addr_src = (char *) wmem_alloc(pinfo->pool, str_addr_len); |
4764 | |
4765 | sub_item = proto_tree_add_ether(btle_tree, hf_central_bd_addr, tvb, 0, 0, broadcastiso_connection_info->central_bd_addr); |
4766 | proto_item_set_generated(sub_item); |
4767 | |
4768 | snprintf(str_addr_src, str_addr_len, "Central_0x%08x", access_address); |
4769 | set_address(&pinfo->dl_src, AT_ETHER, sizeof(broadcastiso_connection_info->central_bd_addr), broadcastiso_connection_info->central_bd_addr); |
4770 | clear_address(&pinfo->dl_dst); |
4771 | |
4772 | set_address(&pinfo->net_src, AT_STRINGZ, (int)strlen(str_addr_src)+1, str_addr_src); |
4773 | copy_address_shallow(&pinfo->src, &pinfo->net_src); |
4774 | |
4775 | if (!pinfo->fd->visited) { |
4776 | address *addr; |
4777 | |
4778 | addr = (address *) wmem_memdup(wmem_file_scope(), &pinfo->dl_src, sizeof(address)); |
4779 | addr->data = wmem_memdup(wmem_file_scope(), pinfo->dl_src.data, pinfo->dl_src.len); |
4780 | p_add_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_SRC0, addr); |
4781 | } |
4782 | } |
4783 | } |
4784 | |
4785 | set_address(&pinfo->net_dst, AT_ETHER, 6, broadcast_addr); |
4786 | copy_address_shallow(&pinfo->dl_dst, &pinfo->net_dst); |
4787 | copy_address_shallow(&pinfo->dst, &pinfo->net_dst); |
4788 | |
4789 | data_header_item = proto_tree_add_item(btle_tree, hf_data_header, tvb, offset, 2, ENC_NA0x00000000); |
4790 | data_header_tree = proto_item_add_subtree(data_header_item, ett_data_header); |
4791 | |
4792 | proto_tree_add_item(data_header_tree, hf_data_header_llid_broadcastiso, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4793 | llid = tvb_get_uint8(tvb, offset) & 0x03; |
4794 | proto_tree_add_item(data_header_tree, hf_data_header_control_subevent_sequence_number, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4795 | proto_tree_add_item(data_header_tree, hf_data_header_control_subevent_transmission_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4796 | proto_tree_add_item(data_header_tree, hf_data_header_rfu_67, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4797 | offset += 1; |
4798 | |
4799 | proto_tree_add_item(data_header_tree, hf_data_header_length, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4800 | item = proto_tree_add_item_ret_uint(btle_tree, hf_length, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000, &length); |
4801 | proto_item_set_hidden(item); |
4802 | offset += 1; |
4803 | |
4804 | switch (llid) { |
4805 | case 0x00: /* Unframed BIS Data PDU; end fragment of an SDU or a complete SDU */ |
4806 | case 0x01: /* Unframed BIS Data PDU; start or continuation fragment of an SDU */ |
4807 | case 0x02: /* Framed BIS Data PDU; one or more segments of an SDU */ |
4808 | proto_tree_add_item(btle_tree, hf_isochronous_data, tvb, offset, length, ENC_NA0x00000000); |
4809 | offset += length; |
4810 | break; |
4811 | |
4812 | case 0x03: /* BIG Control PDU */ |
4813 | proto_tree_add_item(btle_tree, hf_big_control_opcode, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4814 | control_opcode = tvb_get_uint8(tvb, offset); |
4815 | offset += 1; |
4816 | |
4817 | col_add_fstr(pinfo->cinfo, COL_INFO, "BIG Control Opcode: %s", |
4818 | val_to_str_ext_const(control_opcode, &big_control_opcode_vals_ext, "Unknown")); |
4819 | |
4820 | switch (control_opcode) { |
4821 | case 0x00: /* BIG_CHANNEL_MAP_IND */ |
4822 | sub_item = proto_tree_add_item(btle_tree, hf_control_channel_map, tvb, offset, 5, ENC_NA0x00000000); |
4823 | sub_tree = proto_item_add_subtree(sub_item, ett_channel_map); |
4824 | |
4825 | call_dissector(btcommon_le_channel_map_handle, tvb_new_subset_length(tvb, offset, 5), pinfo, sub_tree); |
4826 | offset += 5; |
4827 | |
4828 | proto_tree_add_item_ret_uint(btle_tree, hf_control_instant, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &item_value); |
4829 | offset += 2; |
4830 | break; |
4831 | |
4832 | case 0x01: /* BIG_TERMINATE_IND */ |
4833 | proto_tree_add_item(btle_tree, hf_control_error_code, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4834 | offset += 1; |
4835 | proto_tree_add_item_ret_uint(btle_tree, hf_control_instant, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000, &item_value); |
4836 | offset += 2; |
4837 | break; |
4838 | |
4839 | default: |
4840 | offset = dissect_ctrl_pdu_without_data(tvb, pinfo, btle_tree, offset); |
4841 | break; |
4842 | } |
4843 | break; |
4844 | |
4845 | default: |
4846 | if (tvb_reported_length_remaining(tvb, offset) > 3) { |
4847 | proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_reported_length_remaining(tvb, offset) - 3); |
4848 | offset += tvb_reported_length_remaining(tvb, offset) - 3; |
4849 | } |
4850 | } |
4851 | |
4852 | return offset; |
4853 | } |
4854 | |
4855 | static int |
4856 | dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) |
4857 | { |
4858 | proto_item *btle_item; |
4859 | proto_tree *btle_tree; |
4860 | proto_item *sub_item; |
4861 | int offset = 0; |
4862 | uint32_t access_address, length; |
4863 | tvbuff_t *next_tvb; |
4864 | connection_info_t *connection_info = NULL((void*)0); |
4865 | |
4866 | uint8_t btle_pdu_type = BTLE_PDU_TYPE_UNKNOWN0; |
4867 | |
4868 | uint32_t interface_id; |
4869 | uint32_t adapter_id; |
4870 | const btle_context_t *btle_context = get_btle_context(pinfo, |
4871 | data, |
4872 | &adapter_id, |
4873 | &interface_id); |
4874 | |
4875 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "LE LL"); |
4876 | |
4877 | btle_item = proto_tree_add_item(tree, proto_btle, tvb, offset, -1, ENC_NA0x00000000); |
4878 | btle_tree = proto_item_add_subtree(btle_item, ett_btle); |
4879 | |
4880 | sub_item = proto_tree_add_item(btle_tree, hf_access_address, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000); |
4881 | access_address = tvb_get_letohl(tvb, offset); |
4882 | if (btle_context) { |
4883 | switch(btle_context->aa_category) { |
4884 | case E_AA_MATCHED: |
4885 | expert_add_info(pinfo, sub_item, &ei_access_address_matched); |
4886 | break; |
4887 | case E_AA_ILLEGAL: |
4888 | expert_add_info(pinfo, sub_item, &ei_access_address_illegal); |
4889 | break; |
4890 | case E_AA_BIT_ERRORS: |
4891 | expert_add_info(pinfo, sub_item, &ei_access_address_bit_errors); |
4892 | break; |
4893 | default: |
4894 | break; |
4895 | } |
4896 | } |
4897 | offset += 4; |
4898 | |
4899 | if (btle_context && btle_context->phy == LE_CODED_PHY2) { |
4900 | proto_tree_add_item(btle_tree, hf_coding_indicator, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000); |
4901 | offset += 1; |
4902 | } |
4903 | |
4904 | if (btle_context) { |
4905 | btle_pdu_type = btle_context->pdu_type; |
4906 | } |
4907 | |
4908 | if (btle_pdu_type == BTLE_PDU_TYPE_UNKNOWN0) { |
4909 | /* No context to provide us with physical channel pdu type, make an assumption from the access address */ |
4910 | btle_pdu_type = guess_btle_pdu_type_from_access(interface_id, |
4911 | adapter_id, |
4912 | access_address); |
4913 | } |
4914 | |
4915 | if (btle_pdu_type == BTLE_PDU_TYPE_ADVERTISING1) { |
4916 | next_tvb = tvb_new_subset_remaining(tvb, offset); |
4917 | length = dissect_btle_adv(next_tvb, |
4918 | pinfo, |
4919 | btle_tree, |
4920 | btle_context, |
4921 | adapter_id, |
4922 | interface_id, |
4923 | access_address) - 2; |
4924 | offset += length + 2; |
4925 | } else if (btle_pdu_type == BTLE_PDU_TYPE_DATA2) { |
4926 | next_tvb = tvb_new_subset_remaining(tvb, offset); |
4927 | length = dissect_btle_acl(next_tvb, |
4928 | pinfo, |
4929 | tree, |
4930 | btle_tree, |
4931 | btle_context, |
4932 | adapter_id, |
4933 | interface_id, |
4934 | access_address) - 2; |
4935 | offset += length + 2; |
4936 | } else if (btle_pdu_type == BTLE_PDU_TYPE_CONNECTEDISO3) { |
4937 | next_tvb = tvb_new_subset_remaining(tvb, offset); |
4938 | length = dissect_btle_connected_iso(next_tvb, |
4939 | pinfo, |
4940 | btle_tree, |
4941 | btle_context, |
4942 | adapter_id, |
4943 | interface_id, |
4944 | access_address) - 2; |
4945 | offset += length + 2; |
4946 | } else if (btle_pdu_type == BTLE_PDU_TYPE_BROADCASTISO4) { |
4947 | next_tvb = tvb_new_subset_remaining(tvb, offset); |
4948 | length = dissect_btle_broadcast_iso(next_tvb, |
4949 | pinfo, |
4950 | btle_tree, |
4951 | adapter_id, |
4952 | interface_id, |
4953 | access_address) - 2; |
4954 | offset += length + 2; |
4955 | } else { |
4956 | /* Unknown physical channel PDU type. Assume CRC size is 3 bytes */ |
4957 | if (tvb_reported_length_remaining(tvb, offset) > 3) { |
4958 | proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_reported_length_remaining(tvb, offset) - 3); |
4959 | length = tvb_reported_length_remaining(tvb, offset) - 3; |
4960 | offset += length; |
4961 | } else { |
4962 | /* Length is unknown. */ |
4963 | length = 0; |
4964 | } |
4965 | } |
4966 | |
4967 | offset += dissect_crc(tvb, |
4968 | btle_tree, |
4969 | offset, |
4970 | pinfo, |
4971 | length, |
4972 | connection_info, |
4973 | btle_context, |
4974 | access_address); |
4975 | |
4976 | return offset; |
4977 | } |
4978 | |
4979 | void |
4980 | proto_register_btle(void) |
4981 | { |
4982 | module_t *module; |
4983 | expert_module_t *expert_module; |
4984 | |
4985 | static hf_register_info hf[] = { |
4986 | { &hf_access_address, |
4987 | { "Access Address", "btle.access_address", |
4988 | FT_UINT32, BASE_HEX, NULL((void*)0), 0x0, |
4989 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
4990 | }, |
4991 | { &hf_coding_indicator, |
4992 | { "Coding Indicator", "btle.coding_indicator", |
4993 | FT_UINT8, BASE_DEC, VALS(le_coding_indicators)((0 ? (const struct _value_string*)0 : ((le_coding_indicators )))), 0x3, |
4994 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
4995 | }, |
4996 | { &hf_central_bd_addr, |
4997 | { "Central Address", "btle.central_bd_addr", |
4998 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, |
4999 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5000 | }, |
5001 | { &hf_peripheral_bd_addr, |
5002 | { "Peripheral Address", "btle.peripheral_bd_addr", |
5003 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, |
5004 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5005 | }, |
5006 | { &hf_length, |
5007 | { "Length", "btle.length", |
5008 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
5009 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5010 | }, |
5011 | { &hf_advertising_header, |
5012 | { "Packet Header", "btle.advertising_header", |
5013 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, |
5014 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5015 | }, |
5016 | { &hf_advertising_header_pdu_type, |
5017 | { "PDU Type", "btle.advertising_header.pdu_type", |
5018 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0F, |
5019 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5020 | }, |
5021 | { &hf_advertising_header_rfu_1, |
5022 | { "Reserved", "btle.advertising_header.rfu.1", |
5023 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x10, |
5024 | "Reserved for Future Use", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5025 | }, |
5026 | { &hf_advertising_header_ch_sel, |
5027 | { "Channel Selection Algorithm", "btle.advertising_header.ch_sel", |
5028 | FT_BOOLEAN, 8, TFS(&tfs_ch_sel)((0 ? (const struct true_false_string*)0 : ((&tfs_ch_sel) ))), 0x20, |
5029 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5030 | }, |
5031 | { &hf_advertising_header_rfu_2, |
5032 | { "Reserved", "btle.advertising_header.rfu.2", |
5033 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x20, |
5034 | "Reserved for Future Use", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5035 | }, |
5036 | { &hf_advertising_header_randomized_tx, |
5037 | { "Tx Address", "btle.advertising_header.randomized_tx", |
5038 | FT_BOOLEAN, 8, TFS(&tfs_random_public)((0 ? (const struct true_false_string*)0 : ((&tfs_random_public )))), 0x40, |
5039 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5040 | }, |
5041 | { &hf_advertising_header_rfu_3, |
5042 | { "Reserved", "btle.advertising_header.rfu.3", |
5043 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x40, |
5044 | "Reserved for Future Use", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5045 | }, |
5046 | { &hf_advertising_header_randomized_rx, |
5047 | { "Rx Address", "btle.advertising_header.randomized_rx", |
5048 | FT_BOOLEAN, 8, TFS(&tfs_random_public)((0 ? (const struct true_false_string*)0 : ((&tfs_random_public )))), 0x80, |
5049 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5050 | }, |
5051 | { &hf_advertising_header_rfu_4, |
5052 | { "Reserved", "btle.advertising_header.rfu.4", |
5053 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x80, |
5054 | "Reserved for Future Use", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5055 | }, |
5056 | { &hf_advertising_header_length, |
5057 | { "Length", "btle.advertising_header.length", |
5058 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
5059 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5060 | }, |
5061 | { &hf_advertising_address, |
5062 | { "Advertising Address", "btle.advertising_address", |
5063 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, |
5064 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5065 | }, |
5066 | { &hf_initiator_addresss, |
5067 | { "Initiator Address", "btle.initiator_address", |
5068 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, |
5069 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5070 | }, |
5071 | { &hf_target_addresss, |
5072 | { "Target Address", "btle.target_address", |
5073 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, |
5074 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5075 | }, |
5076 | { &hf_scanning_address, |
5077 | { "Scanning Address", "btle.scanning_address", |
5078 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, |
5079 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5080 | }, |
5081 | { &hf_scan_response_data, |
5082 | { "Scan Response Data", "btle.scan_response_data", |
5083 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, |
5084 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5085 | }, |
5086 | { &hf_link_layer_data, |
5087 | { "Link Layer Data", "btle.link_layer_data", |
5088 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, |
5089 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5090 | }, |
5091 | { &hf_link_layer_data_access_address, |
5092 | { "Access Address", "btle.link_layer_data.access_address", |
5093 | FT_UINT32, BASE_HEX, NULL((void*)0), 0x0, |
5094 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5095 | }, |
5096 | { &hf_link_layer_data_crc_init, |
5097 | { "CRC Init", "btle.link_layer_data.crc_init", |
5098 | FT_UINT24, BASE_HEX, NULL((void*)0), 0x0, |
5099 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5100 | }, |
5101 | { &hf_link_layer_data_window_size, |
5102 | { "Window Size", "btle.link_layer_data.window_size", |
5103 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
5104 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5105 | }, |
5106 | { &hf_link_layer_data_window_offset, |
5107 | { "Window Offset", "btle.link_layer_data.window_offset", |
5108 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5109 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5110 | }, |
5111 | { &hf_link_layer_data_interval, |
5112 | { "Interval", "btle.link_layer_data.interval", |
5113 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5114 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5115 | }, |
5116 | { &hf_link_layer_data_latency, |
5117 | { "Latency", "btle.link_layer_data.latency", |
5118 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5119 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5120 | }, |
5121 | { &hf_link_layer_data_timeout, |
5122 | { "Timeout", "btle.link_layer_data.timeout", |
5123 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5124 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5125 | }, |
5126 | { &hf_link_layer_data_channel_map, |
5127 | { "Channel Map", "btle.link_layer_data.channel_map", |
5128 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, |
5129 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5130 | }, |
5131 | { &hf_link_layer_data_hop, |
5132 | { "Hop", "btle.link_layer_data.hop", |
5133 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x1f, |
5134 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5135 | }, |
5136 | { &hf_link_layer_data_sleep_clock_accuracy, |
5137 | { "Sleep Clock Accuracy", "btle.link_layer_data.sleep_clock_accuracy", |
5138 | FT_UINT8, BASE_DEC | BASE_EXT_STRING0x00000200, &sleep_clock_accuracy_vals_ext, 0xe0, |
5139 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5140 | }, |
5141 | { &hf_extended_advertising_header, |
5142 | { "Extended Advertising Header", "btle.extended_advertising_header", |
5143 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, |
5144 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5145 | }, |
5146 | { &hf_extended_advertising_header_length, |
5147 | { "Extended Header Length", "btle.extended_advertising_header.length", |
5148 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x3F, |
5149 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5150 | }, |
5151 | { &hf_extended_advertising_mode, |
5152 | { "Advertising Mode", "btle.extended_advertising_header.mode", |
5153 | FT_UINT8, BASE_HEX | BASE_EXT_STRING0x00000200, &advertising_mode_vals_ext, 0xC0, |
5154 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5155 | }, |
5156 | { &hf_extended_advertising_flags, |
5157 | { "Extended Header Flags", "btle.extended_advertising_header.flags", |
5158 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, |
5159 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5160 | }, |
5161 | { &hf_extended_advertising_flags_adva, |
5162 | { "Advertiser Address", "btle.extended_advertising_header.flags.advertiser_address", |
5163 | FT_BOOLEAN, 8, TFS(&tfs_present_not_present)((0 ? (const struct true_false_string*)0 : ((&tfs_present_not_present )))), 0x01, |
5164 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5165 | }, |
5166 | { &hf_extended_advertising_flags_targeta, |
5167 | { "Target Address", "btle.extended_advertising_header.flags.target_address", |
5168 | FT_BOOLEAN, 8, TFS(&tfs_present_not_present)((0 ? (const struct true_false_string*)0 : ((&tfs_present_not_present )))), 0x02, |
5169 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5170 | }, |
5171 | { &hf_extended_advertising_flags_cte_info, |
5172 | { "CTE Info", "btle.extended_advertising_header.flags.cte_info", |
5173 | FT_BOOLEAN, 8, TFS(&tfs_present_not_present)((0 ? (const struct true_false_string*)0 : ((&tfs_present_not_present )))), 0x04, |
5174 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5175 | }, |
5176 | { &hf_extended_advertising_flags_advdatainfo, |
5177 | { "Advertiser Data Info", "btle.extended_advertising_header.advertiser_data_info", |
5178 | FT_BOOLEAN, 8, TFS(&tfs_present_not_present)((0 ? (const struct true_false_string*)0 : ((&tfs_present_not_present )))), 0x08, |
5179 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5180 | }, |
5181 | { &hf_extended_advertising_flags_aux_ptr, |
5182 | { "Aux pointer", "btle.extended_advertising_header.flags.aux_pointer", |
5183 | FT_BOOLEAN, 8, TFS(&tfs_present_not_present)((0 ? (const struct true_false_string*)0 : ((&tfs_present_not_present )))), 0x10, |
5184 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5185 | }, |
5186 | { &hf_extended_advertising_flags_sync_info, |
5187 | { "Sync Info", "btle.extended_advertising_header.flags.sync_info", |
5188 | FT_BOOLEAN, 8, TFS(&tfs_present_not_present)((0 ? (const struct true_false_string*)0 : ((&tfs_present_not_present )))), 0x20, |
5189 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5190 | }, |
5191 | { &hf_extended_advertising_flags_tx_power, |
5192 | { "TX Power", "btle.extended_advertising_header.flags.tx_power", |
5193 | FT_BOOLEAN, 8, TFS(&tfs_present_not_present)((0 ? (const struct true_false_string*)0 : ((&tfs_present_not_present )))), 0x40, |
5194 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5195 | }, |
5196 | { &hf_extended_advertising_flags_reserved, |
5197 | { "Reserved", "btle.extended_advertising_header.flags.reserved", |
5198 | FT_BOOLEAN, 8, TFS(&tfs_present_not_present)((0 ? (const struct true_false_string*)0 : ((&tfs_present_not_present )))), 0x80, |
5199 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5200 | }, |
5201 | { &hf_extended_advertising_cte_info, |
5202 | { "CTE Info", "btle.extended_advertising_header.cte_info", |
5203 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, |
5204 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5205 | }, |
5206 | { &hf_extended_advertising_cte_info_time, |
5207 | { "CTE Time", "btle.extended_advertising_header.cte_info.time", |
5208 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x1F, |
5209 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5210 | }, |
5211 | { &hf_extended_advertising_cte_info_rfu, |
5212 | { "RFU", "btle.extended_advertising_header.cte_info.rfu", |
5213 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x20, |
5214 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5215 | }, |
5216 | { &hf_extended_advertising_cte_info_type, |
5217 | { "CTE Type", "btle.extended_advertising_header.cte_info.type", |
5218 | FT_UINT8, BASE_HEX, VALS(le_cte_type_vals)((0 ? (const struct _value_string*)0 : ((le_cte_type_vals)))), 0xC0, |
5219 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5220 | }, |
5221 | { &hf_extended_advertising_data_info, |
5222 | { "Advertiser Data Info", "btle.extended_advertising.advertising_data_info", |
5223 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, |
5224 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5225 | }, |
5226 | { &hf_extended_advertising_data_info_did, |
5227 | { "Advertiser Data Identifier", "btle.extended_advertising.advertising_data_info.did", |
5228 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0FFF, |
5229 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5230 | }, |
5231 | { &hf_extended_advertising_data_info_sid, |
5232 | { "Advertiser Set Identifier", "btle.extended_advertising.advertising_data_info.sid", |
5233 | FT_UINT16, BASE_HEX, NULL((void*)0), 0xF000, |
5234 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5235 | }, |
5236 | { &hf_extended_advertising_aux_ptr, |
5237 | { "Advertiser Aux Pointer", "btle.extended_advertising.aux_pointer", |
5238 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, |
5239 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5240 | }, |
5241 | { &hf_extended_advertising_aux_ptr_channel, |
5242 | { "Channel Index", "btle.extended_advertising_header.aux_pointer.channel", |
5243 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x3F, |
5244 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5245 | }, |
5246 | { &hf_extended_advertising_aux_ptr_ca, |
5247 | { "Clock Accuracy", "btle.extended_advertising_header.aux_pointer.ca", |
5248 | FT_BOOLEAN, 8, TFS(&tfs_ca)((0 ? (const struct true_false_string*)0 : ((&tfs_ca)))), 0x40, |
5249 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5250 | }, |
5251 | { &hf_extended_advertising_aux_ptr_offset_units, |
5252 | { "Offset units", "btle.extended_advertising_header.aux_pointer.offset_units", |
5253 | FT_BOOLEAN, 8, TFS(&tfs_offset_units)((0 ? (const struct true_false_string*)0 : ((&tfs_offset_units )))), 0x80, |
5254 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5255 | }, |
5256 | { &hf_extended_advertising_aux_ptr_aux_offset, |
5257 | { "Aux Offset", "btle.extended_advertising_header.aux_pointer.aux_offset", |
5258 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x1FFF, |
5259 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5260 | }, |
5261 | { &hf_extended_advertising_aux_ptr_aux_phy, |
5262 | { "Aux PHY", "btle.extended_advertising_header.aux_pointer.aux_phy", |
5263 | FT_UINT16, BASE_DEC, VALS(le_phys)((0 ? (const struct _value_string*)0 : ((le_phys)))), 0xE000, |
5264 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5265 | }, |
5266 | { &hf_extended_advertising_sync_info, |
5267 | { "Advertiser Sync Info", "btle.extended_advertising.sync_info", |
5268 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, |
5269 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5270 | }, |
5271 | { &hf_extended_advertising_had_fragment, |
5272 | { "Host Advertising Data Fragment", "btle.extended_advertising.had_fragment", |
5273 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, |
5274 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5275 | }, |
5276 | { &hf_extended_advertising_sync_info_offset, |
5277 | { "Sync Offset", "btle.extended_advertising_header.sync_info.sync_offset", |
5278 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x1FFF, |
5279 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5280 | }, |
5281 | { &hf_extended_advertising_sync_info_offset_units, |
5282 | { "Offset Units", "btle.extended_advertising_header.sync_info.offset_units", |
5283 | FT_BOOLEAN, 16, TFS(&tfs_offset_units)((0 ? (const struct true_false_string*)0 : ((&tfs_offset_units )))), 0x2000, |
5284 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5285 | }, |
5286 | { &hf_extended_advertising_sync_info_offset_adjust, |
5287 | { "Offset Adjust", "btle.extended_advertising_header.sync_info.offset_adjust", |
5288 | FT_BOOLEAN, 16, TFS(&tfs_offset_adjust)((0 ? (const struct true_false_string*)0 : ((&tfs_offset_adjust )))), 0x4000, |
5289 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5290 | }, |
5291 | { &hf_extended_advertising_sync_info_reserved, |
5292 | { "Reserved", "btle.extended_advertising_header.sync_info.reserved", |
5293 | FT_BOOLEAN, 16, NULL((void*)0), 0x8000, |
5294 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5295 | }, |
5296 | { &hf_extended_advertising_sync_info_interval, |
5297 | { "Interval", "btle.extended_advertising_header.sync_info.interval", |
5298 | FT_UINT16, BASE_HEX, NULL((void*)0), 0, |
5299 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5300 | }, |
5301 | { &hf_extended_advertising_sync_info_channel_map, |
5302 | { "Channel Map", "btle.extended_advertising_header.sync_info.channel_map", |
5303 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, |
5304 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5305 | }, |
5306 | { &hf_extended_advertising_sync_info_sleep_clock_accuracy, |
5307 | { "Sleep Clock Accuracy", "btle.extended_advertising_header.sync_info.sleep_clock_accuracy", |
5308 | FT_UINT8, BASE_DEC | BASE_EXT_STRING0x00000200, &sleep_clock_accuracy_vals_ext, 0xe0, |
5309 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5310 | }, |
5311 | { &hf_extended_advertising_sync_info_access_address, |
5312 | { "Access Address", "btle.extended_advertising_header.sync_info.access_address", |
5313 | FT_UINT32, BASE_HEX, NULL((void*)0), 0x0, |
5314 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5315 | }, |
5316 | { &hf_extended_advertising_sync_info_crc_init, |
5317 | { "CRC Init", "btle.extended_advertising_header.sync_info.crc_init", |
5318 | FT_UINT24, BASE_HEX, NULL((void*)0), 0x0, |
5319 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5320 | }, |
5321 | { &hf_extended_advertising_sync_info_event_counter, |
5322 | { "Event counter", "btle.extended_advertising_header.sync_info.event_counter", |
5323 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5324 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5325 | }, |
5326 | { &hf_extended_advertising_tx_power, |
5327 | { "TX Power", "btle.extended_advertising_header.tx_power", |
5328 | FT_INT8, BASE_DEC | BASE_UNIT_STRING0x00001000, UNS(&units_dbm)((0 ? (const struct unit_name_string*)0 : ((&units_dbm))) ), 0x0, |
5329 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5330 | }, |
5331 | { &hf_extended_advertising_header_acad, |
5332 | { "Additional Controller Advertising Data", "btle.extended_advertising_header.acad", |
5333 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, |
5334 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5335 | }, |
5336 | { &hf_data_header, |
5337 | { "Data Header", "btle.data_header", |
5338 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, |
5339 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5340 | }, |
5341 | { &hf_data_header_llid, |
5342 | { "LLID", "btle.data_header.llid", |
5343 | FT_UINT8, BASE_HEX | BASE_EXT_STRING0x00000200, &llid_codes_vals_ext, 0x03, |
5344 | "Logical Link Identifier", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5345 | }, |
5346 | { &hf_data_header_llid_connectediso, |
5347 | { "LLID", "btle.data_header.llid", |
5348 | FT_UINT8, BASE_HEX | BASE_EXT_STRING0x00000200, &llid_connectediso_codes_vals_ext, 0x03, |
5349 | "Logical Link Identifier", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5350 | }, |
5351 | { &hf_data_header_llid_broadcastiso, |
5352 | { "LLID", "btle.data_header.llid", |
5353 | FT_UINT8, BASE_HEX | BASE_EXT_STRING0x00000200, &llid_broadcastiso_codes_vals_ext, 0x03, |
5354 | "Logical Link Identifier", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5355 | }, |
5356 | { &hf_data_header_next_expected_sequence_number, |
5357 | { "Next Expected Sequence Number", "btle.data_header.next_expected_sequence_number", |
5358 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x04, |
5359 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5360 | }, |
5361 | { &hf_data_header_sequence_number, |
5362 | { "Sequence Number", "btle.data_header.sequence_number", |
5363 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x08, |
5364 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5365 | }, |
5366 | { &hf_data_header_more_data, |
5367 | { "More Data", "btle.data_header.more_data", |
5368 | FT_BOOLEAN, 8, NULL((void*)0), 0x10, |
5369 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5370 | }, |
5371 | { &hf_data_header_cte_info_present, |
5372 | { "CTE Info", "btle.data_header.cte_info_present", |
5373 | FT_BOOLEAN, 8, TFS(&tfs_present_not_present)((0 ? (const struct true_false_string*)0 : ((&tfs_present_not_present )))), 0x20, |
5374 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5375 | }, |
5376 | { &hf_data_header_length, |
5377 | { "Length", "btle.data_header.length", |
5378 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
5379 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5380 | }, |
5381 | { &hf_data_header_cte_info, |
5382 | { "CTE Info", "btle.data_header.cte_info", |
5383 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, |
5384 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5385 | }, |
5386 | { &hf_data_header_cte_info_time, |
5387 | { "CTE Time", "btle.data_header.cte_info.time", |
5388 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x1F, |
5389 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5390 | }, |
5391 | { &hf_data_header_cte_info_rfu, |
5392 | { "RFU", "btle.data_header.cte_info.rfu", |
5393 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x20, |
5394 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5395 | }, |
5396 | { &hf_data_header_cte_info_type, |
5397 | { "CTE Type", "btle.data_header.cte_info.type", |
5398 | FT_UINT8, BASE_HEX, VALS(le_cte_type_vals)((0 ? (const struct _value_string*)0 : ((le_cte_type_vals)))), 0xC0, |
5399 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5400 | }, |
5401 | { &hf_data_header_rfu, |
5402 | { "RFU", "btle.data_header.rfu", |
5403 | FT_UINT8, BASE_DEC, NULL((void*)0), 0xC0, |
5404 | "Reserved for Future Use", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5405 | }, |
5406 | { &hf_data_header_rfu_67, |
5407 | { "RFU", "btle.data_header.rfu", |
5408 | FT_UINT8, BASE_DEC, NULL((void*)0), 0xC0, |
5409 | "Reserved for Future Use", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5410 | }, |
5411 | { &hf_data_header_rfu_57, |
5412 | { "RFU", "btle.data_header.rfu", |
5413 | FT_UINT8, BASE_DEC, NULL((void*)0), 0xA0, |
5414 | "Reserved for Future Use", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5415 | }, |
5416 | { &hf_data_header_close_isochronous_event, |
5417 | { "Close Isochronous Event", "btle.data_header.close_isochronous_event", |
5418 | FT_BOOLEAN, 8, NULL((void*)0), 0x10, |
5419 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5420 | }, |
5421 | { &hf_data_header_null_pdu_indicator, |
5422 | { "Null PDU Indicator", "btle.data_header.null_pdu_indicator", |
5423 | FT_BOOLEAN, 8, NULL((void*)0), 0x40, |
5424 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5425 | }, |
5426 | { &hf_data_header_control_subevent_sequence_number, |
5427 | { "Control Subevent Sequence Number", "btle.data_header.control_subevent_sequence_number", |
5428 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x1C, |
5429 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5430 | }, |
5431 | { &hf_data_header_control_subevent_transmission_flag, |
5432 | { "Control Subevent Transmission Flag", "btle.data_header.control_subevent_transmission_flag", |
5433 | FT_BOOLEAN, 8, NULL((void*)0), 0x20, |
5434 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5435 | }, |
5436 | { &hf_control_opcode, |
5437 | { "Control Opcode", "btle.control_opcode", |
5438 | FT_UINT8, BASE_HEX | BASE_EXT_STRING0x00000200, &control_opcode_vals_ext, 0x0, |
5439 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5440 | }, |
5441 | { &hf_control_reject_opcode, |
5442 | { "Reject Opcode", "btle.control.reject_opcode", |
5443 | FT_UINT8, BASE_HEX | BASE_EXT_STRING0x00000200, &control_opcode_vals_ext, 0x0, |
5444 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5445 | }, |
5446 | { &hf_control_unknown_type, |
5447 | { "Unknown Type", "btle.control.unknown_type", |
5448 | FT_UINT8, BASE_HEX | BASE_EXT_STRING0x00000200, &control_opcode_vals_ext, 0x0, |
5449 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5450 | }, |
5451 | { &hf_control_error_code, |
5452 | { "Error Code", "btle.control.error_code", |
5453 | FT_UINT8, BASE_HEX | BASE_EXT_STRING0x00000200, &bthci_cmd_status_vals_ext, 0x0, |
5454 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5455 | }, |
5456 | { &hf_control_version_number, |
5457 | { "Version Number", "btle.control.version_number", |
5458 | FT_UINT8, BASE_HEX | BASE_EXT_STRING0x00000200, &ll_version_number_vals_ext, 0x0, |
5459 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5460 | }, |
5461 | { &hf_control_company_id, |
5462 | { "Company Id", "btle.control.company_id", |
5463 | FT_UINT16, BASE_HEX | BASE_EXT_STRING0x00000200, &bluetooth_company_id_vals_ext, 0x0, |
5464 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5465 | }, |
5466 | { &hf_control_subversion_number, |
5467 | { "Subversion Number", "btle.control.subversion_number", |
5468 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, |
5469 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5470 | }, |
5471 | { &hf_control_feature_set, |
5472 | { "Feature Set", "btle.control.feature_set", |
5473 | FT_UINT64, BASE_HEX, NULL((void*)0), 0x0, |
5474 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5475 | }, |
5476 | { &hf_control_feature_set_le_encryption, |
5477 | { "LE Encryption", "btle.control.feature_set.le_encryption", |
5478 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
5479 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5480 | }, |
5481 | { &hf_control_feature_set_connection_parameters_request_procedure, |
5482 | { "Connection Parameters Request Procedure", "btle.control.feature_set.connection_parameters_request_procedure", |
5483 | FT_BOOLEAN, 8, NULL((void*)0), 0x02, |
5484 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5485 | }, |
5486 | { &hf_control_feature_set_extended_reject_indication, |
5487 | { "Extended Reject Indication", "btle.control.feature_set.extended_reject_indication", |
5488 | FT_BOOLEAN, 8, NULL((void*)0), 0x04, |
5489 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5490 | }, |
5491 | { &hf_control_feature_set_peripheral_initiated_features_exchange, |
5492 | { "Peripheral Initiated Features Exchange", "btle.control.feature_set.peripheral_initiated_features_exchange", |
5493 | FT_BOOLEAN, 8, NULL((void*)0), 0x08, |
5494 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5495 | }, |
5496 | { &hf_control_feature_set_le_ping, |
5497 | { "LE Ping", "btle.control.feature_set.le_ping", |
5498 | FT_BOOLEAN, 8, NULL((void*)0), 0x10, |
5499 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5500 | }, |
5501 | { &hf_control_feature_set_le_pkt_len_ext, |
5502 | { "LE Data Packet Length Extension", "btle.control.feature_set.le_pkt_len_ext", |
5503 | FT_BOOLEAN, 8, NULL((void*)0), 0x20, |
5504 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5505 | }, |
5506 | { &hf_control_feature_set_ll_privacy, |
5507 | { "LL Privacy", "btle.control.feature_set.le_privacy", |
5508 | FT_BOOLEAN, 8, NULL((void*)0), 0x40, |
5509 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5510 | }, |
5511 | { &hf_control_feature_set_ext_scan_flt_pol, |
5512 | { "Extended Scanner Filter Policies", "btle.control.feature_set.ext_scan_flt_pol", |
5513 | FT_BOOLEAN, 8, NULL((void*)0), 0x80, |
5514 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5515 | }, |
5516 | { &hf_control_feature_set_le_2m_phy, |
5517 | { "LE 2M PHY", "btle.control.feature_set.le_2m_phy", |
5518 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
5519 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5520 | }, |
5521 | { &hf_control_feature_set_stable_modulation_index_transmitter, |
5522 | { "Stable Modulation Index - Transmitter", "btle.control.feature_set.st_mod_idx_tx", |
5523 | FT_BOOLEAN, 8, NULL((void*)0), 0x02, |
5524 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5525 | }, |
5526 | { &hf_control_feature_set_stable_modulation_index_receiver, |
5527 | { "Stable Modulation Index - Receiver", "btle.control.feature_set.st_mod_idx_rx", |
5528 | FT_BOOLEAN, 8, NULL((void*)0), 0x04, |
5529 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5530 | }, |
5531 | { &hf_control_feature_set_le_coded_phy, |
5532 | { "LE Coded PHY", "btle.control.feature_set.le_coded_phy", |
5533 | FT_BOOLEAN, 8, NULL((void*)0), 0x08, |
5534 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5535 | }, |
5536 | { &hf_control_feature_set_le_extended_advertising, |
5537 | { "LE Extended Advertising", "btle.control.feature_set.le_extended_adv", |
5538 | FT_BOOLEAN, 8, NULL((void*)0), 0x10, |
5539 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5540 | }, |
5541 | { &hf_control_feature_set_le_periodic_advertising, |
5542 | { "LE Periodic Advertising", "btle.control.feature_set.periodic_adv", |
5543 | FT_BOOLEAN, 8, NULL((void*)0), 0x20, |
5544 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5545 | }, |
5546 | { &hf_control_feature_set_channel_selection_algorithm_2, |
5547 | { "Channel Selection Algorithm #2", "btle.control.feature_set.ch_sel_2", |
5548 | FT_BOOLEAN, 8, NULL((void*)0), 0x40, |
5549 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5550 | }, |
5551 | { &hf_control_feature_set_le_power_class_1, |
5552 | { "LE Power Class 1", "btle.control.feature_set.le_power_class_1", |
5553 | FT_BOOLEAN, 8, NULL((void*)0), 0x80, |
5554 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5555 | }, |
5556 | { &hf_control_feature_set_minimum_number_of_used_channels_procedure, |
5557 | { "Minimum Number of Used Channels Procedure", "btle.control.feature_set.min_num_used_ch_proc", |
5558 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
5559 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5560 | }, |
5561 | { &hf_control_feature_set_connection_cte_request, |
5562 | { "Connection CTE Request", "btle.control.feature_set.connection_cte_request", |
5563 | FT_BOOLEAN, 8, NULL((void*)0), 0x02, |
5564 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5565 | }, |
5566 | { &hf_control_feature_set_connection_cte_response, |
5567 | { "Connection CTE Response", "btle.control.feature_set.connection_cte_response", |
5568 | FT_BOOLEAN, 8, NULL((void*)0), 0x04, |
5569 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5570 | }, |
5571 | { &hf_control_feature_set_connectionless_cte_tx, |
5572 | { "Connectionless CTE Transmitter", "btle.control.feature_set.connectionless_cte_transmitter", |
5573 | FT_BOOLEAN, 8, NULL((void*)0), 0x08, |
5574 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5575 | }, |
5576 | { &hf_control_feature_set_connectionless_cte_rx, |
5577 | { "Connectionless CTE Receiver", "btle.control.feature_set.connectionless_cte_receiver", |
5578 | FT_BOOLEAN, 8, NULL((void*)0), 0x10, |
5579 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5580 | }, |
5581 | { &hf_control_feature_set_antenna_switching_tx_aod, |
5582 | { "Antenna Switching During CTE Transmission (AoD)", "btle.control.feature_set.antenna_switching_tx_aod", |
5583 | FT_BOOLEAN, 8, NULL((void*)0), 0x20, |
5584 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5585 | }, |
5586 | { &hf_control_feature_set_antenna_switching_rx_aoa, |
5587 | { "Antenna Switching During CTE Reception (AoA)", "btle.control.feature_set.antenna_switching_rx_aoa", |
5588 | FT_BOOLEAN, 8, NULL((void*)0), 0x40, |
5589 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5590 | }, |
5591 | { &hf_control_feature_set_cte_rx, |
5592 | { "Receiving Constant Tone Extensions", "btle.control.feature_set.cte_rx", |
5593 | FT_BOOLEAN, 8, NULL((void*)0), 0x80, |
5594 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5595 | }, |
5596 | { &hf_control_feature_set_past_sender, |
5597 | { "Periodic Advertising Sync Transfer - Sender", "btle.control.feature_set.past_sender", |
5598 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
5599 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5600 | }, |
5601 | { &hf_control_feature_set_past_receiver, |
5602 | { "Periodic Advertising Sync Transfer - Receiver", "btle.control.feature_set.past_receiver", |
5603 | FT_BOOLEAN, 8, NULL((void*)0), 0x02, |
5604 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5605 | }, |
5606 | { &hf_control_feature_set_sca_updates, |
5607 | { "Sleep Clock Accuracy Updates", "btle.control.feature_set.sca_updates", |
5608 | FT_BOOLEAN, 8, NULL((void*)0), 0x04, |
5609 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5610 | }, |
5611 | { &hf_control_feature_set_remote_public_key_validation, |
5612 | { "Remote Public Key Validation", "btle.control.feature_set.remote_public_key_validation", |
5613 | FT_BOOLEAN, 8, NULL((void*)0), 0x08, |
5614 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5615 | }, |
5616 | { &hf_control_feature_set_cis_central, |
5617 | { "Connected Isochronous Stream - Central", "btle.control.feature_set.cis_central", |
5618 | FT_BOOLEAN, 8, NULL((void*)0), 0x10, |
5619 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5620 | }, |
5621 | { &hf_control_feature_set_cis_peripheral, |
5622 | { "Connected Isochronous Stream - Peripheral", "btle.control.feature_set.cis_peripheral", |
5623 | FT_BOOLEAN, 8, NULL((void*)0), 0x20, |
5624 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5625 | }, |
5626 | { &hf_control_feature_set_iso_broadcast, |
5627 | { "Isochronous Broadcaster", "btle.control.feature_set.iso_broadcast", |
5628 | FT_BOOLEAN, 8, NULL((void*)0), 0x40, |
5629 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5630 | }, |
5631 | { &hf_control_feature_set_synchronized_receiver, |
5632 | { "Synchronized Receiver", "btle.control.feature_set.synchronized_receiver", |
5633 | FT_BOOLEAN, 8, NULL((void*)0), 0x80, |
5634 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5635 | }, |
5636 | { &hf_control_feature_set_connected_iso_host_support, |
5637 | { "Connected Isochronous Stream (Host Support)", "btle.control.feature_set.connected_iso_host_support", |
5638 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
5639 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5640 | }, |
5641 | { &hf_control_feature_set_le_power_control_request1, |
5642 | { "LE Power Control Request", "btle.control.feature_set.le_power_control_request", |
5643 | FT_BOOLEAN, 8, NULL((void*)0), 0x02, |
5644 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5645 | }, |
5646 | { &hf_control_feature_set_le_power_control_request2, |
5647 | { "LE Power Control Request", "btle.control.feature_set.le_power_control_request_bit_2", |
5648 | FT_BOOLEAN, 8, NULL((void*)0), 0x04, |
5649 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5650 | }, |
5651 | { &hf_control_feature_set_le_path_loss_monitoring, |
5652 | { "LE Path Loss Monitoring", "btle.control.feature_set.le_path_loss_monitoring", |
5653 | FT_BOOLEAN, 8, NULL((void*)0), 0x08, |
5654 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5655 | }, |
5656 | { &hf_control_feature_set_le_periodic_adv_adi_support, |
5657 | { "Periodic Advertising ADI support", "btle.control.feature_set.le_periodic_adv_adi_support", |
5658 | FT_BOOLEAN, 8, NULL((void*)0), 0x10, |
5659 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5660 | }, |
5661 | { &hf_control_feature_set_connection_subrating, |
5662 | { "Connection Subrating", "btle.control.feature_set.connection_subrating", |
5663 | FT_BOOLEAN, 8, NULL((void*)0), 0x20, |
5664 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5665 | }, |
5666 | { &hf_control_feature_set_connection_subrating_host_support, |
5667 | { "Connection Subrating (Host Support)", "btle.control.feature_set.connection_subrating_host_support", |
5668 | FT_BOOLEAN, 8, NULL((void*)0), 0x40, |
5669 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5670 | }, |
5671 | { &hf_control_feature_set_channel_classification, |
5672 | { "Channel Classification", "btle.control.feature_set.channel_classification", |
5673 | FT_BOOLEAN, 8, NULL((void*)0), 0x80, |
5674 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5675 | }, |
5676 | { &hf_control_feature_set_adv_coding_selection, |
5677 | { "Advertising Coding Selection", "btle.control.feature_set.adv_coding_selection", |
5678 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
5679 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5680 | }, |
5681 | { &hf_control_feature_set_decision_based_advertising_filtering, |
5682 | { "Decision-Based Advertising Filtering", "btle.control.feature_set.hf_control_feature_set_decision_based_advertising_filtering", |
5683 | FT_BOOLEAN, 8, NULL((void*)0), 0x02, |
5684 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5685 | }, |
5686 | { &hf_control_feature_set_adv_coding_selection_host_support, |
5687 | { "Advertising Coding Selection (Host Support)", "btle.control.feature_set.adv_coding_selection_host_support", |
5688 | FT_BOOLEAN, 8, NULL((void*)0), 0x04, |
5689 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5690 | }, |
5691 | { &hf_control_feature_set_periodic_adv_with_responses_advertiser, |
5692 | { "Periodic Advertising with Responses - Advertiser", "btle.control.feature_set.periodic_adv_with_responses_advertiser", |
5693 | FT_BOOLEAN, 8, NULL((void*)0), 0x08, |
5694 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5695 | }, |
5696 | { &hf_control_feature_set_periodic_adv_with_responses_scanner, |
5697 | { "Periodic Advertising with Responses - Scanner", "btle.control.feature_set.adv_with_responses_scanner", |
5698 | FT_BOOLEAN, 8, NULL((void*)0), 0x10, |
5699 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5700 | }, |
5701 | { &hf_control_feature_set_unsegmented_frame_mode, |
5702 | { "Unsegmented Framed Mode", "btle.control.feature_set.hf_control_feature_set_unsegmented_frame_mode", |
5703 | FT_BOOLEAN, 8, NULL((void*)0), 0x20, |
5704 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5705 | }, |
5706 | { &hf_control_feature_set_channel_sounding, |
5707 | { "Channel Sounding", "btle.control.feature_set.hf_control_feature_set_channel_sounding", |
5708 | FT_BOOLEAN, 8, NULL((void*)0), 0x40, |
5709 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5710 | }, |
5711 | { &hf_control_feature_set_channel_sounding_host_support, |
5712 | { "Channel Sounding (Host Support)", "btle.control.feature_set.hf_control_feature_set_channel_sounding_host_support", |
5713 | FT_BOOLEAN, 8, NULL((void*)0), 0x80, |
5714 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5715 | }, |
5716 | { &hf_control_feature_set_channel_sounding_tone_quality_indication, |
5717 | { "Channel Sounding Tone Quality Indication", "btle.control.feature_set.hf_control_feature_set_channel_sounding_tone_quality_indication", |
5718 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
5719 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5720 | }, |
5721 | { &hf_control_feature_set_reserved_bits_page_7, |
5722 | { "Reserved bits", "btle.control.feature_set.hf_control_feature_set_reserved_bits_page_7", |
5723 | FT_UINT8, BASE_DEC, NULL((void*)0), 0xFE, |
5724 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5725 | }, |
5726 | { &hf_control_feature_set_reserved_bits_page_8, |
5727 | { "Reserved bits", "btle.control.feature_set.hf_control_feature_set_reserved_bits_page_8", |
5728 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x7F, |
5729 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5730 | }, |
5731 | { &hf_control_feature_set_ll_extended_feature_set, |
5732 | { "LL Extended Feature Set", "btle.control.feature_set.hf_control_feature_set_ll_extended_feature_set", |
5733 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x80, |
5734 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5735 | }, |
5736 | { &hf_control_feature_set_monitoring_advertisers, |
5737 | { "Monitoring Advertisers", "btle.control.feature_set.hf_control_feature_set_monitoring_advertisers", |
5738 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x01, |
5739 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5740 | }, |
5741 | { &hf_control_feature_set_frame_space_update, |
5742 | { "Frame Space Update", "btle.control.feature_set.hf_control_feature_set_frame_space_update", |
5743 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x02, |
5744 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5745 | }, |
5746 | { &hf_control_feature_set_reserved_bits_page_9, |
5747 | { "Reserved bits", "btle.control.feature_set.hf_control_feature_set_reserved_bits_page_9", |
5748 | FT_UINT8, BASE_DEC, NULL((void*)0), 0xFC, |
5749 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
5750 | }, |
5751 | { &hf_control_window_size, |
5752 | { "Window Size", "btle.control.window_size", |
5753 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
5754 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5755 | }, |
5756 | { &hf_control_window_offset, |
5757 | { "Window Offset", "btle.control.window_offset", |
5758 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5759 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5760 | }, |
5761 | { &hf_control_interval, |
5762 | { "Interval", "btle.control.interval", |
5763 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5764 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5765 | }, |
5766 | { &hf_control_latency, |
5767 | { "Latency", "btle.control.latency", |
5768 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5769 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5770 | }, |
5771 | { &hf_control_timeout, |
5772 | { "Timeout", "btle.control.timeout", |
5773 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5774 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5775 | }, |
5776 | { &hf_control_instant, |
5777 | { "Instant", "btle.control.instant", |
5778 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5779 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5780 | }, |
5781 | { &hf_control_rfu_5, |
5782 | { "Reserved for future use", "btle.control.reserved", |
5783 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5784 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5785 | }, |
5786 | { &hf_control_interval_min, |
5787 | { "Interval Min", "btle.control.interval.min", |
5788 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5789 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5790 | }, |
5791 | { &hf_control_interval_max, |
5792 | { "Interval Max", "btle.control.interval.max", |
5793 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5794 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5795 | }, |
5796 | { &hf_control_preferred_periodicity, |
5797 | { "Preferred Periodicity", "btle.control.preferred_periodicity", |
5798 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
5799 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5800 | }, |
5801 | { &hf_control_reference_connection_event_count, |
5802 | { "Reference Connection Event Count","btle.control.reference_connection_event_count", |
5803 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5804 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5805 | }, |
5806 | { &hf_control_offset_0, |
5807 | { "Offset 0", "btle.control.offset.0", |
5808 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5809 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5810 | }, |
5811 | { &hf_control_offset_1, |
5812 | { "Offset 1", "btle.control.offset.1", |
5813 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5814 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5815 | }, |
5816 | { &hf_control_offset_2, |
5817 | { "Offset 2", "btle.control.offset.2", |
5818 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5819 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5820 | }, |
5821 | { &hf_control_offset_3, |
5822 | { "Offset 3", "btle.control.offset.3", |
5823 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5824 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5825 | }, |
5826 | { &hf_control_offset_4, |
5827 | { "Offset 4", "btle.control.offset.4", |
5828 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5829 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5830 | }, |
5831 | { &hf_control_offset_5, |
5832 | { "Offset 5", "btle.control.offset.5", |
5833 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5834 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5835 | }, |
5836 | { &hf_control_channel_map, |
5837 | { "Channel Map", "btle.control.channel_map", |
5838 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, |
5839 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5840 | }, |
5841 | { &hf_control_random_number, |
5842 | { "Random Number", "btle.control.random_number", |
5843 | FT_UINT64, BASE_DEC_HEX, NULL((void*)0), 0x0, |
5844 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5845 | }, |
5846 | { &hf_control_encrypted_diversifier, |
5847 | { "Encrypted Diversifier", "btle.control.encrypted_diversifier", |
5848 | FT_UINT16, BASE_DEC_HEX, NULL((void*)0), 0x0, |
5849 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5850 | }, |
5851 | { &hf_control_central_session_key_diversifier, |
5852 | { "Central Session Key Diversifier", "btle.control.central_session_key_diversifier", |
5853 | FT_UINT64, BASE_DEC_HEX, NULL((void*)0), 0x0, |
5854 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5855 | }, |
5856 | { &hf_control_peripheral_session_key_diversifier, |
5857 | { "Peripheral Session Key Diversifier", "btle.control.peripheral_session_key_diversifier", |
5858 | FT_UINT64, BASE_DEC_HEX, NULL((void*)0), 0x0, |
5859 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5860 | }, |
5861 | { &hf_control_central_session_initialization_vector, |
5862 | { "Central Session Initialization Vector", "btle.control.central_session_initialization_vector", |
5863 | FT_UINT32, BASE_DEC_HEX, NULL((void*)0), 0x0, |
5864 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5865 | }, |
5866 | { &hf_control_peripheral_session_initialization_vector, |
5867 | { "Peripheral Session Initialization Vector", "btle.control.peripheral_session_initialization_vector", |
5868 | FT_UINT64, BASE_DEC_HEX, NULL((void*)0), 0x0, |
5869 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5870 | }, |
5871 | { &hf_control_max_rx_octets, |
5872 | { "Max RX octets", "btle.control.max_rx_octets", |
5873 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5874 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5875 | }, |
5876 | { &hf_control_max_rx_time, |
5877 | { "Max RX time", "btle.control.max_rx_time", |
5878 | FT_UINT16, BASE_DEC|BASE_UNIT_STRING0x00001000, UNS(&units_microsecond_microseconds)((0 ? (const struct unit_name_string*)0 : ((&units_microsecond_microseconds )))), 0x0, |
5879 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5880 | }, |
5881 | { &hf_control_max_tx_octets, |
5882 | { "Max TX octets", "btle.control.max_tx_octets", |
5883 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
5884 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5885 | }, |
5886 | { &hf_control_max_tx_time, |
5887 | { "Max TX time", "btle.control.max_tx_time", |
5888 | FT_UINT16, BASE_DEC|BASE_UNIT_STRING0x00001000, UNS(&units_microsecond_microseconds)((0 ? (const struct unit_name_string*)0 : ((&units_microsecond_microseconds )))), 0x0, |
5889 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5890 | }, |
5891 | { &hf_control_phys_sender_le_1m_phy, |
5892 | { "Sender prefers to use the LE 1M PHY", "btle.control.phys.le_1m_phy", |
5893 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
5894 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5895 | }, |
5896 | { &hf_control_phys_sender_le_2m_phy, |
5897 | { "Sender prefers to use the LE 2M PHY", "btle.control.phys.le_2m_phy", |
5898 | FT_BOOLEAN, 8, NULL((void*)0), 0x02, |
5899 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5900 | }, |
5901 | { &hf_control_phys_sender_le_coded_phy, |
5902 | { "Sender prefers to use the LE Coded PHY", "btle.control.phys.le_coded_phy", |
5903 | FT_BOOLEAN, 8, NULL((void*)0), 0x04, |
5904 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5905 | }, |
5906 | { &hf_control_phys_update_le_1m_phy, |
5907 | { "The LE 1M PHY shall be used", "btle.control.phys.le_1m_phy", |
5908 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
5909 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5910 | }, |
5911 | { &hf_control_phys_update_le_2m_phy, |
5912 | { "The LE 2M PHY shall be used", "btle.control.phys.le_2m_phy", |
5913 | FT_BOOLEAN, 8, NULL((void*)0), 0x02, |
5914 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5915 | }, |
5916 | { &hf_control_phys_update_le_coded_phy, |
5917 | { "The LE Coded PHY shall be used", "btle.control.phys.le_coded_phy", |
5918 | FT_BOOLEAN, 8, NULL((void*)0), 0x04, |
5919 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5920 | }, |
5921 | { &hf_control_phys_reserved_bits, |
5922 | { "Reserved for future use", "btle.control.phys.reserved", |
5923 | FT_UINT8, BASE_DEC, NULL((void*)0), 0xF8, |
5924 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5925 | }, |
5926 | { &hf_control_tx_phys, |
5927 | { "TX PHYs", "btle.control.tx_phys", |
5928 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, |
5929 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5930 | }, |
5931 | { &hf_control_rx_phys, |
5932 | { "RX PHYs", "btle.control.rx_phys", |
5933 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, |
5934 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5935 | }, |
5936 | { &hf_control_c_to_p_phy, |
5937 | { "Central to Peripheral PHY", "btle.control.m_to_s_phy", |
5938 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, |
5939 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5940 | }, |
5941 | { &hf_control_c_to_p_phy_le_1m_phy, |
5942 | { "LE 1M PHY", "btle.control.m_to_s_phy.le_1m_phy", |
5943 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
5944 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5945 | }, |
5946 | { &hf_control_c_to_p_phy_le_2m_phy, |
5947 | { "LE 2M PHY", "btle.control.m_to_s_phy.le_2m_phy", |
5948 | FT_BOOLEAN, 8, NULL((void*)0), 0x02, |
5949 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5950 | }, |
5951 | { &hf_control_c_to_p_phy_le_coded_phy, |
5952 | { "LE Coded PHY", "btle.control.m_to_s_phy.le_coded_phy", |
5953 | FT_BOOLEAN, 8, NULL((void*)0), 0x04, |
5954 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5955 | }, |
5956 | { &hf_control_c_to_p_phy_reserved_bits, |
5957 | { "Reserved for future use", "btle.control.m_to_s_phy.reserved", |
5958 | FT_UINT8, BASE_DEC, NULL((void*)0), 0xF8, |
5959 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5960 | }, |
5961 | { &hf_control_p_to_c_phy, |
5962 | { "Peripheral to Central PHY", "btle.control.s_to_m_phy", |
5963 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, |
5964 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5965 | }, |
5966 | { &hf_control_p_to_c_phy_le_1m_phy, |
5967 | { "LE 1M PHY", "btle.control.s_to_m_phy.le_1m_phy", |
5968 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
5969 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5970 | }, |
5971 | { &hf_control_p_to_c_phy_le_2m_phy, |
5972 | { "LE 2M PHY", "btle.control.s_to_m_phy.le_2m_phy", |
5973 | FT_BOOLEAN, 8, NULL((void*)0), 0x02, |
5974 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5975 | }, |
5976 | { &hf_control_p_to_c_phy_le_coded_phy, |
5977 | { "LE Coded PHY", "btle.control.s_to_m_phy.le_coded_phy", |
5978 | FT_BOOLEAN, 8, NULL((void*)0), 0x04, |
5979 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5980 | }, |
5981 | { &hf_control_p_to_c_phy_reserved_bits, |
5982 | { "Reserved for future use", "btle.control.s_to_m_phy.reserved", |
5983 | FT_UINT8, BASE_DEC, NULL((void*)0), 0xF8, |
5984 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5985 | }, |
5986 | { &hf_control_phys, |
5987 | { "PHYs", "btle.control.phys", |
5988 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, |
5989 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5990 | }, |
5991 | { &hf_control_phys_le_1m_phy, |
5992 | { "LE 1M PHY", "btle.control.phys.le_1m_phy", |
5993 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
5994 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
5995 | }, |
5996 | { &hf_control_phys_le_2m_phy, |
5997 | { "LE 2M PHY", "btle.control.phys.le_2m_phy", |
5998 | FT_BOOLEAN, 8, NULL((void*)0), 0x02, |
5999 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6000 | }, |
6001 | { &hf_control_phys_le_coded_phy, |
6002 | { "LE Coded PHY", "btle.control.phys.le_coded_phy", |
6003 | FT_BOOLEAN, 8, NULL((void*)0), 0x04, |
6004 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6005 | }, |
6006 | { &hf_control_min_used_channels, |
6007 | { "Minimum Used Channels", "btle.control.min_used_channels", |
6008 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
6009 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6010 | }, |
6011 | { &hf_control_cte_min_len_req, |
6012 | { "MinCTELenReq", "btle.control.cte.min_len_req", |
6013 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x1F, |
6014 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6015 | }, |
6016 | { &hf_control_cte_rfu, |
6017 | { "Reserved", "btle.control.cte.rfu", |
6018 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x20, |
6019 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6020 | }, |
6021 | { &hf_control_cte_type_req, |
6022 | { "CTETypeReq", "btle.control.cte.type_req", |
6023 | FT_UINT8, BASE_DEC, VALS(le_cte_type_vals)((0 ? (const struct _value_string*)0 : ((le_cte_type_vals)))), 0xC0, |
6024 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6025 | }, |
6026 | { &hf_control_sync_id, |
6027 | { "ID", "btle.control.sync.id", |
6028 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, |
6029 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6030 | }, |
6031 | { &hf_control_sync_info_offset, |
6032 | { "Sync Offset", "btle.control.sync_info.sync_offset", |
6033 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x1FFF, |
6034 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6035 | }, |
6036 | { &hf_control_sync_info_offset_units, |
6037 | { "Offset Units", "btle.control.sync_info.offset_units", |
6038 | FT_BOOLEAN, 16, TFS(&tfs_offset_units)((0 ? (const struct true_false_string*)0 : ((&tfs_offset_units )))), 0x2000, |
6039 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6040 | }, |
6041 | { &hf_control_sync_info_offset_adjust, |
6042 | { "Offset Adjust", "btle.control.sync_info.offset_adjust", |
6043 | FT_BOOLEAN, 16, TFS(&tfs_offset_adjust)((0 ? (const struct true_false_string*)0 : ((&tfs_offset_adjust )))), 0x4000, |
6044 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6045 | }, |
6046 | { &hf_control_sync_info_reserved, |
6047 | { "Reserved", "btle.control.sync_info.reserved", |
6048 | FT_BOOLEAN, 16, NULL((void*)0), 0x8000, |
6049 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6050 | }, |
6051 | { &hf_control_sync_info_interval, |
6052 | { "Interval", "btle.control.sync_info.interval", |
6053 | FT_UINT16, BASE_HEX, NULL((void*)0), 0, |
6054 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6055 | }, |
6056 | { &hf_control_sync_info_channel_map, |
6057 | { "Channel Map", "btle.control.sync_info.channel_map", |
6058 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, |
6059 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6060 | }, |
6061 | { &hf_control_sync_info_sleep_clock_accuracy, |
6062 | { "Sleep Clock Accuracy", "btle.control.sync_info.sleep_clock_accuracy", |
6063 | FT_UINT8, BASE_DEC | BASE_EXT_STRING0x00000200, &sleep_clock_accuracy_vals_ext, 0xe0, |
6064 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6065 | }, |
6066 | { &hf_control_sync_info_access_address, |
6067 | { "Access Address", "btle.control.sync_info.access_address", |
6068 | FT_UINT32, BASE_HEX, NULL((void*)0), 0x0, |
6069 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6070 | }, |
6071 | { &hf_control_sync_info_crc_init, |
6072 | { "CRC Init", "btle.control.sync_info.crc_init", |
6073 | FT_UINT24, BASE_HEX, NULL((void*)0), 0x0, |
6074 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6075 | }, |
6076 | { &hf_control_sync_info_event_counter, |
6077 | { "Event counter", "btle.control.sync_info.event_counter", |
6078 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6079 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6080 | }, |
6081 | { &hf_control_sync_conn_event_count, |
6082 | { "connEventCount", "btle.control.sync.conn_event_count", |
6083 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6084 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6085 | }, |
6086 | { &hf_control_sync_last_pa_event_counter, |
6087 | { "lastPaEventCounter", "btle.control.sync.last_pa_event_counter", |
6088 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6089 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6090 | }, |
6091 | { &hf_control_sync_sid, |
6092 | { "SID", "btle.control.sync.sid", |
6093 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0F, |
6094 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6095 | }, |
6096 | { &hf_control_sync_atype, |
6097 | { "AType", "btle.control.sync.atype", |
6098 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x10, |
6099 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6100 | }, |
6101 | { &hf_control_sync_sleep_clock_accuracy, |
6102 | { "Sleep Clock Accuracy", "btle.control.sync.sleep_clock_accuracy", |
6103 | FT_UINT8, BASE_DEC | BASE_EXT_STRING0x00000200, &sleep_clock_accuracy_vals_ext, 0xE0, |
6104 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6105 | }, |
6106 | { &hf_control_sync_sync_conn_event_counter, |
6107 | { "syncConnEventCount", "btle.control.sync.sync_conn_event_count", |
6108 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6109 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6110 | }, |
6111 | { &hf_control_sleep_clock_accuracy, |
6112 | { "Sleep Clock Accuracy", "btle.control.sleep_clock_accuracy", |
6113 | FT_UINT8, BASE_DEC | BASE_EXT_STRING0x00000200, &sleep_clock_accuracy_vals_ext, 0xe0, |
6114 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6115 | }, |
6116 | { &hf_control_cig_id, |
6117 | { "CIG_ID", "btle.control.cig_id", |
6118 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
6119 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6120 | }, |
6121 | { &hf_control_cis_id, |
6122 | { "CIS_ID", "btle.control.cis_id", |
6123 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
6124 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6125 | }, |
6126 | { &hf_control_max_sdu_c_to_p, |
6127 | { "Max_SDU_C_To_P", "btle.control.max_sdu_c_to_p", |
6128 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0fff, |
6129 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6130 | }, |
6131 | { &hf_control_rfu_1, |
6132 | { "Reserved", "btle.control.rfu.1", |
6133 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x7000, |
6134 | "Reserved for Future Use", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6135 | }, |
6136 | { &hf_control_framed, |
6137 | { "Framed", "btle.control.framed", |
6138 | FT_BOOLEAN, 16, NULL((void*)0), 0x8000, |
6139 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6140 | }, |
6141 | { &hf_control_max_sdu_p_to_c, |
6142 | { "Max_SDU_P_To_C", "btle.control.max_sdu_p_to_c", |
6143 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0fff, |
6144 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6145 | }, |
6146 | { &hf_control_rfu_2, |
6147 | { "Reserved", "btle.control.rfu.2", |
6148 | FT_UINT16, BASE_DEC, NULL((void*)0), 0xf000, |
6149 | "Reserved for Future Use", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6150 | }, |
6151 | { &hf_control_sdu_interval_c_to_p, |
6152 | { "SDU_Interval_C_To_P", "btle.control.sdu_interval_c_to_p", |
6153 | FT_UINT24, BASE_DEC|BASE_UNIT_STRING0x00001000, UNS(&units_microsecond_microseconds)((0 ? (const struct unit_name_string*)0 : ((&units_microsecond_microseconds )))), 0x0fffff, |
6154 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6155 | }, |
6156 | { &hf_control_rfu_3, |
6157 | { "Reserved", "btle.control.rfu.3", |
6158 | FT_UINT24, BASE_DEC, NULL((void*)0), 0xf00000, |
6159 | "Reserved for Future Use", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6160 | }, |
6161 | { &hf_control_sdu_interval_p_to_c, |
6162 | { "SDU_Interval_P_To_C", "btle.control.sdu_interval_p_to_c", |
6163 | FT_UINT24, BASE_DEC|BASE_UNIT_STRING0x00001000, UNS(&units_microsecond_microseconds)((0 ? (const struct unit_name_string*)0 : ((&units_microsecond_microseconds )))), 0x0fffff, |
6164 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6165 | }, |
6166 | { &hf_control_rfu_4, |
6167 | { "Reserved", "btle.control.rfu.4", |
6168 | FT_UINT24, BASE_DEC, NULL((void*)0), 0xf00000, |
6169 | "Reserved for Future Use", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6170 | }, |
6171 | { &hf_control_max_pdu_c_to_p, |
6172 | { "Max_PDU_C_To_P", "btle.control.max_pdu_c_to_p", |
6173 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6174 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6175 | }, |
6176 | { &hf_control_max_pdu_p_to_c, |
6177 | { "Max_PDU_P_To_C", "btle.control.max_pdu_p_to_c", |
6178 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6179 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6180 | }, |
6181 | { &hf_control_num_sub_events, |
6182 | { "Num_Sub_Events", "btle.control.num_sub_events", |
6183 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
6184 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6185 | }, |
6186 | { &hf_control_sub_interval, |
6187 | { "Sub_Interval", "btle.control.sub_interval", |
6188 | FT_UINT24, BASE_DEC|BASE_UNIT_STRING0x00001000, UNS(&units_microsecond_microseconds)((0 ? (const struct unit_name_string*)0 : ((&units_microsecond_microseconds )))), 0x0, |
6189 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6190 | }, |
6191 | { &hf_control_bn_c_to_p, |
6192 | { "BN_C_To_P", "btle.control.bn_c_to_p", |
6193 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0f, |
6194 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6195 | }, |
6196 | { &hf_control_bn_p_to_c, |
6197 | { "BN_P_To_C", "btle.control.bn_p_to_c", |
6198 | FT_UINT8, BASE_DEC, NULL((void*)0), 0xf0, |
6199 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6200 | }, |
6201 | { &hf_control_ft_c_to_p, |
6202 | { "FT_C_To_P", "btle.control.ft_c_to_p", |
6203 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
6204 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6205 | }, |
6206 | { &hf_control_ft_p_to_c, |
6207 | { "FT_P_To_C", "btle.control.ft_p_to_c", |
6208 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
6209 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6210 | }, |
6211 | { &hf_control_iso_interval, |
6212 | { "ISO_Interval", "btle.control.iso_interval", |
6213 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6214 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6215 | }, |
6216 | { &hf_control_cis_offset_min, |
6217 | { "CIS_Offset_Min", "btle.control.cis_offset_min", |
6218 | FT_UINT24, BASE_DEC, NULL((void*)0), 0x0, |
6219 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6220 | }, |
6221 | { &hf_control_cis_offset_max, |
6222 | { "CIS_Offset_Max", "btle.control.cis_offset_max", |
6223 | FT_UINT24, BASE_DEC, NULL((void*)0), 0x0, |
6224 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6225 | }, |
6226 | { &hf_control_conn_event_count, |
6227 | { "connEventCount", "btle.control.conn_event_count", |
6228 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6229 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6230 | }, |
6231 | { &hf_control_access_address, |
6232 | { "Access Address", "btle.control.access_address", |
6233 | FT_UINT32, BASE_HEX, NULL((void*)0), 0x0, |
6234 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6235 | }, |
6236 | { &hf_control_cis_offset, |
6237 | { "CIS_Offset", "btle.control.cis_offset", |
6238 | FT_UINT24, BASE_DEC, NULL((void*)0), 0x0, |
6239 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6240 | }, |
6241 | { &hf_control_cig_sync_delay, |
6242 | { "CIG_Sync_Delay", "btle.control.cig_sync_delay", |
6243 | FT_UINT24, BASE_DEC, NULL((void*)0), 0x0, |
6244 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6245 | }, |
6246 | { &hf_control_cis_sync_delay, |
6247 | { "CIS_Sync_Delay", "btle.control.cis_sync_delay", |
6248 | FT_UINT24, BASE_DEC, NULL((void*)0), 0x0, |
6249 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6250 | }, |
6251 | { &hf_control_pwr_phy, |
6252 | { "Power PHY", "btle.control.pwr_phy", |
6253 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, |
6254 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6255 | }, |
6256 | { &hf_control_pwr_phy_le_1m_phy, |
6257 | { "LE 1M PHY", "btle.control.pwr_phy.le_1m_phy", |
6258 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
6259 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6260 | }, |
6261 | { &hf_control_pwr_phy_le_2m_phy, |
6262 | { "LE 2M PHY", "btle.control.pwr_phy.le_2m_phy", |
6263 | FT_BOOLEAN, 8, NULL((void*)0), 0x02, |
6264 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6265 | }, |
6266 | { &hf_control_pwr_phy_le_coded_s8_phy, |
6267 | { "LE Coded S=8 PHY", "btle.control.pwr_phy.le_coded_s8_phy", |
6268 | FT_BOOLEAN, 8, NULL((void*)0), 0x04, |
6269 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6270 | }, |
6271 | { &hf_control_pwr_phy_le_coded_s2_phy, |
6272 | { "LE Coded S=2 PHY", "btle.control.pwr_phy.le_coded_s2_phy", |
6273 | FT_BOOLEAN, 8, NULL((void*)0), 0x08, |
6274 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6275 | }, |
6276 | { &hf_control_pwr_phy_reserved_bits, |
6277 | { "Reserved for future use", "btle.control.pwr_phy.reserved", |
6278 | FT_UINT8, BASE_DEC, NULL((void*)0), 0xF0, |
6279 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6280 | }, |
6281 | { &hf_control_delta, |
6282 | { "Delta", "btle.control.delta", |
6283 | FT_INT8, BASE_DEC, NULL((void*)0), 0x0, |
6284 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6285 | }, |
6286 | { &hf_control_txpwr, |
6287 | { "TxPower", "btle.control.txpower", |
6288 | FT_INT8, BASE_DEC, NULL((void*)0), 0x0, |
6289 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6290 | }, |
6291 | { &hf_control_pwrflags, |
6292 | { "Power Flags", "btle.control.pwrflags", |
6293 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, |
6294 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6295 | }, |
6296 | { &hf_control_pwrflags_min, |
6297 | { "Min", "btle.control.min", |
6298 | FT_BOOLEAN, 8, NULL((void*)0), 0x01, |
6299 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6300 | }, |
6301 | { &hf_control_pwrflags_max, |
6302 | { "Max", "btle.control.max", |
6303 | FT_BOOLEAN, 8, NULL((void*)0), 0x02, |
6304 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6305 | }, |
6306 | { &hf_control_pwrflags_reserved_bits, |
6307 | { "Reserved for future use", "btle.control.pwrctrl.reserved", |
6308 | FT_UINT8, BASE_DEC, NULL((void*)0), 0xFC, |
6309 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6310 | }, |
6311 | { &hf_control_acceptable_power_reduction, |
6312 | { "Acceptable Power Reduction", "btle.control.acceptable_power_reduction", |
6313 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
6314 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6315 | }, |
6316 | { &hf_control_subrate_factor_min, |
6317 | {"Minimum subrating factor", "btle.control.subrate_factor_min", |
6318 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6319 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6320 | }, |
6321 | { &hf_control_subrate_factor_max, |
6322 | {"Minimum subrating factor", "btle.control.subrate_factor_max", |
6323 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6324 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6325 | }, |
6326 | { &hf_control_max_latency, |
6327 | {"Maximum peripheral latency in subrated events", "btle.control.max_latency", |
6328 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6329 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6330 | }, |
6331 | { &hf_control_continuation_number, |
6332 | {"The minimum requested continuation number", "btle.control.continuation_number", |
6333 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6334 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6335 | }, |
6336 | { &hf_control_subrate_factor, |
6337 | {"Subrate factor", "btle.control.subrate_factor", |
6338 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6339 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6340 | }, |
6341 | { &hf_control_subrate_base_event, |
6342 | {"Subrate base event", "btle.control.subrate_base_event", |
6343 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, |
6344 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6345 | }, |
6346 | { &hf_control_channel_reporting_enable, |
6347 | {"Enable channel reporting", "btle.control.channel_reporting_enable", |
6348 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
6349 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6350 | }, |
6351 | { &hf_control_channel_reporting_min_spacing, |
6352 | {"Channel reporting min spacing (200 ms units)", "btle.control.channel_reporting_min_spacing", |
6353 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
6354 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6355 | }, |
6356 | { &hf_control_channel_reporting_max_delay, |
6357 | {"Channel reporting max delay (200 ms units)", "btle.control.channel_reporting_max_delay", |
6358 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
6359 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6360 | }, |
6361 | { &hf_control_channel_classification, |
6362 | {"Channel classification", "btle.control.hf_control_channel_classification", |
6363 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, |
6364 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6365 | }, |
6366 | { &hf_control_sync_info_rsp_access_address, |
6367 | {"Response Access Address", "btle.control.sync_info.rsp_aa", |
6368 | FT_UINT32, BASE_HEX, NULL((void*)0), 0x0, |
6369 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
6370 | }, |
6371 | { &hf_control_sync_info_num_subevents, |
6372 | {"Num subevents", "btle.control.sync_info.num_subevents", |
6373 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, |
6374 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
6375 | }, |
6376 | { &hf_control_sync_info_subevent_interval, |
6377 | {"Subevent interval", "btle.control.sync_info.subevent_interval", |
6378 | FT_UINT8, BASE_HEX, NULL((void*)0), 0, |
6379 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
6380 | }, |
6381 | { &hf_control_sync_info_response_slot_delay, |
6382 | {"Response slot delay", "btle.control.sync_info.response_slot_delay", |
6383 | FT_UINT8, BASE_HEX, NULL((void*)0), 0, |
6384 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
6385 | }, |
6386 | { &hf_control_sync_info_response_slot_spacing, |
6387 | {"Response slot spacing", "btle.control.sync_info.response_slot_spacing", |
6388 | FT_UINT8, BASE_HEX, NULL((void*)0), 0, |
6389 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
6390 | }, |
6391 | { &hf_big_control_opcode, |
6392 | { "BIG Control Opcode", "btle.big_control_opcode", |
6393 | FT_UINT8, BASE_HEX | BASE_EXT_STRING0x00000200, &big_control_opcode_vals_ext, 0x0, |
6394 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6395 | }, |
6396 | { &hf_l2cap_index, |
6397 | { "L2CAP Index", "btle.l2cap_index", |
6398 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, |
6399 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6400 | }, |
6401 | { &hf_l2cap_fragment, |
6402 | { "L2CAP Fragment", "btle.l2cap_data", |
6403 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, |
6404 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6405 | }, |
6406 | { &hf_connection_parameters_in, |
6407 | { "Connection Parameters in", "btle.connection_parameters_in", |
6408 | FT_FRAMENUM, BASE_NONE, NULL((void*)0), 0x0, |
6409 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6410 | }, |
6411 | { &hf_crc, |
6412 | { "CRC", "btle.crc", |
6413 | FT_UINT24, BASE_HEX, NULL((void*)0), 0x0, |
6414 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6415 | }, |
6416 | { &hf_isochronous_data, |
6417 | { "Isochronous Data", "btle.isochronous_data", |
6418 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, |
6419 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6420 | }, |
6421 | { &hf_btle_l2cap_msg_fragments, |
6422 | { "L2CAP fragments", "btle.l2cap.fragments", |
6423 | FT_NONE, BASE_NONE, NULL((void*)0), 0x00, |
6424 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6425 | }, |
6426 | { &hf_btle_l2cap_msg_fragment, |
6427 | { "L2CAP fragment", "btle.l2cap.fragment", |
6428 | FT_FRAMENUM, BASE_NONE, NULL((void*)0), 0x00, |
6429 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6430 | }, |
6431 | { &hf_btle_l2cap_msg_fragment_overlap, |
6432 | { "L2CAP fragment overlap", "btle.l2cap.fragment.overlap", |
6433 | FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, |
6434 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6435 | }, |
6436 | { &hf_btle_l2cap_msg_fragment_overlap_conflicts, |
6437 | { "L2CAP fragment overlapping with conflicting data", "btle.l2cap.fragment.overlap.conflicts", |
6438 | FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, |
6439 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6440 | }, |
6441 | { &hf_btle_l2cap_msg_fragment_multiple_tails, |
6442 | { "L2CAP has multiple tail fragments", "btle.l2cap.fragment.multiple_tails", |
6443 | FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, |
6444 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6445 | }, |
6446 | { &hf_btle_l2cap_msg_fragment_too_long_fragment, |
6447 | { "L2CAP fragment too long", "btle.l2cap.fragment.too_long_fragment", |
6448 | FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, |
6449 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6450 | }, |
6451 | { &hf_btle_l2cap_msg_fragment_error, |
6452 | { "L2CAP defragmentation error", "btle.l2cap.fragment.error", |
6453 | FT_FRAMENUM, BASE_NONE, NULL((void*)0), 0x00, |
6454 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6455 | }, |
6456 | { &hf_btle_l2cap_msg_fragment_count, |
6457 | { "L2CAP fragment count", "btle.l2cap.fragment.count", |
6458 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x00, |
6459 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6460 | }, |
6461 | { &hf_btle_l2cap_msg_reassembled_in, |
6462 | { "Reassembled in", "btle.l2cap.reassembled.in", |
6463 | FT_FRAMENUM, BASE_NONE, NULL((void*)0), 0x00, |
6464 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6465 | }, |
6466 | { &hf_btle_l2cap_msg_reassembled_length, |
6467 | { "Reassembled L2CAP length", "btle.l2cap.reassembled.length", |
6468 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x00, |
6469 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6470 | }, |
6471 | { &hf_btle_ea_host_advertising_data_fragments, |
6472 | { "EA HAD fragments", "btle.ea.host_advertising_data.fragments", |
6473 | FT_NONE, BASE_NONE, NULL((void*)0), 0x00, |
6474 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6475 | }, |
6476 | { &hf_btle_ea_host_advertising_data_fragment, |
6477 | { "EA HAD fragment", "btle.ea.host_advertising_data.fragment", |
6478 | FT_FRAMENUM, BASE_NONE, NULL((void*)0), 0x00, |
6479 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6480 | }, |
6481 | { &hf_btle_ea_host_advertising_data_fragment_overlap, |
6482 | { "EA HAD fragment overlap", "btle.ea.host_advertising_data.fragment.overlap", |
6483 | FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, |
6484 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6485 | }, |
6486 | { &hf_btle_ea_host_advertising_data_fragment_overlap_conflicts, |
6487 | { "EA HAD fragment overlapping with conflicting data", "btle.ea.host_advertising_data.fragment.overlap.conflicts", |
6488 | FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, |
6489 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6490 | }, |
6491 | { &hf_btle_ea_host_advertising_data_fragment_multiple_tails, |
6492 | { "EA HAD has multiple tail fragments", "btle.ea.host_advertising_data.fragment.multiple_tails", |
6493 | FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, |
6494 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6495 | }, |
6496 | { &hf_btle_ea_host_advertising_data_fragment_too_long_fragment, |
6497 | { "EA HAD fragment too long", "btle.ea.host_advertising_data.fragment.too_long_fragment", |
6498 | FT_BOOLEAN, BASE_NONE, NULL((void*)0), 0x0, |
6499 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6500 | }, |
6501 | { &hf_btle_ea_host_advertising_data_fragment_error, |
6502 | { "EA HAD defragmentation error", "btle.ea.host_advertising_data.fragment.error", |
6503 | FT_FRAMENUM, BASE_NONE, NULL((void*)0), 0x00, |
6504 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6505 | }, |
6506 | { &hf_btle_ea_host_advertising_data_fragment_count, |
6507 | { "EA HAD fragment count", "btle.ea.host_advertising_data.fragment.count", |
6508 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x00, |
6509 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6510 | }, |
6511 | { &hf_btle_ea_host_advertising_data_reassembled_in, |
6512 | { "Reassembled in", "btle.ea.host_advertising_data.reassembled.in", |
6513 | FT_FRAMENUM, BASE_NONE, NULL((void*)0), 0x00, |
6514 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6515 | }, |
6516 | { &hf_btle_ea_host_advertising_data_reassembled_length, |
6517 | { "Reassembled EA HAD length", "btle.ea.host_advertising_data.reassembled.length", |
6518 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x00, |
6519 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } |
6520 | }, |
6521 | { &hf_request_in_frame, |
6522 | {"Request in Frame", "btle.request_in_frame", |
6523 | FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST)((gpointer) (glong) (FT_FRAMENUM_REQUEST)), 0x0, |
6524 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
6525 | }, |
6526 | { &hf_response_in_frame, |
6527 | {"Response in Frame", "btle.response_in_frame", |
6528 | FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE)((gpointer) (glong) (FT_FRAMENUM_RESPONSE)), 0x0, |
6529 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)} |
6530 | }, |
6531 | }; |
6532 | |
6533 | static ei_register_info ei[] = { |
6534 | { &ei_unknown_data, |
6535 | { "btle.unknown_data", PI_PROTOCOL0x09000000, PI_NOTE0x00400000, "Unknown data", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} }}, |
6536 | { &ei_access_address_matched, |
6537 | { "btle.access_address.matched", PI_PROTOCOL0x09000000, PI_NOTE0x00400000, "AccessAddress matched at capture", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} }}, |
6538 | { &ei_access_address_bit_errors, |
6539 | { "btle.access_address.bit_errors", PI_PROTOCOL0x09000000, PI_WARN0x00600000, "AccessAddress has errors present at capture", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} }}, |
6540 | { &ei_access_address_illegal, |
6541 | { "btle.access_address.illegal", PI_PROTOCOL0x09000000, PI_ERROR0x00800000, "AccessAddress has illegal value", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} }}, |
6542 | { &ei_control_proc_overlapping, |
6543 | { "btle.control_proc_overlapping", PI_PROTOCOL0x09000000, PI_ERROR0x00800000, "Initiating a new control procedure before the previous was complete", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} }}, |
6544 | { &ei_control_proc_invalid_collision, |
6545 | { "btle.control_proc_incompatible", PI_PROTOCOL0x09000000, PI_ERROR0x00800000, "Initiating a new incompatible control procedure after having sent a response to an incompatible control procedure", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} }}, |
6546 | { &ei_control_proc_wrong_seq, |
6547 | { "btle.control_proc_unknown_seq", PI_PROTOCOL0x09000000, PI_ERROR0x00800000, "Incorrect control procedure packet sequencing or direction", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} }}, |
6548 | { &ei_control_proc_invalid_conflict_resolution, |
6549 | { "btle.ei_control_proc_invalid_conflict_resolution", |
6550 | PI_PROTOCOL0x09000000, PI_ERROR0x00800000, "Incorrect control procedure packet collision resolution. See Core_v5.2, Vol 6, Part B, Section 5.3", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} }}, |
6551 | { &ei_crc_cannot_be_determined, |
6552 | { "btle.crc.indeterminate", PI_CHECKSUM0x01000000, PI_NOTE0x00400000, "CRC unchecked, not all data available", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} }}, |
6553 | { &ei_crc_incorrect, |
6554 | { "btle.crc.incorrect", PI_CHECKSUM0x01000000, PI_WARN0x00600000, "Incorrect CRC", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} }}, |
6555 | { &ei_missing_fragment_start, |
6556 | { "btle.missing_fragment_start", PI_SEQUENCE0x02000000, PI_WARN0x00600000, "Missing Fragment Start", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} }}, |
6557 | { &ei_retransmit, |
6558 | { "btle.retransmit", PI_SEQUENCE0x02000000, PI_NOTE0x00400000, "Retransmission", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} }}, |
6559 | { &ei_nack, |
6560 | { "btle.nack", PI_SEQUENCE0x02000000, PI_NOTE0x00400000, "Not acknowledged", EXPFILL0, ((void*)0), 0, {0, {((void*)0), ((void*)0), FT_NONE, BASE_NONE , ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE, -1, ((void *)0)}} }}, |
6561 | }; |
6562 | |
6563 | static int *ett[] = { |
6564 | &ett_btle, |
6565 | &ett_advertising_header, |
6566 | &ett_link_layer_data, |
6567 | &ett_extended_advertising_header, |
6568 | &ett_extended_advertising_flags, |
6569 | &ett_extended_advertising_cte_info, |
6570 | &ett_extended_advertising_data_info, |
6571 | &ett_extended_advertising_aux_pointer, |
6572 | &ett_extended_advertising_sync_info, |
6573 | &ett_extended_advertising_acad, |
6574 | &ett_data_header, |
6575 | &ett_data_header_cte_info, |
6576 | &ett_features, |
6577 | &ett_tx_phys, |
6578 | &ett_rx_phys, |
6579 | &ett_c_to_p_phy, |
6580 | &ett_p_to_c_phy, |
6581 | &ett_phys, |
6582 | &ett_pwr_phy, |
6583 | &ett_cte, |
6584 | &ett_channel_map, |
6585 | &ett_scan_response_data, |
6586 | &ett_pwrflags, |
6587 | &ett_btle_l2cap_msg_fragment, |
6588 | &ett_btle_l2cap_msg_fragments, |
6589 | &ett_btle_ea_host_advertising_data_fragment, |
6590 | &ett_btle_ea_host_advertising_data_fragments |
6591 | }; |
6592 | |
6593 | connection_info_tree = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); |
6594 | periodic_adv_info_tree = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); |
6595 | connectediso_connection_info_tree = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); |
6596 | broadcastiso_connection_info_tree = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); |
6597 | connection_parameter_info_tree = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); |
6598 | adi_to_first_frame_tree = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); |
6599 | |
6600 | proto_btle = proto_register_protocol("Bluetooth Low Energy Link Layer", |
6601 | "BT LE LL", "btle"); |
6602 | btle_handle = register_dissector("btle", dissect_btle, proto_btle); |
6603 | |
6604 | proto_register_field_array(proto_btle, hf, array_length(hf)(sizeof (hf) / sizeof (hf)[0])); |
6605 | proto_register_subtree_array(ett, array_length(ett)(sizeof (ett) / sizeof (ett)[0])); |
6606 | |
6607 | expert_module = expert_register_protocol(proto_btle); |
6608 | expert_register_field_array(expert_module, ei, array_length(ei)(sizeof (ei) / sizeof (ei)[0])); |
6609 | |
6610 | module = prefs_register_protocol_subtree("Bluetooth", proto_btle, NULL((void*)0)); |
6611 | prefs_register_static_text_preference(module, "version", |
6612 | "Bluetooth LE LL version: 5.4 (Core)", |
6613 | "Version of protocol supported by this dissector."); |
6614 | |
6615 | prefs_register_bool_preference(module, "detect_retransmit", |
6616 | "Detect retransmission", |
6617 | "Detect retransmission based on SN (Sequence Number)", |
6618 | &btle_detect_retransmit); |
6619 | |
6620 | reassembly_table_register(&btle_l2cap_msg_reassembly_table, |
6621 | &addresses_reassembly_table_functions); |
6622 | |
6623 | reassembly_table_register(&btle_ea_host_advertising_data_reassembly_table, |
6624 | &addresses_reassembly_table_functions); |
6625 | |
6626 | register_init_routine(btle_init); |
6627 | } |
6628 | |
6629 | void |
6630 | proto_reg_handoff_btle(void) |
6631 | { |
6632 | btcommon_ad_handle = find_dissector_add_dependency("btcommon.eir_ad.ad", proto_btle); |
6633 | btcommon_le_channel_map_handle = find_dissector_add_dependency("btcommon.le_channel_map", proto_btle); |
6634 | btl2cap_handle = find_dissector_add_dependency("btl2cap", proto_btle); |
6635 | |
6636 | proto_btle_rf = proto_get_id_by_filter_name("btle_rf"); |
6637 | proto_nordic_ble = proto_get_id_by_filter_name("nordic_ble"); |
6638 | |
6639 | dissector_add_uint("bluetooth.encap", WTAP_ENCAP_BLUETOOTH_LE_LL154, btle_handle); |
6640 | } |
6641 | |
6642 | /* |
6643 | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
6644 | * |
6645 | * Local variables: |
6646 | * c-basic-offset: 4 |
6647 | * tab-width: 8 |
6648 | * indent-tabs-mode: nil |
6649 | * End: |
6650 | * |
6651 | * vi: set shiftwidth=4 tabstop=8 expandtab: |
6652 | * :indentSize=4:tabSize=8:noTabs=true: |
6653 | */ |