diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2012-02-26 22:34:21 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-02-26 22:53:22 +0200 |
commit | 648cc711a5d86f10f40b369a7eaa8e8aa97db256 (patch) | |
tree | 52402c59ca13acbf7601b435b1c7e87746aea977 /hostapd | |
parent | 3eaee4bf4b109e2382a080d577597b4e5bc462aa (diff) | |
download | external_wpa_supplicant_8_ti-648cc711a5d86f10f40b369a7eaa8e8aa97db256.zip external_wpa_supplicant_8_ti-648cc711a5d86f10f40b369a7eaa8e8aa97db256.tar.gz external_wpa_supplicant_8_ti-648cc711a5d86f10f40b369a7eaa8e8aa97db256.tar.bz2 |
GAS server: Add support for ANQP Venue Name element
The new venue_name configuration parameter can now be used to configure
the ANQP Venue Name values that stations can request through GAS.
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'hostapd')
-rw-r--r-- | hostapd/config_file.c | 46 | ||||
-rw-r--r-- | hostapd/hostapd.conf | 9 |
2 files changed, 55 insertions, 0 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c index d20496a..638adcc 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -1175,6 +1175,49 @@ static int parse_roaming_consortium(struct hostapd_bss_config *bss, char *pos, return 0; } + + +static int parse_venue_name(struct hostapd_bss_config *bss, char *pos, + int line) +{ + char *sep; + size_t clen, nlen; + struct hostapd_venue_name *vn; + + sep = os_strchr(pos, ':'); + if (sep == NULL) + goto fail; + *sep++ = '\0'; + + clen = os_strlen(pos); + if (clen < 2) + goto fail; + nlen = os_strlen(sep); + if (nlen > 252) + goto fail; + + vn = os_realloc(bss->venue_name, + sizeof(struct hostapd_venue_name) * + (bss->venue_name_count + 1)); + if (vn == NULL) + return -1; + + bss->venue_name = vn; + vn = &bss->venue_name[bss->venue_name_count]; + bss->venue_name_count++; + + os_memset(vn->lang, 0, sizeof(vn->lang)); + os_memcpy(vn->lang, pos, clen); + vn->name_len = nlen; + os_memcpy(vn->name, sep, nlen); + + return 0; + +fail: + wpa_printf(MSG_ERROR, "Line %d: Invalid venue_name '%s'", + line, pos); + return -1; +} #endif /* CONFIG_INTERWORKING */ @@ -2113,6 +2156,9 @@ static int hostapd_config_fill(struct hostapd_config *conf, } else if (os_strcmp(buf, "roaming_consortium") == 0) { if (parse_roaming_consortium(bss, pos, line) < 0) errors++; + } else if (os_strcmp(buf, "venue_name") == 0) { + if (parse_venue_name(bss, pos, line) < 0) + errors++; } else if (os_strcmp(buf, "gas_frag_limit") == 0) { bss->gas_frag_limit = atoi(pos); } else if (os_strcmp(buf, "gas_comeback_delay") == 0) { diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index 4e6202b..ceae065 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -1118,6 +1118,15 @@ own_ip_addr=127.0.0.1 #roaming_consortium=021122 #roaming_consortium=2233445566 +# Venue Name information +# This parameter can be used to configure one or more Venue Name Duples for +# Venue Name ANQP information. Each entry has a two or three character language +# code (ISO-639) separated by colon from the venue name string. +# Note that venue_group and venue_type have to be set for Venue Name +# information to be complete. +#venue_name=eng:Example venue +#venue_name=fin:Esimerkkipaikka + ##### Multiple BSSID support ################################################## # # Above configuration is using the default interface (wlan#, or multi-SSID VLAN |