2006-05-27 06:45:46 +00:00
|
|
|
/* packet-bthci_sco.c
|
|
|
|
* Routines for the Bluetooth SCO dissection
|
|
|
|
* Copyright 2002, Christoph Scholz <scholz@cs.uni-bonn.de>
|
|
|
|
*
|
|
|
|
* Refactored for wireshark checkin
|
|
|
|
* Ronnie Sahlberg 2006
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2006-05-27 06:45:46 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <epan/packet.h>
|
2013-12-07 01:01:31 +00:00
|
|
|
#include <epan/addr_resolv.h>
|
2012-09-21 10:49:44 +00:00
|
|
|
|
2014-12-12 10:24:44 +00:00
|
|
|
#include "packet-bluetooth.h"
|
2015-05-04 10:54:29 +00:00
|
|
|
#include "packet-bthci_sco.h"
|
2006-05-27 06:45:46 +00:00
|
|
|
|
|
|
|
/* Initialize the protocol and registered fields */
|
2012-09-10 12:08:27 +00:00
|
|
|
static int proto_bthci_sco = -1;
|
2015-04-30 13:44:42 +00:00
|
|
|
static int hf_bthci_sco_reserved = -1;
|
|
|
|
static int hf_bthci_sco_packet_status = -1;
|
2012-09-10 12:08:27 +00:00
|
|
|
static int hf_bthci_sco_chandle = -1;
|
|
|
|
static int hf_bthci_sco_length = -1;
|
|
|
|
static int hf_bthci_sco_data = -1;
|
2006-05-27 06:45:46 +00:00
|
|
|
|
2015-05-04 10:54:29 +00:00
|
|
|
static int hf_bthci_sco_connect_in = -1;
|
|
|
|
static int hf_bthci_sco_disconnect_in = -1;
|
|
|
|
static int hf_bthci_sco_stream_number = -1;
|
|
|
|
|
2006-05-27 06:45:46 +00:00
|
|
|
/* Initialize the subtree pointers */
|
2012-09-10 12:08:27 +00:00
|
|
|
static gint ett_bthci_sco = -1;
|
2006-05-27 06:45:46 +00:00
|
|
|
|
2015-05-04 10:54:29 +00:00
|
|
|
wmem_tree_t *bthci_sco_stream_numbers = NULL;
|
|
|
|
|
2014-03-03 11:12:03 +00:00
|
|
|
static dissector_handle_t bthci_sco_handle;
|
|
|
|
|
2015-04-30 13:44:42 +00:00
|
|
|
static const value_string packet_status_vals[] = {
|
|
|
|
{ 0x00, "Correctly Received Data"},
|
|
|
|
{ 0x01, "Possibly Invalid Data"},
|
|
|
|
{ 0x02, "No Data Received"},
|
|
|
|
{ 0x03, "Data Partially Lost"},
|
|
|
|
{0x0, NULL}
|
|
|
|
};
|
|
|
|
|
2013-03-19 13:51:52 +00:00
|
|
|
void proto_register_bthci_sco(void);
|
|
|
|
void proto_reg_handoff_bthci_sco(void);
|
2006-05-27 06:45:46 +00:00
|
|
|
|
|
|
|
/* Code to actually dissect the packets */
|
2013-11-02 19:20:04 +00:00
|
|
|
static gint
|
2016-03-28 19:02:17 +00:00
|
|
|
dissect_bthci_sco(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
2006-05-27 06:45:46 +00:00
|
|
|
{
|
2014-12-12 10:24:44 +00:00
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *bthci_sco_tree;
|
|
|
|
gint offset = 0;
|
|
|
|
guint16 flags;
|
|
|
|
bluetooth_data_t *bluetooth_data;
|
|
|
|
wmem_tree_key_t key[6];
|
2013-12-07 01:01:31 +00:00
|
|
|
guint32 k_connection_handle;
|
|
|
|
guint32 k_frame_number;
|
|
|
|
guint32 k_interface_id;
|
|
|
|
guint32 k_adapter_id;
|
|
|
|
remote_bdaddr_t *remote_bdaddr;
|
|
|
|
const gchar *localhost_name;
|
2018-09-08 19:47:14 +00:00
|
|
|
guint8 *localhost_bdaddr;
|
2013-12-07 01:01:31 +00:00
|
|
|
const gchar *localhost_ether_addr;
|
|
|
|
gchar *localhost_addr_name;
|
|
|
|
gint localhost_length;
|
|
|
|
localhost_bdaddr_entry_t *localhost_bdaddr_entry;
|
|
|
|
localhost_name_entry_t *localhost_name_entry;
|
2015-05-01 13:13:13 +00:00
|
|
|
chandle_session_t *chandle_session;
|
|
|
|
wmem_tree_t *subtree;
|
|
|
|
proto_item *sub_item;
|
2015-05-04 10:54:29 +00:00
|
|
|
bthci_sco_stream_number_t *sco_stream_number;
|
2013-11-02 19:20:04 +00:00
|
|
|
|
2015-02-26 13:38:57 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_bthci_sco, tvb, offset, tvb_captured_length(tvb), ENC_NA);
|
2013-11-02 19:20:04 +00:00
|
|
|
bthci_sco_tree = proto_item_add_subtree(ti, ett_bthci_sco);
|
2006-05-27 06:45:46 +00:00
|
|
|
|
2013-03-30 21:47:27 +00:00
|
|
|
switch (pinfo->p2p_dir) {
|
|
|
|
case P2P_DIR_SENT:
|
2013-10-29 14:09:20 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Sent ");
|
2013-03-30 21:47:27 +00:00
|
|
|
break;
|
|
|
|
case P2P_DIR_RECV:
|
2013-10-29 14:09:20 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Rcvd ");
|
2013-03-30 21:47:27 +00:00
|
|
|
break;
|
|
|
|
default:
|
2015-01-18 09:44:04 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "UnknownDirection ");
|
2013-03-30 21:47:27 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2015-04-30 13:44:42 +00:00
|
|
|
proto_tree_add_item(bthci_sco_tree, hf_bthci_sco_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
|
|
|
|
proto_tree_add_item(bthci_sco_tree, hf_bthci_sco_packet_status, tvb, offset, 2, ENC_LITTLE_ENDIAN);
|
|
|
|
proto_tree_add_item(bthci_sco_tree, hf_bthci_sco_chandle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
|
2013-12-07 01:01:31 +00:00
|
|
|
flags = tvb_get_letohs(tvb, offset);
|
2013-03-19 13:51:52 +00:00
|
|
|
offset += 2;
|
2006-05-27 06:45:46 +00:00
|
|
|
|
2012-09-10 12:08:27 +00:00
|
|
|
proto_tree_add_item(bthci_sco_tree, hf_bthci_sco_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
|
2012-03-12 14:40:09 +00:00
|
|
|
offset++;
|
2006-05-27 06:45:46 +00:00
|
|
|
|
2014-12-12 10:24:44 +00:00
|
|
|
bluetooth_data = (bluetooth_data_t *) data;
|
|
|
|
DISSECTOR_ASSERT(bluetooth_data);
|
2013-12-07 01:01:31 +00:00
|
|
|
|
2014-12-12 10:24:44 +00:00
|
|
|
k_interface_id = bluetooth_data->interface_id;
|
|
|
|
k_adapter_id = bluetooth_data->adapter_id;
|
2013-12-07 01:01:31 +00:00
|
|
|
k_connection_handle = flags & 0x0fff;
|
2016-01-24 03:40:51 +00:00
|
|
|
k_frame_number = pinfo->num;
|
2013-12-07 01:01:31 +00:00
|
|
|
|
|
|
|
key[0].length = 1;
|
|
|
|
key[0].key = &k_interface_id;
|
|
|
|
key[1].length = 1;
|
|
|
|
key[1].key = &k_adapter_id;
|
2015-05-04 10:54:29 +00:00
|
|
|
key[2].length = 0;
|
|
|
|
key[2].key = NULL;
|
|
|
|
|
|
|
|
subtree = (wmem_tree_t *) wmem_tree_lookup32_array(bthci_sco_stream_numbers, key);
|
2016-01-24 03:40:51 +00:00
|
|
|
sco_stream_number = (subtree) ? (bthci_sco_stream_number_t *) wmem_tree_lookup32_le(subtree, pinfo->num) : NULL;
|
2015-05-04 10:54:29 +00:00
|
|
|
|
2013-12-07 01:01:31 +00:00
|
|
|
key[2].length = 1;
|
|
|
|
key[2].key = &k_connection_handle;
|
2015-05-01 13:13:13 +00:00
|
|
|
key[3].length = 0;
|
|
|
|
key[3].key = NULL;
|
|
|
|
|
|
|
|
subtree = (wmem_tree_t *) wmem_tree_lookup32_array(bluetooth_data->chandle_sessions, key);
|
2016-01-24 03:40:51 +00:00
|
|
|
chandle_session = (subtree) ? (chandle_session_t *) wmem_tree_lookup32_le(subtree, pinfo->num) : NULL;
|
2015-05-01 13:13:13 +00:00
|
|
|
if (!(chandle_session &&
|
2016-01-24 03:40:51 +00:00
|
|
|
chandle_session->connect_in_frame < pinfo->num &&
|
|
|
|
chandle_session->disconnect_in_frame > pinfo->num)){
|
2015-05-01 13:13:13 +00:00
|
|
|
chandle_session = NULL;
|
|
|
|
}
|
|
|
|
|
2013-12-07 01:01:31 +00:00
|
|
|
key[3].length = 1;
|
|
|
|
key[3].key = &k_frame_number;
|
|
|
|
key[4].length = 0;
|
|
|
|
key[4].key = NULL;
|
|
|
|
|
|
|
|
/* remote bdaddr and name */
|
2014-12-12 10:24:44 +00:00
|
|
|
remote_bdaddr = (remote_bdaddr_t *)wmem_tree_lookup32_array_le(bluetooth_data->chandle_to_bdaddr, key);
|
|
|
|
if (remote_bdaddr && remote_bdaddr->interface_id == bluetooth_data->interface_id &&
|
|
|
|
remote_bdaddr->adapter_id == bluetooth_data->adapter_id &&
|
2013-12-07 01:01:31 +00:00
|
|
|
remote_bdaddr->chandle == (flags & 0x0fff)) {
|
|
|
|
guint32 k_bd_addr_oui;
|
|
|
|
guint32 k_bd_addr_id;
|
|
|
|
guint32 bd_addr_oui;
|
|
|
|
guint32 bd_addr_id;
|
|
|
|
device_name_t *device_name;
|
|
|
|
const gchar *remote_name;
|
|
|
|
const gchar *remote_ether_addr;
|
|
|
|
gchar *remote_addr_name;
|
|
|
|
gint remote_length;
|
|
|
|
|
|
|
|
bd_addr_oui = remote_bdaddr->bd_addr[0] << 16 | remote_bdaddr->bd_addr[1] << 8 | remote_bdaddr->bd_addr[2];
|
|
|
|
bd_addr_id = remote_bdaddr->bd_addr[3] << 16 | remote_bdaddr->bd_addr[4] << 8 | remote_bdaddr->bd_addr[5];
|
|
|
|
|
|
|
|
k_bd_addr_oui = bd_addr_oui;
|
|
|
|
k_bd_addr_id = bd_addr_id;
|
2016-01-24 03:40:51 +00:00
|
|
|
k_frame_number = pinfo->num;
|
2013-12-07 01:01:31 +00:00
|
|
|
|
|
|
|
key[0].length = 1;
|
2014-12-12 10:24:44 +00:00
|
|
|
key[0].key = &k_interface_id;
|
2013-12-07 01:01:31 +00:00
|
|
|
key[1].length = 1;
|
2014-12-12 10:24:44 +00:00
|
|
|
key[1].key = &k_adapter_id;
|
2013-12-07 01:01:31 +00:00
|
|
|
key[2].length = 1;
|
2014-12-12 10:24:44 +00:00
|
|
|
key[2].key = &k_bd_addr_id;
|
|
|
|
key[3].length = 1;
|
|
|
|
key[3].key = &k_bd_addr_oui;
|
|
|
|
key[4].length = 1;
|
|
|
|
key[4].key = &k_frame_number;
|
|
|
|
key[5].length = 0;
|
|
|
|
key[5].key = NULL;
|
|
|
|
|
|
|
|
device_name = (device_name_t *)wmem_tree_lookup32_array_le(bluetooth_data->bdaddr_to_name, key);
|
2013-12-07 01:01:31 +00:00
|
|
|
if (device_name && device_name->bd_addr_oui == bd_addr_oui && device_name->bd_addr_id == bd_addr_id)
|
|
|
|
remote_name = device_name->name;
|
|
|
|
else
|
|
|
|
remote_name = "";
|
|
|
|
|
|
|
|
remote_ether_addr = get_ether_name(remote_bdaddr->bd_addr);
|
|
|
|
remote_length = (gint)(strlen(remote_ether_addr) + 3 + strlen(remote_name) + 1);
|
|
|
|
remote_addr_name = (gchar *)wmem_alloc(pinfo->pool, remote_length);
|
|
|
|
|
|
|
|
g_snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name);
|
|
|
|
|
|
|
|
if (pinfo->p2p_dir == P2P_DIR_RECV) {
|
2015-10-21 19:04:16 +00:00
|
|
|
set_address(&pinfo->net_src, AT_STRINGZ, (int)strlen(remote_name) + 1, remote_name);
|
|
|
|
set_address(&pinfo->dl_src, AT_ETHER, 6, remote_bdaddr->bd_addr);
|
|
|
|
set_address(&pinfo->src, AT_STRINGZ, (int)strlen(remote_addr_name) + 1, remote_addr_name);
|
2013-12-07 01:01:31 +00:00
|
|
|
} else if (pinfo->p2p_dir == P2P_DIR_SENT) {
|
2015-10-21 19:04:16 +00:00
|
|
|
set_address(&pinfo->net_dst, AT_STRINGZ, (int)strlen(remote_name) + 1, remote_name);
|
|
|
|
set_address(&pinfo->dl_dst, AT_ETHER, 6, remote_bdaddr->bd_addr);
|
|
|
|
set_address(&pinfo->dst, AT_STRINGZ, (int)strlen(remote_addr_name) + 1, remote_addr_name);
|
2013-12-07 01:01:31 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (pinfo->p2p_dir == P2P_DIR_RECV) {
|
2015-10-21 19:04:16 +00:00
|
|
|
set_address(&pinfo->net_src, AT_STRINGZ, 1, "");
|
|
|
|
set_address(&pinfo->dl_src, AT_STRINGZ, 1, "");
|
|
|
|
set_address(&pinfo->src, AT_STRINGZ, 10, "remote ()");
|
2013-12-07 01:01:31 +00:00
|
|
|
} else if (pinfo->p2p_dir == P2P_DIR_SENT) {
|
2015-10-21 19:04:16 +00:00
|
|
|
set_address(&pinfo->net_dst, AT_STRINGZ, 1, "");
|
|
|
|
set_address(&pinfo->dl_dst, AT_STRINGZ, 1, "");
|
|
|
|
set_address(&pinfo->dst, AT_STRINGZ, 10, "remote ()");
|
2013-12-07 01:01:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-12 10:24:44 +00:00
|
|
|
k_interface_id = bluetooth_data->interface_id;
|
|
|
|
k_adapter_id = bluetooth_data->adapter_id;
|
2016-01-24 03:40:51 +00:00
|
|
|
k_frame_number = pinfo->num;
|
2013-12-07 01:01:31 +00:00
|
|
|
|
|
|
|
/* localhost bdaddr and name */
|
|
|
|
key[0].length = 1;
|
|
|
|
key[0].key = &k_interface_id;
|
|
|
|
key[1].length = 1;
|
|
|
|
key[1].key = &k_adapter_id;
|
|
|
|
key[2].length = 1;
|
|
|
|
key[2].key = &k_frame_number;
|
|
|
|
key[3].length = 0;
|
|
|
|
key[3].key = NULL;
|
|
|
|
|
|
|
|
|
2014-12-12 10:24:44 +00:00
|
|
|
localhost_bdaddr_entry = (localhost_bdaddr_entry_t *)wmem_tree_lookup32_array_le(bluetooth_data->localhost_bdaddr, key);
|
2018-09-08 19:47:14 +00:00
|
|
|
localhost_bdaddr = (guint8 *) wmem_alloc(pinfo->pool, 6);
|
2014-12-12 10:24:44 +00:00
|
|
|
if (localhost_bdaddr_entry && localhost_bdaddr_entry->interface_id == bluetooth_data->interface_id &&
|
|
|
|
localhost_bdaddr_entry->adapter_id == bluetooth_data->adapter_id) {
|
2013-12-07 01:01:31 +00:00
|
|
|
|
|
|
|
localhost_ether_addr = get_ether_name(localhost_bdaddr_entry->bd_addr);
|
|
|
|
memcpy(localhost_bdaddr, localhost_bdaddr_entry->bd_addr, 6);
|
|
|
|
} else {
|
|
|
|
localhost_ether_addr = "localhost";
|
|
|
|
/* XXX - is this the right value to use? */
|
|
|
|
memset(localhost_bdaddr, 0, 6);
|
|
|
|
}
|
|
|
|
|
2014-12-12 10:24:44 +00:00
|
|
|
localhost_name_entry = (localhost_name_entry_t *)wmem_tree_lookup32_array_le(bluetooth_data->localhost_name, key);
|
|
|
|
if (localhost_name_entry && localhost_name_entry->interface_id == bluetooth_data->interface_id &&
|
|
|
|
localhost_name_entry->adapter_id == bluetooth_data->adapter_id)
|
2013-12-07 01:01:31 +00:00
|
|
|
localhost_name = localhost_name_entry->name;
|
|
|
|
else
|
|
|
|
localhost_name = "";
|
|
|
|
|
|
|
|
localhost_length = (gint)(strlen(localhost_ether_addr) + 3 + strlen(localhost_name) + 1);
|
|
|
|
localhost_addr_name = (gchar *)wmem_alloc(pinfo->pool, localhost_length);
|
|
|
|
|
|
|
|
g_snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name);
|
|
|
|
|
|
|
|
if (pinfo->p2p_dir == P2P_DIR_RECV) {
|
2015-10-21 19:04:16 +00:00
|
|
|
set_address(&pinfo->net_dst, AT_STRINGZ, (int)strlen(localhost_name) + 1, localhost_name);
|
|
|
|
set_address(&pinfo->dl_dst, AT_ETHER, 6, localhost_bdaddr);
|
|
|
|
set_address(&pinfo->dst, AT_STRINGZ, (int)strlen(localhost_addr_name) + 1, localhost_addr_name);
|
2013-12-07 01:01:31 +00:00
|
|
|
} else if (pinfo->p2p_dir == P2P_DIR_SENT) {
|
2015-10-21 19:04:16 +00:00
|
|
|
set_address(&pinfo->net_src, AT_STRINGZ, (int)strlen(localhost_name) + 1, localhost_name);
|
|
|
|
set_address(&pinfo->dl_src, AT_ETHER, 6, localhost_bdaddr);
|
|
|
|
set_address(&pinfo->src, AT_STRINGZ, (int)strlen(localhost_addr_name) + 1, localhost_addr_name);
|
2013-12-07 01:01:31 +00:00
|
|
|
}
|
|
|
|
|
2015-02-26 13:38:57 +00:00
|
|
|
proto_tree_add_item(bthci_sco_tree, hf_bthci_sco_data, tvb, offset, tvb_reported_length(tvb), ENC_NA);
|
2013-11-02 19:20:04 +00:00
|
|
|
|
2015-05-01 13:13:13 +00:00
|
|
|
if (chandle_session) {
|
|
|
|
sub_item = proto_tree_add_uint(bthci_sco_tree, hf_bthci_sco_connect_in, tvb, 0, 0, chandle_session->connect_in_frame);
|
2019-04-03 21:32:30 +00:00
|
|
|
proto_item_set_generated(sub_item);
|
2015-05-01 13:13:13 +00:00
|
|
|
|
|
|
|
if (chandle_session->disconnect_in_frame < G_MAXUINT32) {
|
|
|
|
sub_item = proto_tree_add_uint(bthci_sco_tree, hf_bthci_sco_disconnect_in, tvb, 0, 0, chandle_session->disconnect_in_frame);
|
2019-04-03 21:32:30 +00:00
|
|
|
proto_item_set_generated(sub_item);
|
2015-05-01 13:13:13 +00:00
|
|
|
}
|
|
|
|
}
|
2015-05-04 10:54:29 +00:00
|
|
|
if (sco_stream_number) {
|
|
|
|
sub_item = proto_tree_add_uint(bthci_sco_tree, hf_bthci_sco_stream_number, tvb, 0, 0, sco_stream_number->stream_number);
|
2019-04-03 21:32:30 +00:00
|
|
|
proto_item_set_generated(sub_item);
|
2015-05-04 10:54:29 +00:00
|
|
|
}
|
2015-05-01 13:13:13 +00:00
|
|
|
|
2015-02-26 13:38:57 +00:00
|
|
|
return tvb_reported_length(tvb);
|
2006-05-27 06:45:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2012-09-10 12:08:27 +00:00
|
|
|
proto_register_bthci_sco(void)
|
2011-10-21 02:10:19 +00:00
|
|
|
{
|
2012-03-12 14:40:09 +00:00
|
|
|
static hf_register_info hf[] = {
|
2015-04-30 13:44:42 +00:00
|
|
|
{ &hf_bthci_sco_reserved,
|
|
|
|
{ "Reserved", "bthci_sco.reserved",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0xC000,
|
|
|
|
NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_bthci_sco_packet_status,
|
|
|
|
{ "Packet Status", "bthci_sco.packet_status",
|
|
|
|
FT_UINT16, BASE_HEX, VALS(packet_status_vals), 0x3000,
|
|
|
|
NULL, HFILL }
|
|
|
|
},
|
2012-09-10 12:08:27 +00:00
|
|
|
{ &hf_bthci_sco_chandle,
|
2012-03-12 14:40:09 +00:00
|
|
|
{ "Connection Handle", "bthci_sco.chandle",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0FFF,
|
|
|
|
NULL, HFILL }
|
|
|
|
},
|
2015-05-01 13:13:13 +00:00
|
|
|
{ &hf_bthci_sco_connect_in,
|
|
|
|
{ "Connect in frame", "bthci_sco.connect_in",
|
|
|
|
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_bthci_sco_disconnect_in,
|
|
|
|
{ "Disconnect in frame", "bthci_sco.disconnect_in",
|
|
|
|
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }
|
|
|
|
},
|
2015-05-04 10:54:29 +00:00
|
|
|
{ &hf_bthci_sco_stream_number,
|
|
|
|
{ "Stream Number", "bthci_sco.stream_number",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x00,
|
|
|
|
NULL, HFILL }
|
|
|
|
},
|
2012-09-10 12:08:27 +00:00
|
|
|
{ &hf_bthci_sco_length,
|
2012-03-12 14:40:09 +00:00
|
|
|
{ "Data Total Length", "bthci_sco.length",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }
|
|
|
|
},
|
2012-09-10 12:08:27 +00:00
|
|
|
{ &hf_bthci_sco_data,
|
|
|
|
{ "Data", "bthci_sco.data",
|
2012-03-12 14:40:09 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Setup protocol subtree array */
|
|
|
|
static gint *ett[] = {
|
2013-03-19 13:51:52 +00:00
|
|
|
&ett_bthci_sco
|
2012-03-12 14:40:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Register the protocol name and description */
|
2012-09-10 12:08:27 +00:00
|
|
|
proto_bthci_sco = proto_register_protocol("Bluetooth HCI SCO Packet", "HCI_SCO", "bthci_sco");
|
2015-12-09 04:04:01 +00:00
|
|
|
bthci_sco_handle = register_dissector("bthci_sco", dissect_bthci_sco, proto_bthci_sco);
|
2012-03-12 14:40:09 +00:00
|
|
|
|
2015-05-04 10:54:29 +00:00
|
|
|
bthci_sco_stream_numbers = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
|
|
|
|
|
2012-03-12 14:40:09 +00:00
|
|
|
/* Required function calls to register the header fields and subtrees used */
|
2012-09-10 12:08:27 +00:00
|
|
|
proto_register_field_array(proto_bthci_sco, hf, array_length(hf));
|
2012-03-12 14:40:09 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2006-05-27 06:45:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-10-21 02:10:19 +00:00
|
|
|
void
|
2012-09-10 12:08:27 +00:00
|
|
|
proto_reg_handoff_bthci_sco(void)
|
2006-05-27 06:45:46 +00:00
|
|
|
{
|
2012-03-12 14:40:09 +00:00
|
|
|
dissector_add_uint("hci_h4.type", HCI_H4_TYPE_SCO, bthci_sco_handle);
|
|
|
|
dissector_add_uint("hci_h1.type", BTHCI_CHANNEL_SCO, bthci_sco_handle);
|
2006-05-27 06:45:46 +00:00
|
|
|
}
|
|
|
|
|
2012-10-09 10:36:04 +00:00
|
|
|
/*
|
2019-07-26 18:43:17 +00:00
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
2012-10-09 10:36:04 +00:00
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|