aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/hs20_supplicant.c
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2014-03-25 00:36:13 (GMT)
committerJouni Malinen <j@w1.fi>2014-03-25 16:33:21 (GMT)
commitcf28c66bcb8883e6be921d6406a534e4a5b45b96 (patch)
treebee8efd6c819bbf3cd5d29806e6890222834e3ce /wpa_supplicant/hs20_supplicant.c
parent163f801ef23cd486aab5065c90dd71ad4cbb5fcd (diff)
downloadhostap-cf28c66bcb8883e6be921d6406a534e4a5b45b96.zip
hostap-cf28c66bcb8883e6be921d6406a534e4a5b45b96.tar.gz
hostap-cf28c66bcb8883e6be921d6406a534e4a5b45b96.tar.bz2
HS 2.0: Extend ANQP_GET to accept Hotspot 2.0 subtypes
This allows a single ANQP query to be used to fetch both IEEE 802.11 defined ANQP elements and Hotspot 2.0 vendor specific elements. ANQP_GET <addr> <info id>[,<info id>]... [,hs20:<subtype>][...,hs20:<subtype>] For example: ANQP_GET 00:11:22:33:44:55:66 258,268,hs20:3,hs20:4 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'wpa_supplicant/hs20_supplicant.c')
-rw-r--r--wpa_supplicant/hs20_supplicant.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/wpa_supplicant/hs20_supplicant.c b/wpa_supplicant/hs20_supplicant.c
index b342d5d..c242c33 100644
--- a/wpa_supplicant/hs20_supplicant.c
+++ b/wpa_supplicant/hs20_supplicant.c
@@ -121,15 +121,13 @@ int hs20_get_pps_mo_id(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
}
-struct wpabuf * hs20_build_anqp_req(u32 stypes, const u8 *payload,
- size_t payload_len)
+void hs20_put_anqp_req(u32 stypes, const u8 *payload, size_t payload_len,
+ struct wpabuf *buf)
{
- struct wpabuf *buf;
u8 *len_pos;
- buf = gas_anqp_build_initial_req(0, 100 + payload_len);
if (buf == NULL)
- return NULL;
+ return;
len_pos = gas_anqp_add_element(buf, ANQP_VENDOR_SPECIFIC);
wpabuf_put_be24(buf, OUI_WFA);
@@ -156,6 +154,19 @@ struct wpabuf * hs20_build_anqp_req(u32 stypes, const u8 *payload,
gas_anqp_set_element_len(buf, len_pos);
gas_anqp_set_len(buf);
+}
+
+
+struct wpabuf * hs20_build_anqp_req(u32 stypes, const u8 *payload,
+ size_t payload_len)
+{
+ struct wpabuf *buf;
+
+ buf = gas_anqp_build_initial_req(0, 100 + payload_len);
+ if (buf == NULL)
+ return NULL;
+
+ hs20_put_anqp_req(stypes, payload, payload_len, buf);
return buf;
}