wsc: Add wsc_uuid_from_addr

This commit is contained in:
Denis Kenzior 2015-09-18 17:16:09 -05:00
parent e055460709
commit c37e700921
2 changed files with 13 additions and 0 deletions

View File

@ -1107,3 +1107,14 @@ done:
ret = wsc_attr_builder_free(builder, false, out_len);
return ret;
}
bool wsc_uuid_from_addr(const uint8_t addr[], uint8_t *out_uuid)
{
/* Reuse the NSID from WPA Supplicant for compatibility */
static const uint8_t nsid[] = {
0x52, 0x64, 0x80, 0xf8, 0xc9, 0x9b, 0x4b, 0xe5,
0xa6, 0x55, 0x58, 0xed, 0x5f, 0x5d, 0x60, 0x84,
};
return l_uuid_v5(nsid, addr, 6, out_uuid);
}

View File

@ -389,3 +389,5 @@ int wsc_parse_probe_request(const unsigned char *pdu, unsigned int len,
uint8_t *wsc_build_probe_request(const struct wsc_probe_request *probe_request,
size_t *out_len);
bool wsc_uuid_from_addr(const uint8_t addr[], uint8_t *out_uuid);