diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2004-07-22 18:08:49 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2004-07-22 18:08:49 +0000 |
commit | a8efcfa5ca81ef29e4d56dac70761d9b9ffc9708 (patch) | |
tree | 38e8ec5583021fe46a9d22c2edfad0b4efe7f009 | |
parent | 8d358dc737350567d81161e9fce4335392508e3a (diff) |
UUID32 values can also be used as protocol identifiers
-rw-r--r-- | src/sdp.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -2069,14 +2069,14 @@ int sdp_uuid128_to_uuid(uuid_t *uuid) uint128_t *b = sdp_create_base_uuid(); uint128_t *u = &uuid->value.uuid128; uint32_t data; - + if (uuid->type != SDP_UUID128) return 1; - + for (i = 4; i < sizeof(b->data); i++) if (b->data[i] != u->data[i]) return 0; - + memcpy(&data, u->data, 4); data = htonl(data); if (data <= 0xffff) { @@ -2095,8 +2095,14 @@ int sdp_uuid128_to_uuid(uuid_t *uuid) int sdp_uuid_to_proto(uuid_t *uuid) { uuid_t u = *uuid; - if (sdp_uuid128_to_uuid(&u) && u.type == SDP_UUID16) - return u.value.uuid16; + if (sdp_uuid128_to_uuid(&u)) { + switch (u.type) { + case SDP_UUID16: + return u.value.uuid16; + case SDP_UUID32: + return u.value.uuid32; + } + } return 0; } |