summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-08-24 14:51:05 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-08-24 14:51:05 +0000
commit3df8390f8e7be37d0adfac2192c425219941d844 (patch)
tree19bca45e7c6634321bacb5d6391bb0697ae6bf27 /src
parent21f2a5244f0c6195e17ff71868328bc71d77f4d9 (diff)
Fix UUID128 string lookup handling
Diffstat (limited to 'src')
-rw-r--r--src/sdp.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/sdp.c b/src/sdp.c
index 86caa15c..b1ef47ea 100644
--- a/src/sdp.c
+++ b/src/sdp.c
@@ -208,6 +208,24 @@ static char *string_lookup(struct tupla *pt0, int index)
return "";
}
+static char *string_lookup_uuid(struct tupla *pt0, const uuid_t* uuid)
+{
+ uuid_t tmp_uuid;
+
+ memcpy(&tmp_uuid, uuid, sizeof(tmp_uuid));
+
+ if (sdp_uuid128_to_uuid(&tmp_uuid)) {
+ switch (tmp_uuid.type) {
+ case SDP_UUID16:
+ return string_lookup(pt0, tmp_uuid.value.uuid16);
+ case SDP_UUID32:
+ return string_lookup(pt0, tmp_uuid.value.uuid32);
+ }
+ }
+
+ return "";
+}
+
/*
* Prints into a string the Protocol UUID
* coping a maximum of n characters.
@@ -231,8 +249,9 @@ static int uuid2str(struct tupla *message, const uuid_t *uuid, char *str, size_t
snprintf(str, n, str2);
break;
case SDP_UUID128:
- snprintf(str, n, "Error: This is UUID-128");
- return -4;
+ str2 = string_lookup_uuid(message, uuid);
+ snprintf(str, n, str2);
+ break;
default:
snprintf(str, n, "Type of UUID (%x) unknown.", uuid->type);
return -1;