Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-btlmp.c
blob4ad02b29bd29dc29f71b2e823a1b45565b34f45d
1 /* packet-btlmp.c
2 * Routines for the Bluetooth Link Manager Protocol
4 * Copyright 2020, Thomas Sailer <t.sailer@alumni.ethz.ch>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
13 #include "config.h"
15 #include <epan/packet.h>
16 #include <epan/unit_strings.h>
19 #include "packet-btbredr_rf.h"
21 static int proto_btlmp;
23 static int hf_opcode[3];
24 static int hf_escopcode[4];
25 static int hf_accept_opcode;
26 static int hf_accept_escopcode[4];
27 static int hf_errorcode;
28 static int hf_param_feature_page0_byte0[9];
29 static int hf_param_feature_page0_byte1[9];
30 static int hf_param_feature_page0_byte2[7];
31 static int hf_param_feature_page0_byte3[9];
32 static int hf_param_feature_page0_byte4[9];
33 static int hf_param_feature_page0_byte5[9];
34 static int hf_param_feature_page0_byte6[9];
35 static int hf_param_feature_page0_byte7[6];
36 static int hf_param_feature_page1_byte0[6];
37 static int hf_param_feature_page2_byte0[9];
38 static int hf_param_feature_page2_byte1[6];
39 static int hf_param_features_page;
40 static int hf_param_max_supported_page;
41 static int hf_param_versnr;
42 static int hf_param_compid;
43 static int hf_param_subversnr;
44 static int hf_param_namelength;
45 static int hf_param_nameoffset;
46 static int hf_param_namefragment;
47 static int hf_param_afh_mode;
48 static int hf_param_afh_instant;
49 static int hf_param_afh_channelmap[10];
50 static int hf_param_afh_reportingmode;
51 static int hf_param_afh_mininterval;
52 static int hf_param_afh_maxinterval;
53 static int hf_param_afh_channelclass[10][4];
54 static int hf_param_rand;
55 static int hf_param_key;
56 static int hf_param_clockoffset;
57 static int hf_param_authresp;
58 static int hf_param_encryptionmode;
59 static int hf_param_encryptionkeysize;
60 static int hf_param_switchinstant;
61 static int hf_param_holdtime;
62 static int hf_param_holdinstant;
63 static int hf_param_dsniff;
64 static int hf_param_tsniff;
65 static int hf_param_sniffattempt;
66 static int hf_param_snifftimeout;
67 static int hf_param_timingcontrolflags[5];
68 static int hf_param_futureuse1;
69 static int hf_param_datarate[6];
70 static int hf_param_pollinterval;
71 static int hf_param_nbc;
72 static int hf_param_scohandle;
73 static int hf_param_dsco;
74 static int hf_param_tsco;
75 static int hf_param_scopacket;
76 static int hf_param_airmode;
77 static int hf_param_slots;
78 static int hf_param_tmgacc_drift;
79 static int hf_param_tmgacc_jitter;
80 static int hf_param_slotoffset;
81 static int hf_param_bdaddr;
82 static int hf_param_pagingscheme;
83 static int hf_param_pagingschemesettings;
84 static int hf_param_supervisiontimeout;
85 static int hf_param_testscenario;
86 static int hf_param_testhoppingmode;
87 static int hf_param_testtxfrequency;
88 static int hf_param_testrxfrequency;
89 static int hf_param_testpowercontrolmode;
90 static int hf_param_testpollperiod;
91 static int hf_param_testpackettype;
92 static int hf_param_testdatalength;
93 static int hf_param_keysizemask;
94 static int hf_param_encapsulatedmajor;
95 static int hf_param_encapsulatedminor;
96 static int hf_param_encapsulatedlength;
97 static int hf_param_encapsulateddata;
98 static int hf_param_simplepaircommit;
99 static int hf_param_simplepairnonce;
100 static int hf_param_dhkeyconfirm;
101 static int hf_param_clkadjid;
102 static int hf_param_clkadjinstant;
103 static int hf_param_clkadjus;
104 static int hf_param_clkadjslots;
105 static int hf_param_clkadjmode;
106 static int hf_param_clkadjclk;
107 static int hf_param_clkadjperiod;
108 static int hf_param_packettypetable;
109 static int hf_param_escohandle;
110 static int hf_param_escoltaddr;
111 static int hf_param_escod;
112 static int hf_param_escot;
113 static int hf_param_escow;
114 static int hf_param_escopackettypems;
115 static int hf_param_escopackettypesm;
116 static int hf_param_escopacketlengthms;
117 static int hf_param_escopacketlengthsm;
118 static int hf_param_negostate;
119 static int hf_param_maxsniffsubrate;
120 static int hf_param_minsniffmodetimeout;
121 static int hf_param_sniffsubratinginstant;
122 static int hf_param_iocapcap;
123 static int hf_param_iocapoobauthdata;
124 static int hf_param_iocapauthreq;
125 static int hf_param_keypressnotificationtype;
126 static int hf_param_poweradjreq;
127 static int hf_param_poweradjresp[5];
128 static int hf_param_samindex;
129 static int hf_param_samtsm;
130 static int hf_param_samnsm;
131 static int hf_param_samsubmaps;
132 static int hf_param_samupdatemode;
133 static int hf_param_samtype0submap;
134 static int hf_param_samd;
135 static int hf_param_saminstant;
136 static int hf_params;
138 static int ett_btlmp;
140 static dissector_handle_t btlmp_handle;
142 static const value_string opcode_vals[] = {
143 { 1, "LMP_name_req" },
144 { 2, "LMP_name_res" },
145 { 3, "LMP_accepted" },
146 { 4, "LMP_not_accepted" },
147 { 5, "LMP_clkoffset_req" },
148 { 6, "LMP_clkoffset_res" },
149 { 7, "LMP_detach" },
150 { 8, "LMP_in_rand" },
151 { 9, "LMP_comb_key" },
152 { 10, "LMP_unit_key" },
153 { 11, "LMP_au_rand" },
154 { 12, "LMP_sres" },
155 { 13, "LMP_temp_rand" },
156 { 14, "LMP_temp_key" },
157 { 15, "LMP_encryption_mode_req" },
158 { 16, "LMP_encryption_key_size_req" },
159 { 17, "LMP_start_encryption_req" },
160 { 18, "LMP_stop_encryption_req" },
161 { 19, "LMP_switch_req" },
162 { 20, "LMP_hold" },
163 { 21, "LMP_hold_req" },
164 { 23, "LMP_sniff_req" },
165 { 24, "LMP_unsniff_req" },
166 { 31, "LMP_incr_power_req" },
167 { 32, "LMP_decr_power_req" },
168 { 33, "LMP_max_power" },
169 { 34, "LMP_min_power" },
170 { 35, "LMP_auto_rate" },
171 { 36, "LMP_preferred_rate" },
172 { 37, "LMP_version_req" },
173 { 38, "LMP_version_res" },
174 { 39, "LMP_features_req" },
175 { 40, "LMP_features_res" },
176 { 41, "LMP_quality_of_service" },
177 { 42, "LMP_quality_of_service_req" },
178 { 43, "LMP_SCO_link_req" },
179 { 44, "LMP_remove_SCO_link_req" },
180 { 45, "LMP_max_slot" },
181 { 46, "LMP_max_slot_req" },
182 { 47, "LMP_timing_accuracy_req" },
183 { 48, "LMP_timing_accuracy_res" },
184 { 49, "LMP_setup_complete" },
185 { 50, "LMP_use_semi_permanent_key" },
186 { 51, "LMP_host_connection_req" },
187 { 52, "LMP_slot_offset" },
188 { 53, "LMP_page_mode_req" },
189 { 54, "LMP_page_scan_mode_req" },
190 { 55, "LMP_supervision_timeout" },
191 { 56, "LMP_test_activate" },
192 { 57, "LMP_test_control" },
193 { 58, "LMP_encryption_key_size_mask_req" },
194 { 59, "LMP_encryption_key_size_mask_res" },
195 { 60, "LMP_set_AFH" },
196 { 61, "LMP_encapsulated_header" },
197 { 62, "LMP_encapsulated_payload" },
198 { 63, "LMP_Simple_Pairing_Confirm" },
199 { 64, "LMP_Simple_Pairing_Number" },
200 { 65, "LMP_DHkey_Check" },
201 { 66, "LMP_pause_encryption_aes_req" },
202 { 124, "Escape 1" },
203 { 125, "Escape 2" },
204 { 126, "Escape 3" },
205 { 127, "Escape 4" },
206 { 0, NULL }
209 static const value_string escape1_opcode_vals[] = {
210 { 0x00, "Mandatory Scan Mode" },
211 { 0, NULL }
214 static const value_string escape2_opcode_vals[] = {
215 { 0x00, "Mandatory Scan Mode" },
216 { 0, NULL }
219 static const value_string escape3_opcode_vals[] = {
220 { 0x00, "Mandatory Scan Mode" },
221 { 0, NULL }
224 static const value_string escape4_opcode_vals[] = {
225 { 1, "LMP_accepted_ext" },
226 { 2, "LMP_not_accepted_ext" },
227 { 3, "LMP_features_req_ext" },
228 { 4, "LMP_features_res_ext" },
229 { 5, "LMP_clk_adj" },
230 { 6, "LMP_clk_adj_ack" },
231 { 7, "LMP_clk_adj_req" },
232 { 11, "LMP_packet_type_table_req" },
233 { 12, "LMP_eSCO_link_req" },
234 { 13, "LMP_remove_eSCO_link_req" },
235 { 16, "LMP_channel_classification_req" },
236 { 17, "LMP_channel_classification" },
237 { 21, "LMP_sniff_subrating_req" },
238 { 22, "LMP_sniff_subrating_res" },
239 { 23, "LMP_pause_encryption_req" },
240 { 24, "LMP_resume_encryption_req" },
241 { 25, "LMP_IO_Capability_req" },
242 { 26, "LMP_IO_Capability_res" },
243 { 27, "LMP_numeric_comparison_failed" },
244 { 28, "LMP_passkey_failed" },
245 { 29, "LMP_oob_failed" },
246 { 30, "LMP_keypress_notification" },
247 { 31, "LMP_power_control_req" },
248 { 32, "LMP_power_control_res" },
249 { 33, "LMP_ping_req" },
250 { 34, "LMP_ping_res" },
251 { 35, "LMP_SAM_set_type0" },
252 { 36, "LMP_SAM_define_map" },
253 { 37, "LMP_SAM_switch" },
254 { 0, NULL }
257 static const value_string errorcode_vals[] = {
258 { 0x00, "Success" },
259 { 0x01, "Unknown HCI Command" },
260 { 0x02, "Unknown Connection Identifier" },
261 { 0x03, "Hardware Failure" },
262 { 0x04, "Page Timeout" },
263 { 0x05, "Authentication Failure" },
264 { 0x06, "PIN or Key Missing" },
265 { 0x07, "Memory Capacity Exceeded" },
266 { 0x08, "Connection Timeout" },
267 { 0x09, "Connection Limit Exceeded" },
268 { 0x0A, "Synchronous Connection Limit To A Device Exceeded" },
269 { 0x0B, "Connection Already Exists" },
270 { 0x0C, "Command Disallowed" },
271 { 0x0D, "Connection Rejected due to Limited Resources" },
272 { 0x0E, "Connection Rejected Due To Security Reasons" },
273 { 0x0F, "Connection Rejected due to Unacceptable BD_ADDR" },
274 { 0x10, "Connection Accept Timeout Exceeded" },
275 { 0x11, "Unsupported Feature or Parameter Value" },
276 { 0x12, "Invalid HCI Command Parameters" },
277 { 0x13, "Remote User Terminated Connection" },
278 { 0x14, "Remote Device Terminated Connection due to Low Resources" },
279 { 0x15, "Remote Device Terminated Connection due to Power Off" },
280 { 0x16, "Connection Terminated By Local Host" },
281 { 0x17, "Repeated Attempts" },
282 { 0x18, "Pairing Not Allowed" },
283 { 0x19, "Unknown LMP PDU" },
284 { 0x1A, "Unsupported Remote Feature / Unsupported LMP Feature" },
285 { 0x1B, "SCO Offset Rejected" },
286 { 0x1C, "SCO Interval Rejected" },
287 { 0x1D, "SCO Air Mode Rejected" },
288 { 0x1E, "Invalid LMP Parameters / Invalid LL Parameters" },
289 { 0x1F, "Unspecified Error" },
290 { 0x20, "Unsupported LMP Parameter Value / Unsupported LL Parameter Value" },
291 { 0x21, "Role Change Not Allowed" },
292 { 0x22, "LMP Response Timeout / LL Response Timeout" },
293 { 0x23, "LMP Error Transaction Collision / LL Procedure Collision" },
294 { 0x24, "LMP PDU Not Allowed" },
295 { 0x25, "Encryption Mode Not Acceptable" },
296 { 0x26, "Link Key cannot be Changed" },
297 { 0x27, "Requested QoS Not Supported" },
298 { 0x28, "Instant Passed" },
299 { 0x29, "Pairing With Unit Key Not Supported" },
300 { 0x2A, "Different Transaction Collision" },
301 { 0x2B, "Reserved for future use" },
302 { 0x2C, "QoS Unacceptable Parameter" },
303 { 0x2D, "QoS Rejected" },
304 { 0x2E, "Channel Classification Not Supported" },
305 { 0x2F, "Insufficient Security" },
306 { 0x30, "Parameter Out Of Mandatory Range" },
307 { 0x31, "Reserved for future use" },
308 { 0x32, "Role Switch Pending" },
309 { 0x33, "Reserved for future use" },
310 { 0x34, "Reserved Slot Violation" },
311 { 0x35, "Role Switch Failed" },
312 { 0x36, "Extended Inquiry Response Too Large" },
313 { 0x37, "Secure Simple Pairing Not Supported By Host" },
314 { 0x38, "Host Busy - Pairing" },
315 { 0x39, "Connection Rejected due to No Suitable Channel Found" },
316 { 0x3A, "Controller Busy" },
317 { 0x3B, "Unacceptable Connection Parameters" },
318 { 0x3C, "Advertising Timeout" },
319 { 0x3D, "Connection Terminated due to MIC Failure" },
320 { 0x3E, "Connection Failed to be Established / Synchronization Timeout" },
321 { 0x3F, "MAC Connection Failed" },
322 { 0x40, "Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock" },
323 { 0x41, "Type0 Submap Not Defined" },
324 { 0x42, "Unknown Advertising Identifier" },
325 { 0x43, "Limit Reached" },
326 { 0x44, "Operation Cancelled by Host" },
327 { 0x45, "Packet Too Long" },
328 { 0x00, NULL }
331 static const value_string afh_mode_vals[] = {
332 { 0x00, "AFH disabled" },
333 { 0x01, "AFH enabled" },
334 { 0x00, NULL }
337 static const value_string afh_reportingmode_vals[] = {
338 { 0x00, "AFH reporting disabled" },
339 { 0x01, "AFH reporting enabled" },
340 { 0x00, NULL }
343 static const value_string afh_channelclass_vals[] = {
344 { 0x00, "unknown" },
345 { 0x01, "good" },
346 { 0x02, "reserved" },
347 { 0x03, "bad" },
348 { 0x00, NULL }
351 static const value_string encryptionmode_vals[] = {
352 { 0x00, "no encryption" },
353 { 0x01, "encryption" },
354 { 0x02, "encryption" },
355 { 0x00, NULL }
358 static const value_string timingcontrol_timingchange_vals[] = {
359 { 0x00, "no timing change" },
360 { 0x01, "timing change" },
361 { 0x00, NULL }
364 static const value_string timingcontrol_useinit2[] = {
365 { 0x00, "use initialization 1" },
366 { 0x01, "use initialization 2" },
367 { 0x00, NULL }
370 static const value_string timingcontrol_noaccesswindow[] = {
371 { 0x00, "access window" },
372 { 0x01, "no access window" },
373 { 0x00, NULL }
376 static const value_string dataratenofec_vals[] = {
377 { 0x00, "use FEC" },
378 { 0x01, "do not use FEC" },
379 { 0x00, NULL }
382 static const value_string dataratepacketsizepreference_vals[] = {
383 { 0x00, "no packet size preference" },
384 { 0x01, "use 1-slot packets" },
385 { 0x02, "use 3-slot packets" },
386 { 0x03, "use 5-slot packets" },
387 { 0x00, NULL }
390 static const value_string dataratedrpreference_vals[] = {
391 { 0x00, "use DM1 packets" },
392 { 0x01, "use 2Mb/s packets" },
393 { 0x02, "use 3Mb/s packets" },
394 { 0x00, NULL }
397 static const value_string scopacket_vals[] = {
398 { 0x00, "HV1" },
399 { 0x01, "HV2" },
400 { 0x02, "HV3" },
401 { 0x00, NULL }
404 static const value_string airmode_vals[] = {
405 { 0x00, "ulaw log" },
406 { 0x01, "Alaw log" },
407 { 0x02, "CVSD" },
408 { 0x03, "transparent data" },
409 { 0x00, NULL }
412 static const value_string pagingscheme_vals[] = {
413 { 0x00, "mandatory scheme" },
414 { 0x00, NULL }
417 static const value_string pagingschemesettings_vals[] = {
418 { 0x00, "R0" },
419 { 0x01, "R1" },
420 { 0x02, "R2" },
421 { 0x00, NULL }
424 static const value_string encapsulatedmajor_vals[] = {
425 { 0x01, "public key" },
426 { 0x00, NULL }
429 static const value_string encapsulatedminor_vals[] = {
430 { 0x01, "P-192 public key" },
431 { 0x02, "P-256 public key" },
432 { 0x00, NULL }
435 static const value_string clkadjmode_vals[] = {
436 { 0x00, "before instant" },
437 { 0x01, "after instant" },
438 { 0x00, NULL }
441 static const value_string packettypetable_vals[] = {
442 { 0x00, "1Mb/s only" },
443 { 0x01, "2/3Mb/s" },
444 { 0x00, NULL }
447 static const value_string escopackettypems_vals[] = {
448 { 0x00, "POLL" },
449 { 0x07, "EV3" },
450 { 0x0c, "EV4" },
451 { 0x0d, "EV5" },
452 { 0x26, "2-EV3" },
453 { 0x2c, "2-EV5" },
454 { 0x37, "3-EV3" },
455 { 0x3d, "3-EV5" },
456 { 0x00, NULL }
459 static const value_string escopackettypesm_vals[] = {
460 { 0x00, "NULL" },
461 { 0x07, "EV3" },
462 { 0x0c, "EV4" },
463 { 0x0d, "EV5" },
464 { 0x26, "2-EV3" },
465 { 0x2c, "2-EV5" },
466 { 0x37, "3-EV3" },
467 { 0x3d, "3-EV5" },
468 { 0x00, NULL }
471 static const value_string negostate_vals[] = {
472 { 0, "initiate negotiation" },
473 { 1, "the latest received set of negotiable parameters were possible but these parameters are preferred" },
474 { 2, "the latest received set of negotiable parameters would cause a reserved slot violation" },
475 { 3, "the latest received set of negotiable parameters would cause a latency violation" },
476 { 4, "the latest received set of negotiable parameters are not supported" },
477 { 0, NULL }
480 static const value_string iocapcap_vals[] = {
481 { 0x00, "Display Only" },
482 { 0x01, "Display Yes/No" },
483 { 0x02, "Keyboard Only" },
484 { 0x03, "No Input No Output" },
485 { 0x00, NULL }
488 static const value_string iocapoobauthdata_vals[] = {
489 { 0x00, "No OOB Authentication Data received" },
490 { 0x01, "OOB Authentication Data received" },
491 { 0x00, NULL }
494 static const value_string iocapauthreq_vals[] = {
495 { 0x00, "MITM Protection Not Required - No Bonding" },
496 { 0x01, "MITM Protection Required - No Bonding" },
497 { 0x02, "MITM Protection Not Required - Dedicated Bonding" },
498 { 0x03, "MITM Protection Required - Dedicated Bonding" },
499 { 0x04, "MITM Protection Not Required - General Bonding" },
500 { 0x05, "MITM Protection Required - General Bonding" },
501 { 0x00, NULL }
504 static const value_string keypressnotificationtype_vals[] = {
505 { 0x00, "passkey entry started" },
506 { 0x01, "passkey digit entered" },
507 { 0x02, "passkey digit erased" },
508 { 0x03, "passkey cleared" },
509 { 0x04, "passkey entry completed" },
510 { 0x00, NULL }
513 static const value_string poweradjreq_vals[] = {
514 { 0x00, "decrement power one step" },
515 { 0x01, "increment power one step" },
516 { 0x02, "increase to maximum power" },
517 { 0x00, NULL }
520 static const value_string poweradjresp_vals[] = {
521 { 0x00, "not supported" },
522 { 0x01, "changed one step" },
523 { 0x02, "max power" },
524 { 0x03, "min power" },
525 { 0x00, NULL }
528 static const value_string samupdatemode_vals[] = {
529 { 0, "Existing SAM slot maps containing any type 0 submaps are invalidated" },
530 { 1, "The defined type 0 submap takes effect immediately" },
531 { 2, "The defined type 0 submap takes effect at the start of the next sub-interval" },
532 { 0, NULL }
535 static const unit_name_string units_slots = { " slot", " slots" };
537 static const unit_name_string units_slotpairs = { " slot pair", " slot pairs" };
542 static void decode_uint8_binary(char *s, uint8_t value)
544 for (unsigned i = 0; i < 8 && i + 1 < ITEM_LABEL_LENGTH; ++i, value <<= 1)
545 *s++ = '0' + ((value >> 7) & 1);
546 *s = 0;
549 void proto_register_btlmp(void);
550 void proto_reg_handoff_btlmp(void);
552 static int
553 dissect_btlmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
555 proto_item *btlmp_item;
556 proto_tree *btlmp_tree;
557 int offset = 0;
558 uint16_t opcode;
559 connection_info_t *connection_info = (connection_info_t *)data;
561 btlmp_item = proto_tree_add_item(tree, proto_btlmp, tvb, offset, -1, ENC_NA);
562 btlmp_tree = proto_item_add_subtree(btlmp_item, ett_btlmp);
564 col_set_str(pinfo->cinfo, COL_PROTOCOL, "BT LMP");
566 for (unsigned i = 0; i < array_length(hf_opcode); ++i)
567 proto_tree_add_item(btlmp_tree, hf_opcode[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
568 opcode = tvb_get_uint8(tvb, offset) >> 1;
569 offset += 1;
570 if (opcode >= 0x7c) {
571 opcode &= 3;
572 proto_tree_add_item(btlmp_tree, hf_escopcode[opcode], tvb, offset, 1, ENC_LITTLE_ENDIAN);
573 ++opcode;
574 opcode <<= 8;
575 opcode |= tvb_get_uint8(tvb, offset);
576 offset += 1;
578 switch (opcode) {
579 case 0x001: // LMP_name_req
580 break;
582 case 0x002: // LMP_name_res
583 proto_tree_add_item(btlmp_tree, hf_param_nameoffset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
584 ++offset;
585 proto_tree_add_item(btlmp_tree, hf_param_namelength, tvb, offset, 1, ENC_LITTLE_ENDIAN);
586 ++offset;
587 if (tvb_captured_length_remaining(tvb, offset) <= 0)
588 break;
589 proto_tree_add_item(btlmp_tree, hf_param_namefragment, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
590 offset = tvb_reported_length(tvb);
591 break;
593 case 0x003: // LMP_accepted
594 proto_tree_add_item(btlmp_tree, hf_accept_opcode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
595 ++offset;
596 break;
598 case 0x004: // LMP_not_accepted
599 proto_tree_add_item(btlmp_tree, hf_accept_opcode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
600 ++offset;
601 proto_tree_add_item(btlmp_tree, hf_errorcode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
602 ++offset;
603 break;
605 case 0x005: // LMP_clkoffset_req
606 break;
608 case 0x006: // LMP_clkoffset_res
609 proto_tree_add_item(btlmp_tree, hf_param_clockoffset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
610 offset += 2;
611 break;
613 case 0x007: // LMP_detach
614 proto_tree_add_item(btlmp_tree, hf_errorcode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
615 ++offset;
616 break;
618 case 0x008: // LMP_in_rand
619 case 0x009: // LMP_comb_key
620 case 0x00b: // LMP_au_rand
621 case 0x00d: // LMP_temp_rand
622 case 0x011: // LMP_start_encryption_req
623 case 0x042: // LMP_pause_encryption_aes_req
624 proto_tree_add_item(btlmp_tree, hf_param_rand, tvb, offset, 16, ENC_NA);
625 offset += 16;
626 break;
628 case 0x00a: // LMP_unit_key
629 case 0x00e: // LMP_temp_key
630 proto_tree_add_item(btlmp_tree, hf_param_key, tvb, offset, 16, ENC_NA);
631 offset += 16;
632 break;
634 case 0x00c: // LMP_sres
635 proto_tree_add_item(btlmp_tree, hf_param_authresp, tvb, offset, 4, ENC_LITTLE_ENDIAN);
636 offset += 4;
637 break;
639 case 0x00f: // LMP_encryption_mode_req
640 proto_tree_add_item(btlmp_tree, hf_param_encryptionmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
641 ++offset;
642 break;
644 case 0x010: // LMP_encryption_key_size_req
645 proto_tree_add_item(btlmp_tree, hf_param_encryptionkeysize, tvb, offset, 1, ENC_LITTLE_ENDIAN);
646 ++offset;
647 break;
649 case 0x012: // LMP_stop_encryption_req
650 break;
652 case 0x013: // LMP_switch_req
653 proto_tree_add_item(btlmp_tree, hf_param_switchinstant, tvb, offset, 4, ENC_LITTLE_ENDIAN);
654 offset += 4;
655 break;
657 case 0x014: // LMP_hold
658 case 0x015: // LMP_hold_req
659 proto_tree_add_item(btlmp_tree, hf_param_holdtime, tvb, offset, 2, ENC_LITTLE_ENDIAN);
660 offset += 2;
661 proto_tree_add_item(btlmp_tree, hf_param_holdinstant, tvb, offset, 4, ENC_LITTLE_ENDIAN);
662 offset += 4;
663 break;
665 case 0x017: // LMP_sniff_req
666 for (unsigned i = 0; i < array_length(hf_param_timingcontrolflags); ++i)
667 proto_tree_add_item(btlmp_tree, hf_param_timingcontrolflags[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
668 ++offset;
669 proto_tree_add_item(btlmp_tree, hf_param_dsniff, tvb, offset, 2, ENC_LITTLE_ENDIAN);
670 offset += 2;
671 proto_tree_add_item(btlmp_tree, hf_param_tsniff, tvb, offset, 2, ENC_LITTLE_ENDIAN);
672 offset += 2;
673 proto_tree_add_item(btlmp_tree, hf_param_sniffattempt, tvb, offset, 2, ENC_LITTLE_ENDIAN);
674 offset += 2;
675 proto_tree_add_item(btlmp_tree, hf_param_snifftimeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
676 offset += 2;
677 break;
679 case 0x018: // LMP_unsniff_req
680 break;
682 case 0x01f: // LMP_incr_power_req
683 case 0x020: // LMP_decr_power_req
684 proto_tree_add_item(btlmp_tree, hf_param_futureuse1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
685 ++offset;
686 break;
688 case 0x021: // LMP_max_power
689 case 0x022: // LMP_min_power
690 case 0x023: // LMP_auto_rate
691 break;
693 case 0x024: // LMP_preferred_rate
694 for (unsigned i = 0; i < array_length(hf_param_datarate); ++i)
695 proto_tree_add_item(btlmp_tree, hf_param_datarate[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
696 break;
698 case 0x025: // LMP_version_req
699 case 0x026: // LMP_version_res
700 proto_tree_add_item(btlmp_tree, hf_param_versnr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
701 ++offset;
702 proto_tree_add_item(btlmp_tree, hf_param_compid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
703 offset += 2;
704 proto_tree_add_item(btlmp_tree, hf_param_subversnr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
705 offset += 2;
706 break;
708 case 0x027: // LMP_features_req
709 case 0x028: // LMP_features_res
710 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte0); ++i)
711 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte0[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
712 ++offset;
713 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte1); ++i)
714 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte1[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
715 ++offset;
716 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte2); ++i)
717 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte2[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
718 ++offset;
719 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte3); ++i)
720 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte3[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
721 ++offset;
722 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte4); ++i)
723 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte4[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
724 ++offset;
725 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte5); ++i)
726 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte5[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
727 ++offset;
728 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte6); ++i)
729 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte6[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
730 ++offset;
731 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte7); ++i)
732 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte7[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
733 ++offset;
734 break;
736 case 0x029: // LMP_quality_of_service
737 case 0x02a: // LMP_quality_of_service_req
738 proto_tree_add_item(btlmp_tree, hf_param_pollinterval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
739 offset += 2;
740 proto_tree_add_item(btlmp_tree, hf_param_nbc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
741 ++offset;
742 break;
744 case 0x02b: // LMP_SCO_link_req
745 proto_tree_add_item(btlmp_tree, hf_param_scohandle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
746 ++offset;
747 for (unsigned i = 0; i < array_length(hf_param_timingcontrolflags); ++i)
748 proto_tree_add_item(btlmp_tree, hf_param_timingcontrolflags[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
749 ++offset;
750 proto_tree_add_item(btlmp_tree, hf_param_dsco, tvb, offset, 1, ENC_LITTLE_ENDIAN);
751 ++offset;
752 proto_tree_add_item(btlmp_tree, hf_param_tsco, tvb, offset, 1, ENC_LITTLE_ENDIAN);
753 ++offset;
754 proto_tree_add_item(btlmp_tree, hf_param_scopacket, tvb, offset, 1, ENC_LITTLE_ENDIAN);
755 ++offset;
756 proto_tree_add_item(btlmp_tree, hf_param_airmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
757 ++offset;
758 break;
760 case 0x02c: // LMP_remove_SCO_link_req
761 proto_tree_add_item(btlmp_tree, hf_param_scohandle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
762 ++offset;
763 proto_tree_add_item(btlmp_tree, hf_errorcode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
764 ++offset;
765 break;
767 case 0x02d: // LMP_max_slot
768 case 0x02e: // LMP_max_slot_req
769 proto_tree_add_item(btlmp_tree, hf_param_slots, tvb, offset, 1, ENC_LITTLE_ENDIAN);
770 ++offset;
771 break;
773 case 0x02f: // LMP_timing_accuracy_req
774 break;
776 case 0x030: // LMP_timing_accuracy_res
777 proto_tree_add_item(btlmp_tree, hf_param_tmgacc_drift, tvb, offset, 1, ENC_LITTLE_ENDIAN);
778 ++offset;
779 proto_tree_add_item(btlmp_tree, hf_param_tmgacc_jitter, tvb, offset, 1, ENC_LITTLE_ENDIAN);
780 ++offset;
781 break;
783 case 0x031: // LMP_setup_complete
784 case 0x032: // LMP_use_semi_permanent_key
785 case 0x033: // LMP_host_connection_req
786 break;
788 case 0x034: // LMP_slot_offset
789 proto_tree_add_item(btlmp_tree, hf_param_slotoffset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
790 offset += 2;
791 proto_tree_add_item(btlmp_tree, hf_param_bdaddr, tvb, offset, 6, ENC_NA);
792 offset += 6;
793 break;
795 case 0x035: // LMP_page_mode_req
796 case 0x036: // LMP_page_scan_mode_req
797 proto_tree_add_item(btlmp_tree, hf_param_pagingscheme, tvb, offset, 1, ENC_LITTLE_ENDIAN);
798 ++offset;
799 proto_tree_add_item(btlmp_tree, hf_param_pagingschemesettings, tvb, offset, 1, ENC_LITTLE_ENDIAN);
800 ++offset;
801 break;
803 case 0x037: // LMP_supervision_timeout
804 proto_tree_add_item(btlmp_tree, hf_param_supervisiontimeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
805 offset += 2;
806 break;
808 case 0x038: // LMP_test_activate
809 break;
811 case 0x039: // LMP_test_control
812 proto_tree_add_item(btlmp_tree, hf_param_testscenario, tvb, offset, 1, ENC_LITTLE_ENDIAN);
813 ++offset;
814 proto_tree_add_item(btlmp_tree, hf_param_testhoppingmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
815 ++offset;
816 proto_tree_add_item(btlmp_tree, hf_param_testtxfrequency, tvb, offset, 1, ENC_LITTLE_ENDIAN);
817 ++offset;
818 proto_tree_add_item(btlmp_tree, hf_param_testrxfrequency, tvb, offset, 1, ENC_LITTLE_ENDIAN);
819 ++offset;
820 proto_tree_add_item(btlmp_tree, hf_param_testpowercontrolmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
821 ++offset;
822 proto_tree_add_item(btlmp_tree, hf_param_testpollperiod, tvb, offset, 1, ENC_LITTLE_ENDIAN);
823 ++offset;
824 proto_tree_add_item(btlmp_tree, hf_param_testpackettype, tvb, offset, 1, ENC_LITTLE_ENDIAN);
825 ++offset;
826 proto_tree_add_item(btlmp_tree, hf_param_testdatalength, tvb, offset, 1, ENC_LITTLE_ENDIAN);
827 ++offset;
828 break;
830 case 0x03a: // LMP_encryption_key_size_mask_req
831 break;
833 case 0x03b: // LMP_encryption_key_size_mask_res
834 proto_tree_add_item(btlmp_tree, hf_param_keysizemask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
835 offset += 2;
836 break;
838 case 0x03c: // LMP_set_AFH
839 proto_tree_add_item(btlmp_tree, hf_param_afh_instant, tvb, offset, 4, ENC_LITTLE_ENDIAN);
840 offset += 4;
841 proto_tree_add_item(btlmp_tree, hf_param_afh_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
842 ++offset;
843 for (unsigned i = 0; i < array_length(hf_param_afh_channelmap); ++i, ++offset)
844 proto_tree_add_item(btlmp_tree, hf_param_afh_channelmap[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
845 break;
847 case 0x03d: // LMP_encapsulated_header
848 proto_tree_add_item(btlmp_tree, hf_param_encapsulatedmajor, tvb, offset, 1, ENC_LITTLE_ENDIAN);
849 ++offset;
850 proto_tree_add_item(btlmp_tree, hf_param_encapsulatedminor, tvb, offset, 1, ENC_LITTLE_ENDIAN);
851 ++offset;
852 proto_tree_add_item(btlmp_tree, hf_param_encapsulatedlength, tvb, offset, 1, ENC_LITTLE_ENDIAN);
853 ++offset;
854 break;
856 case 0x03e: // LMP_encapsulated_payload
857 proto_tree_add_item(btlmp_tree, hf_param_encapsulateddata, tvb, offset, 16, ENC_NA);
858 offset += 16;
859 break;
861 case 0x03f: // LMP_Simple_Pairing_Confirm
862 proto_tree_add_item(btlmp_tree, hf_param_simplepaircommit, tvb, offset, 16, ENC_NA);
863 offset += 16;
864 break;
866 case 0x040: // LMP_Simple_Pairing_Number
867 proto_tree_add_item(btlmp_tree, hf_param_simplepairnonce, tvb, offset, 16, ENC_NA);
868 offset += 16;
869 break;
871 case 0x041: // LMP_DHkey_Check
872 proto_tree_add_item(btlmp_tree, hf_param_dhkeyconfirm, tvb, offset, 16, ENC_NA);
873 offset += 16;
874 break;
876 case 0x401: // LMP_accepted_ext
877 proto_tree_add_item(btlmp_tree, hf_accept_opcode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
878 ++offset;
879 proto_tree_add_item(btlmp_tree, hf_accept_escopcode[tvb_get_uint8(tvb, offset - 1) & 3], tvb, offset, 1, ENC_LITTLE_ENDIAN);
880 ++offset;
881 break;
883 case 0x402: // LMP_not_accepted_ext
884 proto_tree_add_item(btlmp_tree, hf_accept_opcode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
885 ++offset;
886 proto_tree_add_item(btlmp_tree, hf_accept_escopcode[tvb_get_uint8(tvb, offset - 1) & 3], tvb, offset, 1, ENC_LITTLE_ENDIAN);
887 ++offset;
888 proto_tree_add_item(btlmp_tree, hf_errorcode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
889 ++offset;
890 break;
892 case 0x403: // LMP_features_req_ext
893 case 0x404: // LMP_features_res_ext
894 proto_tree_add_item(btlmp_tree, hf_param_features_page, tvb, offset, 1, ENC_LITTLE_ENDIAN);
895 ++offset;
896 proto_tree_add_item(btlmp_tree, hf_param_max_supported_page, tvb, offset, 1, ENC_LITTLE_ENDIAN);
897 ++offset;
898 switch (tvb_get_uint8(tvb, offset - 2)) {
899 case 0:
900 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte0); ++i)
901 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte0[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
902 ++offset;
903 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte1); ++i)
904 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte1[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
905 ++offset;
906 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte2); ++i)
907 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte2[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
908 ++offset;
909 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte3); ++i)
910 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte3[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
911 ++offset;
912 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte4); ++i)
913 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte4[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
914 ++offset;
915 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte5); ++i)
916 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte5[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
917 ++offset;
918 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte6); ++i)
919 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte6[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
920 ++offset;
921 for (unsigned i = 0; i < array_length(hf_param_feature_page0_byte7); ++i)
922 proto_tree_add_item(btlmp_tree, hf_param_feature_page0_byte7[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
923 ++offset;
924 break;
926 case 1:
927 for (unsigned i = 0; i < array_length(hf_param_feature_page1_byte0); ++i)
928 proto_tree_add_item(btlmp_tree, hf_param_feature_page1_byte0[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
929 ++offset;
930 break;
932 case 2:
933 for (unsigned i = 0; i < array_length(hf_param_feature_page2_byte0); ++i)
934 proto_tree_add_item(btlmp_tree, hf_param_feature_page2_byte0[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
935 ++offset;
936 for (unsigned i = 0; i < array_length(hf_param_feature_page2_byte1); ++i)
937 proto_tree_add_item(btlmp_tree, hf_param_feature_page2_byte1[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
938 ++offset;
939 break;
941 default:
942 break;
944 break;
946 case 0x405: // LMP_clk_adj
947 proto_tree_add_item(btlmp_tree, hf_param_clkadjid, tvb, offset, 1, ENC_LITTLE_ENDIAN);
948 ++offset;
949 proto_tree_add_item(btlmp_tree, hf_param_clkadjinstant, tvb, offset, 4, ENC_LITTLE_ENDIAN);
950 offset += 4;
951 proto_tree_add_item(btlmp_tree, hf_param_clkadjus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
952 offset += 2;
953 proto_tree_add_item(btlmp_tree, hf_param_clkadjslots, tvb, offset, 1, ENC_LITTLE_ENDIAN);
954 ++offset;
955 proto_tree_add_item(btlmp_tree, hf_param_clkadjmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
956 ++offset;
957 proto_tree_add_item(btlmp_tree, hf_param_clkadjclk, tvb, offset, 4, ENC_LITTLE_ENDIAN);
958 offset += 4;
959 break;
961 case 0x406: // LMP_clk_adj_ack
962 proto_tree_add_item(btlmp_tree, hf_param_clkadjid, tvb, offset, 1, ENC_LITTLE_ENDIAN);
963 ++offset;
964 break;
966 case 0x407: // LMP_clk_adj_req
967 proto_tree_add_item(btlmp_tree, hf_param_clkadjus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
968 offset += 2;
969 proto_tree_add_item(btlmp_tree, hf_param_clkadjslots, tvb, offset, 1, ENC_LITTLE_ENDIAN);
970 ++offset;
971 proto_tree_add_item(btlmp_tree, hf_param_clkadjperiod, tvb, offset, 1, ENC_LITTLE_ENDIAN);
972 ++offset;
973 break;
975 case 0x40b: // LMP_packet_type_table_req
976 proto_tree_add_item(btlmp_tree, hf_param_packettypetable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
977 ++offset;
978 break;
980 case 0x40c: // LMP_eSCO_link_req
981 btbredr_rf_add_esco_link(connection_info, pinfo, tvb_get_uint8(tvb, offset), tvb_get_uint8(tvb, offset + 1),
982 tvb_get_uint16(tvb, offset + 8, ENC_LITTLE_ENDIAN), tvb_get_uint16(tvb, offset + 10, ENC_LITTLE_ENDIAN));
983 proto_tree_add_item(btlmp_tree, hf_param_escohandle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
984 ++offset;
985 proto_tree_add_item(btlmp_tree, hf_param_escoltaddr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
986 ++offset;
987 for (unsigned i = 0; i < array_length(hf_param_timingcontrolflags); ++i)
988 proto_tree_add_item(btlmp_tree, hf_param_timingcontrolflags[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
989 ++offset;
990 proto_tree_add_item(btlmp_tree, hf_param_escod, tvb, offset, 1, ENC_LITTLE_ENDIAN);
991 ++offset;
992 proto_tree_add_item(btlmp_tree, hf_param_escot, tvb, offset, 1, ENC_LITTLE_ENDIAN);
993 ++offset;
994 proto_tree_add_item(btlmp_tree, hf_param_escow, tvb, offset, 1, ENC_LITTLE_ENDIAN);
995 ++offset;
996 proto_tree_add_item(btlmp_tree, hf_param_escopackettypems, tvb, offset, 1, ENC_LITTLE_ENDIAN);
997 ++offset;
998 proto_tree_add_item(btlmp_tree, hf_param_escopackettypesm, tvb, offset, 1, ENC_LITTLE_ENDIAN);
999 ++offset;
1000 proto_tree_add_item(btlmp_tree, hf_param_escopacketlengthms, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1001 offset += 2;
1002 proto_tree_add_item(btlmp_tree, hf_param_escopacketlengthsm, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1003 offset += 2;
1004 proto_tree_add_item(btlmp_tree, hf_param_airmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1005 ++offset;
1006 proto_tree_add_item(btlmp_tree, hf_param_negostate, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1007 ++offset;
1008 break;
1010 case 0x40d: // LMP_remove_eSCO_link_req
1011 btbredr_rf_remove_esco_link(connection_info, pinfo, tvb_get_uint8(tvb, offset));
1012 proto_tree_add_item(btlmp_tree, hf_param_escohandle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1013 ++offset;
1014 proto_tree_add_item(btlmp_tree, hf_errorcode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1015 ++offset;
1016 break;
1018 case 0x410: // LMP_channel_classification_req
1019 proto_tree_add_item(btlmp_tree, hf_param_afh_reportingmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1020 ++offset;
1021 proto_tree_add_item(btlmp_tree, hf_param_afh_mininterval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1022 offset += 2;
1023 proto_tree_add_item(btlmp_tree, hf_param_afh_maxinterval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1024 offset += 2;
1025 break;
1027 case 0x411: // LMP_channel_classification
1028 for (unsigned i = 0; i < array_length(hf_param_afh_channelclass); ++i)
1029 for (unsigned j = 0; j < array_length(hf_param_afh_channelclass[0]); ++j)
1030 proto_tree_add_item(btlmp_tree, hf_param_afh_channelclass[i][j], tvb, offset + i, 1, ENC_LITTLE_ENDIAN);
1031 offset += array_length(hf_param_afh_channelclass);
1032 break;
1034 case 0x415: // LMP_sniff_subrating_req
1035 case 0x416: // LMP_sniff_subrating_res
1036 proto_tree_add_item(btlmp_tree, hf_param_maxsniffsubrate, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1037 ++offset;
1038 proto_tree_add_item(btlmp_tree, hf_param_minsniffmodetimeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1039 offset += 2;
1040 proto_tree_add_item(btlmp_tree, hf_param_sniffsubratinginstant, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1041 offset += 4;
1042 break;
1044 case 0x417: // LMP_pause_encryption_req
1045 case 0x418: // LMP_resume_encryption_req
1046 break;
1048 case 0x419: // LMP_IO_Capability_req
1049 case 0x41a: // LMP_IO_Capability_res
1050 proto_tree_add_item(btlmp_tree, hf_param_iocapcap, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1051 ++offset;
1052 proto_tree_add_item(btlmp_tree, hf_param_iocapoobauthdata, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1053 ++offset;
1054 proto_tree_add_item(btlmp_tree, hf_param_iocapauthreq, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1055 ++offset;
1056 break;
1058 case 0x41b: // LMP_numeric_comparison_failed
1059 case 0x41c: // LMP_passkey_failed
1060 case 0x41d: // LMP_oob_failed
1061 break;
1063 case 0x41e: // LMP_keypress_notification
1064 proto_tree_add_item(btlmp_tree, hf_param_keypressnotificationtype, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1065 ++offset;
1066 break;
1068 case 0x41f: // LMP_power_control_req
1069 proto_tree_add_item(btlmp_tree, hf_param_poweradjreq, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1070 ++offset;
1071 break;
1073 case 0x420: // LMP_power_control_res
1074 for (unsigned i = 0; i < array_length(hf_param_poweradjresp); ++i)
1075 proto_tree_add_item(btlmp_tree, hf_param_poweradjresp[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
1076 ++offset;
1077 break;
1079 case 0x421: // LMP_ping_req
1080 case 0x422: // LMP_ping_res
1081 break;
1083 case 0x423: // LMP_SAM_set_type0
1084 proto_tree_add_item(btlmp_tree, hf_param_samupdatemode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1085 ++offset;
1086 proto_tree_add_item(btlmp_tree, hf_param_samtype0submap, tvb, offset, 14, ENC_NA);
1087 offset += 14;
1088 break;
1090 case 0x424: // LMP_SAM_define_map
1091 proto_tree_add_item(btlmp_tree, hf_param_samindex, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1092 ++offset;
1093 proto_tree_add_item(btlmp_tree, hf_param_samtsm, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1094 ++offset;
1095 proto_tree_add_item(btlmp_tree, hf_param_samnsm, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1096 ++offset;
1097 proto_tree_add_item(btlmp_tree, hf_param_samsubmaps, tvb, offset, 12, ENC_NA);
1098 offset += 12;
1099 break;
1101 case 0x425: // LMP_SAM_switch
1102 proto_tree_add_item(btlmp_tree, hf_param_samindex, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1103 ++offset;
1104 for (unsigned i = 0; i < array_length(hf_param_timingcontrolflags); ++i)
1105 proto_tree_add_item(btlmp_tree, hf_param_timingcontrolflags[i], tvb, offset, 1, ENC_LITTLE_ENDIAN);
1106 ++offset;
1107 proto_tree_add_item(btlmp_tree, hf_param_samd, tvb, offset, 1, ENC_LITTLE_ENDIAN);
1108 ++offset;
1109 proto_tree_add_item(btlmp_tree, hf_param_saminstant, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1110 offset += 4;
1111 break;
1113 default:
1114 break;
1116 if (tvb_captured_length_remaining(tvb, offset) > 0) {
1117 proto_tree_add_item(btlmp_tree, hf_params, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
1118 offset = tvb_reported_length(tvb);
1120 return offset;
1123 void
1124 proto_register_btlmp(void)
1126 static hf_register_info hf[] = {
1127 { &hf_opcode[0],
1128 { "Opcode", "btlmp.opcode.byte0",
1129 FT_UINT8, BASE_HEX, NULL, 0x00,
1130 NULL, HFILL }
1132 { &hf_opcode[1],
1133 { "TID", "btlmp.opcode.tid",
1134 FT_UINT8, BASE_HEX, NULL, 0x01,
1135 NULL, HFILL }
1137 { &hf_opcode[2],
1138 { "Opcode", "btlmp.opcode.opcode",
1139 FT_UINT8, BASE_DEC_HEX, VALS(opcode_vals), 0xfe,
1140 NULL, HFILL }
1142 { &hf_escopcode[0],
1143 { "Escape 1 Opcode", "btlmp.opcode.escaped",
1144 FT_UINT16, BASE_DEC_HEX, VALS(escape1_opcode_vals), 0x00,
1145 NULL, HFILL }
1147 { &hf_escopcode[1],
1148 { "Escape 2 Opcode", "btlmp.opcode.escaped",
1149 FT_UINT16, BASE_DEC_HEX, VALS(escape2_opcode_vals), 0x00,
1150 NULL, HFILL }
1152 { &hf_escopcode[2],
1153 { "Escape 3 Opcode", "btlmp.opcode.escaped",
1154 FT_UINT16, BASE_DEC_HEX, VALS(escape3_opcode_vals), 0x00,
1155 NULL, HFILL }
1157 { &hf_escopcode[3],
1158 { "Escape 4 Opcode", "btlmp.opcode.escaped",
1159 FT_UINT16, BASE_DEC_HEX, VALS(escape4_opcode_vals), 0x00,
1160 NULL, HFILL }
1162 { &hf_accept_opcode,
1163 { "Opcode", "btlmp.accept_opcode",
1164 FT_UINT8, BASE_DEC_HEX, VALS(opcode_vals), 0x00,
1165 NULL, HFILL }
1167 { &hf_accept_escopcode[0],
1168 { "Escape 1 Opcode", "btlmp.accept_opcode1",
1169 FT_UINT16, BASE_DEC_HEX, VALS(escape1_opcode_vals), 0x00,
1170 NULL, HFILL }
1172 { &hf_accept_escopcode[1],
1173 { "Escape 2 Opcode", "btlmp.accept_opcode2",
1174 FT_UINT16, BASE_DEC_HEX, VALS(escape2_opcode_vals), 0x00,
1175 NULL, HFILL }
1177 { &hf_accept_escopcode[2],
1178 { "Escape 3 Opcode", "btlmp.accept_opcode3",
1179 FT_UINT16, BASE_DEC_HEX, VALS(escape3_opcode_vals), 0x00,
1180 NULL, HFILL }
1182 { &hf_accept_escopcode[3],
1183 { "Escape 4 Opcode", "btlmp.accept_opcode4",
1184 FT_UINT16, BASE_DEC_HEX, VALS(escape4_opcode_vals), 0x00,
1185 NULL, HFILL }
1187 { &hf_errorcode,
1188 { "Error Code", "btlmp.errorcode",
1189 FT_UINT8, BASE_DEC_HEX, VALS(errorcode_vals), 0x00,
1190 NULL, HFILL }
1192 { &hf_param_feature_page0_byte0[0],
1193 { "Feature Page 0 Byte 0", "btlmp.feature.page0.byte0",
1194 FT_UINT8, BASE_HEX, NULL, 0x00,
1195 NULL, HFILL }
1197 { &hf_param_feature_page0_byte0[1],
1198 { "3 slot packets", "btlmp.feature.page0.3slotpackets",
1199 FT_UINT8, BASE_DEC, NULL, 0x01,
1200 NULL, HFILL }
1202 { &hf_param_feature_page0_byte0[2],
1203 { "5 slot packets", "btlmp.feature.page0.5slotpackets",
1204 FT_UINT8, BASE_DEC, NULL, 0x02,
1205 NULL, HFILL }
1207 { &hf_param_feature_page0_byte0[3],
1208 { "Encryption", "btlmp.feature.page0.encryption",
1209 FT_UINT8, BASE_DEC, NULL, 0x04,
1210 NULL, HFILL }
1212 { &hf_param_feature_page0_byte0[4],
1213 { "Slot offset", "btlmp.feature.page0.slotoffset",
1214 FT_UINT8, BASE_DEC, NULL, 0x08,
1215 NULL, HFILL }
1217 { &hf_param_feature_page0_byte0[5],
1218 { "Timing accuracy", "btlmp.feature.page0.timingaccuracy",
1219 FT_UINT8, BASE_DEC, NULL, 0x10,
1220 NULL, HFILL }
1222 { &hf_param_feature_page0_byte0[6],
1223 { "Role switch", "btlmp.feature.page0.roleswitch",
1224 FT_UINT8, BASE_DEC, NULL, 0x20,
1225 NULL, HFILL }
1227 { &hf_param_feature_page0_byte0[7],
1228 { "Hold mode", "btlmp.feature.page0.holdmode",
1229 FT_UINT8, BASE_DEC, NULL, 0x40,
1230 NULL, HFILL }
1232 { &hf_param_feature_page0_byte0[8],
1233 { "Sniff mode", "btlmp.feature.page0.sniffmode",
1234 FT_UINT8, BASE_DEC, NULL, 0x80,
1235 NULL, HFILL }
1237 { &hf_param_feature_page0_byte1[0],
1238 { "Feature Page 0 Byte 1", "btlmp.feature.page0.byte1",
1239 FT_UINT8, BASE_HEX, NULL, 0x00,
1240 NULL, HFILL }
1242 { &hf_param_feature_page0_byte1[1],
1243 { "Reserved", "btlmp.feature.page0.reserved1",
1244 FT_UINT8, BASE_DEC, NULL, 0x01,
1245 NULL, HFILL }
1247 { &hf_param_feature_page0_byte1[2],
1248 { "Power control requests", "btlmp.feature.page0.powercontrolrequests",
1249 FT_UINT8, BASE_DEC, NULL, 0x02,
1250 NULL, HFILL }
1252 { &hf_param_feature_page0_byte1[3],
1253 { "Channel quality driven data rate (CQDDR)", "btlmp.feature.page0.cqddr",
1254 FT_UINT8, BASE_DEC, NULL, 0x04,
1255 NULL, HFILL }
1257 { &hf_param_feature_page0_byte1[4],
1258 { "SCO link", "btlmp.feature.page0.scolink",
1259 FT_UINT8, BASE_DEC, NULL, 0x08,
1260 NULL, HFILL }
1262 { &hf_param_feature_page0_byte1[5],
1263 { "HV2 packets", "btlmp.feature.page0.hv2packets",
1264 FT_UINT8, BASE_DEC, NULL, 0x10,
1265 NULL, HFILL }
1267 { &hf_param_feature_page0_byte1[6],
1268 { "HV3 packets", "btlmp.feature.page0.hv3packets",
1269 FT_UINT8, BASE_DEC, NULL, 0x20,
1270 NULL, HFILL }
1272 { &hf_param_feature_page0_byte1[7],
1273 { "u-law log synchronous data", "btlmp.feature.page0.ulaw",
1274 FT_UINT8, BASE_DEC, NULL, 0x40,
1275 NULL, HFILL }
1277 { &hf_param_feature_page0_byte1[8],
1278 { "A-law log synchronous data", "btlmp.feature.page0.alaw",
1279 FT_UINT8, BASE_DEC, NULL, 0x80,
1280 NULL, HFILL }
1282 { &hf_param_feature_page0_byte2[0],
1283 { "Feature Page 0 Byte 2", "btlmp.feature.page0.byte2",
1284 FT_UINT8, BASE_HEX, NULL, 0x00,
1285 NULL, HFILL }
1287 { &hf_param_feature_page0_byte2[1],
1288 { "CVSD synchronous data", "btlmp.feature.page0.cvsd",
1289 FT_UINT8, BASE_DEC, NULL, 0x01,
1290 NULL, HFILL }
1292 { &hf_param_feature_page0_byte2[2],
1293 { "Paging parameter negotiation", "btlmp.feature.page0.pagingparameter",
1294 FT_UINT8, BASE_DEC, NULL, 0x02,
1295 NULL, HFILL }
1297 { &hf_param_feature_page0_byte2[3],
1298 { "Power control", "btlmp.feature.page0.powercontrol",
1299 FT_UINT8, BASE_DEC, NULL, 0x04,
1300 NULL, HFILL }
1302 { &hf_param_feature_page0_byte2[4],
1303 { "Transparent synchronous data", "btlmp.feature.page0.transparentsynchronous",
1304 FT_UINT8, BASE_DEC, NULL, 0x08,
1305 NULL, HFILL }
1307 { &hf_param_feature_page0_byte2[5],
1308 { "Flow control lag (least significant bit)", "btlmp.feature.page0.flowcontrollag",
1309 FT_UINT8, BASE_DEC, NULL, 0x70,
1310 NULL, HFILL }
1312 { &hf_param_feature_page0_byte2[6],
1313 { "Broadcast Encryption", "btlmp.feature.page0.broadcastencryption",
1314 FT_UINT8, BASE_DEC, NULL, 0x80,
1315 NULL, HFILL }
1317 { &hf_param_feature_page0_byte3[0],
1318 { "Feature Page 0 Byte 3", "btlmp.feature.page0.byte3",
1319 FT_UINT8, BASE_HEX, NULL, 0x00,
1320 NULL, HFILL }
1322 { &hf_param_feature_page0_byte3[1],
1323 { "Reserved", "btlmp.feature.page0.reserved2",
1324 FT_UINT8, BASE_DEC, NULL, 0x01,
1325 NULL, HFILL }
1327 { &hf_param_feature_page0_byte3[2],
1328 { "Enhanced Data Rate ACL 2 Mb/s mode", "btlmp.feature.page0.edracl2",
1329 FT_UINT8, BASE_DEC, NULL, 0x02,
1330 NULL, HFILL }
1332 { &hf_param_feature_page0_byte3[3],
1333 { "Enhanced Data Rate ACL 3 Mb/s mode", "btlmp.feature.page0.edracl3",
1334 FT_UINT8, BASE_DEC, NULL, 0x04,
1335 NULL, HFILL }
1337 { &hf_param_feature_page0_byte3[4],
1338 { "Enhanced inquiry scan", "btlmp.feature.page0.enhinqscan",
1339 FT_UINT8, BASE_DEC, NULL, 0x08,
1340 NULL, HFILL }
1342 { &hf_param_feature_page0_byte3[5],
1343 { "Interlaced inquiry scan", "btlmp.feature.page0.interlacedinqscan",
1344 FT_UINT8, BASE_DEC, NULL, 0x10,
1345 NULL, HFILL }
1347 { &hf_param_feature_page0_byte3[6],
1348 { "Interlaced page scan", "btlmp.feature.page0.interlacedpgscan",
1349 FT_UINT8, BASE_DEC, NULL, 0x20,
1350 NULL, HFILL }
1352 { &hf_param_feature_page0_byte3[7],
1353 { "RSSI with inquiry results", "btlmp.feature.page0.inqrssi",
1354 FT_UINT8, BASE_DEC, NULL, 0x40,
1355 NULL, HFILL }
1357 { &hf_param_feature_page0_byte3[8],
1358 { "Extended SCO link (EV3 packets)", "btlmp.feature.page0.escolink",
1359 FT_UINT8, BASE_DEC, NULL, 0x80,
1360 NULL, HFILL }
1362 { &hf_param_feature_page0_byte4[0],
1363 { "Feature Page 0 Byte 4", "btlmp.feature.page0.byte4",
1364 FT_UINT8, BASE_HEX, NULL, 0x00,
1365 NULL, HFILL }
1367 { &hf_param_feature_page0_byte4[1],
1368 { "EV4 packets", "btlmp.feature.page0.ev4",
1369 FT_UINT8, BASE_DEC, NULL, 0x01,
1370 NULL, HFILL }
1372 { &hf_param_feature_page0_byte4[2],
1373 { "EV5 packets", "btlmp.feature.page0.ev5",
1374 FT_UINT8, BASE_DEC, NULL, 0x02,
1375 NULL, HFILL }
1377 { &hf_param_feature_page0_byte4[3],
1378 { "Reserved", "btlmp.feature.page0.reserved3",
1379 FT_UINT8, BASE_DEC, NULL, 0x04,
1380 NULL, HFILL }
1382 { &hf_param_feature_page0_byte4[4],
1383 { "AFH capable peripheral", "btlmp.feature.page0.afhcapableperipheral",
1384 FT_UINT8, BASE_DEC, NULL, 0x08,
1385 NULL, HFILL }
1387 { &hf_param_feature_page0_byte4[5],
1388 { "AFH classification peripheral", "btlmp.feature.page0.afhclassificationperipheral",
1389 FT_UINT8, BASE_DEC, NULL, 0x10,
1390 NULL, HFILL }
1392 { &hf_param_feature_page0_byte4[6],
1393 { "BR/EDR Not Supported", "btlmp.feature.page0.bredrnotsupp",
1394 FT_UINT8, BASE_DEC, NULL, 0x20,
1395 NULL, HFILL }
1397 { &hf_param_feature_page0_byte4[7],
1398 { "LE Supported (Controller)", "btlmp.feature.page0.lesuppcontroller",
1399 FT_UINT8, BASE_DEC, NULL, 0x40,
1400 NULL, HFILL }
1402 { &hf_param_feature_page0_byte4[8],
1403 { "3-slot Enhanced Data Rate ACL packets", "btlmp.feature.page0.3slotedracl",
1404 FT_UINT8, BASE_DEC, NULL, 0x80,
1405 NULL, HFILL }
1407 { &hf_param_feature_page0_byte5[0],
1408 { "Feature Page 0 Byte 5", "btlmp.feature.page0.byte5",
1409 FT_UINT8, BASE_HEX, NULL, 0x00,
1410 NULL, HFILL }
1412 { &hf_param_feature_page0_byte5[1],
1413 { "5-slot Enhanced Data Rate ACL packets", "btlmp.feature.page0.5slotedracl",
1414 FT_UINT8, BASE_DEC, NULL, 0x01,
1415 NULL, HFILL }
1417 { &hf_param_feature_page0_byte5[2],
1418 { "Sniff subrating", "btlmp.feature.page0.sniffsubrating",
1419 FT_UINT8, BASE_DEC, NULL, 0x02,
1420 NULL, HFILL }
1422 { &hf_param_feature_page0_byte5[3],
1423 { "Pause encryption", "btlmp.feature.page0.pauseencrypt",
1424 FT_UINT8, BASE_DEC, NULL, 0x04,
1425 NULL, HFILL }
1427 { &hf_param_feature_page0_byte5[4],
1428 { "AFH capable central", "btlmp.feature.page0.afhcapablecentral",
1429 FT_UINT8, BASE_DEC, NULL, 0x08,
1430 NULL, HFILL }
1432 { &hf_param_feature_page0_byte5[5],
1433 { "AFH classification central", "btlmp.feature.page0.afhclassificationcentral",
1434 FT_UINT8, BASE_DEC, NULL, 0x10,
1435 NULL, HFILL }
1437 { &hf_param_feature_page0_byte5[6],
1438 { "Enhanced Data Rate eSCO 2 Mb/s mode", "btlmp.feature.page0.edresco2",
1439 FT_UINT8, BASE_DEC, NULL, 0x20,
1440 NULL, HFILL }
1442 { &hf_param_feature_page0_byte5[7],
1443 { "Enhanced Data Rate eSCO 3 Mb/s mode", "btlmp.feature.page0.edresco3",
1444 FT_UINT8, BASE_DEC, NULL, 0x40,
1445 NULL, HFILL }
1447 { &hf_param_feature_page0_byte5[8],
1448 { "3-slot Enhanced Data Rate eSCO packets", "btlmp.feature.page0.3slotedresco",
1449 FT_UINT8, BASE_DEC, NULL, 0x80,
1450 NULL, HFILL }
1452 { &hf_param_feature_page0_byte6[0],
1453 { "Feature Page 0 Byte 6", "btlmp.feature.page0.byte6",
1454 FT_UINT8, BASE_HEX, NULL, 0x00,
1455 NULL, HFILL }
1457 { &hf_param_feature_page0_byte6[1],
1458 { "Extended Inquiry Response", "btlmp.feature.page0.extinqresp",
1459 FT_UINT8, BASE_DEC, NULL, 0x01,
1460 NULL, HFILL }
1462 { &hf_param_feature_page0_byte6[2],
1463 { "Simultaneous LE and BR/EDR to Same Device Capable (Controller)", "btlmp.feature.page0.simullebredrcontroller",
1464 FT_UINT8, BASE_DEC, NULL, 0x02,
1465 NULL, HFILL }
1467 { &hf_param_feature_page0_byte6[3],
1468 { "Reserved", "btlmp.feature.page0.reserved4",
1469 FT_UINT8, BASE_DEC, NULL, 0x04,
1470 NULL, HFILL }
1472 { &hf_param_feature_page0_byte6[4],
1473 { "Secure Simple Pairing (Controller Support)", "btlmp.feature.page0.securesimplepaircontroller",
1474 FT_UINT8, BASE_DEC, NULL, 0x08,
1475 NULL, HFILL }
1477 { &hf_param_feature_page0_byte6[5],
1478 { "Encapsulated PDU", "btlmp.feature.page0.encpdu",
1479 FT_UINT8, BASE_DEC, NULL, 0x10,
1480 NULL, HFILL }
1482 { &hf_param_feature_page0_byte6[6],
1483 { "Erroneous Data Reporting", "btlmp.feature.page0.errdatareport",
1484 FT_UINT8, BASE_DEC, NULL, 0x20,
1485 NULL, HFILL }
1487 { &hf_param_feature_page0_byte6[7],
1488 { "Non-flushable Packet Boundary Flag", "btlmp.feature.page0.nonflushboundary",
1489 FT_UINT8, BASE_DEC, NULL, 0x40,
1490 NULL, HFILL }
1492 { &hf_param_feature_page0_byte6[8],
1493 { "Reserved", "btlmp.feature.page0.reserved5",
1494 FT_UINT8, BASE_DEC, NULL, 0x80,
1495 NULL, HFILL }
1497 { &hf_param_feature_page0_byte7[0],
1498 { "Feature Page 0 Byte 1", "btlmp.feature.page0.byte7",
1499 FT_UINT8, BASE_HEX, NULL, 0x00,
1500 NULL, HFILL }
1502 { &hf_param_feature_page0_byte7[1],
1503 { "HCI Link Supervision Timeout Changed event", "btlmp.feature.page0.hcilinksupervisiontimeoutchgevt",
1504 FT_UINT8, BASE_DEC, NULL, 0x01,
1505 NULL, HFILL }
1507 { &hf_param_feature_page0_byte7[2],
1508 { "Variable Inquiry TX Power Level", "btlmp.feature.page0.varinqtxpwr",
1509 FT_UINT8, BASE_DEC, NULL, 0x02,
1510 NULL, HFILL }
1512 { &hf_param_feature_page0_byte7[3],
1513 { "Enhanced Power Control", "btlmp.feature.page0.enhpowercontrol",
1514 FT_UINT8, BASE_DEC, NULL, 0x04,
1515 NULL, HFILL }
1517 { &hf_param_feature_page0_byte7[4],
1518 { "Reserved", "btlmp.feature.page0.reserved6",
1519 FT_UINT8, BASE_DEC, NULL, 0x78,
1520 NULL, HFILL }
1522 { &hf_param_feature_page0_byte7[5],
1523 { "Extended features", "btlmp.feature.page0.extftr",
1524 FT_UINT8, BASE_DEC, NULL, 0x80,
1525 NULL, HFILL }
1527 { &hf_param_feature_page1_byte0[0],
1528 { "Feature Page 1 Byte 0", "btlmp.feature.page1.byte0",
1529 FT_UINT8, BASE_HEX, NULL, 0x00,
1530 NULL, HFILL }
1532 { &hf_param_feature_page1_byte0[1],
1533 { "Secure Simple Pairing (Host Support)", "btlmp.feature.page1.securesimplepairhost",
1534 FT_UINT8, BASE_DEC, NULL, 0x01,
1535 NULL, HFILL }
1537 { &hf_param_feature_page1_byte0[2],
1538 { "LE Supported (Host)", "btlmp.feature.page1.lesupphost",
1539 FT_UINT8, BASE_DEC, NULL, 0x02,
1540 NULL, HFILL }
1542 { &hf_param_feature_page1_byte0[3],
1543 { "Simultaneous LE and BR/EDR to Same Device Capable (Host)", "btlmp.feature.page1.simullebredrhost",
1544 FT_UINT8, BASE_DEC, NULL, 0x04,
1545 NULL, HFILL }
1547 { &hf_param_feature_page1_byte0[4],
1548 { "Secure Connections (Host Support)", "btlmp.feature.page1.secureconnhost",
1549 FT_UINT8, BASE_DEC, NULL, 0x08,
1550 NULL, HFILL }
1552 { &hf_param_feature_page1_byte0[5],
1553 { "Reserved", "btlmp.feature.page1.reserved1",
1554 FT_UINT8, BASE_DEC, NULL, 0xf0,
1555 NULL, HFILL }
1557 { &hf_param_feature_page2_byte0[0],
1558 { "Feature Page 2 Byte 0", "btlmp.feature.page2.byte0",
1559 FT_UINT8, BASE_HEX, NULL, 0x00,
1560 NULL, HFILL }
1562 { &hf_param_feature_page2_byte0[1],
1563 { "Connectionless Peripheral Broadcast - Central", "btlmp.feature.page2.cpbcentral",
1564 FT_UINT8, BASE_DEC, NULL, 0x01,
1565 NULL, HFILL }
1567 { &hf_param_feature_page2_byte0[2],
1568 { "Connectionless Peripheral Broadcast - Peripheral", "btlmp.feature.page2.cpbperipheral",
1569 FT_UINT8, BASE_DEC, NULL, 0x02,
1570 NULL, HFILL }
1572 { &hf_param_feature_page2_byte0[3],
1573 { "Synchronization Train", "btlmp.feature.page2.synctrain",
1574 FT_UINT8, BASE_DEC, NULL, 0x04,
1575 NULL, HFILL }
1577 { &hf_param_feature_page2_byte0[4],
1578 { "Synchronization Scan", "btlmp.feature.page2.syncscan",
1579 FT_UINT8, BASE_DEC, NULL, 0x08,
1580 NULL, HFILL }
1582 { &hf_param_feature_page2_byte0[5],
1583 { "HCI_Inquiry_Response_Notification event", "btlmp.feature.page2.hciinqrespnotifevt",
1584 FT_UINT8, BASE_DEC, NULL, 0x10,
1585 NULL, HFILL }
1587 { &hf_param_feature_page2_byte0[6],
1588 { "Generalized interlaced scan", "btlmp.feature.page2.generalinterlacedscan",
1589 FT_UINT8, BASE_DEC, NULL, 0x20,
1590 NULL, HFILL }
1592 { &hf_param_feature_page2_byte0[7],
1593 { "Coarse Clock Adjustment", "btlmp.feature.page2.coarseclockadj",
1594 FT_UINT8, BASE_DEC, NULL, 0x40,
1595 NULL, HFILL }
1597 { &hf_param_feature_page2_byte0[8],
1598 { "Reserved", "btlmp.feature.page2.reserved1",
1599 FT_UINT8, BASE_DEC, NULL, 0x80,
1600 NULL, HFILL }
1602 { &hf_param_feature_page2_byte1[0],
1603 { "Feature Page 2 Byte 1", "btlmp.feature.page2.byte1",
1604 FT_UINT8, BASE_HEX, NULL, 0x00,
1605 NULL, HFILL }
1607 { &hf_param_feature_page2_byte1[1],
1608 { "Secure Connections (Controller Support)", "btlmp.feature.page2.secureconncontroller",
1609 FT_UINT8, BASE_DEC, NULL, 0x01,
1610 NULL, HFILL }
1612 { &hf_param_feature_page2_byte1[2],
1613 { "Ping", "btlmp.feature.page2.ping",
1614 FT_UINT8, BASE_DEC, NULL, 0x02,
1615 NULL, HFILL }
1617 { &hf_param_feature_page2_byte1[3],
1618 { "Slot Availability Mask", "btlmp.feature.page2.slotavailabilitymask",
1619 FT_UINT8, BASE_DEC, NULL, 0x04,
1620 NULL, HFILL }
1622 { &hf_param_feature_page2_byte1[4],
1623 { "Train nudging", "btlmp.feature.page2.trainnudging",
1624 FT_UINT8, BASE_DEC, NULL, 0x08,
1625 NULL, HFILL }
1627 { &hf_param_feature_page2_byte1[5],
1628 { "Reserved", "btlmp.feature.page2.reserved2",
1629 FT_UINT8, BASE_DEC, NULL, 0xf0,
1630 NULL, HFILL }
1632 { &hf_param_features_page,
1633 { "Feature Page", "btlmp.feature.features_page",
1634 FT_UINT8, BASE_HEX, NULL, 0x00,
1635 NULL, HFILL }
1637 { &hf_param_max_supported_page,
1638 { "Max Supported Page", "btlmp.feature.max_supported_page",
1639 FT_UINT8, BASE_HEX, NULL, 0x00,
1640 NULL, HFILL }
1642 { &hf_param_versnr,
1643 { "VersNr", "btlmp.version.versnr",
1644 FT_UINT8, BASE_HEX, NULL, 0x00,
1645 NULL, HFILL }
1647 { &hf_param_compid,
1648 { "CompId", "btlmp.version.CompId",
1649 FT_UINT16, BASE_HEX, NULL, 0x00,
1650 NULL, HFILL }
1652 { &hf_param_subversnr,
1653 { "SubVersNr", "btlmp.version.SubVersNr",
1654 FT_UINT16, BASE_HEX, NULL, 0x00,
1655 NULL, HFILL }
1657 { &hf_param_namelength,
1658 { "Name Length", "btlmp.name.length",
1659 FT_UINT8, BASE_HEX, NULL, 0x00,
1660 NULL, HFILL }
1662 { &hf_param_nameoffset,
1663 { "Name Offset", "btlmp.name.offset",
1664 FT_UINT8, BASE_HEX, NULL, 0x00,
1665 NULL, HFILL }
1667 { &hf_param_namefragment,
1668 { "Name Fragment", "btlmp.name.fragment",
1669 FT_STRINGZPAD, BASE_NONE, NULL, 0x00,
1670 NULL, HFILL }
1672 { &hf_param_afh_mode,
1673 { "AFH Mode", "btlmp.afh.mode",
1674 FT_UINT8, BASE_HEX, VALS(afh_mode_vals), 0x00,
1675 NULL, HFILL }
1677 { &hf_param_afh_instant,
1678 { "AFH Instant", "btlmp.afh.instant",
1679 FT_UINT32, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
1680 NULL, HFILL }
1682 { &hf_param_afh_channelmap[0],
1683 { "AFH Channel Map 0", "btlmp.afh.channelmap0",
1684 FT_UINT32, BASE_CUSTOM, CF_FUNC(decode_uint8_binary), 0x00,
1685 NULL, HFILL }
1687 { &hf_param_afh_channelmap[1],
1688 { "AFH Channel Map 1", "btlmp.afh.channelmap1",
1689 FT_UINT32, BASE_CUSTOM, CF_FUNC(decode_uint8_binary), 0x00,
1690 NULL, HFILL }
1692 { &hf_param_afh_channelmap[2],
1693 { "AFH Channel Map 2", "btlmp.afh.channelmap2",
1694 FT_UINT32, BASE_CUSTOM, CF_FUNC(decode_uint8_binary), 0x00,
1695 NULL, HFILL }
1697 { &hf_param_afh_channelmap[3],
1698 { "AFH Channel Map 3", "btlmp.afh.channelmap3",
1699 FT_UINT32, BASE_CUSTOM, CF_FUNC(decode_uint8_binary), 0x00,
1700 NULL, HFILL }
1702 { &hf_param_afh_channelmap[4],
1703 { "AFH Channel Map 4", "btlmp.afh.channelmap4",
1704 FT_UINT32, BASE_CUSTOM, CF_FUNC(decode_uint8_binary), 0x00,
1705 NULL, HFILL }
1707 { &hf_param_afh_channelmap[5],
1708 { "AFH Channel Map 5", "btlmp.afh.channelmap5",
1709 FT_UINT32, BASE_CUSTOM, CF_FUNC(decode_uint8_binary), 0x00,
1710 NULL, HFILL }
1712 { &hf_param_afh_channelmap[6],
1713 { "AFH Channel Map 6", "btlmp.afh.channelmap6",
1714 FT_UINT32, BASE_CUSTOM, CF_FUNC(decode_uint8_binary), 0x00,
1715 NULL, HFILL }
1717 { &hf_param_afh_channelmap[7],
1718 { "AFH Channel Map 7", "btlmp.afh.channelmap7",
1719 FT_UINT32, BASE_CUSTOM, CF_FUNC(decode_uint8_binary), 0x00,
1720 NULL, HFILL }
1722 { &hf_param_afh_channelmap[8],
1723 { "AFH Channel Map 8", "btlmp.afh.channelmap8",
1724 FT_UINT32, BASE_CUSTOM, CF_FUNC(decode_uint8_binary), 0x00,
1725 NULL, HFILL }
1727 { &hf_param_afh_channelmap[9],
1728 { "AFH Channel Map 9", "btlmp.afh.channelmap9",
1729 FT_UINT32, BASE_CUSTOM, CF_FUNC(decode_uint8_binary), 0x00,
1730 NULL, HFILL }
1732 { &hf_param_afh_reportingmode,
1733 { "AFH Reporting Mode", "btlmp.afh.reportingmode",
1734 FT_UINT8, BASE_HEX, VALS(afh_reportingmode_vals), 0x00,
1735 NULL, HFILL }
1737 { &hf_param_afh_mininterval,
1738 { "AFH Min Interval", "btlmp.afh.mininterval",
1739 FT_UINT16, BASE_HEX_DEC | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
1740 NULL, HFILL }
1742 { &hf_param_afh_maxinterval,
1743 { "AFH Max Interval", "btlmp.afh.maxinterval",
1744 FT_UINT16, BASE_HEX_DEC | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
1745 NULL, HFILL }
1747 { &hf_param_afh_channelclass[0][0],
1748 { "AFH Channel 0-1 Classification", "btlmp.afh.channelclass0",
1749 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x03,
1750 NULL, HFILL }
1752 { &hf_param_afh_channelclass[0][1],
1753 { "AFH Channel 2-3 Classification", "btlmp.afh.channelclass2",
1754 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x0C,
1755 NULL, HFILL }
1757 { &hf_param_afh_channelclass[0][2],
1758 { "AFH Channel 4-5 Classification", "btlmp.afh.channelclass4",
1759 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x30,
1760 NULL, HFILL }
1762 { &hf_param_afh_channelclass[0][3],
1763 { "AFH Channel 6-7 Classification", "btlmp.afh.channelclass6",
1764 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0xC0,
1765 NULL, HFILL }
1767 { &hf_param_afh_channelclass[1][0],
1768 { "AFH Channel 8-9 Classification", "btlmp.afh.channelclass8",
1769 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x03,
1770 NULL, HFILL }
1772 { &hf_param_afh_channelclass[1][1],
1773 { "AFH Channel 10-11 Classification", "btlmp.afh.channelclass10",
1774 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x0C,
1775 NULL, HFILL }
1777 { &hf_param_afh_channelclass[1][2],
1778 { "AFH Channel 12-13 Classification", "btlmp.afh.channelclass12",
1779 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x30,
1780 NULL, HFILL }
1782 { &hf_param_afh_channelclass[1][3],
1783 { "AFH Channel 14-15 Classification", "btlmp.afh.channelclass14",
1784 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0xC0,
1785 NULL, HFILL }
1787 { &hf_param_afh_channelclass[2][0],
1788 { "AFH Channel 16-17 Classification", "btlmp.afh.channelclass16",
1789 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x03,
1790 NULL, HFILL }
1792 { &hf_param_afh_channelclass[2][1],
1793 { "AFH Channel 18-19 Classification", "btlmp.afh.channelclass18",
1794 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x0C,
1795 NULL, HFILL }
1797 { &hf_param_afh_channelclass[2][2],
1798 { "AFH Channel 20-21 Classification", "btlmp.afh.channelclass20",
1799 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x30,
1800 NULL, HFILL }
1802 { &hf_param_afh_channelclass[2][3],
1803 { "AFH Channel 22-23 Classification", "btlmp.afh.channelclass22",
1804 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0xC0,
1805 NULL, HFILL }
1807 { &hf_param_afh_channelclass[3][0],
1808 { "AFH Channel 24-25 Classification", "btlmp.afh.channelclass24",
1809 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x03,
1810 NULL, HFILL }
1812 { &hf_param_afh_channelclass[3][1],
1813 { "AFH Channel 26-27 Classification", "btlmp.afh.channelclass26",
1814 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x0C,
1815 NULL, HFILL }
1817 { &hf_param_afh_channelclass[3][2],
1818 { "AFH Channel 28-29 Classification", "btlmp.afh.channelclass28",
1819 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x30,
1820 NULL, HFILL }
1822 { &hf_param_afh_channelclass[3][3],
1823 { "AFH Channel 30-31 Classification", "btlmp.afh.channelclass30",
1824 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0xC0,
1825 NULL, HFILL }
1827 { &hf_param_afh_channelclass[4][0],
1828 { "AFH Channel 32-33 Classification", "btlmp.afh.channelclass32",
1829 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x03,
1830 NULL, HFILL }
1832 { &hf_param_afh_channelclass[4][1],
1833 { "AFH Channel 34-35 Classification", "btlmp.afh.channelclass34",
1834 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x0C,
1835 NULL, HFILL }
1837 { &hf_param_afh_channelclass[4][2],
1838 { "AFH Channel 36-37 Classification", "btlmp.afh.channelclass36",
1839 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x30,
1840 NULL, HFILL }
1842 { &hf_param_afh_channelclass[4][3],
1843 { "AFH Channel 38-39 Classification", "btlmp.afh.channelclass38",
1844 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0xC0,
1845 NULL, HFILL }
1847 { &hf_param_afh_channelclass[5][0],
1848 { "AFH Channel 40-41 Classification", "btlmp.afh.channelclass40",
1849 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x03,
1850 NULL, HFILL }
1852 { &hf_param_afh_channelclass[5][1],
1853 { "AFH Channel 42-43 Classification", "btlmp.afh.channelclass42",
1854 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x0C,
1855 NULL, HFILL }
1857 { &hf_param_afh_channelclass[5][2],
1858 { "AFH Channel 44-45 Classification", "btlmp.afh.channelclass44",
1859 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x30,
1860 NULL, HFILL }
1862 { &hf_param_afh_channelclass[5][3],
1863 { "AFH Channel 46-47 Classification", "btlmp.afh.channelclass46",
1864 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0xC0,
1865 NULL, HFILL }
1867 { &hf_param_afh_channelclass[6][0],
1868 { "AFH Channel 48-49 Classification", "btlmp.afh.channelclass48",
1869 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x03,
1870 NULL, HFILL }
1872 { &hf_param_afh_channelclass[6][1],
1873 { "AFH Channel 50-51 Classification", "btlmp.afh.channelclass50",
1874 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x0C,
1875 NULL, HFILL }
1877 { &hf_param_afh_channelclass[6][2],
1878 { "AFH Channel 52-53 Classification", "btlmp.afh.channelclass52",
1879 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x30,
1880 NULL, HFILL }
1882 { &hf_param_afh_channelclass[6][3],
1883 { "AFH Channel 54-55 Classification", "btlmp.afh.channelclass54",
1884 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0xC0,
1885 NULL, HFILL }
1887 { &hf_param_afh_channelclass[7][0],
1888 { "AFH Channel 56-57 Classification", "btlmp.afh.channelclass56",
1889 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x03,
1890 NULL, HFILL }
1892 { &hf_param_afh_channelclass[7][1],
1893 { "AFH Channel 58-59 Classification", "btlmp.afh.channelclass58",
1894 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x0C,
1895 NULL, HFILL }
1897 { &hf_param_afh_channelclass[7][2],
1898 { "AFH Channel 60-61 Classification", "btlmp.afh.channelclass60",
1899 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x30,
1900 NULL, HFILL }
1902 { &hf_param_afh_channelclass[7][3],
1903 { "AFH Channel 62-63 Classification", "btlmp.afh.channelclass62",
1904 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0xC0,
1905 NULL, HFILL }
1907 { &hf_param_afh_channelclass[8][0],
1908 { "AFH Channel 64-65 Classification", "btlmp.afh.channelclass64",
1909 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x03,
1910 NULL, HFILL }
1912 { &hf_param_afh_channelclass[8][1],
1913 { "AFH Channel 66-67 Classification", "btlmp.afh.channelclass66",
1914 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x0C,
1915 NULL, HFILL }
1917 { &hf_param_afh_channelclass[8][2],
1918 { "AFH Channel 68-69 Classification", "btlmp.afh.channelclass68",
1919 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x30,
1920 NULL, HFILL }
1922 { &hf_param_afh_channelclass[8][3],
1923 { "AFH Channel 70-71 Classification", "btlmp.afh.channelclass70",
1924 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0xC0,
1925 NULL, HFILL }
1927 { &hf_param_afh_channelclass[9][0],
1928 { "AFH Channel 72-73 Classification", "btlmp.afh.channelclass72",
1929 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x03,
1930 NULL, HFILL }
1932 { &hf_param_afh_channelclass[9][1],
1933 { "AFH Channel 74-75 Classification", "btlmp.afh.channelclass74",
1934 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x0C,
1935 NULL, HFILL }
1937 { &hf_param_afh_channelclass[9][2],
1938 { "AFH Channel 76-77 Classification", "btlmp.afh.channelclass76",
1939 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0x30,
1940 NULL, HFILL }
1942 { &hf_param_afh_channelclass[9][3],
1943 { "AFH Channel 78 Classification", "btlmp.afh.channelclass78",
1944 FT_UINT8, BASE_HEX, VALS(afh_channelclass_vals), 0xC0,
1945 NULL, HFILL }
1947 { &hf_param_rand,
1948 { "Random Number", "btlmp.randomnumber",
1949 FT_BYTES, BASE_NONE, NULL, 0x00,
1950 NULL, HFILL }
1952 { &hf_param_key,
1953 { "Key", "btlmp.key",
1954 FT_BYTES, BASE_NONE, NULL, 0x00,
1955 NULL, HFILL }
1957 { &hf_param_clockoffset,
1958 { "Clock Offset", "btlmp.clockoffset",
1959 FT_UINT16, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slotpairs), 0x00,
1960 NULL, HFILL }
1962 { &hf_param_authresp,
1963 { "Authentication Response", "btlmp.authenticationresponse",
1964 FT_UINT32, BASE_HEX, NULL, 0x00,
1965 NULL, HFILL }
1967 { &hf_param_encryptionmode,
1968 { "Encryption Mode", "btlmp.encryptionmode",
1969 FT_UINT8, BASE_HEX, VALS(encryptionmode_vals), 0x00,
1970 NULL, HFILL }
1972 { &hf_param_encryptionkeysize,
1973 { "Encryption Key Size", "btlmp.encryptionkeysize",
1974 FT_UINT8, BASE_HEX, NULL, 0x00,
1975 NULL, HFILL }
1977 { &hf_param_switchinstant,
1978 { "Switch Instant", "btlmp.switchinstant",
1979 FT_UINT32, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
1980 NULL, HFILL }
1982 { &hf_param_holdtime,
1983 { "Hold Time", "btlmp.holdtime",
1984 FT_UINT16, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
1985 NULL, HFILL }
1987 { &hf_param_holdinstant,
1988 { "Hold Instant", "btlmp.holdinstant",
1989 FT_UINT32, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
1990 NULL, HFILL }
1992 { &hf_param_dsniff,
1993 { "Dsniff", "btlmp.sniff.d",
1994 FT_UINT16, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
1995 NULL, HFILL }
1997 { &hf_param_tsniff,
1998 { "Tsniff", "btlmp.sniff.t",
1999 FT_UINT16, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2000 NULL, HFILL }
2002 { &hf_param_sniffattempt,
2003 { "Sniff Attempt", "btlmp.sniff.attempt",
2004 FT_UINT16, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2005 NULL, HFILL }
2007 { &hf_param_snifftimeout,
2008 { "Sniff Timeout", "btlmp.sniff.timeout",
2009 FT_UINT16, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2010 NULL, HFILL }
2012 { &hf_param_timingcontrolflags[0],
2013 { "Timing Control Flags", "btlmp.timingcontrol.flags",
2014 FT_UINT8, BASE_HEX, NULL, 0x00,
2015 NULL, HFILL }
2017 { &hf_param_timingcontrolflags[1],
2018 { "Timing Change", "btlmp.timingcontrol.timingchange",
2019 FT_UINT8, BASE_DEC, VALS(timingcontrol_timingchange_vals), 0x01,
2020 NULL, HFILL }
2022 { &hf_param_timingcontrolflags[2],
2023 { "Use Initialization 2", "btlmp.timingcontrol.useinit2",
2024 FT_UINT8, BASE_DEC, VALS(timingcontrol_useinit2), 0x02,
2025 NULL, HFILL }
2027 { &hf_param_timingcontrolflags[3],
2028 { "No Access Window", "btlmp.timingcontrol.noaccesswindow",
2029 FT_UINT8, BASE_DEC, VALS(timingcontrol_noaccesswindow), 0x04,
2030 NULL, HFILL }
2032 { &hf_param_timingcontrolflags[4],
2033 { "Reserved", "btlmp.timingcontrol.reserved",
2034 FT_UINT8, BASE_HEX, NULL, 0xf8,
2035 NULL, HFILL }
2037 { &hf_param_futureuse1,
2038 { "Future Use", "btlmp.futureuse1",
2039 FT_UINT8, BASE_HEX, NULL, 0x00,
2040 NULL, HFILL }
2042 { &hf_param_datarate[0],
2043 { "Datarate", "btlmp.datarate.flags",
2044 FT_UINT8, BASE_HEX, NULL, 0x00,
2045 NULL, HFILL }
2047 { &hf_param_datarate[1],
2048 { "Do not use FEC", "btlmp.datarate.nofec",
2049 FT_UINT8, BASE_DEC, VALS(dataratenofec_vals), 0x01,
2050 NULL, HFILL }
2052 { &hf_param_datarate[2],
2053 { "Basic Rate Packet Size Preference", "btlmp.datarate.brpacketsizepreference",
2054 FT_UINT8, BASE_DEC, VALS(dataratepacketsizepreference_vals), 0x06,
2055 NULL, HFILL }
2057 { &hf_param_datarate[3],
2058 { "Enhanced Data Rate Datarate Preference", "btlmp.datarate.edrdataratepreference",
2059 FT_UINT8, BASE_DEC, VALS(dataratedrpreference_vals), 0x18,
2060 NULL, HFILL }
2062 { &hf_param_datarate[4],
2063 { "Enhanced Data Rate Packet Size Preference", "btlmp.datarate.edrpacketsizepreference",
2064 FT_UINT8, BASE_DEC, VALS(dataratepacketsizepreference_vals), 0x60,
2065 NULL, HFILL }
2067 { &hf_param_datarate[5],
2068 { "Reserved", "btlmp.datarate.reserved",
2069 FT_UINT8, BASE_DEC, NULL, 0x80,
2070 NULL, HFILL }
2072 { &hf_param_pollinterval,
2073 { "Poll Interval", "btlmp.qos.pollinterval",
2074 FT_UINT16, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2075 NULL, HFILL }
2077 { &hf_param_nbc,
2078 { "NBC", "btlmp.qos.nbc",
2079 FT_UINT8, BASE_HEX, NULL, 0x00,
2080 NULL, HFILL }
2082 { &hf_param_scohandle,
2083 { "SCO Handle", "btlmp.sco.handle",
2084 FT_UINT8, BASE_HEX, NULL, 0x00,
2085 NULL, HFILL }
2087 { &hf_param_dsco,
2088 { "Dsco", "btlmp.sco.d",
2089 FT_UINT8, BASE_DEC | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2090 NULL, HFILL }
2092 { &hf_param_tsco,
2093 { "Tsco", "btlmp.sco.t",
2094 FT_UINT8, BASE_DEC | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2095 NULL, HFILL }
2097 { &hf_param_scopacket,
2098 { "SCO packet", "btlmp.sco.packet",
2099 FT_UINT8, BASE_HEX, VALS(scopacket_vals), 0x00,
2100 NULL, HFILL }
2102 { &hf_param_airmode,
2103 { "Air Mode", "btlmp.sco.airmode",
2104 FT_UINT8, BASE_HEX, VALS(airmode_vals), 0x00,
2105 NULL, HFILL }
2107 { &hf_param_slots,
2108 { "Slots", "btlmp.slots",
2109 FT_UINT8, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2110 NULL, HFILL }
2112 { &hf_param_tmgacc_drift,
2113 { "Drift", "btlmp.timingaccuracy.drift",
2114 FT_UINT8, BASE_DEC | BASE_UNIT_STRING, UNS(&units_ppm), 0x00,
2115 NULL, HFILL }
2117 { &hf_param_tmgacc_jitter,
2118 { "Jitter", "btlmp.timingaccuracy.jitter",
2119 FT_UINT8, BASE_DEC | BASE_UNIT_STRING, UNS(&units_microsecond_microseconds), 0x00,
2120 NULL, HFILL }
2122 { &hf_param_slotoffset,
2123 { "Slot Offset", "btlmp.slotoffset",
2124 FT_UINT16, BASE_DEC | BASE_UNIT_STRING, UNS(&units_microsecond_microseconds), 0x00,
2125 NULL, HFILL }
2127 { &hf_param_bdaddr,
2128 { "Address", "btlmp.bd_addr",
2129 FT_ETHER, BASE_NONE, NULL, 0x00,
2130 NULL, HFILL }
2132 { &hf_param_pagingscheme,
2133 { "Paging Scheme", "btlmp.paging.scheme",
2134 FT_UINT8, BASE_HEX, VALS(pagingscheme_vals), 0x00,
2135 NULL, HFILL }
2137 { &hf_param_pagingschemesettings,
2138 { "Paging Scheme Settings", "btlmp.paging.schemesettings",
2139 FT_UINT8, BASE_HEX, VALS(pagingschemesettings_vals), 0x00,
2140 NULL, HFILL }
2142 { &hf_param_supervisiontimeout,
2143 { "Supervision Timeout", "btlmp.supervisiontimeout",
2144 FT_UINT16, BASE_DEC | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2145 NULL, HFILL }
2147 { &hf_param_testscenario,
2148 { "Scenario", "btlmp.test.scenario",
2149 FT_UINT8, BASE_HEX, NULL, 0x00,
2150 NULL, HFILL }
2152 { &hf_param_testhoppingmode,
2153 { "Hopping Mode", "btlmp.test.hoppingmode",
2154 FT_UINT8, BASE_HEX, NULL, 0x00,
2155 NULL, HFILL }
2157 { &hf_param_testtxfrequency,
2158 { "TX frequency", "btlmp.test.txfrequency",
2159 FT_UINT8, BASE_HEX, NULL, 0x00,
2160 NULL, HFILL }
2162 { &hf_param_testrxfrequency,
2163 { "RX frequency", "btlmp.test.rxfrequency",
2164 FT_UINT8, BASE_HEX, NULL, 0x00,
2165 NULL, HFILL }
2167 { &hf_param_testpowercontrolmode,
2168 { "Power Control Mode", "btlmp.test.powercontrolmode",
2169 FT_UINT8, BASE_HEX, NULL, 0x00,
2170 NULL, HFILL }
2172 { &hf_param_testpollperiod,
2173 { "Poll Period", "btlmp.test.pollperiod",
2174 FT_UINT8, BASE_HEX, NULL, 0x00,
2175 NULL, HFILL }
2177 { &hf_param_testpackettype,
2178 { "Packet Type", "btlmp.test.packettype",
2179 FT_UINT8, BASE_HEX, NULL, 0x00,
2180 NULL, HFILL }
2182 { &hf_param_testdatalength,
2183 { "Length of Test Data", "btlmp.test.datalength",
2184 FT_UINT8, BASE_HEX, NULL, 0x00,
2185 NULL, HFILL }
2187 { &hf_param_keysizemask,
2188 { "Key Size Mask", "btlmp.keysizemask",
2189 FT_UINT16, BASE_HEX, NULL, 0x00,
2190 NULL, HFILL }
2192 { &hf_param_encapsulatedmajor,
2193 { "Encapsulated Major Type", "btlmp.encapsulated.major",
2194 FT_UINT8, BASE_HEX, VALS(encapsulatedmajor_vals), 0x00,
2195 NULL, HFILL }
2197 { &hf_param_encapsulatedminor,
2198 { "Encapsulated Minor Type", "btlmp.encapsulated.minor",
2199 FT_UINT8, BASE_HEX, VALS(encapsulatedminor_vals), 0x00,
2200 NULL, HFILL }
2202 { &hf_param_encapsulatedlength,
2203 { "Encapsulated Payload Length", "btlmp.encapsulated.payloadlength",
2204 FT_UINT8, BASE_HEX, NULL, 0x00,
2205 NULL, HFILL }
2207 { &hf_param_encapsulateddata,
2208 { "Encapsulated Data", "btlmp.encapsulated.data",
2209 FT_BYTES, BASE_NONE, NULL, 0x00,
2210 NULL, HFILL }
2212 { &hf_param_simplepaircommit,
2213 { "Commitment Value", "btlmp.simplepair.commit",
2214 FT_BYTES, BASE_NONE, NULL, 0x00,
2215 NULL, HFILL }
2217 { &hf_param_simplepairnonce,
2218 { "Nonce Value", "btlmp.simplepair.nonce",
2219 FT_BYTES, BASE_NONE, NULL, 0x00,
2220 NULL, HFILL }
2222 { &hf_param_dhkeyconfirm,
2223 { "Confirmation Value", "btlmp.dhkey.confirm",
2224 FT_BYTES, BASE_NONE, NULL, 0x00,
2225 NULL, HFILL }
2227 { &hf_param_clkadjid,
2228 { "Clock Adjust ID", "btlmp.clkadj.id",
2229 FT_UINT8, BASE_HEX, NULL, 0x00,
2230 NULL, HFILL }
2232 { &hf_param_clkadjinstant,
2233 { "Clock Adjust Instant", "btlmp.clkadj.instant",
2234 FT_UINT32, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2235 NULL, HFILL }
2237 { &hf_param_clkadjus,
2238 { "Clock Adjust Microseconds", "btlmp.clkadj.us",
2239 FT_INT16, BASE_DEC | BASE_UNIT_STRING, UNS(&units_microsecond_microseconds), 0x00,
2240 NULL, HFILL }
2242 { &hf_param_clkadjslots,
2243 { "Clock Adjust Slots", "btlmp.clkadj.slots",
2244 FT_UINT8, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2245 NULL, HFILL }
2247 { &hf_param_clkadjmode,
2248 { "Clock Adjust Mode", "btlmp.clkadj.mode",
2249 FT_UINT8, BASE_HEX, VALS(clkadjmode_vals), 0x00,
2250 NULL, HFILL }
2252 { &hf_param_clkadjclk,
2253 { "Clock Adjust Clock", "btlmp.clkadj.clk",
2254 FT_UINT32, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slotpairs), 0x00,
2255 NULL, HFILL }
2257 { &hf_param_clkadjperiod,
2258 { "Clock Adjust Period", "btlmp.clkadj.period",
2259 FT_UINT8, BASE_DEC | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2260 NULL, HFILL }
2262 { &hf_param_packettypetable,
2263 { "Packet Type Table", "btlmp.packettypetable",
2264 FT_UINT8, BASE_HEX, VALS(packettypetable_vals), 0x00,
2265 NULL, HFILL }
2267 { &hf_param_escohandle,
2268 { "eSCO Handle", "btlmp.esco.handle",
2269 FT_UINT8, BASE_HEX, NULL, 0x00,
2270 NULL, HFILL }
2272 { &hf_param_escoltaddr,
2273 { "eSCO LT_ADDR", "btlmp.esco.ltaddr",
2274 FT_UINT8, BASE_HEX, NULL, 0x00,
2275 NULL, HFILL }
2277 { &hf_param_escod,
2278 { "Desco", "btlmp.esco.d",
2279 FT_UINT8, BASE_DEC | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2280 NULL, HFILL }
2282 { &hf_param_escot,
2283 { "Tesco", "btlmp.esco.t",
2284 FT_UINT8, BASE_DEC | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2285 NULL, HFILL }
2287 { &hf_param_escow,
2288 { "Wesco", "btlmp.esco.w",
2289 FT_UINT8, BASE_DEC | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2290 NULL, HFILL }
2292 { &hf_param_escopackettypems,
2293 { "eSCO Packet Type M->S", "btlmp.esco.packettypems",
2294 FT_UINT8, BASE_HEX, VALS(escopackettypems_vals), 0x00,
2295 NULL, HFILL }
2297 { &hf_param_escopackettypesm,
2298 { "eSCO Packet Type S->M", "btlmp.esco.packettypesm",
2299 FT_UINT8, BASE_HEX, VALS(escopackettypesm_vals), 0x00,
2300 NULL, HFILL }
2302 { &hf_param_escopacketlengthms,
2303 { "eSCO Packet Length M->S", "btlmp.esco.packetlengthms",
2304 FT_UINT16, BASE_HEX, NULL, 0x00,
2305 NULL, HFILL }
2307 { &hf_param_escopacketlengthsm,
2308 { "eSCO Packet Length S->M", "btlmp.esco.packetlengthsm",
2309 FT_UINT16, BASE_HEX, NULL, 0x00,
2310 NULL, HFILL }
2312 { &hf_param_negostate,
2313 { "Negotiation State", "btlmp.negotiationstate",
2314 FT_UINT8, BASE_HEX, VALS(negostate_vals), 0x00,
2315 NULL, HFILL }
2317 { &hf_param_maxsniffsubrate,
2318 { "Max Sniff Subrate", "btlmp.sniffsubrate.max",
2319 FT_UINT8, BASE_HEX, NULL, 0x00,
2320 NULL, HFILL }
2322 { &hf_param_minsniffmodetimeout,
2323 { "Min Sniff Mode Timeout", "btlmp.sniffsubrate.minmodetimeout",
2324 FT_UINT16, BASE_DEC | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2325 NULL, HFILL }
2327 { &hf_param_sniffsubratinginstant,
2328 { "Sniff Subrating Instant", "btlmp.sniffsubrate.instant",
2329 FT_UINT32, BASE_HEX, NULL, 0x00,
2330 NULL, HFILL }
2332 { &hf_param_iocapcap,
2333 { "IO Capabilities", "btlmp.iocap.cap",
2334 FT_UINT8, BASE_HEX, VALS(iocapcap_vals), 0x00,
2335 NULL, HFILL }
2337 { &hf_param_iocapoobauthdata,
2338 { "OOB Authentication Data", "btlmp.iocap.oobauthdata",
2339 FT_UINT8, BASE_HEX, VALS(iocapoobauthdata_vals), 0x00,
2340 NULL, HFILL }
2342 { &hf_param_iocapauthreq,
2343 { "Authentication Requirement", "btlmp.iocap.authreq",
2344 FT_UINT8, BASE_HEX, VALS(iocapauthreq_vals), 0x00,
2345 NULL, HFILL }
2347 { &hf_param_keypressnotificationtype,
2348 { "Notification Type", "btlmp.keypress.notificationtype",
2349 FT_UINT8, BASE_HEX, VALS(keypressnotificationtype_vals), 0x00,
2350 NULL, HFILL }
2352 { &hf_param_poweradjreq,
2353 { "Power Adjustment Request", "btlmp.poweradj.request",
2354 FT_UINT8, BASE_HEX, VALS(poweradjreq_vals), 0x00,
2355 NULL, HFILL }
2357 { &hf_param_poweradjresp[0],
2358 { "Power Adjustment Response", "btlmp.poweradj.response",
2359 FT_UINT8, BASE_HEX, NULL, 0x00,
2360 NULL, HFILL }
2362 { &hf_param_poweradjresp[1],
2363 { "GFSK", "btlmp.poweradj.gfsk",
2364 FT_UINT8, BASE_HEX, VALS(poweradjresp_vals), 0x03,
2365 NULL, HFILL }
2367 { &hf_param_poweradjresp[2],
2368 { "Pi/4-DQPSK", "btlmp.poweradj.pi4dqsk",
2369 FT_UINT8, BASE_HEX, VALS(poweradjresp_vals), 0x0C,
2370 NULL, HFILL }
2372 { &hf_param_poweradjresp[3],
2373 { "8DPSK", "btlmp.poweradj.8dpsk",
2374 FT_UINT8, BASE_HEX, VALS(poweradjresp_vals), 0x30,
2375 NULL, HFILL }
2377 { &hf_param_poweradjresp[4],
2378 { "Reserved", "btlmp.poweradj.reserved",
2379 FT_UINT8, BASE_HEX, NULL, 0xC0,
2380 NULL, HFILL }
2382 { &hf_param_samindex,
2383 { "SAM Index", "btlmp.sam.index",
2384 FT_UINT8, BASE_HEX, NULL, 0x00,
2385 NULL, HFILL }
2387 { &hf_param_samtsm,
2388 { "Tsam-sm", "btlmp.sam.tsm",
2389 FT_UINT8, BASE_DEC | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2390 NULL, HFILL }
2392 { &hf_param_samnsm,
2393 { "Nsam-sm", "btlmp.sam.nsm",
2394 FT_UINT8, BASE_HEX, NULL, 0x00,
2395 NULL, HFILL }
2397 { &hf_param_samsubmaps,
2398 { "SAM Submaps", "btlmp.sam.submaps",
2399 FT_BYTES, BASE_NONE, NULL, 0x00,
2400 NULL, HFILL }
2402 { &hf_param_samupdatemode,
2403 { "Update Mode", "btlmp.sam.updatemode",
2404 FT_UINT8, BASE_HEX, VALS(samupdatemode_vals), 0x00,
2405 NULL, HFILL }
2407 { &hf_param_samtype0submap,
2408 { "SAM Type 0 Submap", "btlmp.sam.type0submap",
2409 FT_BYTES, BASE_NONE, NULL, 0x00,
2410 NULL, HFILL }
2412 { &hf_param_samd,
2413 { "Dsam", "btlmp.sam.d",
2414 FT_UINT8, BASE_HEX, NULL, 0x00,
2415 NULL, HFILL }
2417 { &hf_param_saminstant,
2418 { "SAM Instant", "btlmp.sam.instant",
2419 FT_UINT32, BASE_HEX | BASE_UNIT_STRING, UNS(&units_slots), 0x00,
2420 NULL, HFILL }
2422 { &hf_params,
2423 { "Parameters", "btlmp.parameters",
2424 FT_NONE, BASE_NONE, NULL, 0x00,
2425 NULL, HFILL }
2429 static int *ett[] = {
2430 &ett_btlmp
2433 proto_btlmp = proto_register_protocol("Bluetooth Link Manager Protocol", "BT LMP", "btlmp");
2434 proto_register_field_array(proto_btlmp, hf, array_length(hf));
2435 proto_register_subtree_array(ett, array_length(ett));
2436 btlmp_handle = register_dissector("btlmp", dissect_btlmp, proto_btlmp);
2439 void
2440 proto_reg_handoff_btlmp(void)
2445 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2447 * Local variables:
2448 * c-basic-offset: 4
2449 * tab-width: 8
2450 * indent-tabs-mode: nil
2451 * End:
2453 * vi: set shiftwidth=4 tabstop=8 expandtab:
2454 * :indentSize=4:tabSize=8:noTabs=true: