wscutil: Add wsc_parse_association_response

This commit is contained in:
Denis Kenzior 2016-09-13 15:57:16 -05:00
parent f3d5adfc3c
commit 022d24474b
2 changed files with 27 additions and 0 deletions

View File

@ -1088,6 +1088,26 @@ done:
return 0;
}
int wsc_parse_association_response(const uint8_t *pdu, uint32_t len,
struct wsc_association_response *out)
{
int r;
struct wsc_wfa_ext_iter iter;
uint8_t version;
memset(out, 0, sizeof(struct wsc_association_response));
r = wsc_parse_attrs(pdu, len, &out->version2, &iter, 0, NULL,
REQUIRED(VERSION, &version),
REQUIRED(RESPONSE_TYPE, &out->response_type),
WSC_ATTR_INVALID);
if (r < 0)
return r;
return 0;
}
int wsc_parse_m1(const uint8_t *pdu, uint32_t len, struct wsc_m1 *out)
{
int r;

View File

@ -399,6 +399,11 @@ struct wsc_probe_request {
struct wsc_primary_device_type requested_device_type;
};
struct wsc_association_response {
bool version2;
enum wsc_response_type response_type;
};
struct wsc_m1 {
bool version2;
uint8_t uuid_e[16];
@ -543,6 +548,8 @@ int wsc_parse_probe_response(const unsigned char *pdu, unsigned int len,
struct wsc_probe_response *out);
int wsc_parse_probe_request(const unsigned char *pdu, unsigned int len,
struct wsc_probe_request *out);
int wsc_parse_association_response(const uint8_t *pdu, uint32_t len,
struct wsc_association_response *out);
int wsc_parse_m1(const uint8_t *pdu, uint32_t len, struct wsc_m1 *out);
int wsc_parse_m2(const uint8_t *pdu, uint32_t len, struct wsc_m2 *out);