guint type = 0;
proto_item *addr_item;
proto_tree *addr_tree = NULL;
- const guint8 *src_addr;
- const guint8 *dst_addr;
pi = proto_tree_add_item(tree, proto_btbnep, tvb, offset, -1, ENC_NA);
btbnep_tree = proto_item_add_subtree(pi, ett_btbnep);
col_set_str(pinfo->cinfo, COL_INFO, "Rcvd ");
break;
default:
- col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ",
- pinfo->p2p_dir);
+ col_set_str(pinfo->cinfo, COL_INFO, "UnknownDirection ");
break;
}
if (extension_flag) col_append_str(pinfo->cinfo, COL_INFO, "+E");
if (bnep_type == BNEP_TYPE_GENERAL_ETHERNET || bnep_type == BNEP_TYPE_COMPRESSED_ETHERNET_DESTINATION_ONLY) {
- dst_addr = tvb_get_ptr(tvb, offset, 6);
- SET_ADDRESS(&pinfo->dl_dst, AT_ETHER, 6, dst_addr);
- SET_ADDRESS(&pinfo->dst, AT_ETHER, 6, dst_addr);
+ TVB_SET_ADDRESS(&pinfo->dl_dst, AT_ETHER, tvb, offset, 6);
+ copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
- addr_item = proto_tree_add_ether(btbnep_tree, hf_btbnep_dst, tvb, offset, 6, dst_addr);
- if (addr_item) addr_tree = proto_item_add_subtree(addr_item, ett_addr);
- proto_tree_add_ether(addr_tree, hf_btbnep_addr, tvb, offset, 6, dst_addr);
+ addr_item = proto_tree_add_item(btbnep_tree, hf_btbnep_dst, tvb, offset, 6, ENC_NA);
+ addr_tree = proto_item_add_subtree(addr_item, ett_addr);
+ proto_tree_add_item(addr_tree, hf_btbnep_addr, tvb, offset, 6, ENC_NA);
proto_tree_add_item(addr_tree, hf_btbnep_lg, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(addr_tree, hf_btbnep_ig, tvb, offset, 3, ENC_BIG_ENDIAN);
offset += 6;
}
if (bnep_type == BNEP_TYPE_GENERAL_ETHERNET || bnep_type == BNEP_TYPE_COMPRESSED_ETHERNET_SOURCE_ONLY) {
- src_addr = tvb_get_ptr(tvb, offset, 6);
- SET_ADDRESS(&pinfo->dl_src, AT_ETHER, 6, src_addr);
- SET_ADDRESS(&pinfo->src, AT_ETHER, 6, src_addr);
+ TVB_SET_ADDRESS(&pinfo->dl_src, AT_ETHER, tvb, offset, 6);
+ copy_address_shallow(&pinfo->src, &pinfo->dl_src);
-
- addr_item = proto_tree_add_ether(btbnep_tree, hf_btbnep_src, tvb, offset, 6, src_addr);
- if (addr_item) {
- addr_tree = proto_item_add_subtree(addr_item, ett_addr);
- if (tvb_get_guint8(tvb, offset) & 0x01) {
- expert_add_info(pinfo, addr_item, &ei_btbnep_src_not_group_address);
- }
+ addr_item = proto_tree_add_item(btbnep_tree, hf_btbnep_src, tvb, offset, 6, ENC_NA);
+ addr_tree = proto_item_add_subtree(addr_item, ett_addr);
+ if (tvb_get_guint8(tvb, offset) & 0x01) {
+ expert_add_info(pinfo, addr_item, &ei_btbnep_src_not_group_address);
}
- proto_tree_add_ether(addr_tree, hf_btbnep_addr, tvb, offset, 6, src_addr);
+
+ proto_tree_add_item(addr_tree, hf_btbnep_addr, tvb, offset, 6, ENC_NA);
proto_tree_add_item(addr_tree, hf_btbnep_lg, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(addr_tree, hf_btbnep_ig, tvb, offset, 3, ENC_BIG_ENDIAN);
offset += 6;
data_handle = find_dissector("data");
ethertype_handle = find_dissector("ethertype");
- dissector_add_uint("btl2cap.service", BTSDP_PAN_GN_SERVICE_UUID, btbnep_handle);
- dissector_add_uint("btl2cap.service", BTSDP_PAN_NAP_SERVICE_UUID, btbnep_handle);
- dissector_add_uint("btl2cap.service", BTSDP_PAN_GN_SERVICE_UUID, btbnep_handle);
+ dissector_add_string("bluetooth.uuid", "1115", btbnep_handle);
+ dissector_add_string("bluetooth.uuid", "1116", btbnep_handle);
+ dissector_add_string("bluetooth.uuid", "1117", btbnep_handle);
dissector_add_uint("btl2cap.psm", BTL2CAP_PSM_BNEP, btbnep_handle);
dissector_add_for_decode_as("btl2cap.cid", btbnep_handle);