Lines Matching refs:bss
29 static int hostapd_config_read_vlan_file(struct hostapd_bss_config *bss, in hostapd_config_read_vlan_file() argument
97 if (bss->vlan_tail) in hostapd_config_read_vlan_file()
98 bss->vlan_tail->next = vlan; in hostapd_config_read_vlan_file()
100 bss->vlan = vlan; in hostapd_config_read_vlan_file()
101 bss->vlan_tail = vlan; in hostapd_config_read_vlan_file()
572 static int hostapd_parse_das_client(struct hostapd_bss_config *bss, in hostapd_parse_das_client() argument
583 if (hostapd_parse_ip_addr(val, &bss->radius_das_client_addr)) in hostapd_parse_das_client()
586 os_free(bss->radius_das_shared_secret); in hostapd_parse_das_client()
587 bss->radius_das_shared_secret = (u8 *) os_strdup(secret); in hostapd_parse_das_client()
588 if (bss->radius_das_shared_secret == NULL) in hostapd_parse_das_client()
590 bss->radius_das_shared_secret_len = os_strlen(secret); in hostapd_parse_das_client()
792 struct hostapd_bss_config *bss; in hostapd_config_bss() local
797 bss = os_realloc_array(conf->bss, conf->num_bss + 1, in hostapd_config_bss()
799 if (bss == NULL) { in hostapd_config_bss()
804 conf->bss = bss; in hostapd_config_bss()
806 bss = &(conf->bss[conf->num_bss]); in hostapd_config_bss()
807 os_memset(bss, 0, sizeof(*bss)); in hostapd_config_bss()
808 bss->radius = os_zalloc(sizeof(*bss->radius)); in hostapd_config_bss()
809 if (bss->radius == NULL) { in hostapd_config_bss()
816 conf->last_bss = bss; in hostapd_config_bss()
818 hostapd_config_defaults_bss(bss); in hostapd_config_bss()
819 os_strlcpy(bss->iface, ifname, sizeof(bss->iface)); in hostapd_config_bss()
820 os_memcpy(bss->ssid.vlan, bss->iface, IFNAMSIZ + 1); in hostapd_config_bss()
923 static int add_r0kh(struct hostapd_bss_config *bss, char *value) in add_r0kh() argument
962 r0kh->next = bss->r0kh_list; in add_r0kh()
963 bss->r0kh_list = r0kh; in add_r0kh()
969 static int add_r1kh(struct hostapd_bss_config *bss, char *value) in add_r1kh() argument
1007 r1kh->next = bss->r1kh_list; in add_r1kh()
1008 bss->r1kh_list = r1kh; in add_r1kh()
1138 static int hostapd_config_check_bss(struct hostapd_bss_config *bss, in hostapd_config_check_bss() argument
1141 if (bss->ieee802_1x && !bss->eap_server && in hostapd_config_check_bss()
1142 !bss->radius->auth_servers) { in hostapd_config_check_bss()
1148 if (bss->wpa && bss->wpa_psk_radius != PSK_RADIUS_IGNORED && in hostapd_config_check_bss()
1149 bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) { in hostapd_config_check_bss()
1155 if (bss->wpa && (bss->wpa_key_mgmt & WPA_KEY_MGMT_PSK) && in hostapd_config_check_bss()
1156 bss->ssid.wpa_psk == NULL && bss->ssid.wpa_passphrase == NULL && in hostapd_config_check_bss()
1157 bss->ssid.wpa_psk_file == NULL && in hostapd_config_check_bss()
1158 (bss->wpa_psk_radius != PSK_RADIUS_REQUIRED || in hostapd_config_check_bss()
1159 bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH)) { in hostapd_config_check_bss()
1165 if (hostapd_mac_comp_empty(bss->bssid) != 0) { in hostapd_config_check_bss()
1169 if ((&conf->bss[i] != bss) && in hostapd_config_check_bss()
1170 (hostapd_mac_comp(conf->bss[i].bssid, in hostapd_config_check_bss()
1171 bss->bssid) == 0)) { in hostapd_config_check_bss()
1174 MAC2STR(bss->bssid), in hostapd_config_check_bss()
1175 conf->bss[i].iface, bss->iface); in hostapd_config_check_bss()
1182 if (wpa_key_mgmt_ft(bss->wpa_key_mgmt) && in hostapd_config_check_bss()
1183 (bss->nas_identifier == NULL || in hostapd_config_check_bss()
1184 os_strlen(bss->nas_identifier) < 1 || in hostapd_config_check_bss()
1185 os_strlen(bss->nas_identifier) > FT_R0KH_ID_MAX_LEN)) { in hostapd_config_check_bss()
1195 bss->disable_11n = 1; in hostapd_config_check_bss()
1201 bss->ssid.security_policy == SECURITY_STATIC_WEP) { in hostapd_config_check_bss()
1202 bss->disable_11n = 1; in hostapd_config_check_bss()
1207 if (conf->ieee80211n && bss->wpa && in hostapd_config_check_bss()
1208 !(bss->wpa_pairwise & WPA_CIPHER_CCMP) && in hostapd_config_check_bss()
1209 !(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP))) { in hostapd_config_check_bss()
1210 bss->disable_11n = 1; in hostapd_config_check_bss()
1218 if (bss->wps_state && bss->ignore_broadcast_ssid) { in hostapd_config_check_bss()
1221 bss->wps_state = 0; in hostapd_config_check_bss()
1224 if (bss->wps_state && bss->ssid.wep.keys_set && bss->wpa == 0) { in hostapd_config_check_bss()
1227 bss->wps_state = 0; in hostapd_config_check_bss()
1230 if (bss->wps_state && bss->wpa && in hostapd_config_check_bss()
1231 (!(bss->wpa & 2) || in hostapd_config_check_bss()
1232 !(bss->rsn_pairwise & WPA_CIPHER_CCMP))) { in hostapd_config_check_bss()
1235 bss->wps_state = 0; in hostapd_config_check_bss()
1240 if (bss->hs20 && in hostapd_config_check_bss()
1241 (!(bss->wpa & 2) || in hostapd_config_check_bss()
1242 !(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP)))) { in hostapd_config_check_bss()
1265 if (hostapd_config_check_bss(&conf->bss[i], conf)) in hostapd_config_check()
1274 static int parse_roaming_consortium(struct hostapd_bss_config *bss, char *pos, in parse_roaming_consortium() argument
1290 rc = os_realloc_array(bss->roaming_consortium, in parse_roaming_consortium()
1291 bss->roaming_consortium_count + 1, in parse_roaming_consortium()
1296 os_memcpy(rc[bss->roaming_consortium_count].oi, oi, len); in parse_roaming_consortium()
1297 rc[bss->roaming_consortium_count].len = len; in parse_roaming_consortium()
1299 bss->roaming_consortium = rc; in parse_roaming_consortium()
1300 bss->roaming_consortium_count++; in parse_roaming_consortium()
1343 static int parse_venue_name(struct hostapd_bss_config *bss, char *pos, in parse_venue_name() argument
1346 if (parse_lang_string(&bss->venue_name, &bss->venue_name_count, pos)) { in parse_venue_name()
1355 static int parse_3gpp_cell_net(struct hostapd_bss_config *bss, char *buf, in parse_3gpp_cell_net() argument
1414 os_free(bss->anqp_3gpp_cell_net); in parse_3gpp_cell_net()
1415 bss->anqp_3gpp_cell_net = info; in parse_3gpp_cell_net()
1416 bss->anqp_3gpp_cell_net_len = 2 + 3 + 3 * count; in parse_3gpp_cell_net()
1418 bss->anqp_3gpp_cell_net, bss->anqp_3gpp_cell_net_len); in parse_3gpp_cell_net()
1430 static int parse_nai_realm(struct hostapd_bss_config *bss, char *buf, int line) in parse_nai_realm() argument
1437 offsets = os_calloc(bss->nai_realm_count * MAX_NAI_REALMS, in parse_nai_realm()
1442 for (i = 0; i < bss->nai_realm_count; i++) { in parse_nai_realm()
1443 realm = &bss->nai_realm_data[i]; in parse_nai_realm()
1451 realm = os_realloc_array(bss->nai_realm_data, bss->nai_realm_count + 1, in parse_nai_realm()
1457 bss->nai_realm_data = realm; in parse_nai_realm()
1460 for (i = 0; i < bss->nai_realm_count; i++) { in parse_nai_realm()
1461 realm = &bss->nai_realm_data[i]; in parse_nai_realm()
1472 realm = &bss->nai_realm_data[bss->nai_realm_count]; in parse_nai_realm()
1561 bss->nai_realm_count++; in parse_nai_realm()
1574 static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf, in hs20_parse_conn_capab() argument
1580 if (bss->hs20_connection_capability_len >= 0xfff0) in hs20_parse_conn_capab()
1583 conn_cap = os_realloc(bss->hs20_connection_capability, in hs20_parse_conn_capab()
1584 bss->hs20_connection_capability_len + 4); in hs20_parse_conn_capab()
1588 bss->hs20_connection_capability = conn_cap; in hs20_parse_conn_capab()
1589 conn_cap += bss->hs20_connection_capability_len; in hs20_parse_conn_capab()
1602 bss->hs20_connection_capability_len += 4; in hs20_parse_conn_capab()
1608 static int hs20_parse_wan_metrics(struct hostapd_bss_config *bss, char *buf, in hs20_parse_wan_metrics() argument
1660 os_free(bss->hs20_wan_metrics); in hs20_parse_wan_metrics()
1661 bss->hs20_wan_metrics = wan_metrics; in hs20_parse_wan_metrics()
1673 static int hs20_parse_oper_friendly_name(struct hostapd_bss_config *bss, in hs20_parse_oper_friendly_name() argument
1676 if (parse_lang_string(&bss->hs20_oper_friendly_name, in hs20_parse_oper_friendly_name()
1677 &bss->hs20_oper_friendly_name_count, pos)) { in hs20_parse_oper_friendly_name()
1713 struct hostapd_bss_config *bss, in hostapd_config_fill() argument
1720 os_strlcpy(conf->bss[0].iface, pos, in hostapd_config_fill()
1721 sizeof(conf->bss[0].iface)); in hostapd_config_fill()
1723 os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); in hostapd_config_fill()
1725 os_strlcpy(bss->wds_bridge, pos, in hostapd_config_fill()
1726 sizeof(bss->wds_bridge)); in hostapd_config_fill()
1748 bss->logger_syslog_level = atoi(pos); in hostapd_config_fill()
1750 bss->logger_stdout_level = atoi(pos); in hostapd_config_fill()
1752 bss->logger_syslog = atoi(pos); in hostapd_config_fill()
1754 bss->logger_stdout = atoi(pos); in hostapd_config_fill()
1756 bss->dump_log_name = os_strdup(pos); in hostapd_config_fill()
1758 bss->ssid.ssid_len = os_strlen(pos); in hostapd_config_fill()
1759 if (bss->ssid.ssid_len > HOSTAPD_MAX_SSID_LEN || in hostapd_config_fill()
1760 bss->ssid.ssid_len < 1) { in hostapd_config_fill()
1765 os_memcpy(bss->ssid.ssid, pos, in hostapd_config_fill()
1766 bss->ssid.ssid_len); in hostapd_config_fill()
1767 bss->ssid.ssid_set = 1; in hostapd_config_fill()
1778 os_memcpy(bss->ssid.ssid, str, slen); in hostapd_config_fill()
1779 bss->ssid.ssid_len = slen; in hostapd_config_fill()
1780 bss->ssid.ssid_set = 1; in hostapd_config_fill()
1784 bss->ssid.utf8_ssid = atoi(pos) > 0; in hostapd_config_fill()
1786 bss->macaddr_acl = atoi(pos); in hostapd_config_fill()
1787 if (bss->macaddr_acl != ACCEPT_UNLESS_DENIED && in hostapd_config_fill()
1788 bss->macaddr_acl != DENY_UNLESS_ACCEPTED && in hostapd_config_fill()
1789 bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) { in hostapd_config_fill()
1792 line, bss->macaddr_acl); in hostapd_config_fill()
1795 if (hostapd_config_read_maclist(pos, &bss->accept_mac, in hostapd_config_fill()
1796 &bss->num_accept_mac)) in hostapd_config_fill()
1804 if (hostapd_config_read_maclist(pos, &bss->deny_mac, in hostapd_config_fill()
1805 &bss->num_deny_mac)) { in hostapd_config_fill()
1812 bss->wds_sta = atoi(pos); in hostapd_config_fill()
1814 bss->isolate = atoi(pos); in hostapd_config_fill()
1816 bss->ap_max_inactivity = atoi(pos); in hostapd_config_fill()
1818 bss->skip_inactivity_poll = atoi(pos); in hostapd_config_fill()
1826 bss->ieee802_1x = atoi(pos); in hostapd_config_fill()
1828 bss->eapol_version = atoi(pos); in hostapd_config_fill()
1829 if (bss->eapol_version < 1 || in hostapd_config_fill()
1830 bss->eapol_version > 2) { in hostapd_config_fill()
1833 line, bss->eapol_version, pos); in hostapd_config_fill()
1837 bss->eapol_version); in hostapd_config_fill()
1840 bss->eap_server = atoi(pos); in hostapd_config_fill()
1845 bss->eap_server = atoi(pos); in hostapd_config_fill()
1847 if (hostapd_config_read_eap_user(pos, bss)) in hostapd_config_fill()
1850 os_free(bss->ca_cert); in hostapd_config_fill()
1851 bss->ca_cert = os_strdup(pos); in hostapd_config_fill()
1853 os_free(bss->server_cert); in hostapd_config_fill()
1854 bss->server_cert = os_strdup(pos); in hostapd_config_fill()
1856 os_free(bss->private_key); in hostapd_config_fill()
1857 bss->private_key = os_strdup(pos); in hostapd_config_fill()
1859 os_free(bss->private_key_passwd); in hostapd_config_fill()
1860 bss->private_key_passwd = os_strdup(pos); in hostapd_config_fill()
1862 bss->check_crl = atoi(pos); in hostapd_config_fill()
1864 os_free(bss->dh_file); in hostapd_config_fill()
1865 bss->dh_file = os_strdup(pos); in hostapd_config_fill()
1867 bss->fragment_size = atoi(pos); in hostapd_config_fill()
1870 os_free(bss->pac_opaque_encr_key); in hostapd_config_fill()
1871 bss->pac_opaque_encr_key = os_malloc(16); in hostapd_config_fill()
1872 if (bss->pac_opaque_encr_key == NULL) { in hostapd_config_fill()
1876 } else if (hexstr2bin(pos, bss->pac_opaque_encr_key, in hostapd_config_fill()
1889 os_free(bss->eap_fast_a_id); in hostapd_config_fill()
1890 bss->eap_fast_a_id = os_malloc(idlen / 2); in hostapd_config_fill()
1891 if (bss->eap_fast_a_id == NULL || in hostapd_config_fill()
1892 hexstr2bin(pos, bss->eap_fast_a_id, in hostapd_config_fill()
1899 bss->eap_fast_a_id_len = idlen / 2; in hostapd_config_fill()
1902 os_free(bss->eap_fast_a_id_info); in hostapd_config_fill()
1903 bss->eap_fast_a_id_info = os_strdup(pos); in hostapd_config_fill()
1905 bss->eap_fast_prov = atoi(pos); in hostapd_config_fill()
1907 bss->pac_key_lifetime = atoi(pos); in hostapd_config_fill()
1909 bss->pac_key_refresh_time = atoi(pos); in hostapd_config_fill()
1913 os_free(bss->eap_sim_db); in hostapd_config_fill()
1914 bss->eap_sim_db = os_strdup(pos); in hostapd_config_fill()
1916 bss->eap_sim_aka_result_ind = atoi(pos); in hostapd_config_fill()
1920 bss->tnc = atoi(pos); in hostapd_config_fill()
1924 bss->pwd_group = atoi(pos); in hostapd_config_fill()
1929 bss->eap_req_id_text = os_strdup(pos); in hostapd_config_fill()
1930 if (bss->eap_req_id_text == NULL) { in hostapd_config_fill()
1937 bss->eap_req_id_text_len = in hostapd_config_fill()
1938 os_strlen(bss->eap_req_id_text); in hostapd_config_fill()
1939 term = os_strstr(bss->eap_req_id_text, "\\0"); in hostapd_config_fill()
1943 bss->eap_req_id_text_len - in hostapd_config_fill()
1944 (term - bss->eap_req_id_text) - 1); in hostapd_config_fill()
1945 bss->eap_req_id_text_len--; in hostapd_config_fill()
1948 bss->default_wep_key_len = atoi(pos); in hostapd_config_fill()
1949 if (bss->default_wep_key_len > 13) { in hostapd_config_fill()
1953 bss->default_wep_key_len, in hostapd_config_fill()
1955 bss->default_wep_key_len * 8); in hostapd_config_fill()
1959 bss->individual_wep_key_len = atoi(pos); in hostapd_config_fill()
1960 if (bss->individual_wep_key_len < 0 || in hostapd_config_fill()
1961 bss->individual_wep_key_len > 13) { in hostapd_config_fill()
1964 bss->individual_wep_key_len, in hostapd_config_fill()
1965 bss->individual_wep_key_len * 8); in hostapd_config_fill()
1969 bss->wep_rekeying_period = atoi(pos); in hostapd_config_fill()
1970 if (bss->wep_rekeying_period < 0) { in hostapd_config_fill()
1973 line, bss->wep_rekeying_period); in hostapd_config_fill()
1977 bss->eap_reauth_period = atoi(pos); in hostapd_config_fill()
1978 if (bss->eap_reauth_period < 0) { in hostapd_config_fill()
1981 line, bss->eap_reauth_period); in hostapd_config_fill()
1985 bss->eapol_key_index_workaround = atoi(pos); in hostapd_config_fill()
1988 bss->ieee802_11f = 1; in hostapd_config_fill()
1989 os_strlcpy(bss->iapp_iface, pos, in hostapd_config_fill()
1990 sizeof(bss->iapp_iface)); in hostapd_config_fill()
1993 if (hostapd_parse_ip_addr(pos, &bss->own_ip_addr)) { in hostapd_config_fill()
1999 bss->nas_identifier = os_strdup(pos); in hostapd_config_fill()
2003 &bss->radius->auth_servers, in hostapd_config_fill()
2004 &bss->radius->num_auth_servers, pos, 1812, in hostapd_config_fill()
2005 &bss->radius->auth_server)) { in hostapd_config_fill()
2010 } else if (bss->radius->auth_server && in hostapd_config_fill()
2012 bss->radius->auth_server->port = atoi(pos); in hostapd_config_fill()
2013 } else if (bss->radius->auth_server && in hostapd_config_fill()
2022 bss->radius->auth_server->shared_secret = in hostapd_config_fill()
2024 bss->radius->auth_server->shared_secret_len = len; in hostapd_config_fill()
2027 &bss->radius->acct_servers, in hostapd_config_fill()
2028 &bss->radius->num_acct_servers, pos, 1813, in hostapd_config_fill()
2029 &bss->radius->acct_server)) { in hostapd_config_fill()
2034 } else if (bss->radius->acct_server && in hostapd_config_fill()
2036 bss->radius->acct_server->port = atoi(pos); in hostapd_config_fill()
2037 } else if (bss->radius->acct_server && in hostapd_config_fill()
2046 bss->radius->acct_server->shared_secret = in hostapd_config_fill()
2048 bss->radius->acct_server->shared_secret_len = len; in hostapd_config_fill()
2051 bss->radius->retry_primary_interval = atoi(pos); in hostapd_config_fill()
2054 bss->acct_interim_interval = atoi(pos); in hostapd_config_fill()
2056 bss->radius_request_cui = atoi(pos); in hostapd_config_fill()
2064 } else if (bss->radius_auth_req_attr == NULL) { in hostapd_config_fill()
2065 bss->radius_auth_req_attr = attr; in hostapd_config_fill()
2067 a = bss->radius_auth_req_attr; in hostapd_config_fill()
2079 } else if (bss->radius_acct_req_attr == NULL) { in hostapd_config_fill()
2080 bss->radius_acct_req_attr = attr; in hostapd_config_fill()
2082 a = bss->radius_acct_req_attr; in hostapd_config_fill()
2088 bss->radius_das_port = atoi(pos); in hostapd_config_fill()
2090 if (hostapd_parse_das_client(bss, pos) < 0) { in hostapd_config_fill()
2096 bss->radius_das_time_window = atoi(pos); in hostapd_config_fill()
2099 bss->radius_das_require_event_timestamp = atoi(pos); in hostapd_config_fill()
2102 bss->auth_algs = atoi(pos); in hostapd_config_fill()
2103 if (bss->auth_algs == 0) { in hostapd_config_fill()
2110 bss->max_num_sta = atoi(pos); in hostapd_config_fill()
2111 if (bss->max_num_sta < 0 || in hostapd_config_fill()
2112 bss->max_num_sta > MAX_STA_COUNT) { in hostapd_config_fill()
2115 "0..%d", line, bss->max_num_sta, in hostapd_config_fill()
2120 bss->wpa = atoi(pos); in hostapd_config_fill()
2122 bss->wpa_group_rekey = atoi(pos); in hostapd_config_fill()
2124 bss->wpa_strict_rekey = atoi(pos); in hostapd_config_fill()
2126 bss->wpa_gmk_rekey = atoi(pos); in hostapd_config_fill()
2128 bss->wpa_ptk_rekey = atoi(pos); in hostapd_config_fill()
2137 os_free(bss->ssid.wpa_passphrase); in hostapd_config_fill()
2138 bss->ssid.wpa_passphrase = os_strdup(pos); in hostapd_config_fill()
2139 os_free(bss->ssid.wpa_psk); in hostapd_config_fill()
2140 bss->ssid.wpa_psk = NULL; in hostapd_config_fill()
2143 os_free(bss->ssid.wpa_psk); in hostapd_config_fill()
2144 bss->ssid.wpa_psk = in hostapd_config_fill()
2146 if (bss->ssid.wpa_psk == NULL) in hostapd_config_fill()
2148 else if (hexstr2bin(pos, bss->ssid.wpa_psk->psk, in hostapd_config_fill()
2155 bss->ssid.wpa_psk->group = 1; in hostapd_config_fill()
2156 os_free(bss->ssid.wpa_passphrase); in hostapd_config_fill()
2157 bss->ssid.wpa_passphrase = NULL; in hostapd_config_fill()
2160 os_free(bss->ssid.wpa_psk_file); in hostapd_config_fill()
2161 bss->ssid.wpa_psk_file = os_strdup(pos); in hostapd_config_fill()
2162 if (!bss->ssid.wpa_psk_file) { in hostapd_config_fill()
2168 bss->wpa_key_mgmt = in hostapd_config_fill()
2170 if (bss->wpa_key_mgmt == -1) in hostapd_config_fill()
2173 bss->wpa_psk_radius = atoi(pos); in hostapd_config_fill()
2174 if (bss->wpa_psk_radius != PSK_RADIUS_IGNORED && in hostapd_config_fill()
2175 bss->wpa_psk_radius != PSK_RADIUS_ACCEPTED && in hostapd_config_fill()
2176 bss->wpa_psk_radius != PSK_RADIUS_REQUIRED) { in hostapd_config_fill()
2179 line, bss->wpa_psk_radius); in hostapd_config_fill()
2183 bss->wpa_pairwise = in hostapd_config_fill()
2185 if (bss->wpa_pairwise == -1 || in hostapd_config_fill()
2186 bss->wpa_pairwise == 0) in hostapd_config_fill()
2188 else if (bss->wpa_pairwise & in hostapd_config_fill()
2193 bss->wpa_pairwise, pos); in hostapd_config_fill()
2197 bss->rsn_pairwise = in hostapd_config_fill()
2199 if (bss->rsn_pairwise == -1 || in hostapd_config_fill()
2200 bss->rsn_pairwise == 0) in hostapd_config_fill()
2202 else if (bss->rsn_pairwise & in hostapd_config_fill()
2207 bss->rsn_pairwise, pos); in hostapd_config_fill()
2212 bss->rsn_preauth = atoi(pos); in hostapd_config_fill()
2214 bss->rsn_preauth_interfaces = os_strdup(pos); in hostapd_config_fill()
2218 bss->peerkey = atoi(pos); in hostapd_config_fill()
2223 hexstr2bin(pos, bss->mobility_domain, in hostapd_config_fill()
2232 hexstr2bin(pos, bss->r1_key_holder, in hostapd_config_fill()
2240 bss->r0_key_lifetime = atoi(pos); in hostapd_config_fill()
2242 bss->reassociation_deadline = atoi(pos); in hostapd_config_fill()
2244 if (add_r0kh(bss, pos) < 0) { in hostapd_config_fill()
2251 if (add_r1kh(bss, pos) < 0) { in hostapd_config_fill()
2258 bss->pmk_r1_push = atoi(pos); in hostapd_config_fill()
2260 bss->ft_over_ds = atoi(pos); in hostapd_config_fill()
2264 os_free(bss->ctrl_interface); in hostapd_config_fill()
2265 bss->ctrl_interface = os_strdup(pos); in hostapd_config_fill()
2274 bss->ctrl_interface_gid = grp->gr_gid; in hostapd_config_fill()
2275 bss->ctrl_interface_gid_set = 1; in hostapd_config_fill()
2278 bss->ctrl_interface_gid, group); in hostapd_config_fill()
2283 bss->ctrl_interface_gid = strtol(group, &endp, 10); in hostapd_config_fill()
2290 bss->ctrl_interface_gid_set = 1; in hostapd_config_fill()
2292 bss->ctrl_interface_gid); in hostapd_config_fill()
2297 os_free(bss->radius_server_clients); in hostapd_config_fill()
2298 bss->radius_server_clients = os_strdup(pos); in hostapd_config_fill()
2300 bss->radius_server_auth_port = atoi(pos); in hostapd_config_fill()
2302 bss->radius_server_ipv6 = atoi(pos); in hostapd_config_fill()
2305 os_free(bss->test_socket); in hostapd_config_fill()
2306 bss->test_socket = os_strdup(pos); in hostapd_config_fill()
2308 bss->use_pae_group_addr = atoi(pos); in hostapd_config_fill()
2325 bss->wps_rf_bands = WPS_RF_50GHZ; in hostapd_config_fill()
2328 bss->wps_rf_bands = WPS_RF_24GHZ; in hostapd_config_fill()
2331 bss->wps_rf_bands = in hostapd_config_fill()
2355 bss->dtim_period = atoi(pos); in hostapd_config_fill()
2356 if (bss->dtim_period < 1 || bss->dtim_period > 255) { in hostapd_config_fill()
2359 line, bss->dtim_period); in hostapd_config_fill()
2406 bss->ignore_broadcast_ssid = atoi(pos); in hostapd_config_fill()
2408 bss->ssid.wep.idx = atoi(pos); in hostapd_config_fill()
2409 if (bss->ssid.wep.idx > 3) { in hostapd_config_fill()
2412 bss->ssid.wep.idx); in hostapd_config_fill()
2419 if (hostapd_config_read_wep(&bss->ssid.wep, in hostapd_config_fill()
2427 bss->ssid.dynamic_vlan = atoi(pos); in hostapd_config_fill()
2429 if (hostapd_config_read_vlan_file(bss, pos)) { in hostapd_config_fill()
2435 bss->ssid.vlan_naming = atoi(pos); in hostapd_config_fill()
2436 if (bss->ssid.vlan_naming >= DYNAMIC_VLAN_NAMING_END || in hostapd_config_fill()
2437 bss->ssid.vlan_naming < 0) { in hostapd_config_fill()
2440 bss->ssid.vlan_naming); in hostapd_config_fill()
2445 bss->ssid.vlan_tagged_interface = os_strdup(pos); in hostapd_config_fill()
2460 bss->wmm_enabled = atoi(pos); in hostapd_config_fill()
2462 bss->wmm_uapsd = atoi(pos); in hostapd_config_fill()
2478 if (hwaddr_aton(pos, bss->bssid)) { in hostapd_config_fill()
2485 bss->ieee80211w = atoi(pos); in hostapd_config_fill()
2487 bss->assoc_sa_query_max_timeout = atoi(pos); in hostapd_config_fill()
2488 if (bss->assoc_sa_query_max_timeout == 0) { in hostapd_config_fill()
2495 bss->assoc_sa_query_retry_timeout = atoi(pos); in hostapd_config_fill()
2496 if (bss->assoc_sa_query_retry_timeout == 0) { in hostapd_config_fill()
2536 bss->max_listen_interval = atoi(pos); in hostapd_config_fill()
2538 bss->disable_pmksa_caching = atoi(pos); in hostapd_config_fill()
2540 bss->okc = atoi(pos); in hostapd_config_fill()
2543 bss->wps_state = atoi(pos); in hostapd_config_fill()
2544 if (bss->wps_state < 0 || bss->wps_state > 2) { in hostapd_config_fill()
2550 bss->ap_setup_locked = atoi(pos); in hostapd_config_fill()
2552 if (uuid_str2bin(pos, bss->uuid)) { in hostapd_config_fill()
2558 os_free(bss->wps_pin_requests); in hostapd_config_fill()
2559 bss->wps_pin_requests = os_strdup(pos); in hostapd_config_fill()
2566 os_free(bss->device_name); in hostapd_config_fill()
2567 bss->device_name = os_strdup(pos); in hostapd_config_fill()
2574 os_free(bss->manufacturer); in hostapd_config_fill()
2575 bss->manufacturer = os_strdup(pos); in hostapd_config_fill()
2582 os_free(bss->model_name); in hostapd_config_fill()
2583 bss->model_name = os_strdup(pos); in hostapd_config_fill()
2590 os_free(bss->model_number); in hostapd_config_fill()
2591 bss->model_number = os_strdup(pos); in hostapd_config_fill()
2598 os_free(bss->serial_number); in hostapd_config_fill()
2599 bss->serial_number = os_strdup(pos); in hostapd_config_fill()
2601 if (wps_dev_type_str2bin(pos, bss->device_type)) in hostapd_config_fill()
2604 os_free(bss->config_methods); in hostapd_config_fill()
2605 bss->config_methods = os_strdup(pos); in hostapd_config_fill()
2607 if (hexstr2bin(pos, bss->os_version, 4)) { in hostapd_config_fill()
2613 os_free(bss->ap_pin); in hostapd_config_fill()
2614 bss->ap_pin = os_strdup(pos); in hostapd_config_fill()
2616 bss->skip_cred_build = atoi(pos); in hostapd_config_fill()
2618 os_free(bss->extra_cred); in hostapd_config_fill()
2619 bss->extra_cred = in hostapd_config_fill()
2620 (u8 *) os_readfile(pos, &bss->extra_cred_len); in hostapd_config_fill()
2621 if (bss->extra_cred == NULL) { in hostapd_config_fill()
2628 bss->wps_cred_processing = atoi(pos); in hostapd_config_fill()
2630 os_free(bss->ap_settings); in hostapd_config_fill()
2631 bss->ap_settings = in hostapd_config_fill()
2632 (u8 *) os_readfile(pos, &bss->ap_settings_len); in hostapd_config_fill()
2633 if (bss->ap_settings == NULL) { in hostapd_config_fill()
2640 bss->upnp_iface = os_strdup(pos); in hostapd_config_fill()
2642 os_free(bss->friendly_name); in hostapd_config_fill()
2643 bss->friendly_name = os_strdup(pos); in hostapd_config_fill()
2645 os_free(bss->manufacturer_url); in hostapd_config_fill()
2646 bss->manufacturer_url = os_strdup(pos); in hostapd_config_fill()
2648 os_free(bss->model_description); in hostapd_config_fill()
2649 bss->model_description = os_strdup(pos); in hostapd_config_fill()
2651 os_free(bss->model_url); in hostapd_config_fill()
2652 bss->model_url = os_strdup(pos); in hostapd_config_fill()
2654 os_free(bss->upc); in hostapd_config_fill()
2655 bss->upc = os_strdup(pos); in hostapd_config_fill()
2657 bss->pbc_in_m1 = atoi(pos); in hostapd_config_fill()
2660 bss->wps_nfc_dev_pw_id = atoi(pos); in hostapd_config_fill()
2661 if (bss->wps_nfc_dev_pw_id < 0x10 || in hostapd_config_fill()
2662 bss->wps_nfc_dev_pw_id > 0xffff) { in hostapd_config_fill()
2668 wpabuf_free(bss->wps_nfc_dh_pubkey); in hostapd_config_fill()
2669 bss->wps_nfc_dh_pubkey = hostapd_parse_bin(pos); in hostapd_config_fill()
2671 wpabuf_free(bss->wps_nfc_dh_privkey); in hostapd_config_fill()
2672 bss->wps_nfc_dh_privkey = hostapd_parse_bin(pos); in hostapd_config_fill()
2674 wpabuf_free(bss->wps_nfc_dev_pw); in hostapd_config_fill()
2675 bss->wps_nfc_dev_pw = hostapd_parse_bin(pos); in hostapd_config_fill()
2682 bss->p2p |= P2P_MANAGE; in hostapd_config_fill()
2684 bss->p2p &= ~P2P_MANAGE; in hostapd_config_fill()
2687 bss->p2p |= P2P_ALLOW_CROSS_CONNECTION; in hostapd_config_fill()
2689 bss->p2p &= ~P2P_ALLOW_CROSS_CONNECTION; in hostapd_config_fill()
2692 bss->disassoc_low_ack = atoi(pos); in hostapd_config_fill()
2696 bss->tdls |= TDLS_PROHIBIT; in hostapd_config_fill()
2698 bss->tdls &= ~TDLS_PROHIBIT; in hostapd_config_fill()
2702 bss->tdls |= TDLS_PROHIBIT_CHAN_SWITCH; in hostapd_config_fill()
2704 bss->tdls &= ~TDLS_PROHIBIT_CHAN_SWITCH; in hostapd_config_fill()
2711 bss->time_advertisement = atoi(pos); in hostapd_config_fill()
2720 os_free(bss->time_zone); in hostapd_config_fill()
2721 bss->time_zone = os_strdup(pos); in hostapd_config_fill()
2722 if (bss->time_zone == NULL) in hostapd_config_fill()
2726 bss->wnm_sleep_mode = atoi(pos); in hostapd_config_fill()
2728 bss->bss_transition = atoi(pos); in hostapd_config_fill()
2732 bss->interworking = atoi(pos); in hostapd_config_fill()
2734 bss->access_network_type = atoi(pos); in hostapd_config_fill()
2735 if (bss->access_network_type < 0 || in hostapd_config_fill()
2736 bss->access_network_type > 15) { in hostapd_config_fill()
2742 bss->internet = atoi(pos); in hostapd_config_fill()
2744 bss->asra = atoi(pos); in hostapd_config_fill()
2746 bss->esr = atoi(pos); in hostapd_config_fill()
2748 bss->uesa = atoi(pos); in hostapd_config_fill()
2750 bss->venue_group = atoi(pos); in hostapd_config_fill()
2751 bss->venue_info_set = 1; in hostapd_config_fill()
2753 bss->venue_type = atoi(pos); in hostapd_config_fill()
2754 bss->venue_info_set = 1; in hostapd_config_fill()
2756 if (hwaddr_aton(pos, bss->hessid)) { in hostapd_config_fill()
2762 if (parse_roaming_consortium(bss, pos, line) < 0) in hostapd_config_fill()
2765 if (parse_venue_name(bss, pos, line) < 0) in hostapd_config_fill()
2781 os_free(bss->network_auth_type); in hostapd_config_fill()
2782 bss->network_auth_type = in hostapd_config_fill()
2784 if (bss->network_auth_type == NULL) { in hostapd_config_fill()
2788 *bss->network_auth_type = auth_type; in hostapd_config_fill()
2789 WPA_PUT_LE16(bss->network_auth_type + 1, in hostapd_config_fill()
2792 os_memcpy(bss->network_auth_type + 3, in hostapd_config_fill()
2794 bss->network_auth_type_len = 3 + redirect_url_len; in hostapd_config_fill()
2796 if (hexstr2bin(pos, &bss->ipaddr_type_availability, 1)) in hostapd_config_fill()
2801 bss->ipaddr_type_configured = 0; in hostapd_config_fill()
2805 bss->ipaddr_type_configured = 1; in hostapd_config_fill()
2844 os_free(bss->domain_name); in hostapd_config_fill()
2845 bss->domain_name = domain_list; in hostapd_config_fill()
2846 bss->domain_name_len = domain_list_len; in hostapd_config_fill()
2848 if (parse_3gpp_cell_net(bss, pos, line) < 0) in hostapd_config_fill()
2851 if (parse_nai_realm(bss, pos, line) < 0) in hostapd_config_fill()
2854 bss->gas_frag_limit = atoi(pos); in hostapd_config_fill()
2856 bss->gas_comeback_delay = atoi(pos); in hostapd_config_fill()
2860 os_free(bss->dump_msk_file); in hostapd_config_fill()
2861 bss->dump_msk_file = os_strdup(pos); in hostapd_config_fill()
2865 bss->hs20 = atoi(pos); in hostapd_config_fill()
2867 bss->disable_dgaf = atoi(pos); in hostapd_config_fill()
2869 if (hs20_parse_oper_friendly_name(bss, pos, line) < 0) in hostapd_config_fill()
2872 if (hs20_parse_wan_metrics(bss, pos, line) < 0) { in hostapd_config_fill()
2877 if (hs20_parse_conn_capab(bss, pos, line) < 0) { in hostapd_config_fill()
2906 os_free(bss->hs20_operating_class); in hostapd_config_fill()
2907 bss->hs20_operating_class = oper_class; in hostapd_config_fill()
2908 bss->hs20_operating_class_len = oper_class_len; in hostapd_config_fill()
2920 wpabuf_free(bss->vendor_elements); in hostapd_config_fill()
2921 bss->vendor_elements = NULL; in hostapd_config_fill()
2936 wpabuf_free(bss->vendor_elements); in hostapd_config_fill()
2937 bss->vendor_elements = elems; in hostapd_config_fill()
2949 static void hostapd_set_security_params(struct hostapd_bss_config *bss) in hostapd_set_security_params() argument
2953 if (bss->individual_wep_key_len == 0) { in hostapd_set_security_params()
2956 bss->broadcast_key_idx_min = 0; in hostapd_set_security_params()
2962 if (bss->wpa & 1) in hostapd_set_security_params()
2963 pairwise |= bss->wpa_pairwise; in hostapd_set_security_params()
2964 if (bss->wpa & 2) { in hostapd_set_security_params()
2965 if (bss->rsn_pairwise == 0) in hostapd_set_security_params()
2966 bss->rsn_pairwise = bss->wpa_pairwise; in hostapd_set_security_params()
2967 pairwise |= bss->rsn_pairwise; in hostapd_set_security_params()
2970 bss->wpa_group = WPA_CIPHER_TKIP; in hostapd_set_security_params()
2973 bss->wpa_group = WPA_CIPHER_GCMP; in hostapd_set_security_params()
2975 bss->wpa_group = WPA_CIPHER_CCMP; in hostapd_set_security_params()
2977 bss->radius->auth_server = bss->radius->auth_servers; in hostapd_set_security_params()
2978 bss->radius->acct_server = bss->radius->acct_servers; in hostapd_set_security_params()
2980 if (bss->wpa && bss->ieee802_1x) { in hostapd_set_security_params()
2981 bss->ssid.security_policy = SECURITY_WPA; in hostapd_set_security_params()
2982 } else if (bss->wpa) { in hostapd_set_security_params()
2983 bss->ssid.security_policy = SECURITY_WPA_PSK; in hostapd_set_security_params()
2984 } else if (bss->ieee802_1x) { in hostapd_set_security_params()
2986 bss->ssid.security_policy = SECURITY_IEEE_802_1X; in hostapd_set_security_params()
2987 bss->ssid.wep.default_len = bss->default_wep_key_len; in hostapd_set_security_params()
2988 if (bss->default_wep_key_len) in hostapd_set_security_params()
2989 cipher = bss->default_wep_key_len >= 13 ? in hostapd_set_security_params()
2991 bss->wpa_group = cipher; in hostapd_set_security_params()
2992 bss->wpa_pairwise = cipher; in hostapd_set_security_params()
2993 bss->rsn_pairwise = cipher; in hostapd_set_security_params()
2994 } else if (bss->ssid.wep.keys_set) { in hostapd_set_security_params()
2996 if (bss->ssid.wep.len[0] >= 13) in hostapd_set_security_params()
2998 bss->ssid.security_policy = SECURITY_STATIC_WEP; in hostapd_set_security_params()
2999 bss->wpa_group = cipher; in hostapd_set_security_params()
3000 bss->wpa_pairwise = cipher; in hostapd_set_security_params()
3001 bss->rsn_pairwise = cipher; in hostapd_set_security_params()
3003 bss->ssid.security_policy = SECURITY_PLAINTEXT; in hostapd_set_security_params()
3004 bss->wpa_group = WPA_CIPHER_NONE; in hostapd_set_security_params()
3005 bss->wpa_pairwise = WPA_CIPHER_NONE; in hostapd_set_security_params()
3006 bss->rsn_pairwise = WPA_CIPHER_NONE; in hostapd_set_security_params()
3019 struct hostapd_bss_config *bss; in hostapd_config_read() local
3048 bss = conf->last_bss = conf->bss; in hostapd_config_read()
3051 bss = conf->last_bss; in hostapd_config_read()
3076 errors += hostapd_config_fill(conf, bss, buf, pos, line); in hostapd_config_read()
3082 hostapd_set_security_params(&conf->bss[i]); in hostapd_config_read()
3101 struct hostapd_bss_config *bss, char *field, char *value) in hostapd_set_iface() argument
3106 errors = hostapd_config_fill(conf, bss, field, value, 0); in hostapd_set_iface()
3114 hostapd_set_security_params(&conf->bss[i]); in hostapd_set_iface()