HACK: 2nd try to match RowsetProperties
[wireshark-wip.git] / epan / dissectors / packet-btamp.c
blob06582e7d8213cd595930a91d7c10dbd6b9c874c8
1 /* packet-btamp.c
2 * Routines for the Bluetooth AMP dissection
4 * Copyright 2009, Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>
6 * $Id$
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include "config.h"
29 #include <epan/packet.h>
31 #include "packet-btl2cap.h"
33 /* Initialize the protocol and registered fields */
34 static int proto_btamp = -1;
35 static int hf_btamp_command = -1;
36 static int hf_btamp_cmd_code = -1;
37 static int hf_btamp_cmd_ident = -1;
38 static int hf_btamp_cmd_length = -1;
39 static int hf_btamp_cmd_data = -1;
40 static int hf_btamp_rej_reason = -1;
41 static int hf_btamp_mtu = -1;
42 static int hf_btamp_extfeatures = -1;
43 static int hf_btamp_lcontroller_id = -1;
44 static int hf_btamp_rcontroller_id = -1;
45 static int hf_btamp_controller_list = -1;
46 static int hf_btamp_controllers = -1;
47 static int hf_btamp_controller_id = -1;
48 static int hf_btamp_controller_type = -1;
49 static int hf_btamp_controller_status = -1;
50 static int hf_btamp_status = -1;
51 /* static int hf_btamp_create_status = -1; */
52 /* static int hf_btamp_disc_status = -1; */
53 static int hf_btamp_total_bw = -1;
54 static int hf_btamp_max_guaran_bw = -1;
55 static int hf_btamp_min_latency = -1;
56 static int hf_btamp_pal_caps_guaranteed = -1;
57 static int hf_btamp_pal_caps_mask = -1;
58 static int hf_btamp_amp_assoc_size = -1;
59 static int hf_btamp_amp_assoc = -1;
61 /* Initialize the subtree pointers */
62 static gint ett_btamp = -1;
63 static gint ett_btamp_cmd = -1;
64 static gint ett_btamp_caps = -1;
65 static gint ett_btamp_controller_entry = -1;
66 static gint ett_btamp_controller_list = -1;
68 static const value_string command_code_vals[] = {
69 { 0x01, "AMP Command Reject" },
70 { 0x02, "AMP Discover Request" },
71 { 0x03, "AMP Discover Response" },
72 { 0x04, "AMP Change Notify" },
73 { 0x05, "AMP Change Response" },
74 { 0x06, "AMP Get Info Request" },
75 { 0x07, "AMP Get Info Response" },
76 { 0x08, "AMP Get AMP Assoc Request" },
77 { 0x09, "AMP Get AMP Assoc Response" },
78 { 0x0A, "AMP Create Physical Link Request" },
79 { 0x0B, "AMP Create Physical Link Response" },
80 { 0x0C, "AMP Disconnect Physical Link Request" },
81 { 0x0D, "AMP Disconnect Physical Link Response" },
82 { 0, NULL }
85 static const value_string reason_vals[] = {
86 { 0x0000, "Command not understood" },
87 { 0, NULL }
90 static const value_string controller_type_vals[] = {
91 { 0x0000, "Bluetooth BR/EDR" },
92 { 0x0001, "802.11" },
93 { 0x0002, "ECMA-368" },
94 { 0, NULL }
97 static const value_string controller_status_vals[] = {
98 { 0x0000, "Controller available but currently physically powered down" },
99 { 0x0001, "Controller used exclusively by Bluetooth BR/EDR" },
100 { 0x0002, "Controller has no capacity available for Bluetooth operation" },
101 { 0x0003, "Controller has low capacity available for Bluetooth operation" },
102 { 0x0004, "Controller has medium capacity available for Bluetooth operation" },
103 { 0x0005, "Controller has high capacity available for Bluetooth operation" },
104 { 0x0006, "Controller has full capacity available for Bluetooth operation" },
105 { 0, NULL }
108 static const value_string status_vals[] = {
109 { 0x0000, "Success" },
110 { 0x0001, "Invalid Controller ID" },
111 { 0, NULL }
114 #if 0
115 static const value_string create_status_vals[] = {
116 { 0x0000, "Success" },
117 { 0x0001, "Invalid Controller ID" },
118 { 0x0002, "Failed - Unable to start link creation" },
119 { 0x0003, "Failed - Collision Occurred" },
120 { 0x0004, "Failed - AMP Disconnected Physical Link Request packet received" },
121 { 0x0005, "Failed - Physical Link Already Exists" },
122 { 0, NULL }
125 static const value_string disc_status_vals[] = {
126 { 0x0000, "Success" },
127 { 0x0001, "Invalid Controller ID" },
128 { 0x0002, "Failed - No Physical Link exists and no Physical Link creation is in progress" },
129 { 0, NULL }
131 #endif
133 void proto_register_btamp(void);
134 void proto_reg_handoff_btamp(void);
136 static int
137 dissect_comrej(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
139 guint16 reason;
141 reason = tvb_get_letohs(tvb, offset);
142 proto_tree_add_item(tree, hf_btamp_rej_reason, tvb, offset, 2, ENC_LITTLE_ENDIAN);
143 offset += 2;
145 switch (reason) {
146 case 0x0000: /* Command not understood */
147 break;
149 default:
150 break;
153 return offset;
156 static int
157 dissect_discoverrequest(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
159 proto_tree_add_item(tree, hf_btamp_mtu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
160 offset += 2;
162 proto_tree_add_item(tree, hf_btamp_extfeatures, tvb, offset, 2, ENC_LITTLE_ENDIAN);
163 offset += 2;
165 return offset;
168 static int
169 dissect_controller_entry(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, guint16 idx)
171 proto_item *ti_controller_entry;
172 proto_tree *btamp_controller_entry_tree;
174 ti_controller_entry = proto_tree_add_none_format(tree,
175 hf_btamp_controllers, tvb,
176 offset, 3,
177 "Entry: %u", idx);
178 btamp_controller_entry_tree = proto_item_add_subtree(ti_controller_entry, ett_btamp_controller_entry);
180 proto_tree_add_item(btamp_controller_entry_tree, hf_btamp_controller_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
181 offset += 1;
183 proto_tree_add_item(btamp_controller_entry_tree, hf_btamp_controller_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
184 offset += 1;
186 proto_tree_add_item(btamp_controller_entry_tree, hf_btamp_controller_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
187 offset += 1;
189 return offset;
192 static int
193 dissect_discoverresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
195 guint16 length;
196 guint16 idx = 1;
197 proto_item *ti_controller_list;
198 proto_tree *btamp_controller_list_tree;
200 proto_tree_add_item(tree, hf_btamp_mtu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
201 offset += 2;
203 proto_tree_add_item(tree, hf_btamp_extfeatures, tvb, offset, 2, ENC_LITTLE_ENDIAN);
204 offset += 2;
206 length = tvb_reported_length_remaining(tvb, offset);
207 ti_controller_list = proto_tree_add_none_format(tree,
208 hf_btamp_controller_list, tvb,
209 offset, length,
210 "Controller list");
211 btamp_controller_list_tree = proto_item_add_subtree(ti_controller_list, ett_btamp_controller_list);
213 while (tvb_reported_length_remaining(tvb, offset) >= 3) {
214 offset = dissect_controller_entry(tvb, offset, pinfo, btamp_controller_list_tree, idx);
215 idx += 1;
218 return offset;
221 static int
222 dissect_changenotify(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
224 guint16 length;
225 guint16 idx = 1;
226 proto_item *ti_controller_list;
227 proto_tree *btamp_controller_list_tree;
229 length = tvb_reported_length_remaining(tvb, offset);
230 ti_controller_list = proto_tree_add_none_format(tree,
231 hf_btamp_controller_list, tvb,
232 offset, length,
233 "Controller list");
234 btamp_controller_list_tree = proto_item_add_subtree(ti_controller_list, ett_btamp_controller_list);
236 while (tvb_reported_length_remaining(tvb, offset) >= 3) {
237 offset = dissect_controller_entry(tvb, offset, pinfo, btamp_controller_list_tree, idx);
238 idx += 1;
241 return offset;
244 static int
245 dissect_changeresponse(tvbuff_t *tvb _U_, int offset, packet_info *pinfo _U_, proto_tree *tree _U_)
247 return offset;
250 static int
251 dissect_getinforequest(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
253 proto_tree_add_item(tree, hf_btamp_controller_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
254 offset += 1;
256 return offset;
259 static int
260 dissect_getinforesponse(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
262 proto_item *ti_controller;
263 proto_tree *btamp_controller_tree;
265 proto_tree_add_item(tree, hf_btamp_controller_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
266 offset += 1;
268 proto_tree_add_item(tree, hf_btamp_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
269 offset += 1;
271 proto_tree_add_item(tree, hf_btamp_total_bw, tvb, offset, 4, ENC_LITTLE_ENDIAN);
272 offset += 4;
274 proto_tree_add_item(tree, hf_btamp_max_guaran_bw, tvb, offset, 4, ENC_LITTLE_ENDIAN);
275 offset += 4;
277 proto_tree_add_item(tree, hf_btamp_min_latency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
278 offset += 4;
280 ti_controller = proto_tree_add_none_format(tree,
281 hf_btamp_pal_caps_mask, tvb,
282 offset, 2,
283 "PAL Capabilities");
284 btamp_controller_tree = proto_item_add_subtree(ti_controller, ett_btamp_caps);
285 proto_tree_add_item(btamp_controller_tree, hf_btamp_pal_caps_guaranteed, tvb, offset, 2, ENC_LITTLE_ENDIAN);
286 offset += 2;
288 proto_tree_add_item(tree, hf_btamp_amp_assoc_size, tvb, offset, 2, ENC_LITTLE_ENDIAN);
289 offset += 2;
291 return offset;
294 static int
295 dissect_getampassocrequest(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
297 proto_tree_add_item(tree, hf_btamp_controller_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
298 offset += 1;
300 return offset;
303 static int
304 dissect_ampassoc(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
306 proto_tree_add_item(tree, hf_btamp_amp_assoc, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_NA);
307 return tvb_reported_length(tvb);
310 static int
311 dissect_getampassocresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
313 proto_tree_add_item(tree, hf_btamp_controller_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
314 offset += 1;
316 proto_tree_add_item(tree, hf_btamp_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
317 offset += 1;
319 offset = dissect_ampassoc(tvb, offset, pinfo, tree);
321 return offset;
324 static int
325 dissect_createphysicalrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
327 proto_tree_add_item(tree, hf_btamp_lcontroller_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
328 offset += 1;
330 proto_tree_add_item(tree, hf_btamp_rcontroller_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
331 offset += 1;
333 offset = dissect_ampassoc(tvb, offset, pinfo, tree);
335 return offset;
338 static int
339 dissect_createphysicalresponse(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
341 proto_tree_add_item(tree, hf_btamp_lcontroller_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
342 offset += 1;
344 proto_tree_add_item(tree, hf_btamp_rcontroller_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
345 offset += 1;
347 proto_tree_add_item(tree, hf_btamp_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
348 offset += 1;
350 return offset;
353 static int
354 dissect_discphysicalchanrequest(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
356 proto_tree_add_item(tree, hf_btamp_lcontroller_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
357 offset += 1;
359 proto_tree_add_item(tree, hf_btamp_rcontroller_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
360 offset += 1;
362 return offset;
365 static int
366 dissect_discphysicalchanresponse(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
368 proto_tree_add_item(tree, hf_btamp_lcontroller_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
369 offset += 1;
371 proto_tree_add_item(tree, hf_btamp_rcontroller_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
372 offset += 1;
374 proto_tree_add_item(tree, hf_btamp_controller_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
375 offset += 1;
377 return offset;
380 static int
381 dissect_btamp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
383 int offset = 0;
384 proto_item *ti;
385 proto_tree *btamp_tree;
386 guint16 length;
387 proto_item *ti_command;
388 proto_tree *btamp_cmd_tree;
389 guint8 cmd_code;
390 guint16 cmd_length;
392 col_set_str(pinfo->cinfo, COL_PROTOCOL, "AMP");
394 switch (pinfo->p2p_dir) {
395 case P2P_DIR_SENT:
396 col_set_str(pinfo->cinfo, COL_INFO, "Sent ");
397 break;
398 case P2P_DIR_RECV:
399 col_set_str(pinfo->cinfo, COL_INFO, "Rcvd ");
400 break;
401 default:
402 col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ",
403 pinfo->p2p_dir);
404 break;
407 ti = proto_tree_add_item(tree, proto_btamp, tvb, offset, -1, ENC_NA);
408 btamp_tree = proto_item_add_subtree(ti, ett_btamp);
410 length = tvb_reported_length_remaining(tvb, offset);
411 ti_command = proto_tree_add_none_format(btamp_tree,
412 hf_btamp_command, tvb,
413 offset, length,
414 "Command: ");
415 btamp_cmd_tree = proto_item_add_subtree(ti_command, ett_btamp_cmd);
417 cmd_code = tvb_get_guint8(tvb, offset);
418 proto_tree_add_item(btamp_cmd_tree, hf_btamp_cmd_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
419 offset += 1;
421 proto_tree_add_item(btamp_cmd_tree, hf_btamp_cmd_ident, tvb, offset, 1, ENC_LITTLE_ENDIAN);
422 offset += 1;
424 cmd_length = tvb_get_letohs(tvb, offset);
425 proto_tree_add_item(btamp_cmd_tree, hf_btamp_cmd_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
426 proto_item_set_len(ti_command, cmd_length+4);
427 offset += 2;
429 switch(cmd_code) {
430 case 0x01: /* Command Reject */
431 offset = dissect_comrej(tvb, offset, pinfo, btamp_cmd_tree);
432 break;
434 case 0x02: /* Discover Request */
435 offset = dissect_discoverrequest(tvb, offset, pinfo, btamp_cmd_tree);
436 break;
438 case 0x03: /* Discover Response */
439 offset = dissect_discoverresponse(tvb, offset, pinfo, btamp_cmd_tree);
440 break;
442 case 0x04: /* AMP Change Notify */
443 offset = dissect_changenotify(tvb, offset, pinfo, btamp_cmd_tree);
444 break;
446 case 0x05: /* AMP Change Response */
447 offset = dissect_changeresponse(tvb, offset, pinfo, btamp_cmd_tree);
448 break;
450 case 0x06: /* AMP Get Info Request */
451 offset = dissect_getinforequest(tvb, offset, pinfo, btamp_cmd_tree);
452 break;
454 case 0x07: /* AMP Get Info Response */
455 offset = dissect_getinforesponse(tvb, offset, pinfo, btamp_cmd_tree);
456 break;
458 case 0x08: /* Get AMP Assoc Request */
459 offset = dissect_getampassocrequest(tvb, offset, pinfo, btamp_cmd_tree);
460 break;
462 case 0x09: /* Get AMP Assoc Response */
463 offset = dissect_getampassocresponse(tvb, offset, pinfo, btamp_cmd_tree);
464 break;
466 case 0x0A: /* Create Physical Link Request */
467 offset = dissect_createphysicalrequest(tvb, offset, pinfo, btamp_cmd_tree);
468 break;
470 case 0x0B: /* Create Physical Link Response */
471 offset = dissect_createphysicalresponse(tvb, offset, pinfo, btamp_cmd_tree);
472 break;
474 case 0x0c: /* Disconnect Physical Link Request */
475 offset = dissect_discphysicalchanrequest(tvb, offset, pinfo, btamp_cmd_tree);
476 break;
478 case 0x0d: /* Disconnect Physical Link Response */
479 offset = dissect_discphysicalchanresponse(tvb, offset, pinfo, btamp_cmd_tree);
480 break;
482 default:
483 proto_tree_add_item(btamp_cmd_tree, hf_btamp_cmd_data, tvb, offset, -1, ENC_NA);
484 offset = tvb_reported_length(tvb);
485 break;
488 proto_item_append_text(ti_command, "%s", val_to_str(cmd_code, command_code_vals, "Unknown PDU (%u)"));
489 col_append_str(pinfo->cinfo, COL_INFO, val_to_str(cmd_code, command_code_vals, "Unknown PDU (%u)"));
491 return offset;
494 /* Register the protocol with Wireshark */
495 void
496 proto_register_btamp(void)
498 /* Setup list of header fields See Section 1.6.1 for details*/
499 static hf_register_info hf[] = {
500 { &hf_btamp_command,
501 { "Command", "btamp.command",
502 FT_NONE, BASE_NONE, NULL, 0x0,
503 "L2CAP Command", HFILL }
505 { &hf_btamp_cmd_code,
506 { "Command Code", "btamp.cmd_code",
507 FT_UINT8, BASE_HEX, VALS(command_code_vals), 0x0,
508 "L2CAP Command Code", HFILL }
510 { &hf_btamp_cmd_ident,
511 { "Command Identifier", "btamp.cmd_ident",
512 FT_UINT8, BASE_HEX, NULL, 0x0,
513 "L2CAP Command Identifier", HFILL }
515 { &hf_btamp_cmd_length,
516 { "Command Length", "btamp.cmd_length",
517 FT_UINT8, BASE_DEC, NULL, 0x0,
518 "L2CAP Command Length", HFILL }
520 { &hf_btamp_cmd_data,
521 { "Command Data", "btamp.cmd_data",
522 FT_NONE, BASE_NONE, NULL, 0x0,
523 "L2CAP Command Data", HFILL }
525 { &hf_btamp_rej_reason,
526 { "Reason", "btamp.rej_reason",
527 FT_UINT16, BASE_HEX, VALS(reason_vals), 0x0,
528 NULL, HFILL }
530 { &hf_btamp_mtu,
531 { "MPS/MTU", "btamp.mps",
532 FT_UINT16, BASE_HEX, NULL, 0x0,
533 "MPS/MTU Size", HFILL }
535 { &hf_btamp_extfeatures,
536 { "Extended Features", "btamp.extfeatures",
537 FT_UINT16, BASE_HEX, NULL, 0x0,
538 "Extended Features Mask", HFILL }
540 { &hf_btamp_controllers,
541 { "Controller entry", "btamp.ctrl_entry",
542 FT_NONE, BASE_NONE, NULL, 0x0,
543 NULL, HFILL }
545 { &hf_btamp_controller_list,
546 { "Controller list", "btamp.ctrl_list",
547 FT_NONE, BASE_NONE, NULL, 0x0,
548 NULL, HFILL }
550 { &hf_btamp_lcontroller_id,
551 { "Local Controller ID", "btamp.lctrl_id",
552 FT_UINT8, BASE_DEC, NULL, 0x0,
553 NULL, HFILL }
555 { &hf_btamp_rcontroller_id,
556 { "Remote Controller ID", "btamp.rctrl_id",
557 FT_UINT8, BASE_DEC, NULL, 0x0,
558 NULL, HFILL }
560 { &hf_btamp_controller_id,
561 { "Controller ID", "btamp.ctrl_id",
562 FT_UINT8, BASE_DEC, NULL, 0x0,
563 NULL, HFILL }
565 { &hf_btamp_controller_type,
566 { "Controller Type", "btamp.ctrl_type",
567 FT_UINT8, BASE_DEC, VALS(controller_type_vals), 0x0,
568 NULL, HFILL }
570 { &hf_btamp_controller_status,
571 { "Controller Status", "btamp.ctrl_status",
572 FT_UINT8, BASE_DEC, VALS(controller_status_vals), 0x0,
573 NULL, HFILL }
575 { &hf_btamp_status,
576 { "Status", "btamp.status",
577 FT_UINT8, BASE_DEC, VALS(status_vals), 0x0,
578 NULL, HFILL }
580 #if 0
581 { &hf_btamp_create_status,
582 { "Status", "btamp.create_status",
583 FT_UINT8, BASE_DEC, VALS(create_status_vals), 0x0,
584 NULL, HFILL }
586 { &hf_btamp_disc_status,
587 { "Status", "btamp.disc_status",
588 FT_UINT8, BASE_DEC, VALS(disc_status_vals), 0x0,
589 NULL, HFILL }
591 #endif
592 { &hf_btamp_pal_caps_mask,
593 { "PAL Capabilities Mask", "btamp.pal_caps_mask",
594 FT_NONE, BASE_NONE, NULL, 0x0,
595 NULL, HFILL }
597 { &hf_btamp_pal_caps_guaranteed,
598 { "Guaranteed Service type", "btamp.guaranteed_type",
599 FT_BOOLEAN, 16, NULL, 0x01,
600 NULL, HFILL }
602 { &hf_btamp_total_bw,
603 { "Total Bandwidth", "btamp.total_bw",
604 FT_UINT32, BASE_HEX, NULL, 0x0,
605 NULL, HFILL }
607 { &hf_btamp_max_guaran_bw,
608 { "Max Guaranteed Bandwidth", "btamp.max_guaran_bw",
609 FT_UINT32, BASE_HEX, NULL, 0x0,
610 NULL, HFILL }
612 { &hf_btamp_min_latency,
613 { "Minimum latency", "btamp.min_latency",
614 FT_UINT32, BASE_HEX, NULL, 0x0,
615 NULL, HFILL }
617 { &hf_btamp_amp_assoc_size,
618 { "Assoc Size", "btamp.assoc_size",
619 FT_UINT16, BASE_HEX, NULL, 0x0,
620 NULL, HFILL }
622 { &hf_btamp_amp_assoc,
623 { "Assoc", "btamp.assoc",
624 FT_BYTES, BASE_NONE, NULL, 0x0,
625 NULL, HFILL }
629 /* Setup protocol subtree array */
630 static gint *ett[] = {
631 &ett_btamp,
632 &ett_btamp_cmd,
633 &ett_btamp_caps,
634 &ett_btamp_controller_entry,
635 &ett_btamp_controller_list,
638 /* Register the protocol name and description */
639 proto_btamp = proto_register_protocol("Bluetooth AMP Packet", "BT AMP", "btamp");
641 new_register_dissector("btamp", dissect_btamp, proto_btamp);
643 /* Required function calls to register the header fields and subtrees used */
644 proto_register_field_array(proto_btamp, hf, array_length(hf));
645 proto_register_subtree_array(ett, array_length(ett));
648 void
649 proto_reg_handoff_btamp(void)
651 dissector_handle_t btamp_handle;
653 btamp_handle = find_dissector("btamp");
654 dissector_add_uint("btl2cap.cid", BTL2CAP_FIXED_CID_AMP_MAN, btamp_handle);
658 * Editor modelines - http://www.wireshark.org/tools/modelines.html
660 * Local variables:
661 * c-basic-offset: 4
662 * tab-width: 8
663 * indent-tabs-mode: nil
664 * End:
666 * vi: set shiftwidth=4 tabstop=8 expandtab:
667 * :indentSize=4:tabSize=8:noTabs=true: