Lines Matching defs:config
34 #include "config.h"
50 static int wpa_config_read_blobs(struct wpa_config *config, HKEY hk)
60 wpa_printf(MSG_DEBUG, "Could not open wpa_supplicant config "
111 wpa_config_set_blob(config, blob);
164 static int wpa_config_read_global_uuid(struct wpa_config *config, HKEY hk)
173 if (uuid_str2bin(str, config->uuid))
182 static int wpa_config_read_global_os_version(struct wpa_config *config,
192 if (hexstr2bin(str, config->os_version, 4))
202 static int wpa_config_read_global(struct wpa_config *config, HKEY hk)
207 wpa_config_read_reg_dword(hk, TEXT("ap_scan"), &config->ap_scan);
209 &config->fast_reauth);
211 (int *) &config->dot11RSNAConfigPMKLifetime);
215 &config->dot11RSNAConfigPMKReauthThreshold);
217 (int *) &config->dot11RSNAConfigSATimeout);
219 &config->update_config);
222 &config->eapol_version) == 0) {
223 if (config->eapol_version < 1 ||
224 config->eapol_version > 2) {
226 config->eapol_version);
231 config->ctrl_interface = wpa_config_read_reg_string(
235 if (wpa_config_read_global_uuid(config, hk))
237 config->device_name = wpa_config_read_reg_string(
239 config->manufacturer = wpa_config_read_reg_string(
241 config->model_name = wpa_config_read_reg_string(
243 config->serial_number = wpa_config_read_reg_string(
248 if (t && wps_dev_type_str2bin(t, config->device_type))
252 config->config_methods = wpa_config_read_reg_string(
254 if (wpa_config_read_global_os_version(config, hk))
257 &config->wps_cred_processing);
260 config->p2p_ssid_postfix = wpa_config_read_reg_string(
263 (int *) &config->p2p_group_idle);
267 (int *) &config->bss_max_count);
269 &config->filter_ssids);
271 (int *) &config->max_num_sta);
273 (int *) &config->disassoc_low_ack);
275 wpa_config_read_reg_dword(hk, TEXT("okc"), &config->okc);
277 config->pmf = val;
294 wpa_printf(MSG_DEBUG, "Could not open wpa_supplicant config "
372 static int wpa_config_read_networks(struct wpa_config *config, HKEY hk)
422 if (wpa_config_add_prio_network(config, ssid)) {
432 config->ssid = head;
442 struct wpa_config *config;
449 config = cfgp;
451 config = wpa_config_alloc_empty(NULL, NULL);
452 if (config == NULL)
466 os_free(config);
470 if (wpa_config_read_global(config, hk))
473 if (wpa_config_read_networks(config, hk))
476 if (wpa_config_read_blobs(config, hk))
479 wpa_config_debug_dump_networks(config);
484 wpa_config_free(config);
485 config = NULL;
488 return config;
552 static int wpa_config_write_global(struct wpa_config *config, HKEY hk)
556 config->ctrl_interface);
560 config->eapol_version,
562 wpa_config_write_reg_dword(hk, TEXT("ap_scan"), config->ap_scan,
565 config->fast_reauth, DEFAULT_FAST_REAUTH);
567 config->dot11RSNAConfigPMKLifetime, 0);
570 config->dot11RSNAConfigPMKReauthThreshold,
573 config->dot11RSNAConfigSATimeout, 0);
575 config->update_config,
578 if (!is_nil_uuid(config->uuid)) {
580 uuid_bin2str(config->uuid, buf, sizeof(buf));
583 wpa_config_write_reg_string(hk, "device_name", config->device_name);
584 wpa_config_write_reg_string(hk, "manufacturer", config->manufacturer);
585 wpa_config_write_reg_string(hk, "model_name", config->model_name);
586 wpa_config_write_reg_string(hk, "model_number", config->model_number);
588 config->serial_number);
591 buf = wps_dev_type_bin2str(config->device_type,
596 config->config_methods);
597 if (WPA_GET_BE32(config->os_version)) {
600 WPA_GET_BE32(config->os_version));
604 config->wps_cred_processing, 0);
608 config->p2p_ssid_postfix);
610 config->p2p_group_idle, 0);
614 config->bss_max_count,
617 config->filter_ssids, 0);
619 config->max_num_sta, DEFAULT_MAX_NUM_STA);
621 config->disassoc_low_ack, 0);
623 wpa_config_write_reg_dword(hk, TEXT("okc"), config->okc, 0);
624 wpa_config_write_reg_dword(hk, TEXT("pmf"), config->pmf, 0);
627 config->external_sim, 0);
981 int wpa_config_write(const char *name, struct wpa_config *config)
1007 if (wpa_config_write_global(config, hk)) {
1014 for (ssid = config->ssid, id = 0; ssid; ssid = ssid->next, id++) {
1022 for (blob = config->blobs; blob; blob = blob->next) {