Lines Matching refs:config

2792 int wpa_config_add_prio_network(struct wpa_config *config,  in wpa_config_add_prio_network()  argument
2802 for (prio = 0; prio < config->num_prio; prio++) { in wpa_config_add_prio_network()
2803 prev = config->pssid[prio]; in wpa_config_add_prio_network()
2813 nlist = os_realloc_array(config->pssid, config->num_prio + 1, in wpa_config_add_prio_network()
2818 for (prio = 0; prio < config->num_prio; prio++) { in wpa_config_add_prio_network()
2821 (config->num_prio - prio) * in wpa_config_add_prio_network()
2828 config->num_prio++; in wpa_config_add_prio_network()
2829 config->pssid = nlist; in wpa_config_add_prio_network()
2844 int wpa_config_update_prio_list(struct wpa_config *config) in wpa_config_update_prio_list() argument
2849 os_free(config->pssid); in wpa_config_update_prio_list()
2850 config->pssid = NULL; in wpa_config_update_prio_list()
2851 config->num_prio = 0; in wpa_config_update_prio_list()
2853 ssid = config->ssid; in wpa_config_update_prio_list()
2856 if (wpa_config_add_prio_network(config, ssid) < 0) in wpa_config_update_prio_list()
3004 void wpa_config_flush_blobs(struct wpa_config *config) in wpa_config_flush_blobs() argument
3009 blob = config->blobs; in wpa_config_flush_blobs()
3010 config->blobs = NULL; in wpa_config_flush_blobs()
3027 void wpa_config_free(struct wpa_config *config) in wpa_config_free() argument
3033 ssid = config->ssid; in wpa_config_free()
3040 cred = config->cred; in wpa_config_free()
3047 wpa_config_flush_blobs(config); in wpa_config_free()
3049 wpabuf_free(config->wps_vendor_ext_m1); in wpa_config_free()
3051 wpabuf_free(config->wps_vendor_ext[i]); in wpa_config_free()
3052 os_free(config->ctrl_interface); in wpa_config_free()
3053 os_free(config->ctrl_interface_group); in wpa_config_free()
3055 os_free(config->opensc_engine_path); in wpa_config_free()
3058 os_free(config->pkcs11_engine_path); in wpa_config_free()
3061 os_free(config->pkcs11_module_path); in wpa_config_free()
3063 os_free(config->openssl_ciphers); in wpa_config_free()
3064 os_free(config->pcsc_reader); in wpa_config_free()
3065 str_clear_free(config->pcsc_pin); in wpa_config_free()
3066 os_free(config->driver_param); in wpa_config_free()
3067 os_free(config->device_name); in wpa_config_free()
3068 os_free(config->manufacturer); in wpa_config_free()
3069 os_free(config->model_name); in wpa_config_free()
3070 os_free(config->model_number); in wpa_config_free()
3071 os_free(config->serial_number); in wpa_config_free()
3072 os_free(config->config_methods); in wpa_config_free()
3073 os_free(config->p2p_ssid_postfix); in wpa_config_free()
3074 os_free(config->pssid); in wpa_config_free()
3075 os_free(config->p2p_pref_chan); in wpa_config_free()
3076 os_free(config->p2p_no_go_freq.range); in wpa_config_free()
3077 os_free(config->autoscan); in wpa_config_free()
3078 os_free(config->freq_list); in wpa_config_free()
3079 os_free(config->initial_freq_list); in wpa_config_free()
3080 wpabuf_free(config->wps_nfc_dh_pubkey); in wpa_config_free()
3081 wpabuf_free(config->wps_nfc_dh_privkey); in wpa_config_free()
3082 wpabuf_free(config->wps_nfc_dev_pw); in wpa_config_free()
3083 os_free(config->ext_password_backend); in wpa_config_free()
3084 os_free(config->sae_groups); in wpa_config_free()
3085 wpabuf_free(config->ap_vendor_elements); in wpa_config_free()
3086 wpabuf_free(config->ap_assocresp_elements); in wpa_config_free()
3087 os_free(config->osu_dir); in wpa_config_free()
3088 os_free(config->bgscan); in wpa_config_free()
3089 os_free(config->wowlan_triggers); in wpa_config_free()
3090 os_free(config->fst_group_id); in wpa_config_free()
3091 os_free(config->sched_scan_plans); in wpa_config_free()
3093 os_free(config->non_pref_chan); in wpa_config_free()
3095 os_free(config->dpp_name); in wpa_config_free()
3096 os_free(config->dpp_mud_url); in wpa_config_free()
3097 os_free(config->dpp_extra_conf_req_name); in wpa_config_free()
3098 os_free(config->dpp_extra_conf_req_value); in wpa_config_free()
3100 os_free(config); in wpa_config_free()
3114 void wpa_config_foreach_network(struct wpa_config *config, in wpa_config_foreach_network() argument
3120 ssid = config->ssid; in wpa_config_foreach_network()
3135 struct wpa_ssid * wpa_config_get_network(struct wpa_config *config, int id) in wpa_config_get_network() argument
3139 ssid = config->ssid; in wpa_config_get_network()
3155 struct wpa_ssid * wpa_config_add_network(struct wpa_config *config) in wpa_config_add_network() argument
3161 ssid = config->ssid; in wpa_config_add_network()
3178 config->ssid = ssid; in wpa_config_add_network()
3180 wpa_config_update_prio_list(config); in wpa_config_add_network()
3192 int wpa_config_remove_network(struct wpa_config *config, int id) in wpa_config_remove_network() argument
3196 ssid = config->ssid; in wpa_config_remove_network()
3210 config->ssid = ssid->next; in wpa_config_remove_network()
3212 wpa_config_update_prio_list(config); in wpa_config_remove_network()
4466 struct wpa_cred * wpa_config_get_cred(struct wpa_config *config, int id) in wpa_config_get_cred() argument
4470 cred = config->cred; in wpa_config_get_cred()
4481 struct wpa_cred * wpa_config_add_cred(struct wpa_config *config) in wpa_config_add_cred() argument
4487 cred = config->cred; in wpa_config_add_cred()
4504 config->cred = cred; in wpa_config_add_cred()
4510 int wpa_config_remove_cred(struct wpa_config *config, int id) in wpa_config_remove_cred() argument
4514 cred = config->cred; in wpa_config_remove_cred()
4528 config->cred = cred->next; in wpa_config_remove_cred()
4542 const struct wpa_config_blob * wpa_config_get_blob(struct wpa_config *config, in wpa_config_get_blob() argument
4545 struct wpa_config_blob *blob = config->blobs; in wpa_config_get_blob()
4564 void wpa_config_set_blob(struct wpa_config *config, in wpa_config_set_blob() argument
4567 wpa_config_remove_blob(config, blob->name); in wpa_config_set_blob()
4568 blob->next = config->blobs; in wpa_config_set_blob()
4569 config->blobs = blob; in wpa_config_set_blob()
4593 int wpa_config_remove_blob(struct wpa_config *config, const char *name) in wpa_config_remove_blob() argument
4595 struct wpa_config_blob *pos = config->blobs, *prev = NULL; in wpa_config_remove_blob()
4602 config->blobs = pos->next; in wpa_config_remove_blob()
4627 struct wpa_config *config; in wpa_config_alloc_empty() local
4649 config = os_zalloc(sizeof(*config)); in wpa_config_alloc_empty()
4650 if (config == NULL) in wpa_config_alloc_empty()
4652 config->eapol_version = DEFAULT_EAPOL_VERSION; in wpa_config_alloc_empty()
4653 config->ap_scan = DEFAULT_AP_SCAN; in wpa_config_alloc_empty()
4654 config->user_mpm = DEFAULT_USER_MPM; in wpa_config_alloc_empty()
4655 config->max_peer_links = DEFAULT_MAX_PEER_LINKS; in wpa_config_alloc_empty()
4656 config->mesh_max_inactivity = DEFAULT_MESH_MAX_INACTIVITY; in wpa_config_alloc_empty()
4657 config->mesh_fwding = DEFAULT_MESH_FWDING; in wpa_config_alloc_empty()
4658 config->dot11RSNASAERetransPeriod = in wpa_config_alloc_empty()
4660 config->fast_reauth = DEFAULT_FAST_REAUTH; in wpa_config_alloc_empty()
4661 config->p2p_go_intent = DEFAULT_P2P_GO_INTENT; in wpa_config_alloc_empty()
4662 config->p2p_intra_bss = DEFAULT_P2P_INTRA_BSS; in wpa_config_alloc_empty()
4663 config->p2p_go_freq_change_policy = DEFAULT_P2P_GO_FREQ_MOVE; in wpa_config_alloc_empty()
4664 config->p2p_go_max_inactivity = DEFAULT_P2P_GO_MAX_INACTIVITY; in wpa_config_alloc_empty()
4665 config->p2p_optimize_listen_chan = DEFAULT_P2P_OPTIMIZE_LISTEN_CHAN; in wpa_config_alloc_empty()
4666 config->p2p_go_ctwindow = DEFAULT_P2P_GO_CTWINDOW; in wpa_config_alloc_empty()
4667 config->bss_max_count = DEFAULT_BSS_MAX_COUNT; in wpa_config_alloc_empty()
4668 config->bss_expiration_age = DEFAULT_BSS_EXPIRATION_AGE; in wpa_config_alloc_empty()
4669 config->bss_expiration_scan_count = DEFAULT_BSS_EXPIRATION_SCAN_COUNT; in wpa_config_alloc_empty()
4670 config->max_num_sta = DEFAULT_MAX_NUM_STA; in wpa_config_alloc_empty()
4671 config->ap_isolate = DEFAULT_AP_ISOLATE; in wpa_config_alloc_empty()
4672 config->access_network_type = DEFAULT_ACCESS_NETWORK_TYPE; in wpa_config_alloc_empty()
4673 config->scan_cur_freq = DEFAULT_SCAN_CUR_FREQ; in wpa_config_alloc_empty()
4674 config->scan_res_valid_for_connect = DEFAULT_SCAN_RES_VALID_FOR_CONNECT; in wpa_config_alloc_empty()
4675 config->wmm_ac_params[0] = ac_be; in wpa_config_alloc_empty()
4676 config->wmm_ac_params[1] = ac_bk; in wpa_config_alloc_empty()
4677 config->wmm_ac_params[2] = ac_vi; in wpa_config_alloc_empty()
4678 config->wmm_ac_params[3] = ac_vo; in wpa_config_alloc_empty()
4679 config->tx_queue[0] = txq_vo; in wpa_config_alloc_empty()
4680 config->tx_queue[1] = txq_vi; in wpa_config_alloc_empty()
4681 config->tx_queue[2] = txq_be; in wpa_config_alloc_empty()
4682 config->tx_queue[3] = txq_bk; in wpa_config_alloc_empty()
4683 config->p2p_search_delay = DEFAULT_P2P_SEARCH_DELAY; in wpa_config_alloc_empty()
4684 config->rand_addr_lifetime = DEFAULT_RAND_ADDR_LIFETIME; in wpa_config_alloc_empty()
4685 config->key_mgmt_offload = DEFAULT_KEY_MGMT_OFFLOAD; in wpa_config_alloc_empty()
4686 config->cert_in_cb = DEFAULT_CERT_IN_CB; in wpa_config_alloc_empty()
4687 config->wpa_rsc_relaxation = DEFAULT_WPA_RSC_RELAXATION; in wpa_config_alloc_empty()
4688 config->extended_key_id = DEFAULT_EXTENDED_KEY_ID; in wpa_config_alloc_empty()
4691 config->mbo_cell_capa = DEFAULT_MBO_CELL_CAPA; in wpa_config_alloc_empty()
4692 config->disassoc_imminent_rssi_threshold = in wpa_config_alloc_empty()
4694 config->oce = DEFAULT_OCE_SUPPORT; in wpa_config_alloc_empty()
4698 config->ctrl_interface = os_strdup(ctrl_interface); in wpa_config_alloc_empty()
4700 config->driver_param = os_strdup(driver_param); in wpa_config_alloc_empty()
4701 config->gas_rand_addr_lifetime = DEFAULT_RAND_ADDR_LIFETIME; in wpa_config_alloc_empty()
4704 config->mld_connect_band_pref = DEFAULT_MLD_CONNECT_BAND_PREF; in wpa_config_alloc_empty()
4707 return config; in wpa_config_alloc_empty()
4716 void wpa_config_debug_dump_networks(struct wpa_config *config) in wpa_config_debug_dump_networks() argument
4721 for (prio = 0; prio < config->num_prio; prio++) { in wpa_config_debug_dump_networks()
4722 ssid = config->pssid[prio]; in wpa_config_debug_dump_networks()
4751 struct wpa_config *config, int line, const char *value);
4754 int (*get)(const char *name, struct wpa_config *config, long offset,
4767 struct wpa_config *config, int line, in wpa_global_config_parse_int_impl() argument
4774 dst = (int *) (((u8 *) config) + (long) data->param1); in wpa_global_config_parse_int_impl()
4806 struct wpa_config *config, int line, in wpa_global_config_parse_int() argument
4809 return wpa_global_config_parse_int_impl(data, config, line, pos, false); in wpa_global_config_parse_int()
4815 struct wpa_config *config, int line, in wpa_global_config_parse_int_range() argument
4818 return wpa_global_config_parse_int_impl(data, config, line, pos, true); in wpa_global_config_parse_int_range()
4823 struct wpa_config *config, int line, in wpa_global_config_parse_str() argument
4850 dst = (char **) (((u8 *) config) + (long) data->param1); in wpa_global_config_parse_str()
4873 struct wpa_config *config, int line, in wpa_config_process_bgscan() argument
4887 res = wpa_global_config_parse_str(data, config, line, tmp); in wpa_config_process_bgscan()
4894 struct wpa_config *config, int line, in wpa_global_config_parse_bin() argument
4903 dst = (struct wpabuf **) (((u8 *) config) + (long) data->param1); in wpa_global_config_parse_bin()
4917 struct wpa_config *config, int line, in wpa_config_process_freq_list() argument
4929 os_free(config->freq_list); in wpa_config_process_freq_list()
4930 config->freq_list = freqs; in wpa_config_process_freq_list()
4937 struct wpa_config *config, int line, in wpa_config_process_initial_freq_list() argument
4949 os_free(config->initial_freq_list); in wpa_config_process_initial_freq_list()
4950 config->initial_freq_list = freqs; in wpa_config_process_initial_freq_list()
4957 struct wpa_config *config, int line, in wpa_global_config_parse_ipv4() argument
4968 dst = (u32 *) (((u8 *) config) + (long) data->param1); in wpa_global_config_parse_ipv4()
4981 struct wpa_config *config, int line, in wpa_config_process_country() argument
4988 if (pos[0] == config->country[0] && pos[1] == config->country[1]) in wpa_config_process_country()
4990 config->country[0] = pos[0]; in wpa_config_process_country()
4991 config->country[1] = pos[1]; in wpa_config_process_country()
4993 config->country[0], config->country[1]); in wpa_config_process_country()
5000 const struct global_parse_data *data, struct wpa_config *config, in wpa_config_process_load_dynamic_eap() argument
5023 struct wpa_config *config, int line, in wpa_config_process_uuid() argument
5027 if (uuid_str2bin(pos, config->uuid)) { in wpa_config_process_uuid()
5031 uuid_bin2str(config->uuid, buf, sizeof(buf)); in wpa_config_process_uuid()
5039 struct wpa_config *config, int line, const char *pos) in wpa_config_process_device_type() argument
5041 return wps_dev_type_str2bin(pos, config->device_type); in wpa_config_process_device_type()
5046 struct wpa_config *config, int line, in wpa_config_process_os_version() argument
5049 if (hexstr2bin(pos, config->os_version, 4)) { in wpa_config_process_os_version()
5054 WPA_GET_BE32(config->os_version)); in wpa_config_process_os_version()
5061 struct wpa_config *config, int line, const char *pos) in wpa_config_process_wps_vendor_ext_m1() argument
5084 wpabuf_free(config->wps_vendor_ext_m1); in wpa_config_process_wps_vendor_ext_m1()
5085 config->wps_vendor_ext_m1 = tmp; in wpa_config_process_wps_vendor_ext_m1()
5100 struct wpa_config *config, int line, const char *pos) in wpa_config_process_sec_device_type() argument
5104 if (config->num_sec_device_types >= MAX_SEC_DEVICE_TYPES) { in wpa_config_process_sec_device_type()
5110 idx = config->num_sec_device_types; in wpa_config_process_sec_device_type()
5112 if (wps_dev_type_str2bin(pos, config->sec_device_type[idx])) in wpa_config_process_sec_device_type()
5115 config->num_sec_device_types++; in wpa_config_process_sec_device_type()
5122 struct wpa_config *config, int line, const char *pos) in wpa_config_process_p2p_pref_chan() argument
5154 os_free(config->p2p_pref_chan); in wpa_config_process_p2p_pref_chan()
5155 config->p2p_pref_chan = pref; in wpa_config_process_p2p_pref_chan()
5156 config->num_p2p_pref_chan = num; in wpa_config_process_p2p_pref_chan()
5158 (u8 *) config->p2p_pref_chan, in wpa_config_process_p2p_pref_chan()
5159 config->num_p2p_pref_chan * sizeof(struct p2p_channel)); in wpa_config_process_p2p_pref_chan()
5172 struct wpa_config *config, int line, const char *pos) in wpa_config_process_p2p_no_go_freq() argument
5176 ret = freq_range_list_parse(&config->p2p_no_go_freq, pos); in wpa_config_process_p2p_no_go_freq()
5183 config->p2p_no_go_freq.num); in wpa_config_process_p2p_no_go_freq()
5191 struct wpa_config *config, int line, const char *pos) in wpa_config_process_p2p_device_persistent_mac_addr() argument
5193 if (hwaddr_aton2(pos, config->p2p_device_persistent_mac_addr) < 0) { in wpa_config_process_p2p_device_persistent_mac_addr()
5208 struct wpa_config *config, int line, const char *pos) in wpa_config_process_hessid() argument
5210 if (hwaddr_aton2(pos, config->hessid) < 0) { in wpa_config_process_hessid()
5222 struct wpa_config *config, int line, const char *pos) in wpa_config_process_sae_groups() argument
5231 os_free(config->sae_groups); in wpa_config_process_sae_groups()
5232 config->sae_groups = groups; in wpa_config_process_sae_groups()
5240 struct wpa_config *config, int line, const char *pos) in wpa_config_process_ap_vendor_elements() argument
5245 wpabuf_free(config->ap_vendor_elements); in wpa_config_process_ap_vendor_elements()
5246 config->ap_vendor_elements = NULL; in wpa_config_process_ap_vendor_elements()
5256 wpabuf_free(config->ap_vendor_elements); in wpa_config_process_ap_vendor_elements()
5257 config->ap_vendor_elements = tmp; in wpa_config_process_ap_vendor_elements()
5265 struct wpa_config *config, int line, const char *pos) in wpa_config_process_ap_assocresp_elements() argument
5270 wpabuf_free(config->ap_assocresp_elements); in wpa_config_process_ap_assocresp_elements()
5271 config->ap_assocresp_elements = NULL; in wpa_config_process_ap_assocresp_elements()
5281 wpabuf_free(config->ap_assocresp_elements); in wpa_config_process_ap_assocresp_elements()
5282 config->ap_assocresp_elements = tmp; in wpa_config_process_ap_assocresp_elements()
5291 struct wpa_config *config, int line, const char *pos) in wpa_config_process_no_ctrl_interface() argument
5294 os_free(config->ctrl_interface); in wpa_config_process_no_ctrl_interface()
5295 config->ctrl_interface = NULL; in wpa_config_process_no_ctrl_interface()
5301 static int wpa_config_get_int(const char *name, struct wpa_config *config, in wpa_config_get_int() argument
5305 int *val = (int *) (((u8 *) config) + (long) offset); in wpa_config_get_int()
5313 static int wpa_config_get_str(const char *name, struct wpa_config *config, in wpa_config_get_str() argument
5317 char **val = (char **) (((u8 *) config) + (long) offset); in wpa_config_get_str()
5335 static int wpa_config_get_ipv4(const char *name, struct wpa_config *config, in wpa_config_get_ipv4() argument
5339 void *val = ((u8 *) config) + (long) offset; in wpa_config_get_ipv4()
5362 struct wpa_config *config, int line, const char *pos) in wpa_config_process_mld_connect_bssid_pref() argument
5364 if (hwaddr_aton2(pos, config->mld_connect_bssid_pref) < 0) { in wpa_config_process_mld_connect_bssid_pref()
5614 int wpa_config_dump_values(struct wpa_config *config, char *buf, size_t buflen) in wpa_config_dump_values() argument
5626 tmp = field->get(field->name, config, (long) field->param1, in wpa_config_dump_values()
5638 int wpa_config_get_value(const char *name, struct wpa_config *config, in wpa_config_get_value() argument
5650 return field->get(name, config, (long) field->param1, in wpa_config_get_value()
5688 int wpa_config_process_global(struct wpa_config *config, char *pos, int line) in wpa_config_process_global() argument
5700 ret = field->parser(field, config, line, pos + flen + 1); in wpa_config_process_global()
5709 config->wps_nfc_pw_from_config = 1; in wpa_config_process_global()
5710 config->changed_parameters |= field->changed_flag; in wpa_config_process_global()
5726 if (hostapd_config_tx_queue(config->tx_queue, pos, in wpa_config_process_global()
5746 if (hostapd_config_wmm_ac(config->wmm_ac_params, pos, in wpa_config_process_global()