aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-03-18 06:04:09 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-03-18 06:04:09 +0000
commitc2976ac50824db30343fa2cee70d05ac83423ef3 (patch)
treedfdc963c67873edbfeae35145696fa7399a85333 /epan
parent5726546c6330267c15b9b06814f0c73b5c7aa5ba (diff)
From Michal Labedzki:
Fix issues discovered by cppcheck Also use global OUI array in AVRCP. Thanks to Evan Huus for cppcheck. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8304 svn path=/trunk/; revision=48387
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-btavctp.c5
-rw-r--r--epan/dissectors/packet-btavdtp.c2
-rw-r--r--epan/dissectors/packet-btavrcp.c107
-rw-r--r--epan/dissectors/packet-btbnep.c3
-rw-r--r--epan/dissectors/packet-bthci_cmd.c4
-rw-r--r--epan/dissectors/packet-bthci_evt.c304
-rw-r--r--epan/dissectors/packet-btl2cap.c89
-rw-r--r--epan/dissectors/packet-btobex.c9
-rw-r--r--epan/dissectors/packet-btrfcomm.c14
-rw-r--r--epan/dissectors/packet-llc.c2
10 files changed, 249 insertions, 290 deletions
diff --git a/epan/dissectors/packet-btavctp.c b/epan/dissectors/packet-btavctp.c
index 0f10cdd6f2..e45a5fd5a4 100644
--- a/epan/dissectors/packet-btavctp.c
+++ b/epan/dissectors/packet-btavctp.c
@@ -112,7 +112,6 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint number_of_packets = 0;
guint length;
guint i_frame;
- fragment_t *fragment;
void *save_private_data;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AVCTP");
@@ -193,6 +192,7 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
} else {
+ fragment_t *fragment;
emem_tree_key_t key[6];
guint32 k_interface_id;
guint32 k_adapter_id;
@@ -309,7 +309,6 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} else if (packet_type == PACKET_TYPE_END) {
guint i_length = 0;
- guint8 *reassembled;
fragments = (fragments_t *)se_tree_lookup32_array_le(reassembling, key);
if (!(fragments && fragments->interface_id == interface_id &&
@@ -360,6 +359,8 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"Unexpected frame");
call_dissector(data_handle, next_tvb, pinfo, tree);
} else {
+ guint8 *reassembled;
+
for (i_frame = 1; i_frame <= fragments->count; ++i_frame) {
fragment = (fragment_t *)se_tree_lookup32_le(fragments->fragment, i_frame);
length += fragment->length;
diff --git a/epan/dissectors/packet-btavdtp.c b/epan/dissectors/packet-btavdtp.c
index f4a2c03cc5..1129395a21 100644
--- a/epan/dissectors/packet-btavdtp.c
+++ b/epan/dissectors/packet-btavdtp.c
@@ -918,7 +918,6 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *btavdtp_tree = NULL;
proto_tree *signal_tree = NULL;
proto_item *signal_item = NULL;
- proto_item *pitem;
btl2cap_data_t *l2cap_data;
gint offset = 0;
gint i_sep = 1;
@@ -1286,6 +1285,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
case SIGNAL_ID_DELAY_REPORT:
if (message_type == MESSAGE_TYPE_COMMAND) {
+ proto_item *pitem;
delay = tvb_get_ntohs(tvb, offset + 1);
col_append_fstr(pinfo->cinfo, COL_INFO, "(%u.%u ms)", delay/10, delay%10);
offset = dissect_seid(tvb, pinfo, btavdtp_tree, offset, SEID_ACP, 0, NULL);
diff --git a/epan/dissectors/packet-btavrcp.c b/epan/dissectors/packet-btavrcp.c
index 8f352a4f5e..0b36b70b35 100644
--- a/epan/dissectors/packet-btavrcp.c
+++ b/epan/dissectors/packet-btavrcp.c
@@ -29,6 +29,7 @@
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/expert.h>
+#include <epan/oui.h>
#include "packet-btl2cap.h"
#include "packet-btsdp.h"
@@ -254,8 +255,6 @@ static gint ett_btavrcp_path = -1;
#define STATUS_OK 0x04
-#define COMPANY_BT_SIG 0x001958
-
static emem_tree_t *reassembling = NULL;
static emem_tree_t *timing = NULL;
@@ -374,11 +373,6 @@ static const value_string passthrough_operation_vals[] = {
{ 0, NULL }
};
-static const value_string company_id_vals[] = {
- { COMPANY_BT_SIG, "BT SIG" },
- { 0, NULL }
-};
-
static const value_string pdu_id_vals[] = {
{ PDU_GET_CAPABILITIES, "GetCapabilities" },
{ PDU_LIST_PLAYER_APPLICATION_SETTING_ATTRIBUTES, "ListPlayerApplicationSettingAttributes" },
@@ -642,7 +636,7 @@ dissect_attribute_entries(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 2;
proto_tree_add_item(entry_tree, hf_btavrcp_setting_value_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- proto_tree_add_item(entry_tree, hf_btavrcp_setting_value, tvb, offset, value_length, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(entry_tree, hf_btavrcp_setting_value, tvb, offset, value_length, ENC_UTF_8);
offset += value_length;
}
@@ -808,7 +802,7 @@ dissect_item_mediaplayer(tvbuff_t *tvb, proto_tree *tree, gint offset)
displayable_name_length = tvb_get_ntohs(tvb, offset);
offset += 2;
- proto_tree_add_item(ptree, hf_btavrcp_displayable_name, tvb, offset, displayable_name_length, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(ptree, hf_btavrcp_displayable_name, tvb, offset, displayable_name_length, ENC_UTF_8);
offset += displayable_name_length;
return offset;
@@ -853,7 +847,7 @@ dissect_item_media_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
displayable_name_length = tvb_get_ntohs(tvb, offset);
offset += 2;
- proto_tree_add_item(ptree, hf_btavrcp_displayable_name, tvb, offset, displayable_name_length, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(ptree, hf_btavrcp_displayable_name, tvb, offset, displayable_name_length, ENC_UTF_8);
offset += displayable_name_length;
proto_tree_add_item(ptree, hf_btavrcp_number_of_attributes, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -908,7 +902,7 @@ dissect_item_folder(tvbuff_t *tvb, proto_tree *tree, gint offset)
displayable_name_length = tvb_get_ntohs(tvb, offset);
offset += 2;
- proto_tree_add_item(ptree, hf_btavrcp_displayable_name, tvb, offset, displayable_name_length, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(ptree, hf_btavrcp_displayable_name, tvb, offset, displayable_name_length, ENC_UTF_8);
offset += displayable_name_length;
return offset;
@@ -994,12 +988,13 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gint offset, guint ctype, guint32 *op, guint32 *op_arg,
gboolean is_command)
{
- guint pdu_id;
- guint company_id;
- guint event_id;
- guint packet_type;
- guint parameter_length;
- guint length;
+ proto_item *pitem;
+ guint pdu_id;
+ guint company_id;
+ guint event_id;
+ guint packet_type;
+ guint parameter_length;
+ guint length;
emem_tree_key_t key[7];
guint32 k_interface_id;
guint32 k_adapter_id;
@@ -1011,7 +1006,11 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint32 adapter_id;
guint32 chandle;
guint32 psm;
+ guint volume;
+ guint volume_percent;
btavctp_data_t *avctp_data;
+ fragment_t *fragment;
+ data_fragment_t *data_fragment;
avctp_data = (btavctp_data_t *) pinfo->private_data;
@@ -1026,7 +1025,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
company_id = tvb_get_ntoh24(tvb, offset);
offset += 3;
- if (company_id == COMPANY_BT_SIG) {
+ if (company_id == OUI_BLUETOOTH) {
proto_tree_add_item(tree, hf_btavrcp_bt_pdu_id, tvb, offset, 1, ENC_BIG_ENDIAN);
} else {
@@ -1041,7 +1040,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*op = pdu_id | (company_id << 8);
offset += 1;
- if (company_id != COMPANY_BT_SIG) {
+ if (company_id != OUI_BLUETOOTH) {
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s",
val_to_str_const(pdu_id, NULL, "Unknown PDU ID"));
}
@@ -1055,7 +1054,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
parameter_length = tvb_get_ntohs(tvb, offset);
offset += 2;
- if (company_id != COMPANY_BT_SIG)
+ if (company_id != OUI_BLUETOOTH)
return offset;
col_append_fstr(pinfo->cinfo, COL_INFO, " - %s",
@@ -1066,9 +1065,6 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
length = tvb_ensure_length_remaining(tvb, offset);
if (packet_type == PACKET_TYPE_START) {
if (pinfo->fd->flags.visited == 0) {
- fragment_t *fragment;
- data_fragment_t *data_fragment;
-
k_interface_id = interface_id;
k_adapter_id = adapter_id;
k_chandle = chandle;
@@ -1119,9 +1115,6 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
return offset;
} else if (packet_type == PACKET_TYPE_CONTINUE) {
if (pinfo->fd->flags.visited == 0) {
- fragment_t *fragment;
- data_fragment_t *data_fragment;
-
k_interface_id = interface_id;
k_adapter_id = adapter_id;
k_chandle = chandle;
@@ -1165,12 +1158,8 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_append_fstr(pinfo->cinfo, COL_INFO, " [continue]");
return offset;
} else if (packet_type == PACKET_TYPE_END) {
- fragment_t *fragment;
- data_fragment_t *data_fragment;
guint i_frame;
tvbuff_t *next_tvb;
- guint i_length = 0;
- guint8 *reassembled;
col_append_fstr(pinfo->cinfo, COL_INFO, " [end]");
@@ -1202,6 +1191,8 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
fragment->chandle == chandle &&
fragment->psm == psm &&
fragment->op == (pdu_id | (company_id << 8))) {
+
+
if (fragment->state == 1 && pinfo->fd->flags.visited == 0) {
fragment->end_frame_number = pinfo->fd->num;
fragment->count += 1;
@@ -1216,7 +1207,8 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* reassembling*/
length = 0;
if (fragment->state == 2) {
- proto_item *pitem = NULL;
+ guint i_length = 0;
+ guint8 *reassembled;
for (i_frame = 1; i_frame <= fragment->count; ++i_frame) {
data_fragment = (data_fragment_t *)se_tree_lookup32_le(fragment->fragments, i_frame);
@@ -1407,7 +1399,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
attribute_name_length = tvb_get_ntohs(tvb, offset);
offset += 1;
- proto_tree_add_item(tree, hf_btavrcp_attribute_name, tvb, offset, attribute_name_length, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(tree, hf_btavrcp_attribute_name, tvb, offset, attribute_name_length, ENC_UTF_8);
offset += attribute_name_length;
}
}
@@ -1447,7 +1439,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
attribute_value_length = tvb_get_ntohs(tvb, offset);
offset += 1;
- proto_tree_add_item(tree, hf_btavrcp_attribute_value, tvb, offset, attribute_value_length, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(tree, hf_btavrcp_attribute_value, tvb, offset, attribute_value_length, ENC_UTF_8);
offset += attribute_value_length;
}
}
@@ -1485,7 +1477,6 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (is_command) {
guint number_of_attributes;
guint64 identifier;
- proto_item *pitem = NULL;
proto_tree_add_item(tree, hf_btavrcp_identifier, tvb, offset, 8, ENC_BIG_ENDIAN);
identifier = tvb_get_ntoh64(tvb, offset);
@@ -1545,15 +1536,12 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint number_of_settings;
guint i_setting;
guint64 identifier;
- guint volume;
- guint volume_percent;
guint play_status;
guint song_position;
guint battery_status;
guint uid_counter;
guint player_id;
guint system_status;
- proto_item *pitem = NULL;
proto_tree_add_item(tree, hf_btavrcp_event_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
@@ -1671,8 +1659,6 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 1;
if (pinfo->fd->flags.visited == 0) {
- fragment_t *fragment;
-
k_interface_id = interface_id;
k_adapter_id = adapter_id;
k_chandle = chandle;
@@ -1722,8 +1708,6 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 1;
if (pinfo->fd->flags.visited == 0) {
- fragment_t *fragment;
-
k_interface_id = interface_id;
k_adapter_id = adapter_id;
k_chandle = chandle;
@@ -1761,33 +1745,14 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
break;
case PDU_SET_ABSOLUTE_VOLUME:
- if (is_command) {
- guint volume;
- guint volume_percent;
- proto_item *pitem;
-
- proto_tree_add_item(tree, hf_btavrcp_absolute_volume_rfa, tvb, offset, 1, ENC_BIG_ENDIAN);
- pitem = proto_tree_add_item(tree, hf_btavrcp_absolute_volume, tvb, offset, 1, ENC_BIG_ENDIAN);
- volume = tvb_get_guint8(tvb, offset) & 0x7F;
- volume_percent = (guint) ((double) volume * 100 / (double) 0x7F);
- offset += 1;
-
- proto_item_append_text(pitem, " (%u%%)", volume_percent);
- col_append_fstr(pinfo->cinfo, COL_INFO, " - Volume: %u%%", volume_percent);
- } else {
- guint volume;
- guint volume_percent;
- proto_item *pitem;
-
- proto_tree_add_item(tree, hf_btavrcp_absolute_volume_rfa, tvb, offset, 1, ENC_BIG_ENDIAN);
- pitem = proto_tree_add_item(tree, hf_btavrcp_absolute_volume, tvb, offset, 1, ENC_BIG_ENDIAN);
- volume = tvb_get_guint8(tvb, offset) & 0x7F;
- volume_percent = (guint) ((double) volume * 100 / (double) 0x7F);
- offset += 1;
-
- proto_item_append_text(pitem, " (%u%%)", volume_percent);
- col_append_fstr(pinfo->cinfo, COL_INFO, " - Volume: %u%%", volume_percent);
- }
+ proto_tree_add_item(tree, hf_btavrcp_absolute_volume_rfa, tvb, offset, 1, ENC_BIG_ENDIAN);
+ pitem = proto_tree_add_item(tree, hf_btavrcp_absolute_volume, tvb, offset, 1, ENC_BIG_ENDIAN);
+ volume = tvb_get_guint8(tvb, offset) & 0x7F;
+ volume_percent = (guint) ((double) volume * 100 / (double) 0x7F);
+ offset += 1;
+
+ proto_item_append_text(pitem, " (%u%%)", volume_percent);
+ col_append_fstr(pinfo->cinfo, COL_INFO, " - Volume: %u%%", volume_percent);
break;
case PDU_SET_ADDRESSED_PLAYER:
if (is_command) {
@@ -2048,7 +2013,7 @@ dissect_browsing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_btavrcp_uid_counter, tvb, offset, 2, ENC_BIG_ENDIAN);
uid_counter = tvb_get_ntohs(tvb, offset);
offset += 2;
- proto_tree_add_item(tree, hf_btavrcp_number_of_attributes, tvb, offset, 1, ENC_BIG_ENDIAN);
+ pitem = proto_tree_add_item(tree, hf_btavrcp_number_of_attributes, tvb, offset, 1, ENC_BIG_ENDIAN);
number_of_attributes = tvb_get_guint8(tvb, offset);
col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" G_GINT64_MODIFIER "x, UidCounter: 0x%04x",
@@ -2383,7 +2348,7 @@ proto_register_btavrcp(void)
},
{ &hf_btavrcp_company_id,
{ "Company ID", "btavrcp.company_id",
- FT_UINT24, BASE_HEX, VALS(company_id_vals), 0x00,
+ FT_UINT24, BASE_HEX, VALS(oui_vals), 0x00,
NULL, HFILL }
},
{ &hf_btavrcp_passthrough_state,
@@ -2408,7 +2373,7 @@ proto_register_btavrcp(void)
},
{ &hf_btavrcp_passthrough_company_id,
{ "Company ID", "btavrcp.passthrough.company_id",
- FT_UINT24, BASE_HEX, VALS(company_id_vals), 0x00,
+ FT_UINT24, BASE_HEX, VALS(oui_vals), 0x00,
NULL, HFILL }
},
{ &hf_btavrcp_unit_unknown,
diff --git a/epan/dissectors/packet-btbnep.c b/epan/dissectors/packet-btbnep.c
index 18372cc901..acb99caebe 100644
--- a/epan/dissectors/packet-btbnep.c
+++ b/epan/dissectors/packet-btbnep.c
@@ -281,7 +281,6 @@ dissect_btbnep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *addr_tree = NULL;
const guint8 *src_addr;
const guint8 *dst_addr;
- tvbuff_t *next_tvb;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BNEP");
col_clear(pinfo->cinfo, COL_INFO);
@@ -373,6 +372,8 @@ dissect_btbnep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ethertype(type, tvb, offset, pinfo, tree, btbnep_tree,
hf_btbnep_type, 0, 0);
} else {
+ tvbuff_t *next_tvb;
+
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-bthci_cmd.c b/epan/dissectors/packet-bthci_cmd.c
index 9770d80f55..0768ae6042 100644
--- a/epan/dissectors/packet-bthci_cmd.c
+++ b/epan/dissectors/packet-bthci_cmd.c
@@ -2430,7 +2430,7 @@ dissect_testing_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tre
return offset;
}
-static void
+static gint
dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint16 cmd_ocf)
{
proto_item *item;
@@ -2628,6 +2628,8 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
offset+=tvb_length_remaining(tvb, offset);
break;
}
+
+ return offset;
}
/* Code to actually dissect the packets */
diff --git a/epan/dissectors/packet-bthci_evt.c b/epan/dissectors/packet-bthci_evt.c
index 2ab049fa73..88cc25c3ba 100644
--- a/epan/dissectors/packet-bthci_evt.c
+++ b/epan/dissectors/packet-bthci_evt.c
@@ -929,7 +929,7 @@ dissect_bthci_evt_conn_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, p
guint16 connection_handle;
guint8 bd_addr[6];
guint8 status;
- hci_data_t *hci_data;
+ hci_data_t *hci_data = (hci_data_t *) pinfo->private_data;
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
status = tvb_get_guint8(tvb, offset);
@@ -940,7 +940,7 @@ dissect_bthci_evt_conn_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, p
offset+=2;
offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, bd_addr);
- if (!pinfo->fd->flags.visited && status == 0x00) {
+ if (!pinfo->fd->flags.visited && hci_data != NULL && status == 0x00) {
emem_tree_key_t key[5];
guint32 k_interface_id;
guint32 k_adapter_id;
@@ -948,32 +948,29 @@ dissect_bthci_evt_conn_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, p
guint32 k_frame_number;
remote_bdaddr_t *remote_bdaddr;
- hci_data = (hci_data_t *) pinfo->private_data;
- if (hci_data != NULL) {
- k_interface_id = hci_data->interface_id;
- k_adapter_id = hci_data->adapter_id;
- k_connection_handle = connection_handle;
- k_frame_number = pinfo->fd->num;
-
- 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_connection_handle;
- key[3].length = 1;
- key[3].key = &k_frame_number;
- key[4].length = 0;
- key[4].key = NULL;
-
- remote_bdaddr = se_alloc(sizeof(remote_bdaddr_t));
- remote_bdaddr->interface_id = hci_data->interface_id;
- remote_bdaddr->adapter_id = hci_data->adapter_id;
- remote_bdaddr->chandle = connection_handle;
- memcpy(remote_bdaddr->bd_addr, bd_addr, 6);
-
- se_tree_insert32_array(hci_data->chandle_to_bdaddr_table, key, remote_bdaddr);
- }
+ k_interface_id = hci_data->interface_id;
+ k_adapter_id = hci_data->adapter_id;
+ k_connection_handle = connection_handle;
+ k_frame_number = pinfo->fd->num;
+
+ 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_connection_handle;
+ key[3].length = 1;
+ key[3].key = &k_frame_number;
+ key[4].length = 0;
+ key[4].key = NULL;
+
+ remote_bdaddr = se_alloc(sizeof(remote_bdaddr_t));
+ remote_bdaddr->interface_id = hci_data->interface_id;
+ remote_bdaddr->adapter_id = hci_data->adapter_id;
+ remote_bdaddr->chandle = connection_handle;
+ memcpy(remote_bdaddr->bd_addr, bd_addr, 6);
+
+ se_tree_insert32_array(hci_data->chandle_to_bdaddr_table, key, remote_bdaddr);
}
@@ -1031,12 +1028,13 @@ dissect_bthci_evt_lmp_features(tvbuff_t *tvb, int offset, packet_info *pinfo _U_
{
guint8 fc_lag;
proto_item *item;
- proto_item *ti_lmp_features = NULL;
- proto_item *ti_lmp_subtree = NULL;
+ proto_item *ti_lmp_subtree = NULL;
- if(tree){
- ti_lmp_features=proto_tree_add_text(tree, tvb, offset, 8, "LMP_Features");
- ti_lmp_subtree=proto_item_add_subtree(ti_lmp_features, ett_lmp_subtree);
+ if (tree) {
+ proto_item *ti_lmp_features;
+
+ ti_lmp_features = proto_tree_add_text(tree, tvb, offset, 8, "LMP_Features");
+ ti_lmp_subtree = proto_item_add_subtree(ti_lmp_features, ett_lmp_subtree);
}
proto_tree_add_item(ti_lmp_subtree,hf_bthci_evt_lmp_feature_00, tvb, offset, 1, ENC_LITTLE_ENDIAN);
@@ -1178,7 +1176,8 @@ dissect_bthci_evt_read_remote_support_features_complete(tvbuff_t *tvb, int offse
static int
dissect_bthci_evt_remote_name_req_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
- guint8 bd_addr[6];
+ guint8 bd_addr[6];
+ hci_data_t *hci_data = (hci_data_t *) pinfo->private_data;
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
@@ -1186,8 +1185,8 @@ dissect_bthci_evt_remote_name_req_complete(tvbuff_t *tvb, int offset, packet_inf
offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, bd_addr);
proto_tree_add_item(tree, hf_bthci_evt_remote_name, tvb, offset, 248, ENC_ASCII|ENC_NA);
- if (!pinfo->fd->flags.visited) {
- hci_data_t *hci_data;
+ if (!pinfo->fd->flags.visited && hci_data != NULL) {
+
emem_tree_key_t key[4];
guint32 k_bd_addr_oui;
guint32 k_bd_addr_id;
@@ -1195,30 +1194,27 @@ dissect_bthci_evt_remote_name_req_complete(tvbuff_t *tvb, int offset, packet_inf
gchar *name;
device_name_t *device_name;
- hci_data = (hci_data_t *) pinfo->private_data;
- if (hci_data != NULL) {
- name = tvb_get_ephemeral_string(tvb, offset, 248);
-
- k_frame_number = pinfo->fd->num;
- k_bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
- k_bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
-
- key[0].length = 1;
- key[0].key = &k_bd_addr_id;
- key[1].length = 1;
- key[1].key = &k_bd_addr_oui;
- key[2].length = 1;
- key[2].key = &k_frame_number;
- key[3].length = 0;
- key[3].key = NULL;
-
- device_name = se_alloc(sizeof(device_name_t));
- device_name->bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
- device_name->bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
- device_name->name = se_strdup(name);
-
- se_tree_insert32_array(hci_data->bdaddr_to_name_table, key, device_name);
- }
+ name = tvb_get_ephemeral_string(tvb, offset, 248);
+
+ k_frame_number = pinfo->fd->num;
+ k_bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
+ k_bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
+
+ key[0].length = 1;
+ key[0].key = &k_bd_addr_id;
+ key[1].length = 1;
+ key[1].key = &k_bd_addr_oui;
+ key[2].length = 1;
+ key[2].key = &k_frame_number;
+ key[3].length = 0;
+ key[3].key = NULL;
+
+ device_name = se_alloc(sizeof(device_name_t));
+ device_name->bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
+ device_name->bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
+ device_name->name = se_strdup(name);
+
+ se_tree_insert32_array(hci_data->bdaddr_to_name_table, key, device_name);
}
offset += 248;
@@ -1541,8 +1537,9 @@ dissect_bthci_evt_eir_ad_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
{
guint16 i, j;
guint8 length, type;
- proto_item *ti_eir=NULL;
- proto_item *ti_eir_subtree=NULL;
+ proto_item *ti_eir = NULL;
+ proto_item *ti_eir_subtree = NULL;
+ hci_data_t *hci_data = (hci_data_t *) pinfo->private_data;
if(tree){
if(size == 240 ) { /* EIR data */
@@ -1615,8 +1612,7 @@ dissect_bthci_evt_eir_ad_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
case 0x09: /* Device Name, full */
proto_tree_add_item(ti_eir_struct_subtree, hf_bthci_evt_device_name, tvb, offset+i+2, length-1, ENC_ASCII|ENC_NA);
proto_item_append_text(ti_eir_struct,": %s", tvb_format_text(tvb,offset+i+2,length-1));
- if (!pinfo->fd->flags.visited && bd_addr) {
- hci_data_t *hci_data;
+ if (!pinfo->fd->flags.visited && hci_data != NULL &&bd_addr) {
emem_tree_key_t key[4];
guint32 k_bd_addr_oui;
guint32 k_bd_addr_id;
@@ -1624,30 +1620,27 @@ dissect_bthci_evt_eir_ad_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
gchar *name;
device_name_t *device_name;
- hci_data = (hci_data_t *) pinfo->private_data;
- if (hci_data != NULL) {
- name = tvb_get_ephemeral_string(tvb, offset+i+2, length-1);
-
- k_frame_number = pinfo->fd->num;
- k_bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
- k_bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
-
- key[0].length = 1;
- key[0].key = &k_bd_addr_id;
- key[1].length = 1;
- key[1].key = &k_bd_addr_oui;
- key[2].length = 1;
- key[2].key = &k_frame_number;
- key[3].length = 0;
- key[3].key = NULL;
-
- device_name = se_alloc(sizeof(device_name_t));
- device_name->bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
- device_name->bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
- device_name->name = se_strdup(name);
-
- se_tree_insert32_array(hci_data->bdaddr_to_name_table, key, device_name);
- }
+ name = tvb_get_ephemeral_string(tvb, offset+i+2, length-1);
+
+ k_frame_number = pinfo->fd->num;
+ k_bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
+ k_bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
+
+ key[0].length = 1;
+ key[0].key = &k_bd_addr_id;
+ key[1].length = 1;
+ key[1].key = &k_bd_addr_oui;
+ key[2].length = 1;
+ key[2].key = &k_frame_number;
+ key[3].length = 0;
+ key[3].key = NULL;
+
+ device_name = se_alloc(sizeof(device_name_t));
+ device_name->bd_addr_oui = bd_addr[0] << 16 | bd_addr[1] << 8 | bd_addr[2];
+ device_name->bd_addr_id = bd_addr[3] << 16 | bd_addr[4] << 8 | bd_addr[5];
+ device_name->name = se_strdup(name);
+
+ se_tree_insert32_array(hci_data->bdaddr_to_name_table, key, device_name);
}
break;
case 0x0A: /* Tx Power Level */
@@ -2062,16 +2055,17 @@ dissect_bthci_evt_amp_status_change(tvbuff_t *tvb, int offset, packet_info *pinf
static int
dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
- proto_item *ti_opcode;
- proto_tree *opcode_tree;
- proto_item *item;
- gint16 timeout;
- guint8 num8;
- guint i;
- guint16 com_opcode;
- guint32 accuracy;
- guint8 bd_addr[6];
- gboolean local_addr = FALSE;
+ proto_item *ti_opcode;
+ proto_tree *opcode_tree;
+ proto_item *item;
+ gint16 timeout;
+ guint8 num8;
+ guint i;
+ guint16 com_opcode;
+ guint32 accuracy;
+ guint8 bd_addr[6];
+ gboolean local_addr = FALSE;
+ hci_data_t *hci_data = (hci_data_t *) pinfo->private_data;
proto_tree_add_item(tree, hf_bthci_evt_num_command_packets, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
@@ -2180,35 +2174,31 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, packet_info *pinfo
offset++;
offset = dissect_bthci_evt_bd_addr(tvb, offset, pinfo, tree, bd_addr);
- if (!pinfo->fd->flags.visited && local_addr) {
- hci_data_t *hci_data;
+ if (!pinfo->fd->flags.visited && hci_data != NULL && local_addr) {
emem_tree_key_t key[4];
guint32 k_interface_id;
guint32 k_adapter_id;
guint32 k_frame_number;
localhost_bdaddr_entry_t *localhost_bdaddr_entry;
- hci_data = (hci_data_t *) pinfo->private_data;
- if (hci_data != NULL) {
- k_interface_id = hci_data->interface_id;
- k_adapter_id = hci_data->adapter_id;
- k_frame_number = pinfo->fd->num;
-
- 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;
-
- localhost_bdaddr_entry = se_alloc(sizeof(localhost_bdaddr_entry_t));
- localhost_bdaddr_entry->interface_id = k_interface_id;
- localhost_bdaddr_entry->adapter_id = k_adapter_id;
- memcpy(localhost_bdaddr_entry->bd_addr, bd_addr, 6);
- se_tree_insert32_array(hci_data->localhost_bdaddr, key, localhost_bdaddr_entry);
- }
+ k_interface_id = hci_data->interface_id;
+ k_adapter_id = hci_data->adapter_id;
+ k_frame_number = pinfo->fd->num;
+
+ 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;
+
+ localhost_bdaddr_entry = se_alloc(sizeof(localhost_bdaddr_entry_t));
+ localhost_bdaddr_entry->interface_id = k_interface_id;
+ localhost_bdaddr_entry->adapter_id = k_adapter_id;
+ memcpy(localhost_bdaddr_entry->bd_addr, bd_addr, 6);
+ se_tree_insert32_array(hci_data->localhost_bdaddr, key, localhost_bdaddr_entry);
}
break;
@@ -2382,8 +2372,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, packet_info *pinfo
offset++;
proto_tree_add_item(tree, hf_bthci_evt_device_name, tvb, offset, 248, ENC_ASCII|ENC_NA);
- if (!pinfo->fd->flags.visited) {
- hci_data_t *hci_data;
+ if (!pinfo->fd->flags.visited && hci_data != NULL) {
emem_tree_key_t key[4];
guint32 k_interface_id;
guint32 k_adapter_id;
@@ -2391,30 +2380,27 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, packet_info *pinfo
gchar *name;
localhost_name_entry_t *localhost_name_entry;
- hci_data = (hci_data_t *) pinfo->private_data;
- if (hci_data != NULL) {
- k_interface_id = hci_data->interface_id;
- k_adapter_id = hci_data->adapter_id;
- k_frame_number = pinfo->fd->num;
-
- name = tvb_get_ephemeral_string(tvb, offset, 248);
-
- 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;
-
- localhost_name_entry = se_alloc(sizeof(localhost_name_entry_t));
- localhost_name_entry->interface_id = k_interface_id;
- localhost_name_entry->adapter_id = k_adapter_id;
- localhost_name_entry->name = se_strdup(name);
-
- se_tree_insert32_array(hci_data->localhost_name, key, localhost_name_entry);
- }
+ k_interface_id = hci_data->interface_id;
+ k_adapter_id = hci_data->adapter_id;
+ k_frame_number = pinfo->fd->num;
+
+ name = tvb_get_ephemeral_string(tvb, offset, 248);
+
+ 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;
+
+ localhost_name_entry = se_alloc(sizeof(localhost_name_entry_t));
+ localhost_name_entry->interface_id = k_interface_id;
+ localhost_name_entry->adapter_id = k_adapter_id;
+ localhost_name_entry->name = se_strdup(name);
+
+ se_tree_insert32_array(hci_data->localhost_name, key, localhost_name_entry);
}
offset += 248;
@@ -2911,23 +2897,20 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, packet_info *pinfo
break;
case 0x2003: /* LE Read Local Supported Features */
- {
- proto_item *ti_le_features=NULL;
- proto_item *ti_le_subtree=NULL;
-
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
- if(tree){
- ti_le_features=proto_tree_add_text(tree, tvb, offset, 8, "LE Features");
- ti_le_subtree=proto_item_add_subtree(ti_le_features, ett_lmp_subtree);
+ if (tree) {
+ proto_item *ti_le_features;
+ proto_item *ti_le_subtree;
+
+ ti_le_features = proto_tree_add_text(tree, tvb, offset, 8, "LE Features");
+ ti_le_subtree = proto_item_add_subtree(ti_le_features, ett_lmp_subtree);
proto_tree_add_item(ti_le_subtree,hf_bthci_evt_le_feature_00, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset+=8;
}
break;
- }
-
case 0x2007: /* LE Read Advertising Channel Tx Power */
{
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
@@ -3339,15 +3322,16 @@ dissect_bthci_evt_inq_result(tvbuff_t *tvb, int offset, packet_info *pinfo, prot
static int
dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- proto_item *ti;
proto_tree *bthci_evt_tree = NULL;
guint8 param_length, evt_code;
guint8 bd_addr[6];
int offset = 0;
- if(tree){
- ti=proto_tree_add_item(tree, proto_bthci_evt, tvb, offset, -1, ENC_NA);
- bthci_evt_tree=proto_item_add_subtree(ti, ett_bthci_evt);
+ if (tree) {
+ proto_item *ti;
+
+ ti = proto_tree_add_item(tree, proto_bthci_evt, tvb, offset, -1, ENC_NA);
+ bthci_evt_tree = proto_item_add_subtree(ti, ett_bthci_evt);
}
evt_code = tvb_get_guint8(tvb, offset);
diff --git a/epan/dissectors/packet-btl2cap.c b/epan/dissectors/packet-btl2cap.c
index 2de292bdb7..d24d1b192a 100644
--- a/epan/dissectors/packet-btl2cap.c
+++ b/epan/dissectors/packet-btl2cap.c
@@ -424,7 +424,6 @@ dissect_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t
guint32 chandle;
guint32 key_psm;
bthci_acl_data_t *acl_data = (bthci_acl_data_t *) pinfo->private_data;
- psm_data_t *psm_data;
const gchar *psm_str = "<NONE>";
psm = tvb_get_letohs(tvb, offset);
@@ -488,6 +487,8 @@ dissect_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t
}
if (!pinfo->fd->flags.visited) {
+ psm_data_t *psm_data;
+
k_interface_id = interface_id;
k_adapter_id = adapter_id;
k_chandle = chandle;
@@ -690,20 +691,7 @@ dissect_options(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *t
static int
dissect_configrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint16 length)
{
- psm_data_t *psm_data;
- config_data_t *config_data;
- guint16 dcid;
- emem_tree_key_t key[6];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
- guint32 cid;
- bthci_acl_data_t *acl_data = (bthci_acl_data_t *) pinfo->private_data;
+ guint16 dcid;
dcid = tvb_get_letohs(tvb, offset);
@@ -716,6 +704,20 @@ dissect_configrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
offset += 2;
if (tvb_reported_length_remaining(tvb, offset) > 0) {
+ psm_data_t *psm_data;
+ config_data_t *config_data;
+ emem_tree_key_t key[6];
+ guint32 k_interface_id;
+ guint32 k_adapter_id;
+ guint32 k_chandle;
+ guint32 k_cid;
+ guint32 k_frame_number;
+ guint32 interface_id;
+ guint32 adapter_id;
+ guint32 chandle;
+ guint32 cid;
+ bthci_acl_data_t *acl_data = (bthci_acl_data_t *) pinfo->private_data;
+
interface_id = (acl_data) ? acl_data->interface_id : HCI_INTERFACE_AMP;
adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT;
chandle = (acl_data) ? acl_data->chandle : 0;
@@ -872,21 +874,9 @@ dissect_inforesponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *
static int
dissect_configresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint16 length)
{
- psm_data_t *psm_data;
- config_data_t *config_data;
guint16 scid;
guint16 result;
- emem_tree_key_t key[6];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
- guint32 cid;
- bthci_acl_data_t *acl_data = (bthci_acl_data_t *) pinfo->private_data;
+
scid = tvb_get_letohs(tvb, offset);
@@ -904,6 +894,20 @@ dissect_configresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
val_to_str_const(result, configuration_result_vals, "Unknown"), scid);
if (tvb_reported_length_remaining(tvb, offset) > 0) {
+ psm_data_t *psm_data;
+ config_data_t *config_data;
+ emem_tree_key_t key[6];
+ guint32 k_interface_id;
+ guint32 k_adapter_id;
+ guint32 k_chandle;
+ guint32 k_cid;
+ guint32 k_frame_number;
+ guint32 interface_id;
+ guint32 adapter_id;
+ guint32 chandle;
+ guint32 cid;
+ bthci_acl_data_t *acl_data = (bthci_acl_data_t *) pinfo->private_data;
+
interface_id = (acl_data) ? acl_data->interface_id : HCI_INTERFACE_AMP;
adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT;
chandle = (acl_data) ? acl_data->chandle : 0;
@@ -951,18 +955,6 @@ static int
dissect_connresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
guint16 scid, dcid, result;
- psm_data_t *psm_data;
- emem_tree_key_t key[6];
- guint32 k_interface_id;
- guint32 k_adapter_id;
- guint32 k_chandle;
- guint32 k_cid;
- guint32 k_frame_number;
- guint32 interface_id;
- guint32 adapter_id;
- guint32 chandle;
- guint32 cid;
- bthci_acl_data_t *acl_data = (bthci_acl_data_t *) pinfo->private_data;
dcid = tvb_get_letohs(tvb, offset);
proto_tree_add_item(tree, hf_btl2cap_dcid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -988,6 +980,19 @@ dissect_connresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *
}
if (pinfo->fd->flags.visited == 0) {
+ psm_data_t *psm_data;
+ emem_tree_key_t key[6];
+ guint32 k_interface_id;
+ guint32 k_adapter_id;
+ guint32 k_chandle;
+ guint32 k_cid;
+ guint32 k_frame_number;
+ guint32 interface_id;
+ guint32 adapter_id;
+ guint32 chandle;
+ guint32 cid;
+ bthci_acl_data_t *acl_data = (bthci_acl_data_t *) pinfo->private_data;
+
interface_id = (acl_data) ? acl_data->interface_id : HCI_INTERFACE_AMP;
adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT;
chandle = (acl_data) ? acl_data->chandle : 0;
@@ -1594,8 +1599,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
psm_data_t *psm_data;
bthci_acl_data_t *acl_data;
btl2cap_data_t *l2cap_data;
- config_data_t *config_data;
- void* pd_save;
+ void *pd_save;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "L2CAP");
switch (pinfo->p2p_dir) {
@@ -1900,6 +1904,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
(psm_data->scid == key_cid ||
psm_data->dcid == key_cid) &&
psm_data->disconnect_in_frame > pinfo->fd->num) {
+ config_data_t *config_data;
if ((psm_data->scid == key_cid) &&
psm_data->first_scid_frame == 0) {
diff --git a/epan/dissectors/packet-btobex.c b/epan/dissectors/packet-btobex.c
index 3de703adb6..93fdfa4a6a 100644
--- a/epan/dissectors/packet-btobex.c
+++ b/epan/dissectors/packet-btobex.c
@@ -1245,9 +1245,6 @@ dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo,
static void
dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- proto_item *ti;
- proto_tree *st;
- proto_item *sub_item;
fragment_data *frag_msg = NULL;
gboolean save_fragmented, complete;
tvbuff_t* new_tvb = NULL;
@@ -1367,7 +1364,11 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (complete) {
- guint8 code, final_flag;
+ proto_item *ti;
+ proto_tree *st;
+ proto_item *sub_item;
+ guint8 code;
+ guint8 final_flag;
/* fully dissectable packet ready */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "OBEX");
diff --git a/epan/dissectors/packet-btrfcomm.c b/epan/dissectors/packet-btrfcomm.c
index 2a20a0ad79..89190398bd 100644
--- a/epan/dissectors/packet-btrfcomm.c
+++ b/epan/dissectors/packet-btrfcomm.c
@@ -559,14 +559,12 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ti;
proto_tree *rfcomm_tree;
- proto_tree *ctrl_tree;
int offset = 0;
int fcs_offset;
guint8 dlci, cr_flag, ea_flag;
guint8 frame_type, pf_flag;
guint16 frame_len;
dlci_state_t *dlci_state = NULL;
- dissector_handle_t decode_by_dissector;
ti = proto_tree_add_item(tree, proto_btrfcomm, tvb, offset, -1, ENC_NA);
rfcomm_tree = proto_item_add_subtree(ti, ett_btrfcomm);
@@ -639,8 +637,9 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* multiplexer control command */
if (!dlci && frame_len) {
proto_item *mcc_ti;
- proto_tree *dlci_tree = NULL;
- proto_item *dlci_item = NULL;
+ proto_tree *ctrl_tree;
+ proto_tree *dlci_tree;
+ proto_item *dlci_item;
guint32 mcc_type, length;
guint8 mcc_cr_flag, mcc_ea_flag;
guint8 mcc_channel;
@@ -707,9 +706,10 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* for this kind of service, if none is found dissect it as raw "data"
*/
if (dlci && frame_len) {
- tvbuff_t *next_tvb;
- btl2cap_data_t *l2cap_data;
- btrfcomm_data_t rfcomm_data;
+ dissector_handle_t decode_by_dissector;
+ tvbuff_t *next_tvb;
+ btl2cap_data_t *l2cap_data;
+ btrfcomm_data_t rfcomm_data;
next_tvb = tvb_new_subset(tvb, offset, frame_len, frame_len);
diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c
index c19ed782d9..4de3502c8a 100644
--- a/epan/dissectors/packet-llc.c
+++ b/epan/dissectors/packet-llc.c
@@ -205,7 +205,7 @@ http://www.cisco.com/univercd/cc/td/doc/product/software/ios113ed/113ed_cr/ibm_r
{ OUI_SONY_ERICSSON_5, "Sony Ericsson Mobile Communications AB" },
{ OUI_SONY_ERICSSON_6, "Sony Ericsson Mobile Communications AB" },
{ OUI_SONY_ERICSSON_7, "Sony Ericsson Mobile Communications AB" },
- { OUI_BLUETOOTH, "Bluetooth" },
+ { OUI_BLUETOOTH, "Bluetooth SIG, Inc." },
{ OUI_SONY_ERICSSON_8, "Sony Ericsson Mobile Communications AB" },
{ OUI_IEEE_802_1QBG, "IEEE 802.1Qbg" },
{ OUI_TURBOCELL, "Karlnet (Turbocell)" },