aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2011-10-17 20:55:50 (GMT)
committerJouni Malinen <j@w1.fi>2011-10-17 20:55:50 (GMT)
commit4b2a77aba2aa29ddbe20e3ffd975d3b1034e6e6b (patch)
treed16bfd0f108a36b06d724c8f14f4844477e6fefc /hostapd
parentc7c178e15e19dfece9ccd02de79c7cb7e7d91291 (diff)
downloadhostap-4b2a77aba2aa29ddbe20e3ffd975d3b1034e6e6b.zip
hostap-4b2a77aba2aa29ddbe20e3ffd975d3b1034e6e6b.tar.gz
hostap-4b2a77aba2aa29ddbe20e3ffd975d3b1034e6e6b.tar.bz2
Interworking: Add support for configuring Roaming Consortium List
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/config_file.c37
-rw-r--r--hostapd/hostapd.conf9
2 files changed, 46 insertions, 0 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index a148e39..b84545d 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -1142,6 +1142,40 @@ static int hostapd_config_check(struct hostapd_config *conf)
}
+#ifdef CONFIG_INTERWORKING
+static int parse_roaming_consortium(struct hostapd_bss_config *bss, char *pos,
+ int line)
+{
+ size_t len = os_strlen(pos);
+ u8 oi[MAX_ROAMING_CONSORTIUM_LEN];
+
+ struct hostapd_roaming_consortium *rc;
+
+ if ((len & 1) || len < 2 * 3 || len / 2 > MAX_ROAMING_CONSORTIUM_LEN ||
+ hexstr2bin(pos, oi, len / 2)) {
+ wpa_printf(MSG_ERROR, "Line %d: invalid roaming_consortium "
+ "'%s'", line, pos);
+ return -1;
+ }
+ len /= 2;
+
+ rc = os_realloc(bss->roaming_consortium,
+ sizeof(struct hostapd_roaming_consortium) *
+ (bss->roaming_consortium_count + 1));
+ if (rc == NULL)
+ return -1;
+
+ os_memcpy(rc[bss->roaming_consortium_count].oi, oi, len);
+ rc[bss->roaming_consortium_count].len = len;
+
+ bss->roaming_consortium = rc;
+ bss->roaming_consortium_count++;
+
+ return 0;
+}
+#endif /* CONFIG_INTERWORKING */
+
+
/**
* hostapd_config_read - Read and parse a configuration file
* @fname: Configuration file name (including path, if needed)
@@ -2089,6 +2123,9 @@ struct hostapd_config * hostapd_config_read(const char *fname)
"hessid", line);
errors++;
}
+ } else if (os_strcmp(buf, "roaming_consortium") == 0) {
+ if (parse_roaming_consortium(bss, pos, line) < 0)
+ errors++;
#endif /* CONFIG_INTERWORKING */
} else {
wpa_printf(MSG_ERROR, "Line %d: unknown configuration "
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index be02720..d5ab422 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -1072,6 +1072,15 @@ own_ip_addr=127.0.0.1
# ESS.
#hessid=02:03:04:05:06:07
+# Roaming Consortium List
+# Arbitrary number of Roaming Consortium OIs can be configured with each line
+# adding a new OI to the list. The first three entries are available through
+# Beacon and Probe Response frames. Any additional entry will be available only
+# through ANQP queries. Each OI is between 3 and 15 octets and is configured a
+# a hexstring.
+#roaming_consortium=021122
+#roaming_consortium=2233445566
+
##### Multiple BSSID support ##################################################
#
# Above configuration is using the default interface (wlan#, or multi-SSID VLAN