Lines Matching refs:bss

34 static int hostapd_config_read_vlan_file(struct hostapd_bss_config *bss,  in hostapd_config_read_vlan_file()  argument
103 vlan->next = bss->vlan; in hostapd_config_read_vlan_file()
104 bss->vlan = vlan; in hostapd_config_read_vlan_file()
639 static int hostapd_parse_das_client(struct hostapd_bss_config *bss, in hostapd_parse_das_client() argument
650 if (hostapd_parse_ip_addr(val, &bss->radius_das_client_addr)) in hostapd_parse_das_client()
653 os_free(bss->radius_das_shared_secret); in hostapd_parse_das_client()
654 bss->radius_das_shared_secret = (u8 *) os_strdup(secret); in hostapd_parse_das_client()
655 if (bss->radius_das_shared_secret == NULL) in hostapd_parse_das_client()
657 bss->radius_das_shared_secret_len = os_strlen(secret); in hostapd_parse_das_client()
848 struct hostapd_bss_config **all, *bss; in hostapd_config_bss() local
853 all = os_realloc_array(conf->bss, conf->num_bss + 1, in hostapd_config_bss()
860 conf->bss = all; in hostapd_config_bss()
862 bss = os_zalloc(sizeof(*bss)); in hostapd_config_bss()
863 if (bss == NULL) in hostapd_config_bss()
865 bss->radius = os_zalloc(sizeof(*bss->radius)); in hostapd_config_bss()
866 if (bss->radius == NULL) { in hostapd_config_bss()
869 os_free(bss); in hostapd_config_bss()
873 conf->bss[conf->num_bss++] = bss; in hostapd_config_bss()
874 conf->last_bss = bss; in hostapd_config_bss()
876 hostapd_config_defaults_bss(bss); in hostapd_config_bss()
877 os_strlcpy(bss->iface, ifname, sizeof(bss->iface)); in hostapd_config_bss()
878 os_memcpy(bss->ssid.vlan, bss->iface, IFNAMSIZ + 1); in hostapd_config_bss()
983 static int add_r0kh(struct hostapd_bss_config *bss, char *value) in add_r0kh() argument
1022 r0kh->next = bss->r0kh_list; in add_r0kh()
1023 bss->r0kh_list = r0kh; in add_r0kh()
1029 static int add_r1kh(struct hostapd_bss_config *bss, char *value) in add_r1kh() argument
1067 r1kh->next = bss->r1kh_list; in add_r1kh()
1068 bss->r1kh_list = r1kh; in add_r1kh()
1219 static int parse_roaming_consortium(struct hostapd_bss_config *bss, char *pos, in parse_roaming_consortium() argument
1235 rc = os_realloc_array(bss->roaming_consortium, in parse_roaming_consortium()
1236 bss->roaming_consortium_count + 1, in parse_roaming_consortium()
1241 os_memcpy(rc[bss->roaming_consortium_count].oi, oi, len); in parse_roaming_consortium()
1242 rc[bss->roaming_consortium_count].len = len; in parse_roaming_consortium()
1244 bss->roaming_consortium = rc; in parse_roaming_consortium()
1245 bss->roaming_consortium_count++; in parse_roaming_consortium()
1299 static int parse_venue_name(struct hostapd_bss_config *bss, char *pos, in parse_venue_name() argument
1302 if (parse_lang_string(&bss->venue_name, &bss->venue_name_count, pos)) { in parse_venue_name()
1311 static int parse_3gpp_cell_net(struct hostapd_bss_config *bss, char *buf, in parse_3gpp_cell_net() argument
1370 os_free(bss->anqp_3gpp_cell_net); in parse_3gpp_cell_net()
1371 bss->anqp_3gpp_cell_net = info; in parse_3gpp_cell_net()
1372 bss->anqp_3gpp_cell_net_len = 2 + 3 + 3 * count; in parse_3gpp_cell_net()
1374 bss->anqp_3gpp_cell_net, bss->anqp_3gpp_cell_net_len); in parse_3gpp_cell_net()
1386 static int parse_nai_realm(struct hostapd_bss_config *bss, char *buf, int line) in parse_nai_realm() argument
1393 offsets = os_calloc(bss->nai_realm_count * MAX_NAI_REALMS, in parse_nai_realm()
1398 for (i = 0; i < bss->nai_realm_count; i++) { in parse_nai_realm()
1399 realm = &bss->nai_realm_data[i]; in parse_nai_realm()
1407 realm = os_realloc_array(bss->nai_realm_data, bss->nai_realm_count + 1, in parse_nai_realm()
1413 bss->nai_realm_data = realm; in parse_nai_realm()
1416 for (i = 0; i < bss->nai_realm_count; i++) { in parse_nai_realm()
1417 realm = &bss->nai_realm_data[i]; in parse_nai_realm()
1428 realm = &bss->nai_realm_data[bss->nai_realm_count]; in parse_nai_realm()
1517 bss->nai_realm_count++; in parse_nai_realm()
1527 static int parse_anqp_elem(struct hostapd_bss_config *bss, char *buf, int line) in parse_anqp_elem() argument
1552 dl_list_for_each(elem, &bss->anqp_elem, struct anqp_element, list) { in parse_anqp_elem()
1569 dl_list_add(&bss->anqp_elem, &elem->list); in parse_anqp_elem()
1575 static int parse_qos_map_set(struct hostapd_bss_config *bss, in parse_qos_map_set() argument
1609 os_memcpy(bss->qos_map_set, qos_map_set, count); in parse_qos_map_set()
1610 bss->qos_map_set_len = count; in parse_qos_map_set()
1619 static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf, in hs20_parse_conn_capab() argument
1625 if (bss->hs20_connection_capability_len >= 0xfff0) in hs20_parse_conn_capab()
1628 conn_cap = os_realloc(bss->hs20_connection_capability, in hs20_parse_conn_capab()
1629 bss->hs20_connection_capability_len + 4); in hs20_parse_conn_capab()
1633 bss->hs20_connection_capability = conn_cap; in hs20_parse_conn_capab()
1634 conn_cap += bss->hs20_connection_capability_len; in hs20_parse_conn_capab()
1647 bss->hs20_connection_capability_len += 4; in hs20_parse_conn_capab()
1653 static int hs20_parse_wan_metrics(struct hostapd_bss_config *bss, char *buf, in hs20_parse_wan_metrics() argument
1705 os_free(bss->hs20_wan_metrics); in hs20_parse_wan_metrics()
1706 bss->hs20_wan_metrics = wan_metrics; in hs20_parse_wan_metrics()
1718 static int hs20_parse_oper_friendly_name(struct hostapd_bss_config *bss, in hs20_parse_oper_friendly_name() argument
1721 if (parse_lang_string(&bss->hs20_oper_friendly_name, in hs20_parse_oper_friendly_name()
1722 &bss->hs20_oper_friendly_name_count, pos)) { in hs20_parse_oper_friendly_name()
1731 static int hs20_parse_icon(struct hostapd_bss_config *bss, char *pos) in hs20_parse_icon() argument
1736 icon = os_realloc_array(bss->hs20_icons, bss->hs20_icons_count + 1, in hs20_parse_icon()
1740 bss->hs20_icons = icon; in hs20_parse_icon()
1741 icon = &bss->hs20_icons[bss->hs20_icons_count]; in hs20_parse_icon()
1778 bss->hs20_icons_count++; in hs20_parse_icon()
1784 static int hs20_parse_osu_ssid(struct hostapd_bss_config *bss, in hs20_parse_osu_ssid() argument
1797 os_memcpy(bss->osu_ssid, str, slen); in hs20_parse_osu_ssid()
1798 bss->osu_ssid_len = slen; in hs20_parse_osu_ssid()
1805 static int hs20_parse_osu_server_uri(struct hostapd_bss_config *bss, in hs20_parse_osu_server_uri() argument
1810 p = os_realloc_array(bss->hs20_osu_providers, in hs20_parse_osu_server_uri()
1811 bss->hs20_osu_providers_count + 1, sizeof(*p)); in hs20_parse_osu_server_uri()
1815 bss->hs20_osu_providers = p; in hs20_parse_osu_server_uri()
1816 bss->last_osu = &bss->hs20_osu_providers[bss->hs20_osu_providers_count]; in hs20_parse_osu_server_uri()
1817 bss->hs20_osu_providers_count++; in hs20_parse_osu_server_uri()
1818 os_memset(bss->last_osu, 0, sizeof(*p)); in hs20_parse_osu_server_uri()
1819 bss->last_osu->server_uri = os_strdup(pos); in hs20_parse_osu_server_uri()
1825 static int hs20_parse_osu_friendly_name(struct hostapd_bss_config *bss, in hs20_parse_osu_friendly_name() argument
1828 if (bss->last_osu == NULL) { in hs20_parse_osu_friendly_name()
1833 if (parse_lang_string(&bss->last_osu->friendly_name, in hs20_parse_osu_friendly_name()
1834 &bss->last_osu->friendly_name_count, pos)) { in hs20_parse_osu_friendly_name()
1844 static int hs20_parse_osu_nai(struct hostapd_bss_config *bss, in hs20_parse_osu_nai() argument
1847 if (bss->last_osu == NULL) { in hs20_parse_osu_nai()
1852 os_free(bss->last_osu->osu_nai); in hs20_parse_osu_nai()
1853 bss->last_osu->osu_nai = os_strdup(pos); in hs20_parse_osu_nai()
1854 if (bss->last_osu->osu_nai == NULL) in hs20_parse_osu_nai()
1861 static int hs20_parse_osu_method_list(struct hostapd_bss_config *bss, char *pos, in hs20_parse_osu_method_list() argument
1864 if (bss->last_osu == NULL) { in hs20_parse_osu_method_list()
1869 if (hostapd_parse_intlist(&bss->last_osu->method_list, pos)) { in hs20_parse_osu_method_list()
1878 static int hs20_parse_osu_icon(struct hostapd_bss_config *bss, char *pos, in hs20_parse_osu_icon() argument
1882 struct hs20_osu_provider *p = bss->last_osu; in hs20_parse_osu_icon()
1902 static int hs20_parse_osu_service_desc(struct hostapd_bss_config *bss, in hs20_parse_osu_service_desc() argument
1905 if (bss->last_osu == NULL) { in hs20_parse_osu_service_desc()
1910 if (parse_lang_string(&bss->last_osu->service_desc, in hs20_parse_osu_service_desc()
1911 &bss->last_osu->service_desc_count, pos)) { in hs20_parse_osu_service_desc()
1991 struct hostapd_bss_config *bss, in hostapd_config_fill() argument
1995 os_strlcpy(conf->bss[0]->iface, pos, in hostapd_config_fill()
1996 sizeof(conf->bss[0]->iface)); in hostapd_config_fill()
1998 os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); in hostapd_config_fill()
2000 os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge)); in hostapd_config_fill()
2002 os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge)); in hostapd_config_fill()
2026 bss->logger_syslog_level = atoi(pos); in hostapd_config_fill()
2028 bss->logger_stdout_level = atoi(pos); in hostapd_config_fill()
2030 bss->logger_syslog = atoi(pos); in hostapd_config_fill()
2032 bss->logger_stdout = atoi(pos); in hostapd_config_fill()
2037 bss->ssid.ssid_len = os_strlen(pos); in hostapd_config_fill()
2038 if (bss->ssid.ssid_len > SSID_MAX_LEN || in hostapd_config_fill()
2039 bss->ssid.ssid_len < 1) { in hostapd_config_fill()
2044 os_memcpy(bss->ssid.ssid, pos, bss->ssid.ssid_len); in hostapd_config_fill()
2045 bss->ssid.ssid_set = 1; in hostapd_config_fill()
2055 os_memcpy(bss->ssid.ssid, str, slen); in hostapd_config_fill()
2056 bss->ssid.ssid_len = slen; in hostapd_config_fill()
2057 bss->ssid.ssid_set = 1; in hostapd_config_fill()
2060 bss->ssid.utf8_ssid = atoi(pos) > 0; in hostapd_config_fill()
2062 bss->macaddr_acl = atoi(pos); in hostapd_config_fill()
2063 if (bss->macaddr_acl != ACCEPT_UNLESS_DENIED && in hostapd_config_fill()
2064 bss->macaddr_acl != DENY_UNLESS_ACCEPTED && in hostapd_config_fill()
2065 bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) { in hostapd_config_fill()
2067 line, bss->macaddr_acl); in hostapd_config_fill()
2070 if (hostapd_config_read_maclist(pos, &bss->accept_mac, in hostapd_config_fill()
2071 &bss->num_accept_mac)) { in hostapd_config_fill()
2077 if (hostapd_config_read_maclist(pos, &bss->deny_mac, in hostapd_config_fill()
2078 &bss->num_deny_mac)) { in hostapd_config_fill()
2084 bss->wds_sta = atoi(pos); in hostapd_config_fill()
2086 bss->start_disabled = atoi(pos); in hostapd_config_fill()
2088 bss->isolate = atoi(pos); in hostapd_config_fill()
2090 bss->ap_max_inactivity = atoi(pos); in hostapd_config_fill()
2092 bss->skip_inactivity_poll = atoi(pos); in hostapd_config_fill()
2102 bss->ieee802_1x = atoi(pos); in hostapd_config_fill()
2104 bss->eapol_version = atoi(pos); in hostapd_config_fill()
2105 if (bss->eapol_version < 1 || bss->eapol_version > 2) { in hostapd_config_fill()
2108 line, bss->eapol_version, pos); in hostapd_config_fill()
2111 wpa_printf(MSG_DEBUG, "eapol_version=%d", bss->eapol_version); in hostapd_config_fill()
2114 bss->eap_server = atoi(pos); in hostapd_config_fill()
2117 bss->eap_server = atoi(pos); in hostapd_config_fill()
2119 if (hostapd_config_read_eap_user(pos, bss)) in hostapd_config_fill()
2122 os_free(bss->ca_cert); in hostapd_config_fill()
2123 bss->ca_cert = os_strdup(pos); in hostapd_config_fill()
2125 os_free(bss->server_cert); in hostapd_config_fill()
2126 bss->server_cert = os_strdup(pos); in hostapd_config_fill()
2128 os_free(bss->private_key); in hostapd_config_fill()
2129 bss->private_key = os_strdup(pos); in hostapd_config_fill()
2131 os_free(bss->private_key_passwd); in hostapd_config_fill()
2132 bss->private_key_passwd = os_strdup(pos); in hostapd_config_fill()
2134 bss->check_crl = atoi(pos); in hostapd_config_fill()
2136 bss->tls_session_lifetime = atoi(pos); in hostapd_config_fill()
2138 os_free(bss->ocsp_stapling_response); in hostapd_config_fill()
2139 bss->ocsp_stapling_response = os_strdup(pos); in hostapd_config_fill()
2141 os_free(bss->ocsp_stapling_response_multi); in hostapd_config_fill()
2142 bss->ocsp_stapling_response_multi = os_strdup(pos); in hostapd_config_fill()
2144 os_free(bss->dh_file); in hostapd_config_fill()
2145 bss->dh_file = os_strdup(pos); in hostapd_config_fill()
2147 os_free(bss->openssl_ciphers); in hostapd_config_fill()
2148 bss->openssl_ciphers = os_strdup(pos); in hostapd_config_fill()
2150 bss->fragment_size = atoi(pos); in hostapd_config_fill()
2153 os_free(bss->pac_opaque_encr_key); in hostapd_config_fill()
2154 bss->pac_opaque_encr_key = os_malloc(16); in hostapd_config_fill()
2155 if (bss->pac_opaque_encr_key == NULL) { in hostapd_config_fill()
2160 } else if (hexstr2bin(pos, bss->pac_opaque_encr_key, 16)) { in hostapd_config_fill()
2172 os_free(bss->eap_fast_a_id); in hostapd_config_fill()
2173 bss->eap_fast_a_id = os_malloc(idlen / 2); in hostapd_config_fill()
2174 if (bss->eap_fast_a_id == NULL || in hostapd_config_fill()
2175 hexstr2bin(pos, bss->eap_fast_a_id, idlen / 2)) { in hostapd_config_fill()
2178 os_free(bss->eap_fast_a_id); in hostapd_config_fill()
2179 bss->eap_fast_a_id = NULL; in hostapd_config_fill()
2182 bss->eap_fast_a_id_len = idlen / 2; in hostapd_config_fill()
2185 os_free(bss->eap_fast_a_id_info); in hostapd_config_fill()
2186 bss->eap_fast_a_id_info = os_strdup(pos); in hostapd_config_fill()
2188 bss->eap_fast_prov = atoi(pos); in hostapd_config_fill()
2190 bss->pac_key_lifetime = atoi(pos); in hostapd_config_fill()
2192 bss->pac_key_refresh_time = atoi(pos); in hostapd_config_fill()
2196 os_free(bss->eap_sim_db); in hostapd_config_fill()
2197 bss->eap_sim_db = os_strdup(pos); in hostapd_config_fill()
2199 bss->eap_sim_db_timeout = atoi(pos); in hostapd_config_fill()
2201 bss->eap_sim_aka_result_ind = atoi(pos); in hostapd_config_fill()
2205 bss->tnc = atoi(pos); in hostapd_config_fill()
2209 bss->pwd_group = atoi(pos); in hostapd_config_fill()
2212 bss->eap_server_erp = atoi(pos); in hostapd_config_fill()
2216 os_free(bss->eap_req_id_text); in hostapd_config_fill()
2217 bss->eap_req_id_text = os_strdup(pos); in hostapd_config_fill()
2218 if (bss->eap_req_id_text == NULL) { in hostapd_config_fill()
2223 bss->eap_req_id_text_len = os_strlen(bss->eap_req_id_text); in hostapd_config_fill()
2224 term = os_strstr(bss->eap_req_id_text, "\\0"); in hostapd_config_fill()
2228 bss->eap_req_id_text_len - in hostapd_config_fill()
2229 (term - bss->eap_req_id_text) - 1); in hostapd_config_fill()
2230 bss->eap_req_id_text_len--; in hostapd_config_fill()
2233 bss->erp_send_reauth_start = atoi(pos); in hostapd_config_fill()
2235 os_free(bss->erp_domain); in hostapd_config_fill()
2236 bss->erp_domain = os_strdup(pos); in hostapd_config_fill()
2238 bss->default_wep_key_len = atoi(pos); in hostapd_config_fill()
2239 if (bss->default_wep_key_len > 13) { in hostapd_config_fill()
2242 (unsigned long) bss->default_wep_key_len, in hostapd_config_fill()
2244 bss->default_wep_key_len * 8); in hostapd_config_fill()
2248 bss->individual_wep_key_len = atoi(pos); in hostapd_config_fill()
2249 if (bss->individual_wep_key_len < 0 || in hostapd_config_fill()
2250 bss->individual_wep_key_len > 13) { in hostapd_config_fill()
2252 line, bss->individual_wep_key_len, in hostapd_config_fill()
2253 bss->individual_wep_key_len * 8); in hostapd_config_fill()
2257 bss->wep_rekeying_period = atoi(pos); in hostapd_config_fill()
2258 if (bss->wep_rekeying_period < 0) { in hostapd_config_fill()
2260 line, bss->wep_rekeying_period); in hostapd_config_fill()
2264 bss->eap_reauth_period = atoi(pos); in hostapd_config_fill()
2265 if (bss->eap_reauth_period < 0) { in hostapd_config_fill()
2267 line, bss->eap_reauth_period); in hostapd_config_fill()
2271 bss->eapol_key_index_workaround = atoi(pos); in hostapd_config_fill()
2274 bss->ieee802_11f = 1; in hostapd_config_fill()
2275 os_strlcpy(bss->iapp_iface, pos, sizeof(bss->iapp_iface)); in hostapd_config_fill()
2278 if (hostapd_parse_ip_addr(pos, &bss->own_ip_addr)) { in hostapd_config_fill()
2285 os_free(bss->nas_identifier); in hostapd_config_fill()
2286 bss->nas_identifier = os_strdup(pos); in hostapd_config_fill()
2289 if (hostapd_parse_ip_addr(pos, &bss->radius->client_addr)) { in hostapd_config_fill()
2295 bss->radius->force_client_addr = 1; in hostapd_config_fill()
2298 &bss->radius->auth_servers, in hostapd_config_fill()
2299 &bss->radius->num_auth_servers, pos, 1812, in hostapd_config_fill()
2300 &bss->radius->auth_server)) { in hostapd_config_fill()
2306 } else if (bss->radius->auth_server && in hostapd_config_fill()
2309 &bss->radius->auth_server->addr)) { in hostapd_config_fill()
2315 } else if (bss->radius->auth_server && in hostapd_config_fill()
2317 bss->radius->auth_server->port = atoi(pos); in hostapd_config_fill()
2318 } else if (bss->radius->auth_server && in hostapd_config_fill()
2327 os_free(bss->radius->auth_server->shared_secret); in hostapd_config_fill()
2328 bss->radius->auth_server->shared_secret = (u8 *) os_strdup(pos); in hostapd_config_fill()
2329 bss->radius->auth_server->shared_secret_len = len; in hostapd_config_fill()
2332 &bss->radius->acct_servers, in hostapd_config_fill()
2333 &bss->radius->num_acct_servers, pos, 1813, in hostapd_config_fill()
2334 &bss->radius->acct_server)) { in hostapd_config_fill()
2340 } else if (bss->radius->acct_server && in hostapd_config_fill()
2343 &bss->radius->acct_server->addr)) { in hostapd_config_fill()
2349 } else if (bss->radius->acct_server && in hostapd_config_fill()
2351 bss->radius->acct_server->port = atoi(pos); in hostapd_config_fill()
2352 } else if (bss->radius->acct_server && in hostapd_config_fill()
2361 os_free(bss->radius->acct_server->shared_secret); in hostapd_config_fill()
2362 bss->radius->acct_server->shared_secret = (u8 *) os_strdup(pos); in hostapd_config_fill()
2363 bss->radius->acct_server->shared_secret_len = len; in hostapd_config_fill()
2365 bss->radius->retry_primary_interval = atoi(pos); in hostapd_config_fill()
2367 bss->acct_interim_interval = atoi(pos); in hostapd_config_fill()
2369 bss->radius_request_cui = atoi(pos); in hostapd_config_fill()
2378 } else if (bss->radius_auth_req_attr == NULL) { in hostapd_config_fill()
2379 bss->radius_auth_req_attr = attr; in hostapd_config_fill()
2381 a = bss->radius_auth_req_attr; in hostapd_config_fill()
2394 } else if (bss->radius_acct_req_attr == NULL) { in hostapd_config_fill()
2395 bss->radius_acct_req_attr = attr; in hostapd_config_fill()
2397 a = bss->radius_acct_req_attr; in hostapd_config_fill()
2403 bss->radius_das_port = atoi(pos); in hostapd_config_fill()
2405 if (hostapd_parse_das_client(bss, pos) < 0) { in hostapd_config_fill()
2411 bss->radius_das_time_window = atoi(pos); in hostapd_config_fill()
2413 bss->radius_das_require_event_timestamp = atoi(pos); in hostapd_config_fill()
2416 bss->auth_algs = atoi(pos); in hostapd_config_fill()
2417 if (bss->auth_algs == 0) { in hostapd_config_fill()
2423 bss->max_num_sta = atoi(pos); in hostapd_config_fill()
2424 if (bss->max_num_sta < 0 || in hostapd_config_fill()
2425 bss->max_num_sta > MAX_STA_COUNT) { in hostapd_config_fill()
2427 line, bss->max_num_sta, MAX_STA_COUNT); in hostapd_config_fill()
2431 bss->wpa = atoi(pos); in hostapd_config_fill()
2433 bss->wpa_group_rekey = atoi(pos); in hostapd_config_fill()
2435 bss->wpa_strict_rekey = atoi(pos); in hostapd_config_fill()
2437 bss->wpa_gmk_rekey = atoi(pos); in hostapd_config_fill()
2439 bss->wpa_ptk_rekey = atoi(pos); in hostapd_config_fill()
2447 os_free(bss->ssid.wpa_passphrase); in hostapd_config_fill()
2448 bss->ssid.wpa_passphrase = os_strdup(pos); in hostapd_config_fill()
2449 if (bss->ssid.wpa_passphrase) { in hostapd_config_fill()
2450 hostapd_config_clear_wpa_psk(&bss->ssid.wpa_psk); in hostapd_config_fill()
2451 bss->ssid.wpa_passphrase_set = 1; in hostapd_config_fill()
2454 hostapd_config_clear_wpa_psk(&bss->ssid.wpa_psk); in hostapd_config_fill()
2455 bss->ssid.wpa_psk = os_zalloc(sizeof(struct hostapd_wpa_psk)); in hostapd_config_fill()
2456 if (bss->ssid.wpa_psk == NULL) in hostapd_config_fill()
2458 if (hexstr2bin(pos, bss->ssid.wpa_psk->psk, PMK_LEN) || in hostapd_config_fill()
2462 hostapd_config_clear_wpa_psk(&bss->ssid.wpa_psk); in hostapd_config_fill()
2465 bss->ssid.wpa_psk->group = 1; in hostapd_config_fill()
2466 os_free(bss->ssid.wpa_passphrase); in hostapd_config_fill()
2467 bss->ssid.wpa_passphrase = NULL; in hostapd_config_fill()
2468 bss->ssid.wpa_psk_set = 1; in hostapd_config_fill()
2470 os_free(bss->ssid.wpa_psk_file); in hostapd_config_fill()
2471 bss->ssid.wpa_psk_file = os_strdup(pos); in hostapd_config_fill()
2472 if (!bss->ssid.wpa_psk_file) { in hostapd_config_fill()
2478 bss->wpa_key_mgmt = hostapd_config_parse_key_mgmt(line, pos); in hostapd_config_fill()
2479 if (bss->wpa_key_mgmt == -1) in hostapd_config_fill()
2482 bss->wpa_psk_radius = atoi(pos); in hostapd_config_fill()
2483 if (bss->wpa_psk_radius != PSK_RADIUS_IGNORED && in hostapd_config_fill()
2484 bss->wpa_psk_radius != PSK_RADIUS_ACCEPTED && in hostapd_config_fill()
2485 bss->wpa_psk_radius != PSK_RADIUS_REQUIRED) { in hostapd_config_fill()
2488 line, bss->wpa_psk_radius); in hostapd_config_fill()
2492 bss->wpa_pairwise = hostapd_config_parse_cipher(line, pos); in hostapd_config_fill()
2493 if (bss->wpa_pairwise == -1 || bss->wpa_pairwise == 0) in hostapd_config_fill()
2495 if (bss->wpa_pairwise & in hostapd_config_fill()
2498 bss->wpa_pairwise, pos); in hostapd_config_fill()
2502 bss->rsn_pairwise = hostapd_config_parse_cipher(line, pos); in hostapd_config_fill()
2503 if (bss->rsn_pairwise == -1 || bss->rsn_pairwise == 0) in hostapd_config_fill()
2505 if (bss->rsn_pairwise & in hostapd_config_fill()
2508 bss->rsn_pairwise, pos); in hostapd_config_fill()
2513 bss->rsn_preauth = atoi(pos); in hostapd_config_fill()
2515 os_free(bss->rsn_preauth_interfaces); in hostapd_config_fill()
2516 bss->rsn_preauth_interfaces = os_strdup(pos); in hostapd_config_fill()
2520 bss->peerkey = atoi(pos); in hostapd_config_fill()
2525 hexstr2bin(pos, bss->mobility_domain, in hostapd_config_fill()
2534 hexstr2bin(pos, bss->r1_key_holder, FT_R1KH_ID_LEN) != 0) { in hostapd_config_fill()
2541 bss->r0_key_lifetime = atoi(pos); in hostapd_config_fill()
2543 bss->reassociation_deadline = atoi(pos); in hostapd_config_fill()
2545 if (add_r0kh(bss, pos) < 0) { in hostapd_config_fill()
2551 if (add_r1kh(bss, pos) < 0) { in hostapd_config_fill()
2557 bss->pmk_r1_push = atoi(pos); in hostapd_config_fill()
2559 bss->ft_over_ds = atoi(pos); in hostapd_config_fill()
2563 os_free(bss->ctrl_interface); in hostapd_config_fill()
2564 bss->ctrl_interface = os_strdup(pos); in hostapd_config_fill()
2573 bss->ctrl_interface_gid = grp->gr_gid; in hostapd_config_fill()
2574 bss->ctrl_interface_gid_set = 1; in hostapd_config_fill()
2576 bss->ctrl_interface_gid, group); in hostapd_config_fill()
2581 bss->ctrl_interface_gid = strtol(group, &endp, 10); in hostapd_config_fill()
2587 bss->ctrl_interface_gid_set = 1; in hostapd_config_fill()
2589 bss->ctrl_interface_gid); in hostapd_config_fill()
2594 os_free(bss->radius_server_clients); in hostapd_config_fill()
2595 bss->radius_server_clients = os_strdup(pos); in hostapd_config_fill()
2597 bss->radius_server_auth_port = atoi(pos); in hostapd_config_fill()
2599 bss->radius_server_acct_port = atoi(pos); in hostapd_config_fill()
2601 bss->radius_server_ipv6 = atoi(pos); in hostapd_config_fill()
2604 bss->use_pae_group_addr = atoi(pos); in hostapd_config_fill()
2623 bss->wps_rf_bands = WPS_RF_60GHZ; in hostapd_config_fill()
2625 bss->wps_rf_bands = WPS_RF_50GHZ; in hostapd_config_fill()
2628 bss->wps_rf_bands = WPS_RF_24GHZ; in hostapd_config_fill()
2631 bss->wps_rf_bands = WPS_RF_24GHZ | WPS_RF_50GHZ; in hostapd_config_fill()
2688 bss->dtim_period = atoi(pos); in hostapd_config_fill()
2689 if (bss->dtim_period < 1 || bss->dtim_period > 255) { in hostapd_config_fill()
2691 line, bss->dtim_period); in hostapd_config_fill()
2695 bss->bss_load_update_period = atoi(pos); in hostapd_config_fill()
2696 if (bss->bss_load_update_period < 0 || in hostapd_config_fill()
2697 bss->bss_load_update_period > 100) { in hostapd_config_fill()
2700 line, bss->bss_load_update_period); in hostapd_config_fill()
2748 bss->ignore_broadcast_ssid = atoi(pos); in hostapd_config_fill()
2750 bss->no_probe_resp_if_max_sta = atoi(pos); in hostapd_config_fill()
2752 bss->ssid.wep.idx = atoi(pos); in hostapd_config_fill()
2753 if (bss->ssid.wep.idx > 3) { in hostapd_config_fill()
2756 bss->ssid.wep.idx); in hostapd_config_fill()
2763 if (hostapd_config_read_wep(&bss->ssid.wep, in hostapd_config_fill()
2771 bss->ssid.dynamic_vlan = atoi(pos); in hostapd_config_fill()
2773 bss->ssid.per_sta_vif = atoi(pos); in hostapd_config_fill()
2775 if (hostapd_config_read_vlan_file(bss, pos)) { in hostapd_config_fill()
2781 bss->ssid.vlan_naming = atoi(pos); in hostapd_config_fill()
2782 if (bss->ssid.vlan_naming >= DYNAMIC_VLAN_NAMING_END || in hostapd_config_fill()
2783 bss->ssid.vlan_naming < 0) { in hostapd_config_fill()
2786 line, bss->ssid.vlan_naming); in hostapd_config_fill()
2791 os_free(bss->ssid.vlan_tagged_interface); in hostapd_config_fill()
2792 bss->ssid.vlan_tagged_interface = os_strdup(pos); in hostapd_config_fill()
2807 bss->wmm_enabled = atoi(pos); in hostapd_config_fill()
2809 bss->wmm_uapsd = atoi(pos); in hostapd_config_fill()
2824 if (hwaddr_aton(pos, bss->bssid)) { in hostapd_config_fill()
2833 bss->ieee80211w = atoi(pos); in hostapd_config_fill()
2836 bss->group_mgmt_cipher = WPA_CIPHER_AES_128_CMAC; in hostapd_config_fill()
2838 bss->group_mgmt_cipher = WPA_CIPHER_BIP_GMAC_128; in hostapd_config_fill()
2840 bss->group_mgmt_cipher = WPA_CIPHER_BIP_GMAC_256; in hostapd_config_fill()
2842 bss->group_mgmt_cipher = WPA_CIPHER_BIP_CMAC_256; in hostapd_config_fill()
2849 bss->assoc_sa_query_max_timeout = atoi(pos); in hostapd_config_fill()
2850 if (bss->assoc_sa_query_max_timeout == 0) { in hostapd_config_fill()
2856 bss->assoc_sa_query_retry_timeout = atoi(pos); in hostapd_config_fill()
2857 if (bss->assoc_sa_query_retry_timeout == 0) { in hostapd_config_fill()
2895 bss->vendor_vht = atoi(pos); in hostapd_config_fill()
2898 bss->max_listen_interval = atoi(pos); in hostapd_config_fill()
2900 bss->disable_pmksa_caching = atoi(pos); in hostapd_config_fill()
2902 bss->okc = atoi(pos); in hostapd_config_fill()
2905 bss->wps_state = atoi(pos); in hostapd_config_fill()
2906 if (bss->wps_state < 0 || bss->wps_state > 2) { in hostapd_config_fill()
2912 bss->wps_independent = atoi(pos); in hostapd_config_fill()
2914 bss->ap_setup_locked = atoi(pos); in hostapd_config_fill()
2916 if (uuid_str2bin(pos, bss->uuid)) { in hostapd_config_fill()
2921 os_free(bss->wps_pin_requests); in hostapd_config_fill()
2922 bss->wps_pin_requests = os_strdup(pos); in hostapd_config_fill()
2929 os_free(bss->device_name); in hostapd_config_fill()
2930 bss->device_name = os_strdup(pos); in hostapd_config_fill()
2937 os_free(bss->manufacturer); in hostapd_config_fill()
2938 bss->manufacturer = os_strdup(pos); in hostapd_config_fill()
2945 os_free(bss->model_name); in hostapd_config_fill()
2946 bss->model_name = os_strdup(pos); in hostapd_config_fill()
2953 os_free(bss->model_number); in hostapd_config_fill()
2954 bss->model_number = os_strdup(pos); in hostapd_config_fill()
2961 os_free(bss->serial_number); in hostapd_config_fill()
2962 bss->serial_number = os_strdup(pos); in hostapd_config_fill()
2964 if (wps_dev_type_str2bin(pos, bss->device_type)) in hostapd_config_fill()
2967 os_free(bss->config_methods); in hostapd_config_fill()
2968 bss->config_methods = os_strdup(pos); in hostapd_config_fill()
2970 if (hexstr2bin(pos, bss->os_version, 4)) { in hostapd_config_fill()
2976 os_free(bss->ap_pin); in hostapd_config_fill()
2977 bss->ap_pin = os_strdup(pos); in hostapd_config_fill()
2979 bss->skip_cred_build = atoi(pos); in hostapd_config_fill()
2981 os_free(bss->extra_cred); in hostapd_config_fill()
2982 bss->extra_cred = (u8 *) os_readfile(pos, &bss->extra_cred_len); in hostapd_config_fill()
2983 if (bss->extra_cred == NULL) { in hostapd_config_fill()
2989 bss->wps_cred_processing = atoi(pos); in hostapd_config_fill()
2991 os_free(bss->ap_settings); in hostapd_config_fill()
2992 bss->ap_settings = in hostapd_config_fill()
2993 (u8 *) os_readfile(pos, &bss->ap_settings_len); in hostapd_config_fill()
2994 if (bss->ap_settings == NULL) { in hostapd_config_fill()
3000 os_free(bss->upnp_iface); in hostapd_config_fill()
3001 bss->upnp_iface = os_strdup(pos); in hostapd_config_fill()
3003 os_free(bss->friendly_name); in hostapd_config_fill()
3004 bss->friendly_name = os_strdup(pos); in hostapd_config_fill()
3006 os_free(bss->manufacturer_url); in hostapd_config_fill()
3007 bss->manufacturer_url = os_strdup(pos); in hostapd_config_fill()
3009 os_free(bss->model_description); in hostapd_config_fill()
3010 bss->model_description = os_strdup(pos); in hostapd_config_fill()
3012 os_free(bss->model_url); in hostapd_config_fill()
3013 bss->model_url = os_strdup(pos); in hostapd_config_fill()
3015 os_free(bss->upc); in hostapd_config_fill()
3016 bss->upc = os_strdup(pos); in hostapd_config_fill()
3018 bss->pbc_in_m1 = atoi(pos); in hostapd_config_fill()
3020 os_free(bss->server_id); in hostapd_config_fill()
3021 bss->server_id = os_strdup(pos); in hostapd_config_fill()
3024 bss->wps_nfc_dev_pw_id = atoi(pos); in hostapd_config_fill()
3025 if (bss->wps_nfc_dev_pw_id < 0x10 || in hostapd_config_fill()
3026 bss->wps_nfc_dev_pw_id > 0xffff) { in hostapd_config_fill()
3031 bss->wps_nfc_pw_from_config = 1; in hostapd_config_fill()
3033 wpabuf_free(bss->wps_nfc_dh_pubkey); in hostapd_config_fill()
3034 bss->wps_nfc_dh_pubkey = hostapd_parse_bin(pos); in hostapd_config_fill()
3035 bss->wps_nfc_pw_from_config = 1; in hostapd_config_fill()
3037 wpabuf_free(bss->wps_nfc_dh_privkey); in hostapd_config_fill()
3038 bss->wps_nfc_dh_privkey = hostapd_parse_bin(pos); in hostapd_config_fill()
3039 bss->wps_nfc_pw_from_config = 1; in hostapd_config_fill()
3041 wpabuf_free(bss->wps_nfc_dev_pw); in hostapd_config_fill()
3042 bss->wps_nfc_dev_pw = hostapd_parse_bin(pos); in hostapd_config_fill()
3043 bss->wps_nfc_pw_from_config = 1; in hostapd_config_fill()
3049 bss->p2p |= P2P_MANAGE; in hostapd_config_fill()
3051 bss->p2p &= ~P2P_MANAGE; in hostapd_config_fill()
3054 bss->p2p |= P2P_ALLOW_CROSS_CONNECTION; in hostapd_config_fill()
3056 bss->p2p &= ~P2P_ALLOW_CROSS_CONNECTION; in hostapd_config_fill()
3059 bss->disassoc_low_ack = atoi(pos); in hostapd_config_fill()
3062 bss->tdls |= TDLS_PROHIBIT; in hostapd_config_fill()
3064 bss->tdls &= ~TDLS_PROHIBIT; in hostapd_config_fill()
3067 bss->tdls |= TDLS_PROHIBIT_CHAN_SWITCH; in hostapd_config_fill()
3069 bss->tdls &= ~TDLS_PROHIBIT_CHAN_SWITCH; in hostapd_config_fill()
3076 bss->time_advertisement = atoi(pos); in hostapd_config_fill()
3084 os_free(bss->time_zone); in hostapd_config_fill()
3085 bss->time_zone = os_strdup(pos); in hostapd_config_fill()
3086 if (bss->time_zone == NULL) in hostapd_config_fill()
3090 bss->wnm_sleep_mode = atoi(pos); in hostapd_config_fill()
3092 bss->bss_transition = atoi(pos); in hostapd_config_fill()
3096 bss->interworking = atoi(pos); in hostapd_config_fill()
3098 bss->access_network_type = atoi(pos); in hostapd_config_fill()
3099 if (bss->access_network_type < 0 || in hostapd_config_fill()
3100 bss->access_network_type > 15) { in hostapd_config_fill()
3107 bss->internet = atoi(pos); in hostapd_config_fill()
3109 bss->asra = atoi(pos); in hostapd_config_fill()
3111 bss->esr = atoi(pos); in hostapd_config_fill()
3113 bss->uesa = atoi(pos); in hostapd_config_fill()
3115 bss->venue_group = atoi(pos); in hostapd_config_fill()
3116 bss->venue_info_set = 1; in hostapd_config_fill()
3118 bss->venue_type = atoi(pos); in hostapd_config_fill()
3119 bss->venue_info_set = 1; in hostapd_config_fill()
3121 if (hwaddr_aton(pos, bss->hessid)) { in hostapd_config_fill()
3126 if (parse_roaming_consortium(bss, pos, line) < 0) in hostapd_config_fill()
3129 if (parse_venue_name(bss, pos, line) < 0) in hostapd_config_fill()
3144 os_free(bss->network_auth_type); in hostapd_config_fill()
3145 bss->network_auth_type = os_malloc(redirect_url_len + 3 + 1); in hostapd_config_fill()
3146 if (bss->network_auth_type == NULL) in hostapd_config_fill()
3148 *bss->network_auth_type = auth_type; in hostapd_config_fill()
3149 WPA_PUT_LE16(bss->network_auth_type + 1, redirect_url_len); in hostapd_config_fill()
3151 os_memcpy(bss->network_auth_type + 3, pos + 2, in hostapd_config_fill()
3153 bss->network_auth_type_len = 3 + redirect_url_len; in hostapd_config_fill()
3155 if (hexstr2bin(pos, &bss->ipaddr_type_availability, 1)) { in hostapd_config_fill()
3158 bss->ipaddr_type_configured = 0; in hostapd_config_fill()
3161 bss->ipaddr_type_configured = 1; in hostapd_config_fill()
3196 os_free(bss->domain_name); in hostapd_config_fill()
3197 bss->domain_name = domain_list; in hostapd_config_fill()
3198 bss->domain_name_len = domain_list_len; in hostapd_config_fill()
3200 if (parse_3gpp_cell_net(bss, pos, line) < 0) in hostapd_config_fill()
3203 if (parse_nai_realm(bss, pos, line) < 0) in hostapd_config_fill()
3206 if (parse_anqp_elem(bss, pos, line) < 0) in hostapd_config_fill()
3209 bss->gas_frag_limit = atoi(pos); in hostapd_config_fill()
3211 bss->gas_comeback_delay = atoi(pos); in hostapd_config_fill()
3213 if (parse_qos_map_set(bss, pos, line) < 0) in hostapd_config_fill()
3218 os_free(bss->dump_msk_file); in hostapd_config_fill()
3219 bss->dump_msk_file = os_strdup(pos); in hostapd_config_fill()
3223 bss->proxy_arp = atoi(pos); in hostapd_config_fill()
3227 bss->hs20 = atoi(pos); in hostapd_config_fill()
3229 bss->disable_dgaf = atoi(pos); in hostapd_config_fill()
3231 bss->na_mcast_to_ucast = atoi(pos); in hostapd_config_fill()
3233 bss->osen = atoi(pos); in hostapd_config_fill()
3235 bss->anqp_domain_id = atoi(pos); in hostapd_config_fill()
3237 bss->hs20_deauth_req_timeout = atoi(pos); in hostapd_config_fill()
3239 if (hs20_parse_oper_friendly_name(bss, pos, line) < 0) in hostapd_config_fill()
3242 if (hs20_parse_wan_metrics(bss, pos, line) < 0) in hostapd_config_fill()
3245 if (hs20_parse_conn_capab(bss, pos, line) < 0) { in hostapd_config_fill()
3269 os_free(bss->hs20_operating_class); in hostapd_config_fill()
3270 bss->hs20_operating_class = oper_class; in hostapd_config_fill()
3271 bss->hs20_operating_class_len = oper_class_len; in hostapd_config_fill()
3273 if (hs20_parse_icon(bss, pos) < 0) { in hostapd_config_fill()
3279 if (hs20_parse_osu_ssid(bss, pos, line) < 0) in hostapd_config_fill()
3282 if (hs20_parse_osu_server_uri(bss, pos, line) < 0) in hostapd_config_fill()
3285 if (hs20_parse_osu_friendly_name(bss, pos, line) < 0) in hostapd_config_fill()
3288 if (hs20_parse_osu_nai(bss, pos, line) < 0) in hostapd_config_fill()
3291 if (hs20_parse_osu_method_list(bss, pos, line) < 0) in hostapd_config_fill()
3294 if (hs20_parse_osu_icon(bss, pos, line) < 0) in hostapd_config_fill()
3297 if (hs20_parse_osu_service_desc(bss, pos, line) < 0) in hostapd_config_fill()
3300 os_free(bss->subscr_remediation_url); in hostapd_config_fill()
3301 bss->subscr_remediation_url = os_strdup(pos); in hostapd_config_fill()
3303 bss->subscr_remediation_method = atoi(pos); in hostapd_config_fill()
3307 bss->mbo_enabled = atoi(pos); in hostapd_config_fill()
3330 WPA_PUT_LE16(bss->bss_load_test, atoi(pos)); in hostapd_config_fill()
3338 bss->bss_load_test[2] = atoi(pos); in hostapd_config_fill()
3346 WPA_PUT_LE16(&bss->bss_load_test[3], atoi(pos)); in hostapd_config_fill()
3347 bss->bss_load_test_set = 1; in hostapd_config_fill()
3349 bss->radio_measurements = atoi(pos); in hostapd_config_fill()
3366 wpabuf_free(bss->own_ie_override); in hostapd_config_fill()
3367 bss->own_ie_override = tmp; in hostapd_config_fill()
3380 wpabuf_free(bss->vendor_elements); in hostapd_config_fill()
3381 bss->vendor_elements = NULL; in hostapd_config_fill()
3397 wpabuf_free(bss->vendor_elements); in hostapd_config_fill()
3398 bss->vendor_elements = elems; in hostapd_config_fill()
3400 bss->sae_anti_clogging_threshold = atoi(pos); in hostapd_config_fill()
3402 if (hostapd_parse_intlist(&bss->sae_groups, pos)) { in hostapd_config_fill()
3419 os_free(bss->wowlan_triggers); in hostapd_config_fill()
3420 bss->wowlan_triggers = os_strdup(pos); in hostapd_config_fill()
3485 os_free(bss->no_probe_resp_if_seen_on); in hostapd_config_fill()
3486 bss->no_probe_resp_if_seen_on = os_strdup(pos); in hostapd_config_fill()
3488 os_free(bss->no_auth_if_seen_on); in hostapd_config_fill()
3489 bss->no_auth_if_seen_on = os_strdup(pos); in hostapd_config_fill()
3537 conf->last_bss = conf->bss[0]; in hostapd_config_read()
3540 struct hostapd_bss_config *bss; in hostapd_config_read() local
3542 bss = conf->last_bss; in hostapd_config_read()
3567 errors += hostapd_config_fill(conf, bss, buf, pos, line); in hostapd_config_read()
3573 hostapd_set_security_params(conf->bss[i], 1); in hostapd_config_read()
3592 struct hostapd_bss_config *bss, const char *field, in hostapd_set_iface() argument
3598 errors = hostapd_config_fill(conf, bss, field, value, 0); in hostapd_set_iface()
3606 hostapd_set_security_params(conf->bss[i], 0); in hostapd_set_iface()