Interworking: Add Domain Name element (AP)

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jay Katabathuni 2012-07-30 21:55:46 +03:00 committed by Jouni Malinen
parent 78bda93e83
commit 26fac8b6a0
6 changed files with 72 additions and 0 deletions

View file

@ -499,6 +499,7 @@ static void hostapd_config_free_bss(struct hostapd_bss_config *conf)
os_free(conf->roaming_consortium);
os_free(conf->venue_name);
os_free(conf->network_auth_type);
os_free(conf->domain_name);
#ifdef CONFIG_RADIUS_TEST
os_free(conf->dump_msk_file);

View file

@ -399,6 +399,10 @@ struct hostapd_bss_config {
u8 ipaddr_type_availability;
u8 ipaddr_type_configured;
/* IEEE 802.11u - Domain Name */
u8 *domain_name;
size_t domain_name_len;
u16 gas_comeback_delay;
int gas_frag_limit;

View file

@ -143,6 +143,8 @@ static void anqp_add_capab_list(struct hostapd_data *hapd,
wpabuf_put_le16(buf, ANQP_ROAMING_CONSORTIUM);
if (hapd->conf->ipaddr_type_configured)
wpabuf_put_le16(buf, ANQP_IP_ADDR_TYPE_AVAILABILITY);
if (hapd->conf->domain_name)
wpabuf_put_le16(buf, ANQP_DOMAIN_NAME);
gas_anqp_set_element_len(buf, len);
}
@ -207,6 +209,17 @@ static void anqp_add_ip_addr_type_availability(struct hostapd_data *hapd,
}
static void anqp_add_domain_name(struct hostapd_data *hapd, struct wpabuf *buf)
{
if (hapd->conf->domain_name) {
wpabuf_put_le16(buf, ANQP_DOMAIN_NAME);
wpabuf_put_le16(buf, hapd->conf->domain_name_len);
wpabuf_put_data(buf, hapd->conf->domain_name,
hapd->conf->domain_name_len);
}
}
static struct wpabuf *
gas_serv_build_gas_resp_payload(struct hostapd_data *hapd,
unsigned int request,
@ -228,6 +241,8 @@ gas_serv_build_gas_resp_payload(struct hostapd_data *hapd,
anqp_add_roaming_consortium(hapd, buf);
if (request & ANQP_REQ_IP_ADDR_TYPE_AVAILABILITY)
anqp_add_ip_addr_type_availability(hapd, buf);
if (request & ANQP_REQ_DOMAIN_NAME)
anqp_add_domain_name(hapd, buf);
return buf;
}
@ -297,6 +312,11 @@ static void rx_anqp_query_list_id(struct hostapd_data *hapd, u16 info_id,
"IP Addr Type Availability",
hapd->conf->ipaddr_type_configured,
0, 0, qi);
case ANQP_DOMAIN_NAME:
set_anqp_req(ANQP_REQ_DOMAIN_NAME, "Domain Name",
hapd->conf->domain_name != NULL,
0, 0, qi);
break;
default:
wpa_printf(MSG_DEBUG, "ANQP: Unsupported Info Id %u",
info_id);

View file

@ -19,6 +19,8 @@
(1 << (ANQP_ROAMING_CONSORTIUM - ANQP_QUERY_LIST))
#define ANQP_REQ_IP_ADDR_TYPE_AVAILABILITY \
(1 << (ANQP_IP_ADDR_TYPE_AVAILABILITY - ANQP_QUERY_LIST))
#define ANQP_REQ_DOMAIN_NAME \
(1 << (ANQP_DOMAIN_NAME - ANQP_QUERY_LIST))
/* To account for latencies between hostapd and external ANQP processor */
#define GAS_SERV_COMEBACK_DELAY_FUDGE 10