HS 2.0: Add advertisement of WAN Metrics

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jay Katabathuni 2012-08-25 16:09:01 +03:00 committed by Jouni Malinen
parent 5ccc54aae4
commit 4065a3092b
6 changed files with 112 additions and 0 deletions

View file

@ -507,6 +507,7 @@ static void hostapd_config_free_bss(struct hostapd_bss_config *conf)
#endif /* CONFIG_RADIUS_TEST */
#ifdef CONFIG_HS20
os_free(conf->hs20_wan_metrics);
os_free(conf->hs20_connection_capability);
os_free(conf->hs20_operating_class);
#endif /* CONFIG_HS20 */

View file

@ -410,6 +410,7 @@ struct hostapd_bss_config {
#ifdef CONFIG_HS20
int hs20;
int disable_dgaf;
u8 *hs20_wan_metrics;
u8 *hs20_connection_capability;
size_t hs20_connection_capability_len;
u8 *hs20_operating_class;

View file

@ -139,6 +139,8 @@ static void anqp_add_hs_capab_list(struct hostapd_data *hapd,
wpabuf_put_u8(buf, HS20_STYPE_CAPABILITY_LIST);
wpabuf_put_u8(buf, 0); /* Reserved */
wpabuf_put_u8(buf, HS20_STYPE_CAPABILITY_LIST);
if (hapd->conf->hs20_wan_metrics)
wpabuf_put_u8(buf, HS20_STYPE_WAN_METRICS);
if (hapd->conf->hs20_connection_capability)
wpabuf_put_u8(buf, HS20_STYPE_CONNECTION_CAPABILITY);
if (hapd->conf->hs20_operating_class)
@ -255,6 +257,21 @@ static void anqp_add_domain_name(struct hostapd_data *hapd, struct wpabuf *buf)
}
static void anqp_add_wan_metrics(struct hostapd_data *hapd,
struct wpabuf *buf)
{
if (hapd->conf->hs20_wan_metrics) {
u8 *len = gas_anqp_add_element(buf, ANQP_VENDOR_SPECIFIC);
wpabuf_put_be24(buf, OUI_WFA);
wpabuf_put_u8(buf, HS20_ANQP_OUI_TYPE);
wpabuf_put_u8(buf, HS20_STYPE_WAN_METRICS);
wpabuf_put_u8(buf, 0); /* Reserved */
wpabuf_put_data(buf, hapd->conf->hs20_wan_metrics, 13);
gas_anqp_set_element_len(buf, len);
}
}
static void anqp_add_connection_capability(struct hostapd_data *hapd,
struct wpabuf *buf)
{
@ -315,6 +332,8 @@ gas_serv_build_gas_resp_payload(struct hostapd_data *hapd,
if (request & ANQP_REQ_HS_CAPABILITY_LIST)
anqp_add_hs_capab_list(hapd, buf);
if (request & ANQP_REQ_WAN_METRICS)
anqp_add_wan_metrics(hapd, buf);
if (request & ANQP_REQ_CONNECTION_CAPABILITY)
anqp_add_connection_capability(hapd, buf);
if (request & ANQP_REQ_OPERATING_CLASS)
@ -430,6 +449,11 @@ static void rx_anqp_hs_query_list(struct hostapd_data *hapd, u8 subtype,
set_anqp_req(ANQP_REQ_HS_CAPABILITY_LIST, "HS Capability List",
1, 0, 0, qi);
break;
case HS20_STYPE_WAN_METRICS:
set_anqp_req(ANQP_REQ_WAN_METRICS, "WAN Metrics",
hapd->conf->hs20_wan_metrics != NULL,
0, 0, qi);
break;
case HS20_STYPE_CONNECTION_CAPABILITY:
set_anqp_req(ANQP_REQ_CONNECTION_CAPABILITY,
"Connection Capability",

View file

@ -25,6 +25,8 @@
(1 << (ANQP_DOMAIN_NAME - ANQP_QUERY_LIST))
#define ANQP_REQ_HS_CAPABILITY_LIST \
(0x10000 << HS20_STYPE_CAPABILITY_LIST)
#define ANQP_REQ_WAN_METRICS \
(0x10000 << HS20_STYPE_WAN_METRICS)
#define ANQP_REQ_CONNECTION_CAPABILITY \
(0x10000 << HS20_STYPE_CONNECTION_CAPABILITY)
#define ANQP_REQ_OPERATING_CLASS \