diff options
| author | Marcel Holtmann <marcel@holtmann.org> | 2006-08-24 14:51:05 +0000 | 
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2006-08-24 14:51:05 +0000 | 
| commit | 3df8390f8e7be37d0adfac2192c425219941d844 (patch) | |
| tree | 19bca45e7c6634321bacb5d6391bb0697ae6bf27 /src/sdp.c | |
| parent | 21f2a5244f0c6195e17ff71868328bc71d77f4d9 (diff) | |
Fix UUID128 string lookup handling
Diffstat (limited to 'src/sdp.c')
| -rw-r--r-- | src/sdp.c | 23 | 
1 files changed, 21 insertions, 2 deletions
@@ -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;  | 
