aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/config_file.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2018-04-16 10:18:57 (GMT)
committerJouni Malinen <j@w1.fi>2018-04-17 13:40:47 (GMT)
commit0e450db285d46bfd14877287f0ca8e74025d92b1 (patch)
treec9794dc6b8d7113ead291bf12138bdfdbeb01635 /hostapd/config_file.c
parent6a8a04d7429a2b5791aba3d7ee777ad7c683a777 (diff)
downloadhostap-0e450db285d46bfd14877287f0ca8e74025d92b1.zip
hostap-0e450db285d46bfd14877287f0ca8e74025d92b1.tar.gz
hostap-0e450db285d46bfd14877287f0ca8e74025d92b1.tar.bz2
HS 2.0: Allow configuration of operator icons
This extends hostapd Hotspot 2.0 implementation to allow operator icons to be made available. The existing hs20_icon parameter is used to define the icons and the new operator_icon parameter (zero or more entries) is used to specify which of the available icons are operator icons. The operator icons are advertised in the Operator Icon Metadata ANQP-element while the icon data can be fetched using the same mechanism (icon request/binary file) that was added for the OSU Providers icons. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'hostapd/config_file.c')
-rw-r--r--hostapd/config_file.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 90f30dd..f327cff 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2023,6 +2023,25 @@ static int hs20_parse_osu_service_desc(struct hostapd_bss_config *bss,
return 0;
}
+
+static int hs20_parse_operator_icon(struct hostapd_bss_config *bss, char *pos,
+ int line)
+{
+ char **n;
+
+ n = os_realloc_array(bss->hs20_operator_icon,
+ bss->hs20_operator_icon_count + 1, sizeof(char *));
+ if (!n)
+ return -1;
+ bss->hs20_operator_icon = n;
+ bss->hs20_operator_icon[bss->hs20_operator_icon_count] = os_strdup(pos);
+ if (!bss->hs20_operator_icon[bss->hs20_operator_icon_count])
+ return -1;
+ bss->hs20_operator_icon_count++;
+
+ return 0;
+}
+
#endif /* CONFIG_HS20 */
@@ -3602,6 +3621,9 @@ static int hostapd_config_fill(struct hostapd_config *conf,
} else if (os_strcmp(buf, "osu_service_desc") == 0) {
if (hs20_parse_osu_service_desc(bss, pos, line) < 0)
return 1;
+ } else if (os_strcmp(buf, "operator_icon") == 0) {
+ if (hs20_parse_operator_icon(bss, pos, line) < 0)
+ return 1;
} else if (os_strcmp(buf, "subscr_remediation_url") == 0) {
os_free(bss->subscr_remediation_url);
bss->subscr_remediation_url = os_strdup(pos);