aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-07-18 21:30:24 (GMT)
committerJouni Malinen <j@w1.fi>2010-09-09 14:17:16 (GMT)
commit611aea7d41f83b2ef3d5d2cada39113060aac8eb (patch)
tree7c6b4a3158b558d21a8c3af72be4acfff4398cd3 /wpa_supplicant/wps_supplicant.c
parent1d47214aa973d46cde9dd9fcdbb9a6ef95076f8f (diff)
downloadhostap-611aea7d41f83b2ef3d5d2cada39113060aac8eb.zip
hostap-611aea7d41f83b2ef3d5d2cada39113060aac8eb.tar.gz
hostap-611aea7d41f83b2ef3d5d2cada39113060aac8eb.tar.bz2
Allow ctrl_iface SET command to change global config parameters
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 99fcabc..5e724c6 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -1322,3 +1322,44 @@ int wpas_wps_in_progress(struct wpa_supplicant *wpa_s)
return 0;
}
+
+
+void wpas_wps_update_config(struct wpa_supplicant *wpa_s)
+{
+ struct wps_context *wps = wpa_s->wps;
+
+ if (wps == NULL)
+ return;
+
+ if (wpa_s->conf->changed_parameters & CFG_CHANGED_CONFIG_METHODS) {
+ wps->config_methods = wps_config_methods_str2bin(
+ wpa_s->conf->config_methods);
+ if ((wps->config_methods &
+ (WPS_CONFIG_DISPLAY | WPS_CONFIG_LABEL)) ==
+ (WPS_CONFIG_DISPLAY | WPS_CONFIG_LABEL)) {
+ wpa_printf(MSG_ERROR, "WPS: Both Label and Display "
+ "config methods are not allowed at the "
+ "same time");
+ wps->config_methods &= ~WPS_CONFIG_LABEL;
+ }
+ }
+
+ if (wpa_s->conf->changed_parameters & CFG_CHANGED_DEVICE_TYPE) {
+ if (wpa_s->conf->device_type &&
+ wps_dev_type_str2bin(wpa_s->conf->device_type,
+ wps->dev.pri_dev_type) < 0)
+ wpa_printf(MSG_ERROR, "WPS: Invalid device_type");
+ }
+
+ if (wpa_s->conf->changed_parameters & CFG_CHANGED_OS_VERSION)
+ wps->dev.os_version = WPA_GET_BE32(wpa_s->conf->os_version);
+
+ if (wpa_s->conf->changed_parameters & CFG_CHANGED_UUID) {
+ if (is_nil_uuid(wpa_s->conf->uuid)) {
+ uuid_gen_mac_addr(wpa_s->own_addr, wps->uuid);
+ wpa_hexdump(MSG_DEBUG, "WPS: UUID based on MAC "
+ "address", wps->uuid, WPS_UUID_LEN);
+ } else
+ os_memcpy(wps->uuid, wpa_s->conf->uuid, WPS_UUID_LEN);
+ }
+}