[PATCH v3 01/19] hostapd: Set LCI and Location Civic information in configuration

Ilan Peer ilan.peer at intel.com
Wed Apr 6 09:42:01 PDT 2016


From: David Spinadel <david.spinadel at intel.com>

Enable configuring LCI and location Civic information in
hostapd.conf.

Signed-off-by: David Spinadel <david.spinadel at intel.com>
---
 hostapd/config_file.c | 8 ++++++--
 hostapd/hostapd.conf  | 5 +++++
 src/ap/ap_config.c    | 2 ++
 src/ap/ap_config.h    | 3 +++
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index c35d5ae..9e17388 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -1920,7 +1920,6 @@ static int hs20_parse_osu_service_desc(struct hostapd_bss_config *bss,
 #endif /* CONFIG_HS20 */
 
 
-#ifdef CONFIG_WPS_NFC
 static struct wpabuf * hostapd_parse_bin(const char *buf)
 {
 	size_t len;
@@ -1942,7 +1941,6 @@ static struct wpabuf * hostapd_parse_bin(const char *buf)
 
 	return ret;
 }
-#endif /* CONFIG_WPS_NFC */
 
 
 #ifdef CONFIG_ACS
@@ -3487,6 +3485,12 @@ static int hostapd_config_fill(struct hostapd_config *conf,
 	} else if (os_strcmp(buf, "no_auth_if_seen_on") == 0) {
 		os_free(bss->no_auth_if_seen_on);
 		bss->no_auth_if_seen_on = os_strdup(pos);
+	} else if (os_strcmp(buf, "lci") == 0) {
+		wpabuf_free(conf->lci);
+		conf->lci = hostapd_parse_bin(pos);
+	} else if (os_strcmp(buf, "civic") == 0) {
+		wpabuf_free(conf->civic);
+		conf->civic = hostapd_parse_bin(pos);
 	} else {
 		wpa_printf(MSG_ERROR,
 			   "Line %d: unknown configuration item '%s'",
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index d943a43..621a645 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -1947,3 +1947,8 @@ own_ip_addr=127.0.0.1
 #bss=wlan0_1
 #bssid=00:13:10:95:fe:0b
 # ...
+
+# The content of a LCI measurement subelement
+# lci=<Binary data of the LCI report>
+# The content of a location civic measurement subelement
+# civic=<Binary data of the location civic report>
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
index 66b843c..e7d7bb9 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -606,6 +606,8 @@ void hostapd_config_free(struct hostapd_config *conf)
 #ifdef CONFIG_ACS
 	os_free(conf->acs_chan_bias);
 #endif /* CONFIG_ACS */
+	wpabuf_free(conf->lci);
+	wpabuf_free(conf->civic);
 
 	os_free(conf);
 }
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 2d07c67..a78d0b2 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -693,6 +693,9 @@ struct hostapd_config {
 	} *acs_chan_bias;
 	unsigned int num_acs_chan_bias;
 #endif /* CONFIG_ACS */
+
+	struct wpabuf *lci;
+	struct wpabuf *civic;
 };
 
 
-- 
1.9.1




More information about the Hostap mailing list