aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-02-07 14:51:06 -0800
committerGuy Harris <guy@alum.mit.edu>2015-02-07 22:52:06 +0000
commit3066d6b29fa872bc48176b8e4306e803a03dda8a (patch)
tree2bb52b556967ae24282bf3e8040a40bbb48fbe74 /epan/dissectors
parent96527e24e8e10a707c51c48f52233453c3056702 (diff)
Don't call the Bluetooth code's UUID type "uuid_t".
uuid_t is a data type provided by a number of environments, thanks to the Open Software Fuundation; calling the Bluetooth code's data type, which includes an actual OSF-style UUID as a member, "uuid_t" can lead to confusion and *does* lead to compile errors on platforms where, for better or worse, system headers such as <unistd.h> define uuid_t (and are included by, for example, Qt headers). Just rename it "bluetooth_uuid_t". Change-Id: Ic742723913ba4105cd3269dd24fc821147285176 Reviewed-on: https://code.wireshark.org/review/7017 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-bluetooth.c8
-rw-r--r--epan/dissectors/packet-bluetooth.h8
-rw-r--r--epan/dissectors/packet-btatt.c29
-rw-r--r--epan/dissectors/packet-btatt.h2
-rw-r--r--epan/dissectors/packet-btsdp.c66
-rw-r--r--epan/dissectors/packet-btsdp.h2
6 files changed, 58 insertions, 57 deletions
diff --git a/epan/dissectors/packet-bluetooth.c b/epan/dissectors/packet-bluetooth.c
index cef7a63616..ce8d76cfb5 100644
--- a/epan/dissectors/packet-bluetooth.c
+++ b/epan/dissectors/packet-bluetooth.c
@@ -1173,10 +1173,10 @@ get_conversation(packet_info *pinfo,
return conversation;
}
-uuid_t
+bluetooth_uuid_t
get_uuid(tvbuff_t *tvb, gint offset, gint size)
{
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
uuid.bt_uuid = 0;
@@ -1204,7 +1204,7 @@ get_uuid(tvbuff_t *tvb, gint offset, gint size)
}
gchar *
-print_uuid(uuid_t *uuid)
+print_uuid(bluetooth_uuid_t *uuid)
{
if (uuid->bt_uuid) {
return wmem_strdup(wmem_packet_scope(), val_to_str_ext_const(uuid->bt_uuid, &bluetooth_uuid_vals_ext, "Unknown"));
@@ -1230,7 +1230,7 @@ print_uuid(uuid_t *uuid)
}
gchar *
-print_numeric_uuid(uuid_t *uuid)
+print_numeric_uuid(bluetooth_uuid_t *uuid)
{
if (uuid && uuid->size > 0)
return bytes_to_str(wmem_packet_scope(), uuid->data, uuid->size);
diff --git a/epan/dissectors/packet-bluetooth.h b/epan/dissectors/packet-bluetooth.h
index 18e69e5493..876ab20ffe 100644
--- a/epan/dissectors/packet-bluetooth.h
+++ b/epan/dissectors/packet-bluetooth.h
@@ -205,7 +205,7 @@ typedef struct _uuid_t {
guint16 bt_uuid;
guint8 size;
guint8 data[16];
-} uuid_t;
+} bluetooth_uuid_t;
typedef struct _bluetooth_uuid_custom {
const guint8 uuid[16];
@@ -223,9 +223,9 @@ extern guint32 max_disconnect_in_frame;
extern gint dissect_bd_addr(gint hf_bd_addr, proto_tree *tree, tvbuff_t *tvb,
gint offset, guint8 *bdaddr);
-extern uuid_t get_uuid(tvbuff_t *tvb, gint offset, gint size);
-extern gchar *print_uuid(uuid_t *uuid);
-extern gchar *print_numeric_uuid(uuid_t *uuid);
+extern bluetooth_uuid_t get_uuid(tvbuff_t *tvb, gint offset, gint size);
+extern gchar *print_uuid(bluetooth_uuid_t *uuid);
+extern gchar *print_numeric_uuid(bluetooth_uuid_t *uuid);
extern void save_local_device_name_from_eir_ad(tvbuff_t *tvb, gint offset,
packet_info *pinfo, guint8 size, bluetooth_data_t *bluetooth_data);
diff --git a/epan/dissectors/packet-btatt.c b/epan/dissectors/packet-btatt.c
index 597728a70c..7bd4732fc9 100644
--- a/epan/dissectors/packet-btatt.c
+++ b/epan/dissectors/packet-btatt.c
@@ -1359,7 +1359,7 @@ union request_parameters_union {
struct _read_by_type {
guint16 starting_handle;
guint16 ending_handle;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
} read_by_type;
struct _find_information {
@@ -1377,7 +1377,7 @@ typedef struct _request_data_t {
} request_data_t;
typedef struct _handle_data_t {
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
} handle_data_t;
typedef struct _mtu_data_t {
@@ -1572,7 +1572,7 @@ save_request(packet_info *pinfo, guint8 opcode, union request_parameters_union p
}
static void
-save_handle(packet_info *pinfo, uuid_t uuid, guint32 handle,
+save_handle(packet_info *pinfo, bluetooth_uuid_t uuid, guint32 handle,
bluetooth_data_t *bluetooth_data)
{
if (!handle && uuid.size != 2 && uuid.size != 16)
@@ -1612,7 +1612,7 @@ save_handle(packet_info *pinfo, uuid_t uuid, guint32 handle,
}
}
-static uuid_t
+static bluetooth_uuid_t
get_uuid_from_handle(packet_info *pinfo, guint32 handle,
bluetooth_data_t *bluetooth_data)
{
@@ -1620,7 +1620,7 @@ get_uuid_from_handle(packet_info *pinfo, guint32 handle,
guint32 frame_number;
handle_data_t *handle_data;
wmem_tree_t *sub_wmemtree;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
memset(&uuid, 0, sizeof uuid);
@@ -1647,11 +1647,11 @@ get_uuid_from_handle(packet_info *pinfo, guint32 handle,
static int
dissect_handle_uint(proto_tree *tree, packet_info *pinfo, gint hf,
tvbuff_t *tvb, gint offset, bluetooth_data_t *bluetooth_data,
- uuid_t *uuid, guint16 handle)
+ bluetooth_uuid_t *uuid, guint16 handle)
{
proto_item *sub_item;
proto_tree *sub_tree;
- uuid_t local_uuid;
+ bluetooth_uuid_t local_uuid;
sub_item = proto_tree_add_uint(tree, hf, tvb, 0, 0, handle);
PROTO_ITEM_SET_GENERATED(sub_item);
@@ -1683,12 +1683,13 @@ dissect_handle_uint(proto_tree *tree, packet_info *pinfo, gint hf,
static int
dissect_handle(proto_tree *tree, packet_info *pinfo, gint hf,
- tvbuff_t *tvb, gint offset, bluetooth_data_t *bluetooth_data, uuid_t *uuid)
+ tvbuff_t *tvb, gint offset, bluetooth_data_t *bluetooth_data,
+ bluetooth_uuid_t *uuid)
{
proto_item *sub_item;
proto_tree *sub_tree;
guint16 handle;
- uuid_t local_uuid;
+ bluetooth_uuid_t local_uuid;
sub_item = proto_tree_add_item(tree, hf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
handle = tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN);
@@ -1719,13 +1720,13 @@ dissect_handle(proto_tree *tree, packet_info *pinfo, gint hf,
static gint
dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info *pinfo, tvbuff_t *old_tvb,
- gint old_offset, gint length, guint16 handle, uuid_t uuid, bluetooth_data_t *bluetooth_data)
+ gint old_offset, gint length, guint16 handle, bluetooth_uuid_t uuid, bluetooth_data_t *bluetooth_data)
{
proto_item *sub_item;
proto_tree *sub_tree;
tvbuff_t *tvb;
gint offset = 0;
- uuid_t sub_uuid;
+ bluetooth_uuid_t sub_uuid;
guint16 sub_handle;
guint32 value;
const gint **hfs;
@@ -2735,7 +2736,7 @@ dissect_btgatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_item *main_item;
proto_tree *main_tree;
proto_item *patron_item = NULL;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
main_item = proto_tree_add_item(tree, (gint) GPOINTER_TO_UINT(wmem_list_frame_data(wmem_list_tail(pinfo->layers))), tvb, 0, -1, ENC_NA);
main_tree = proto_item_add_subtree(main_item, ett_btgatt);
@@ -2751,7 +2752,7 @@ dissect_btgatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
static gboolean
-is_long_attribute_value(uuid_t uuid)
+is_long_attribute_value(bluetooth_uuid_t uuid)
{
switch (uuid.bt_uuid) {
case 0x2901: /* Characteristic User Description */
@@ -2921,7 +2922,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
bluetooth_data_t *bluetooth_data;
request_data_t *request_data;
guint16 handle;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
guint mtu;
uuid.size = 0;
diff --git a/epan/dissectors/packet-btatt.h b/epan/dissectors/packet-btatt.h
index a8ccdf0f92..db229fbb20 100644
--- a/epan/dissectors/packet-btatt.h
+++ b/epan/dissectors/packet-btatt.h
@@ -27,7 +27,7 @@
typedef struct _tap_handles_t {
guint32 handle;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
} tap_handles_t;
#endif
diff --git a/epan/dissectors/packet-btsdp.c b/epan/dissectors/packet-btsdp.c
index 9f712ebfc1..e3be71cae9 100644
--- a/epan/dissectors/packet-btsdp.c
+++ b/epan/dissectors/packet-btsdp.c
@@ -1036,10 +1036,10 @@ service_info_t* btsdp_get_service_info(wmem_tree_key_t* key)
return (service_info_t *)wmem_tree_lookup32_array_le(service_infos, key);
}
-static uuid_t
+static bluetooth_uuid_t
get_specified_uuid(wmem_array_t *uuid_array)
{
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
/* Try to find UUID that is already use in RFCOMM or L2CAP, otherwise try to
return last one (most generic).
@@ -1047,12 +1047,12 @@ get_specified_uuid(wmem_array_t *uuid_array)
if (uuid_array) {
guint32 i_uuid;
guint32 size;
- uuid_t *p_uuid = NULL;
+ bluetooth_uuid_t *p_uuid = NULL;
size = wmem_array_get_count(uuid_array);
for (i_uuid = 0; i_uuid < size; i_uuid += 1) {
- p_uuid = (uuid_t *) wmem_array_index(uuid_array, i_uuid);
+ p_uuid = (bluetooth_uuid_t *) wmem_array_index(uuid_array, i_uuid);
if (dissector_get_uint_handle(btrfcomm_service_table, p_uuid->bt_uuid))
break;
if (dissector_get_uint_handle(btl2cap_service_table, p_uuid->bt_uuid))
@@ -1062,7 +1062,7 @@ get_specified_uuid(wmem_array_t *uuid_array)
if (p_uuid) return *p_uuid;
}
- memset(&uuid, 0, sizeof(uuid_t));
+ memset(&uuid, 0, sizeof(bluetooth_uuid_t));
return uuid;
}
@@ -1280,7 +1280,7 @@ get_int_by_size(tvbuff_t *tvb, gint off, gint size)
}
static gint
-dissect_uuid(proto_tree *tree, tvbuff_t *tvb, gint offset, gint size, uuid_t *uuid)
+dissect_uuid(proto_tree *tree, tvbuff_t *tvb, gint offset, gint size, bluetooth_uuid_t *uuid)
{
proto_item *item;
@@ -1928,7 +1928,7 @@ dissect_protocol_descriptor_list(proto_tree *next_tree, tvbuff_t *tvb,
guint32 value;
gint length;
guint32 i_protocol;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
service_info_t *record = NULL;
list_offset = offset;
@@ -2052,7 +2052,7 @@ dissect_protocol_descriptor_list(proto_tree *next_tree, tvbuff_t *tvb,
static gint
dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
- gint offset, gint attribute, uuid_t service_uuid,
+ gint offset, gint attribute, bluetooth_uuid_t service_uuid,
gint service_did_vendor_id, gint service_did_vendor_id_source,
service_info_t *service_info, wmem_strbuf_t **pinfo_buf)
{
@@ -2089,7 +2089,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
guint8 *new_str;
guint32 value;
guint64 value_64;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
gchar *uuid_str;
gint length;
gint protocol_order;
@@ -3444,7 +3444,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
static gint
dissect_sdp_service_attribute(proto_tree *tree, tvbuff_t *tvb, gint offset,
- packet_info *pinfo, uuid_t uuid, gint service_offset,
+ packet_info *pinfo, bluetooth_uuid_t uuid, gint service_offset,
service_info_t *service_info, gint number_of_attributes, gboolean attribute_only)
{
proto_tree *attribute_tree;
@@ -3708,7 +3708,7 @@ dissect_sdp_service_attribute(proto_tree *tree, tvbuff_t *tvb, gint offset,
static gint
dissect_attribute_id_list(proto_tree *tree, tvbuff_t *tvb, gint offset,
- packet_info *pinfo, uuid_t *uuid)
+ packet_info *pinfo, bluetooth_uuid_t *uuid)
{
proto_item *list_item;
proto_tree *list_tree;
@@ -3717,10 +3717,10 @@ dissect_attribute_id_list(proto_tree *tree, tvbuff_t *tvb, gint offset,
gint previous_offset;
gint service_offset;
gint bytes_to_go;
- uuid_t empty_uuid;
+ bluetooth_uuid_t empty_uuid;
if (!uuid)
- memset(&empty_uuid, 0, sizeof(uuid_t));
+ memset(&empty_uuid, 0, sizeof(bluetooth_uuid_t));
start_offset = offset;
list_item = proto_tree_add_item(tree, hf_attribute_id_list, tvb, offset, 0, ENC_NA);
@@ -3755,7 +3755,7 @@ dissect_sdp_error_response(proto_tree *tree, tvbuff_t *tvb, gint offset)
static gint
dissect_sdp_service_attribute_list(proto_tree *tree, tvbuff_t *tvb, gint offset,
- packet_info *pinfo, uuid_t *service_uuid, btl2cap_data_t *l2cap_data)
+ packet_info *pinfo, bluetooth_uuid_t *service_uuid, btl2cap_data_t *l2cap_data)
{
proto_item *list_item;
proto_tree *list_tree;
@@ -3769,7 +3769,7 @@ dissect_sdp_service_attribute_list(proto_tree *tree, tvbuff_t *tvb, gint offset,
gint element_length;
gint new_offset;
gint service_offset;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
wmem_tree_key_t key[10];
guint32 k_interface_id;
guint32 k_adapter_id;
@@ -3783,10 +3783,10 @@ dissect_sdp_service_attribute_list(proto_tree *tree, tvbuff_t *tvb, gint offset,
service_info_t *service_info;
wmem_array_t *uuid_array;
- uuid_array = wmem_array_new(wmem_packet_scope(), sizeof(uuid_t));
+ uuid_array = wmem_array_new(wmem_packet_scope(), sizeof(bluetooth_uuid_t));
offset = get_type_length(tvb, offset, &len);
- memset(&uuid, 0, sizeof(uuid_t));
+ memset(&uuid, 0, sizeof(bluetooth_uuid_t));
list_item = proto_tree_add_item(tree, hf_attribute_list, tvb,
start_offset, len + (offset - start_offset), ENC_NA);
@@ -3904,7 +3904,7 @@ dissect_sdp_service_attribute_list(proto_tree *tree, tvbuff_t *tvb, gint offset,
static gint
dissect_sdp_service_attribute_list_array(proto_tree *tree, tvbuff_t *tvb,
gint offset, packet_info *pinfo, gint attribute_list_byte_count,
- uuid_t *service_uuid, btl2cap_data_t *l2cap_data)
+ bluetooth_uuid_t *service_uuid, btl2cap_data_t *l2cap_data)
{
proto_item *lists_item;
proto_tree *lists_tree;
@@ -3947,13 +3947,13 @@ dissect_sdp_service_search_request(proto_tree *tree, tvbuff_t *tvb, gint offset,
proto_item *ti;
proto_tree *st;
proto_tree *sub_tree = NULL;
- uuid_t empty_uuid;
+ bluetooth_uuid_t empty_uuid;
wmem_array_t *uuid_array = NULL;
start_offset = offset;
- memset(&empty_uuid, 0, sizeof(uuid_t));
+ memset(&empty_uuid, 0, sizeof(bluetooth_uuid_t));
if (!pinfo->fd->flags.visited)
- uuid_array = wmem_array_new(wmem_file_scope(), sizeof(uuid_t));
+ uuid_array = wmem_array_new(wmem_file_scope(), sizeof(bluetooth_uuid_t));
ti = proto_tree_add_item(tree, hf_service_search_pattern, tvb, offset, 0, ENC_NA);
st = proto_item_add_subtree(ti, ett_btsdp_service_search_pattern);
@@ -3966,7 +3966,7 @@ dissect_sdp_service_search_request(proto_tree *tree, tvbuff_t *tvb, gint offset,
wmem_strbuf_t *str = NULL;
gint entry_offset;
gint entry_size;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
size = dissect_sdp_type(sub_tree, pinfo, tvb, offset, -1, empty_uuid, 0, 0, NULL, &str);
@@ -4140,7 +4140,7 @@ dissect_sdp_service_attribute_request(proto_tree *tree, tvbuff_t *tvb,
{
guint32 record_handle;
wmem_array_t *uuid_array;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
proto_tree_add_item(tree, hf_sdp_service_record_handle, tvb, offset, 4, ENC_BIG_ENDIAN);
record_handle = tvb_get_ntohl(tvb, offset);
@@ -4173,7 +4173,7 @@ dissect_sdp_service_attribute_response(proto_tree *tree, tvbuff_t *tvb,
gboolean is_continued;
tvbuff_t *new_tvb;
guint32 record_handle = 0;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
proto_tree_add_item(tree, hf_attribute_list_byte_count, tvb, offset, 2, ENC_BIG_ENDIAN);
attribute_list_byte_count = tvb_get_ntohs(tvb, offset);
@@ -4191,7 +4191,7 @@ dissect_sdp_service_attribute_response(proto_tree *tree, tvbuff_t *tvb,
uuid_array = get_uuids(pinfo, record_handle, l2cap_data);
uuid = get_specified_uuid(uuid_array);
} else {
- memset(&uuid, 0, sizeof(uuid_t));
+ memset(&uuid, 0, sizeof(bluetooth_uuid_t));
}
if (is_first && !is_continued) {
@@ -4239,15 +4239,15 @@ dissect_sdp_service_search_attribute_request(proto_tree *tree, tvbuff_t *tvb,
gint size;
gint bytes_to_go;
wmem_strbuf_t *info_buf = NULL;
- uuid_t empty_uuid;
+ bluetooth_uuid_t empty_uuid;
wmem_array_t *uuid_array = NULL;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
- memset(&empty_uuid, 0, sizeof(uuid_t));
+ memset(&empty_uuid, 0, sizeof(bluetooth_uuid_t));
if (!pinfo->fd->flags.visited)
- uuid_array = wmem_array_new(wmem_file_scope(), sizeof(uuid_t));
+ uuid_array = wmem_array_new(wmem_file_scope(), sizeof(bluetooth_uuid_t));
else
- uuid_array = wmem_array_new(wmem_packet_scope(), sizeof(uuid_t));
+ uuid_array = wmem_array_new(wmem_packet_scope(), sizeof(bluetooth_uuid_t));
start_offset = offset;
pitem = proto_tree_add_item(tree, hf_service_search_pattern, tvb, offset, 0, ENC_NA);
@@ -4260,9 +4260,9 @@ dissect_sdp_service_search_attribute_request(proto_tree *tree, tvbuff_t *tvb,
while (bytes_to_go > 0) {
gint entry_offset;
gint entry_size;
- uuid_t a_uuid;
+ bluetooth_uuid_t a_uuid;
- memset(&a_uuid, 0, sizeof(uuid_t));
+ memset(&a_uuid, 0, sizeof(bluetooth_uuid_t));
size = dissect_sdp_type(next_tree, pinfo, tvb, offset, -1, empty_uuid, 0, 0, NULL, &info_buf);
proto_item_append_text(pitem,"%s", wmem_strbuf_get_str(info_buf));
@@ -4303,7 +4303,7 @@ dissect_sdp_service_search_attribute_response(proto_tree *tree, tvbuff_t *tvb,
gboolean is_first;
gboolean is_continued;
tvbuff_t *new_tvb;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
wmem_array_t *uuid_array = NULL;
proto_tree_add_item(tree, hf_attribute_list_byte_count, tvb, offset, 2, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-btsdp.h b/epan/dissectors/packet-btsdp.h
index d7dde71fe9..6f01428817 100644
--- a/epan/dissectors/packet-btsdp.h
+++ b/epan/dissectors/packet-btsdp.h
@@ -195,7 +195,7 @@ typedef struct _service_info_t {
guint32 type;
guint32 channel;
- uuid_t uuid;
+ bluetooth_uuid_t uuid;
gint protocol_order; /* main service protocol has 0, goep -1, additional protocol 1, 2... */
gint protocol;