3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-29 22:19:23 +01:00

wscutil: Add wsc_build_association_response

This commit is contained in:
Denis Kenzior 2016-09-13 17:26:18 -05:00
parent 77abdb7d96
commit 047a196c70
2 changed files with 31 additions and 0 deletions

View File

@ -1938,6 +1938,13 @@ static void build_request_type(struct wsc_attr_builder *builder,
wsc_attr_builder_put_u8(builder, type);
}
static void build_response_type(struct wsc_attr_builder *builder,
enum wsc_response_type type)
{
wsc_attr_builder_start_attr(builder, WSC_ATTR_RESPONSE_TYPE);
wsc_attr_builder_put_u8(builder, type);
}
static void build_rf_bands(struct wsc_attr_builder *builder, uint8_t rf_bands)
{
wsc_attr_builder_start_attr(builder, WSC_ATTR_RF_BANDS);
@ -2071,6 +2078,27 @@ done:
return ret;
}
uint8_t *wsc_build_association_response(
const struct wsc_association_response *association_response,
size_t *out_len)
{
struct wsc_attr_builder *builder;
uint8_t *ret;
builder = wsc_attr_builder_new(128);
build_version(builder, 0x10);
build_response_type(builder, association_response->response_type);
if (!association_response->version2)
goto done;
START_WFA_VENDOR_EXTENSION();
done:
ret = wsc_attr_builder_free(builder, false, out_len);
return ret;
}
uint8_t *wsc_build_m1(const struct wsc_m1 *m1, size_t *out_len)
{
struct wsc_attr_builder *builder;

View File

@ -593,6 +593,9 @@ uint8_t *wsc_build_probe_request(const struct wsc_probe_request *probe_request,
uint8_t *wsc_build_association_request(
const struct wsc_association_request *association_request,
size_t *out_len);
uint8_t *wsc_build_association_response(
const struct wsc_association_response *association_response,
size_t *out_len);
uint8_t *wsc_build_m1(const struct wsc_m1 *m1, size_t *out_len);
uint8_t *wsc_build_m2(const struct wsc_m2 *m2, size_t *out_len);