From d5d24784e6eb6d41dafbdf9878b5632a5ec068ad Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 17 Mar 2013 15:59:36 +0200 Subject: [PATCH] HS 2.0R2 AP: Update HS 2.0 Indication element to Release 2 The HS 2.0 Indication element from hostapd now includes the release number field and the new ANQP Domain ID field. This ID can be configured with anqp_domain_id parameter in hostapd.conf. Signed-hostap: Jouni Malinen --- hostapd/config_file.c | 2 ++ hostapd/hostapd.conf | 5 +++++ src/ap/ap_config.h | 1 + src/ap/hs20.c | 13 ++++++++++--- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index a889dcafb..26f52e9f7 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -2810,6 +2810,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, bss->hs20 = atoi(pos); } else if (os_strcmp(buf, "disable_dgaf") == 0) { bss->disable_dgaf = atoi(pos); + } else if (os_strcmp(buf, "anqp_domain_id") == 0) { + bss->anqp_domain_id = atoi(pos); } else if (os_strcmp(buf, "hs20_oper_friendly_name") == 0) { if (hs20_parse_oper_friendly_name(bss, pos, line) < 0) errors++; diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index 3733a32c4..0630320d1 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -1582,6 +1582,11 @@ own_ip_addr=127.0.0.1 # forging such frames to other stations in the BSS. #disable_dgaf=1 +# ANQP Domain ID (0..65535) +# An identifier for a set of APs in an ESS that share the same common ANQP +# information. 0 = Some of the ANQP information is unique to this AP (default). +#anqp_domain_id=1234 + # Operator Friendly Name # This parameter can be used to configure one or more Operator Friendly Name # Duples. Each entry has a two or three character language code (ISO-639) diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index eda193b33..b6e8cbcce 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -455,6 +455,7 @@ struct hostapd_bss_config { #ifdef CONFIG_HS20 int hs20; int disable_dgaf; + u16 anqp_domain_id; unsigned int hs20_oper_friendly_name_count; struct hostapd_lang_string *hs20_oper_friendly_name; u8 *hs20_wan_metrics; diff --git a/src/ap/hs20.c b/src/ap/hs20.c index 45d518bc1..01c87e820 100644 --- a/src/ap/hs20.c +++ b/src/ap/hs20.c @@ -18,14 +18,21 @@ u8 * hostapd_eid_hs20_indication(struct hostapd_data *hapd, u8 *eid) { + u8 conf; if (!hapd->conf->hs20) return eid; *eid++ = WLAN_EID_VENDOR_SPECIFIC; - *eid++ = 5; + *eid++ = 7; WPA_PUT_BE24(eid, OUI_WFA); eid += 3; *eid++ = HS20_INDICATION_OUI_TYPE; - /* Hotspot Configuration: DGAF Enabled */ - *eid++ = hapd->conf->disable_dgaf ? 0x01 : 0x00; + conf = HS20_VERSION; /* Release Number */ + conf |= HS20_ANQP_DOMAIN_ID_PRESENT; + if (hapd->conf->disable_dgaf) + conf |= HS20_DGAF_DISABLED; + *eid++ = conf; + WPA_PUT_LE16(eid, hapd->conf->anqp_domain_id); + eid += 2; + return eid; }