3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-21 03:32:42 +01:00

wscutil: Add wsc_parse_association_request

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

View File

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

View File

@ -399,6 +399,11 @@ struct wsc_probe_request {
struct wsc_primary_device_type requested_device_type; struct wsc_primary_device_type requested_device_type;
}; };
struct wsc_association_request {
bool version2;
enum wsc_request_type request_type;
};
struct wsc_association_response { struct wsc_association_response {
bool version2; bool version2;
enum wsc_response_type response_type; enum wsc_response_type response_type;
@ -548,6 +553,8 @@ int wsc_parse_probe_response(const unsigned char *pdu, unsigned int len,
struct wsc_probe_response *out); struct wsc_probe_response *out);
int wsc_parse_probe_request(const unsigned char *pdu, unsigned int len, int wsc_parse_probe_request(const unsigned char *pdu, unsigned int len,
struct wsc_probe_request *out); struct wsc_probe_request *out);
int wsc_parse_association_request(const uint8_t *pdu, uint32_t len,
struct wsc_association_request *out);
int wsc_parse_association_response(const uint8_t *pdu, uint32_t len, int wsc_parse_association_response(const uint8_t *pdu, uint32_t len,
struct wsc_association_response *out); struct wsc_association_response *out);