Lines Matching refs:config

336 static int wpa_config_process_blob(struct wpa_config *config, FILE *f,  in wpa_config_process_blob()  argument
356 wpa_config_set_blob(config, blob); in wpa_config_process_blob()
369 struct wpa_config *config; in wpa_config_read() local
376 config = cfgp; in wpa_config_read()
378 config = wpa_config_alloc_empty(NULL, NULL); in wpa_config_read()
379 if (config == NULL) { in wpa_config_read()
384 tail = head = config->ssid; in wpa_config_read()
387 cred_tail = cred_head = config->cred; in wpa_config_read()
396 os_free(config); in wpa_config_read()
415 if (wpa_config_add_prio_network(config, ssid)) { in wpa_config_read()
438 if (wpa_config_process_blob(config, f, &line, pos + 12) in wpa_config_read()
446 } else if (wpa_config_process_global(config, pos, line) < 0) { in wpa_config_read()
456 config->ssid = head; in wpa_config_read()
457 wpa_config_debug_dump_networks(config); in wpa_config_read()
458 config->cred = cred_head; in wpa_config_read()
462 wpa_config_free(config); in wpa_config_read()
463 config = NULL; in wpa_config_read()
468 return config; in wpa_config_read()
988 static void wpa_config_write_global(FILE *f, struct wpa_config *config) in wpa_config_write_global() argument
991 if (config->ctrl_interface) in wpa_config_write_global()
992 fprintf(f, "ctrl_interface=%s\n", config->ctrl_interface); in wpa_config_write_global()
993 if (config->ctrl_interface_group) in wpa_config_write_global()
995 config->ctrl_interface_group); in wpa_config_write_global()
997 if (config->eapol_version != DEFAULT_EAPOL_VERSION) in wpa_config_write_global()
998 fprintf(f, "eapol_version=%d\n", config->eapol_version); in wpa_config_write_global()
999 if (config->ap_scan != DEFAULT_AP_SCAN) in wpa_config_write_global()
1000 fprintf(f, "ap_scan=%d\n", config->ap_scan); in wpa_config_write_global()
1001 if (config->disable_scan_offload) in wpa_config_write_global()
1003 config->disable_scan_offload); in wpa_config_write_global()
1004 if (config->fast_reauth != DEFAULT_FAST_REAUTH) in wpa_config_write_global()
1005 fprintf(f, "fast_reauth=%d\n", config->fast_reauth); in wpa_config_write_global()
1006 if (config->opensc_engine_path) in wpa_config_write_global()
1008 config->opensc_engine_path); in wpa_config_write_global()
1009 if (config->pkcs11_engine_path) in wpa_config_write_global()
1011 config->pkcs11_engine_path); in wpa_config_write_global()
1012 if (config->pkcs11_module_path) in wpa_config_write_global()
1014 config->pkcs11_module_path); in wpa_config_write_global()
1015 if (config->openssl_ciphers) in wpa_config_write_global()
1016 fprintf(f, "openssl_ciphers=%s\n", config->openssl_ciphers); in wpa_config_write_global()
1017 if (config->pcsc_reader) in wpa_config_write_global()
1018 fprintf(f, "pcsc_reader=%s\n", config->pcsc_reader); in wpa_config_write_global()
1019 if (config->pcsc_pin) in wpa_config_write_global()
1020 fprintf(f, "pcsc_pin=%s\n", config->pcsc_pin); in wpa_config_write_global()
1021 if (config->driver_param) in wpa_config_write_global()
1022 fprintf(f, "driver_param=%s\n", config->driver_param); in wpa_config_write_global()
1023 if (config->dot11RSNAConfigPMKLifetime) in wpa_config_write_global()
1025 config->dot11RSNAConfigPMKLifetime); in wpa_config_write_global()
1026 if (config->dot11RSNAConfigPMKReauthThreshold) in wpa_config_write_global()
1028 config->dot11RSNAConfigPMKReauthThreshold); in wpa_config_write_global()
1029 if (config->dot11RSNAConfigSATimeout) in wpa_config_write_global()
1031 config->dot11RSNAConfigSATimeout); in wpa_config_write_global()
1032 if (config->update_config) in wpa_config_write_global()
1033 fprintf(f, "update_config=%d\n", config->update_config); in wpa_config_write_global()
1035 if (!is_nil_uuid(config->uuid)) { in wpa_config_write_global()
1037 uuid_bin2str(config->uuid, buf, sizeof(buf)); in wpa_config_write_global()
1040 if (config->device_name) in wpa_config_write_global()
1041 fprintf(f, "device_name=%s\n", config->device_name); in wpa_config_write_global()
1042 if (config->manufacturer) in wpa_config_write_global()
1043 fprintf(f, "manufacturer=%s\n", config->manufacturer); in wpa_config_write_global()
1044 if (config->model_name) in wpa_config_write_global()
1045 fprintf(f, "model_name=%s\n", config->model_name); in wpa_config_write_global()
1046 if (config->model_number) in wpa_config_write_global()
1047 fprintf(f, "model_number=%s\n", config->model_number); in wpa_config_write_global()
1048 if (config->serial_number) in wpa_config_write_global()
1049 fprintf(f, "serial_number=%s\n", config->serial_number); in wpa_config_write_global()
1052 buf = wps_dev_type_bin2str(config->device_type, in wpa_config_write_global()
1057 if (WPA_GET_BE32(config->os_version)) in wpa_config_write_global()
1059 WPA_GET_BE32(config->os_version)); in wpa_config_write_global()
1060 if (config->config_methods) in wpa_config_write_global()
1061 fprintf(f, "config_methods=%s\n", config->config_methods); in wpa_config_write_global()
1062 if (config->wps_cred_processing) in wpa_config_write_global()
1064 config->wps_cred_processing); in wpa_config_write_global()
1065 if (config->wps_vendor_ext_m1) { in wpa_config_write_global()
1066 int i, len = wpabuf_len(config->wps_vendor_ext_m1); in wpa_config_write_global()
1067 const u8 *p = wpabuf_head_u8(config->wps_vendor_ext_m1); in wpa_config_write_global()
1077 if (config->p2p_listen_reg_class) in wpa_config_write_global()
1079 config->p2p_listen_reg_class); in wpa_config_write_global()
1080 if (config->p2p_listen_channel) in wpa_config_write_global()
1082 config->p2p_listen_channel); in wpa_config_write_global()
1083 if (config->p2p_oper_reg_class) in wpa_config_write_global()
1085 config->p2p_oper_reg_class); in wpa_config_write_global()
1086 if (config->p2p_oper_channel) in wpa_config_write_global()
1087 fprintf(f, "p2p_oper_channel=%d\n", config->p2p_oper_channel); in wpa_config_write_global()
1088 if (config->p2p_go_intent != DEFAULT_P2P_GO_INTENT) in wpa_config_write_global()
1089 fprintf(f, "p2p_go_intent=%d\n", config->p2p_go_intent); in wpa_config_write_global()
1090 if (config->p2p_ssid_postfix) in wpa_config_write_global()
1091 fprintf(f, "p2p_ssid_postfix=%s\n", config->p2p_ssid_postfix); in wpa_config_write_global()
1092 if (config->persistent_reconnect) in wpa_config_write_global()
1094 config->persistent_reconnect); in wpa_config_write_global()
1095 if (config->p2p_intra_bss != DEFAULT_P2P_INTRA_BSS) in wpa_config_write_global()
1096 fprintf(f, "p2p_intra_bss=%d\n", config->p2p_intra_bss); in wpa_config_write_global()
1097 if (config->p2p_group_idle) in wpa_config_write_global()
1098 fprintf(f, "p2p_group_idle=%d\n", config->p2p_group_idle); in wpa_config_write_global()
1099 if (config->p2p_passphrase_len) in wpa_config_write_global()
1101 config->p2p_passphrase_len); in wpa_config_write_global()
1102 if (config->p2p_pref_chan) { in wpa_config_write_global()
1105 for (i = 0; i < config->num_p2p_pref_chan; i++) { in wpa_config_write_global()
1107 config->p2p_pref_chan[i].op_class, in wpa_config_write_global()
1108 config->p2p_pref_chan[i].chan); in wpa_config_write_global()
1112 if (config->p2p_no_go_freq.num) { in wpa_config_write_global()
1113 char *val = freq_range_list_str(&config->p2p_no_go_freq); in wpa_config_write_global()
1119 if (config->p2p_add_cli_chan) in wpa_config_write_global()
1120 fprintf(f, "p2p_add_cli_chan=%d\n", config->p2p_add_cli_chan); in wpa_config_write_global()
1121 if (config->p2p_optimize_listen_chan != in wpa_config_write_global()
1124 config->p2p_optimize_listen_chan); in wpa_config_write_global()
1125 if (config->p2p_go_ht40) in wpa_config_write_global()
1126 fprintf(f, "p2p_go_ht40=%d\n", config->p2p_go_ht40); in wpa_config_write_global()
1127 if (config->p2p_go_vht) in wpa_config_write_global()
1128 fprintf(f, "p2p_go_vht=%d\n", config->p2p_go_vht); in wpa_config_write_global()
1129 if (config->p2p_go_ctwindow != DEFAULT_P2P_GO_CTWINDOW) in wpa_config_write_global()
1130 fprintf(f, "p2p_go_ctwindow=%d\n", config->p2p_go_ctwindow); in wpa_config_write_global()
1131 if (config->p2p_disabled) in wpa_config_write_global()
1132 fprintf(f, "p2p_disabled=%d\n", config->p2p_disabled); in wpa_config_write_global()
1133 if (config->p2p_no_group_iface) in wpa_config_write_global()
1135 config->p2p_no_group_iface); in wpa_config_write_global()
1136 if (config->p2p_ignore_shared_freq) in wpa_config_write_global()
1138 config->p2p_ignore_shared_freq); in wpa_config_write_global()
1139 if (config->p2p_cli_probe) in wpa_config_write_global()
1140 fprintf(f, "p2p_cli_probe=%d\n", config->p2p_cli_probe); in wpa_config_write_global()
1141 if (config->p2p_go_freq_change_policy != DEFAULT_P2P_GO_FREQ_MOVE) in wpa_config_write_global()
1143 config->p2p_go_freq_change_policy); in wpa_config_write_global()
1144 if (WPA_GET_BE32(config->ip_addr_go)) in wpa_config_write_global()
1146 config->ip_addr_go[0], config->ip_addr_go[1], in wpa_config_write_global()
1147 config->ip_addr_go[2], config->ip_addr_go[3]); in wpa_config_write_global()
1148 if (WPA_GET_BE32(config->ip_addr_mask)) in wpa_config_write_global()
1150 config->ip_addr_mask[0], config->ip_addr_mask[1], in wpa_config_write_global()
1151 config->ip_addr_mask[2], config->ip_addr_mask[3]); in wpa_config_write_global()
1152 if (WPA_GET_BE32(config->ip_addr_start)) in wpa_config_write_global()
1154 config->ip_addr_start[0], config->ip_addr_start[1], in wpa_config_write_global()
1155 config->ip_addr_start[2], config->ip_addr_start[3]); in wpa_config_write_global()
1156 if (WPA_GET_BE32(config->ip_addr_end)) in wpa_config_write_global()
1158 config->ip_addr_end[0], config->ip_addr_end[1], in wpa_config_write_global()
1159 config->ip_addr_end[2], config->ip_addr_end[3]); in wpa_config_write_global()
1161 if (config->country[0] && config->country[1]) { in wpa_config_write_global()
1163 config->country[0], config->country[1]); in wpa_config_write_global()
1165 if (config->bss_max_count != DEFAULT_BSS_MAX_COUNT) in wpa_config_write_global()
1166 fprintf(f, "bss_max_count=%u\n", config->bss_max_count); in wpa_config_write_global()
1167 if (config->bss_expiration_age != DEFAULT_BSS_EXPIRATION_AGE) in wpa_config_write_global()
1169 config->bss_expiration_age); in wpa_config_write_global()
1170 if (config->bss_expiration_scan_count != in wpa_config_write_global()
1173 config->bss_expiration_scan_count); in wpa_config_write_global()
1174 if (config->filter_ssids) in wpa_config_write_global()
1175 fprintf(f, "filter_ssids=%d\n", config->filter_ssids); in wpa_config_write_global()
1176 if (config->max_num_sta != DEFAULT_MAX_NUM_STA) in wpa_config_write_global()
1177 fprintf(f, "max_num_sta=%u\n", config->max_num_sta); in wpa_config_write_global()
1178 if (config->disassoc_low_ack) in wpa_config_write_global()
1179 fprintf(f, "disassoc_low_ack=%d\n", config->disassoc_low_ack); in wpa_config_write_global()
1181 if (config->hs20) in wpa_config_write_global()
1185 if (config->interworking) in wpa_config_write_global()
1186 fprintf(f, "interworking=%d\n", config->interworking); in wpa_config_write_global()
1187 if (!is_zero_ether_addr(config->hessid)) in wpa_config_write_global()
1188 fprintf(f, "hessid=" MACSTR "\n", MAC2STR(config->hessid)); in wpa_config_write_global()
1189 if (config->access_network_type != DEFAULT_ACCESS_NETWORK_TYPE) in wpa_config_write_global()
1191 config->access_network_type); in wpa_config_write_global()
1193 if (config->pbc_in_m1) in wpa_config_write_global()
1194 fprintf(f, "pbc_in_m1=%d\n", config->pbc_in_m1); in wpa_config_write_global()
1195 if (config->wps_nfc_pw_from_config) { in wpa_config_write_global()
1196 if (config->wps_nfc_dev_pw_id) in wpa_config_write_global()
1198 config->wps_nfc_dev_pw_id); in wpa_config_write_global()
1200 config->wps_nfc_dh_pubkey); in wpa_config_write_global()
1202 config->wps_nfc_dh_privkey); in wpa_config_write_global()
1203 write_global_bin(f, "wps_nfc_dev_pw", config->wps_nfc_dev_pw); in wpa_config_write_global()
1206 if (config->ext_password_backend) in wpa_config_write_global()
1208 config->ext_password_backend); in wpa_config_write_global()
1209 if (config->p2p_go_max_inactivity != DEFAULT_P2P_GO_MAX_INACTIVITY) in wpa_config_write_global()
1211 config->p2p_go_max_inactivity); in wpa_config_write_global()
1212 if (config->auto_interworking) in wpa_config_write_global()
1214 config->auto_interworking); in wpa_config_write_global()
1215 if (config->okc) in wpa_config_write_global()
1216 fprintf(f, "okc=%d\n", config->okc); in wpa_config_write_global()
1217 if (config->pmf) in wpa_config_write_global()
1218 fprintf(f, "pmf=%d\n", config->pmf); in wpa_config_write_global()
1219 if (config->dtim_period) in wpa_config_write_global()
1220 fprintf(f, "dtim_period=%d\n", config->dtim_period); in wpa_config_write_global()
1221 if (config->beacon_int) in wpa_config_write_global()
1222 fprintf(f, "beacon_int=%d\n", config->beacon_int); in wpa_config_write_global()
1224 if (config->sae_groups) { in wpa_config_write_global()
1227 for (i = 0; config->sae_groups[i] >= 0; i++) { in wpa_config_write_global()
1229 config->sae_groups[i]); in wpa_config_write_global()
1234 if (config->ap_vendor_elements) { in wpa_config_write_global()
1235 int i, len = wpabuf_len(config->ap_vendor_elements); in wpa_config_write_global()
1236 const u8 *p = wpabuf_head_u8(config->ap_vendor_elements); in wpa_config_write_global()
1245 if (config->ignore_old_scan_res) in wpa_config_write_global()
1247 config->ignore_old_scan_res); in wpa_config_write_global()
1249 if (config->freq_list && config->freq_list[0]) { in wpa_config_write_global()
1252 for (i = 0; config->freq_list[i]; i++) { in wpa_config_write_global()
1254 config->freq_list[i]); in wpa_config_write_global()
1258 if (config->scan_cur_freq != DEFAULT_SCAN_CUR_FREQ) in wpa_config_write_global()
1259 fprintf(f, "scan_cur_freq=%d\n", config->scan_cur_freq); in wpa_config_write_global()
1261 if (config->sched_scan_interval) in wpa_config_write_global()
1263 config->sched_scan_interval); in wpa_config_write_global()
1265 if (config->external_sim) in wpa_config_write_global()
1266 fprintf(f, "external_sim=%d\n", config->external_sim); in wpa_config_write_global()
1268 if (config->tdls_external_control) in wpa_config_write_global()
1270 config->tdls_external_control); in wpa_config_write_global()
1272 if (config->wowlan_triggers) in wpa_config_write_global()
1274 config->wowlan_triggers); in wpa_config_write_global()
1276 if (config->bgscan) in wpa_config_write_global()
1277 fprintf(f, "bgscan=\"%s\"\n", config->bgscan); in wpa_config_write_global()
1279 if (config->p2p_search_delay != DEFAULT_P2P_SEARCH_DELAY) in wpa_config_write_global()
1281 config->p2p_search_delay); in wpa_config_write_global()
1283 if (config->mac_addr) in wpa_config_write_global()
1284 fprintf(f, "mac_addr=%d\n", config->mac_addr); in wpa_config_write_global()
1286 if (config->rand_addr_lifetime != DEFAULT_RAND_ADDR_LIFETIME) in wpa_config_write_global()
1288 config->rand_addr_lifetime); in wpa_config_write_global()
1290 if (config->preassoc_mac_addr) in wpa_config_write_global()
1291 fprintf(f, "preassoc_mac_addr=%d\n", config->preassoc_mac_addr); in wpa_config_write_global()
1293 if (config->key_mgmt_offload != DEFAULT_KEY_MGMT_OFFLOAD) in wpa_config_write_global()
1294 fprintf(f, "key_mgmt_offload=%d\n", config->key_mgmt_offload); in wpa_config_write_global()
1296 if (config->user_mpm != DEFAULT_USER_MPM) in wpa_config_write_global()
1297 fprintf(f, "user_mpm=%d\n", config->user_mpm); in wpa_config_write_global()
1299 if (config->max_peer_links != DEFAULT_MAX_PEER_LINKS) in wpa_config_write_global()
1300 fprintf(f, "max_peer_links=%d\n", config->max_peer_links); in wpa_config_write_global()
1302 if (config->cert_in_cb != DEFAULT_CERT_IN_CB) in wpa_config_write_global()
1303 fprintf(f, "cert_in_cb=%d\n", config->cert_in_cb); in wpa_config_write_global()
1305 if (config->mesh_max_inactivity != DEFAULT_MESH_MAX_INACTIVITY) in wpa_config_write_global()
1307 config->mesh_max_inactivity); in wpa_config_write_global()
1309 if (config->dot11RSNASAERetransPeriod != in wpa_config_write_global()
1312 config->dot11RSNASAERetransPeriod); in wpa_config_write_global()
1314 if (config->passive_scan) in wpa_config_write_global()
1315 fprintf(f, "passive_scan=%d\n", config->passive_scan); in wpa_config_write_global()
1317 if (config->reassoc_same_bss_optim) in wpa_config_write_global()
1319 config->reassoc_same_bss_optim); in wpa_config_write_global()
1321 if (config->wps_priority) in wpa_config_write_global()
1322 fprintf(f, "wps_priority=%d\n", config->wps_priority); in wpa_config_write_global()
1324 if (config->wpa_rsc_relaxation != DEFAULT_WPA_RSC_RELAXATION) in wpa_config_write_global()
1326 config->wpa_rsc_relaxation); in wpa_config_write_global()
1328 if (config->sched_scan_plans) in wpa_config_write_global()
1329 fprintf(f, "sched_scan_plans=%s\n", config->sched_scan_plans); in wpa_config_write_global()
1332 if (config->non_pref_chan) in wpa_config_write_global()
1333 fprintf(f, "non_pref_chan=%s\n", config->non_pref_chan); in wpa_config_write_global()
1334 if (config->mbo_cell_capa != DEFAULT_MBO_CELL_CAPA) in wpa_config_write_global()
1335 fprintf(f, "mbo_cell_capa=%u\n", config->mbo_cell_capa); in wpa_config_write_global()
1343 int wpa_config_write(const char *name, struct wpa_config *config) in wpa_config_write() argument
1371 wpa_config_write_global(f, config); in wpa_config_write()
1373 for (cred = config->cred; cred; cred = cred->next) { in wpa_config_write()
1381 for (ssid = config->ssid; ssid; ssid = ssid->next) { in wpa_config_write()
1393 for (blob = config->blobs; blob; blob = blob->next) { in wpa_config_write()