2 * Routines for the Bluetooth SCO dissection
3 * Copyright 2002, Christoph Scholz <scholz@cs.uni-bonn.de>
5 * Refactored for wireshark checkin
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1998 Gerald Combs
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 #include <epan/packet.h>
36 #include <packet-hci_h4.h>
38 /* Initialize the protocol and registered fields */
39 static int proto_btsco = -1;
40 static int hf_btsco_chandle = -1;
41 static int hf_btsco_length = -1;
42 static int hf_btsco_data = -1;
44 /* Initialize the subtree pointers */
45 static gint ett_btsco = -1;
48 /* Code to actually dissect the packets */
50 dissect_btsco(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
53 proto_tree *btsco_tree;
56 ti = proto_tree_add_item(tree, proto_btsco, tvb, offset, -1, ENC_NA);
57 btsco_tree = proto_item_add_subtree(ti, ett_btsco);
60 proto_tree_add_item(btsco_tree, hf_btsco_chandle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
63 proto_tree_add_item(btsco_tree, hf_btsco_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
66 proto_tree_add_item(btsco_tree, hf_btsco_data, tvb, offset, -1, ENC_NA);
71 proto_register_btsco(void)
73 static hf_register_info hf[] = {
75 { "Connection Handle", "bthci_sco.chandle",
76 FT_UINT16, BASE_HEX, NULL, 0x0FFF,
80 { "Data Total Length", "bthci_sco.length",
81 FT_UINT8, BASE_DEC, NULL, 0x0,
85 { "Data", "bthci_sco.data",
86 FT_NONE, BASE_NONE, NULL, 0x0,
91 /* Setup protocol subtree array */
92 static gint *ett[] = {
96 /* Register the protocol name and description */
97 proto_btsco = proto_register_protocol("Bluetooth HCI SCO Packet", "HCI_SCO", "bthci_sco");
98 register_dissector("bthci_sco", dissect_btsco, proto_btsco);
100 /* Required function calls to register the header fields and subtrees used */
101 proto_register_field_array(proto_btsco, hf, array_length(hf));
102 proto_register_subtree_array(ett, array_length(ett));
107 proto_reg_handoff_btsco(void)
109 dissector_handle_t bthci_sco_handle;
111 bthci_sco_handle = find_dissector("bthci_sco");
112 dissector_add_uint("hci_h4.type", HCI_H4_TYPE_SCO, bthci_sco_handle);
113 dissector_add_uint("hci_h1.type", BTHCI_CHANNEL_SCO, bthci_sco_handle);