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()
755 struct hostapd_bss_config *bss; in hostapd_config_bss() local
760 bss = os_realloc_array(conf->bss, conf->num_bss + 1, in hostapd_config_bss()
762 if (bss == NULL) { in hostapd_config_bss()
767 conf->bss = bss; in hostapd_config_bss()
769 bss = &(conf->bss[conf->num_bss]); in hostapd_config_bss()
770 os_memset(bss, 0, sizeof(*bss)); in hostapd_config_bss()
771 bss->radius = os_zalloc(sizeof(*bss->radius)); in hostapd_config_bss()
772 if (bss->radius == NULL) { in hostapd_config_bss()
779 conf->last_bss = bss; in hostapd_config_bss()
781 hostapd_config_defaults_bss(bss); in hostapd_config_bss()
782 os_strlcpy(bss->iface, ifname, sizeof(bss->iface)); in hostapd_config_bss()
783 os_memcpy(bss->ssid.vlan, bss->iface, IFNAMSIZ + 1); in hostapd_config_bss()
886 static int add_r0kh(struct hostapd_bss_config *bss, char *value) in add_r0kh() argument
925 r0kh->next = bss->r0kh_list; in add_r0kh()
926 bss->r0kh_list = r0kh; in add_r0kh()
932 static int add_r1kh(struct hostapd_bss_config *bss, char *value) in add_r1kh() argument
970 r1kh->next = bss->r1kh_list; in add_r1kh()
971 bss->r1kh_list = r1kh; in add_r1kh()
1101 static int hostapd_config_check_bss(struct hostapd_bss_config *bss, in hostapd_config_check_bss() argument
1104 if (bss->ieee802_1x && !bss->eap_server && in hostapd_config_check_bss()
1105 !bss->radius->auth_servers) { in hostapd_config_check_bss()
1111 if (bss->wpa && bss->wpa_psk_radius != PSK_RADIUS_IGNORED && in hostapd_config_check_bss()
1112 bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) { in hostapd_config_check_bss()
1118 if (bss->wpa && (bss->wpa_key_mgmt & WPA_KEY_MGMT_PSK) && in hostapd_config_check_bss()
1119 bss->ssid.wpa_psk == NULL && bss->ssid.wpa_passphrase == NULL && in hostapd_config_check_bss()
1120 bss->ssid.wpa_psk_file == NULL && in hostapd_config_check_bss()
1121 (bss->wpa_psk_radius != PSK_RADIUS_REQUIRED || in hostapd_config_check_bss()
1122 bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH)) { in hostapd_config_check_bss()
1128 if (hostapd_mac_comp_empty(bss->bssid) != 0) { in hostapd_config_check_bss()
1132 if ((&conf->bss[i] != bss) && in hostapd_config_check_bss()
1133 (hostapd_mac_comp(conf->bss[i].bssid, in hostapd_config_check_bss()
1134 bss->bssid) == 0)) { in hostapd_config_check_bss()
1137 MAC2STR(bss->bssid), in hostapd_config_check_bss()
1138 conf->bss[i].iface, bss->iface); in hostapd_config_check_bss()
1145 if (wpa_key_mgmt_ft(bss->wpa_key_mgmt) && in hostapd_config_check_bss()
1146 (bss->nas_identifier == NULL || in hostapd_config_check_bss()
1147 os_strlen(bss->nas_identifier) < 1 || in hostapd_config_check_bss()
1148 os_strlen(bss->nas_identifier) > FT_R0KH_ID_MAX_LEN)) { in hostapd_config_check_bss()
1158 bss->disable_11n = 1; in hostapd_config_check_bss()
1164 bss->ssid.security_policy == SECURITY_STATIC_WEP) { in hostapd_config_check_bss()
1165 bss->disable_11n = 1; in hostapd_config_check_bss()
1170 if (conf->ieee80211n && bss->wpa && in hostapd_config_check_bss()
1171 !(bss->wpa_pairwise & WPA_CIPHER_CCMP) && in hostapd_config_check_bss()
1172 !(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP))) { in hostapd_config_check_bss()
1173 bss->disable_11n = 1; in hostapd_config_check_bss()
1181 if (bss->wps_state && bss->ignore_broadcast_ssid) { in hostapd_config_check_bss()
1184 bss->wps_state = 0; in hostapd_config_check_bss()
1187 if (bss->wps_state && bss->ssid.wep.keys_set && bss->wpa == 0) { in hostapd_config_check_bss()
1190 bss->wps_state = 0; in hostapd_config_check_bss()
1193 if (bss->wps_state && bss->wpa && in hostapd_config_check_bss()
1194 (!(bss->wpa & 2) || in hostapd_config_check_bss()
1195 !(bss->rsn_pairwise & WPA_CIPHER_CCMP))) { in hostapd_config_check_bss()
1198 bss->wps_state = 0; in hostapd_config_check_bss()
1203 if (bss->hs20 && in hostapd_config_check_bss()
1204 (!(bss->wpa & 2) || in hostapd_config_check_bss()
1205 !(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP)))) { in hostapd_config_check_bss()
1228 if (hostapd_config_check_bss(&conf->bss[i], conf)) in hostapd_config_check()
1237 static int parse_roaming_consortium(struct hostapd_bss_config *bss, char *pos, in parse_roaming_consortium() argument
1253 rc = os_realloc_array(bss->roaming_consortium, in parse_roaming_consortium()
1254 bss->roaming_consortium_count + 1, in parse_roaming_consortium()
1259 os_memcpy(rc[bss->roaming_consortium_count].oi, oi, len); in parse_roaming_consortium()
1260 rc[bss->roaming_consortium_count].len = len; in parse_roaming_consortium()
1262 bss->roaming_consortium = rc; in parse_roaming_consortium()
1263 bss->roaming_consortium_count++; in parse_roaming_consortium()
1306 static int parse_venue_name(struct hostapd_bss_config *bss, char *pos, in parse_venue_name() argument
1309 if (parse_lang_string(&bss->venue_name, &bss->venue_name_count, pos)) { in parse_venue_name()
1318 static int parse_3gpp_cell_net(struct hostapd_bss_config *bss, char *buf, in parse_3gpp_cell_net() argument
1377 os_free(bss->anqp_3gpp_cell_net); in parse_3gpp_cell_net()
1378 bss->anqp_3gpp_cell_net = info; in parse_3gpp_cell_net()
1379 bss->anqp_3gpp_cell_net_len = 2 + 3 + 3 * count; in parse_3gpp_cell_net()
1381 bss->anqp_3gpp_cell_net, bss->anqp_3gpp_cell_net_len); in parse_3gpp_cell_net()
1393 static int parse_nai_realm(struct hostapd_bss_config *bss, char *buf, int line) in parse_nai_realm() argument
1400 offsets = os_calloc(bss->nai_realm_count * MAX_NAI_REALMS, in parse_nai_realm()
1405 for (i = 0; i < bss->nai_realm_count; i++) { in parse_nai_realm()
1406 realm = &bss->nai_realm_data[i]; in parse_nai_realm()
1414 realm = os_realloc_array(bss->nai_realm_data, bss->nai_realm_count + 1, in parse_nai_realm()
1420 bss->nai_realm_data = realm; in parse_nai_realm()
1423 for (i = 0; i < bss->nai_realm_count; i++) { in parse_nai_realm()
1424 realm = &bss->nai_realm_data[i]; in parse_nai_realm()
1435 realm = &bss->nai_realm_data[bss->nai_realm_count]; in parse_nai_realm()
1524 bss->nai_realm_count++; in parse_nai_realm()
1537 static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf, in hs20_parse_conn_capab() argument
1543 if (bss->hs20_connection_capability_len >= 0xfff0) in hs20_parse_conn_capab()
1546 conn_cap = os_realloc(bss->hs20_connection_capability, in hs20_parse_conn_capab()
1547 bss->hs20_connection_capability_len + 4); in hs20_parse_conn_capab()
1551 bss->hs20_connection_capability = conn_cap; in hs20_parse_conn_capab()
1552 conn_cap += bss->hs20_connection_capability_len; in hs20_parse_conn_capab()
1565 bss->hs20_connection_capability_len += 4; in hs20_parse_conn_capab()
1571 static int hs20_parse_wan_metrics(struct hostapd_bss_config *bss, char *buf, in hs20_parse_wan_metrics() argument
1623 os_free(bss->hs20_wan_metrics); in hs20_parse_wan_metrics()
1624 bss->hs20_wan_metrics = wan_metrics; in hs20_parse_wan_metrics()
1636 static int hs20_parse_oper_friendly_name(struct hostapd_bss_config *bss, in hs20_parse_oper_friendly_name() argument
1639 if (parse_lang_string(&bss->hs20_oper_friendly_name, in hs20_parse_oper_friendly_name()
1640 &bss->hs20_oper_friendly_name_count, pos)) { in hs20_parse_oper_friendly_name()
1676 struct hostapd_bss_config *bss, in hostapd_config_fill() argument
1683 os_strlcpy(conf->bss[0].iface, pos, in hostapd_config_fill()
1684 sizeof(conf->bss[0].iface)); in hostapd_config_fill()
1686 os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); in hostapd_config_fill()
1688 os_strlcpy(bss->wds_bridge, pos, in hostapd_config_fill()
1689 sizeof(bss->wds_bridge)); in hostapd_config_fill()
1711 bss->logger_syslog_level = atoi(pos); in hostapd_config_fill()
1713 bss->logger_stdout_level = atoi(pos); in hostapd_config_fill()
1715 bss->logger_syslog = atoi(pos); in hostapd_config_fill()
1717 bss->logger_stdout = atoi(pos); in hostapd_config_fill()
1719 bss->dump_log_name = os_strdup(pos); in hostapd_config_fill()
1721 bss->ssid.ssid_len = os_strlen(pos); in hostapd_config_fill()
1722 if (bss->ssid.ssid_len > HOSTAPD_MAX_SSID_LEN || in hostapd_config_fill()
1723 bss->ssid.ssid_len < 1) { in hostapd_config_fill()
1728 os_memcpy(bss->ssid.ssid, pos, in hostapd_config_fill()
1729 bss->ssid.ssid_len); in hostapd_config_fill()
1730 bss->ssid.ssid_set = 1; in hostapd_config_fill()
1741 os_memcpy(bss->ssid.ssid, str, slen); in hostapd_config_fill()
1742 bss->ssid.ssid_len = slen; in hostapd_config_fill()
1743 bss->ssid.ssid_set = 1; in hostapd_config_fill()
1747 bss->ssid.utf8_ssid = atoi(pos) > 0; in hostapd_config_fill()
1749 bss->macaddr_acl = atoi(pos); in hostapd_config_fill()
1750 if (bss->macaddr_acl != ACCEPT_UNLESS_DENIED && in hostapd_config_fill()
1751 bss->macaddr_acl != DENY_UNLESS_ACCEPTED && in hostapd_config_fill()
1752 bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) { in hostapd_config_fill()
1755 line, bss->macaddr_acl); in hostapd_config_fill()
1758 if (hostapd_config_read_maclist(pos, &bss->accept_mac, in hostapd_config_fill()
1759 &bss->num_accept_mac)) in hostapd_config_fill()
1767 if (hostapd_config_read_maclist(pos, &bss->deny_mac, in hostapd_config_fill()
1768 &bss->num_deny_mac)) { in hostapd_config_fill()
1775 bss->wds_sta = atoi(pos); in hostapd_config_fill()
1777 bss->isolate = atoi(pos); in hostapd_config_fill()
1779 bss->ap_max_inactivity = atoi(pos); in hostapd_config_fill()
1781 bss->skip_inactivity_poll = atoi(pos); in hostapd_config_fill()
1789 bss->ieee802_1x = atoi(pos); in hostapd_config_fill()
1791 bss->eapol_version = atoi(pos); in hostapd_config_fill()
1792 if (bss->eapol_version < 1 || in hostapd_config_fill()
1793 bss->eapol_version > 2) { in hostapd_config_fill()
1796 line, bss->eapol_version, pos); in hostapd_config_fill()
1800 bss->eapol_version); in hostapd_config_fill()
1803 bss->eap_server = atoi(pos); in hostapd_config_fill()
1808 bss->eap_server = atoi(pos); in hostapd_config_fill()
1810 if (hostapd_config_read_eap_user(pos, bss)) in hostapd_config_fill()
1813 os_free(bss->ca_cert); in hostapd_config_fill()
1814 bss->ca_cert = os_strdup(pos); in hostapd_config_fill()
1816 os_free(bss->server_cert); in hostapd_config_fill()
1817 bss->server_cert = os_strdup(pos); in hostapd_config_fill()
1819 os_free(bss->private_key); in hostapd_config_fill()
1820 bss->private_key = os_strdup(pos); in hostapd_config_fill()
1822 os_free(bss->private_key_passwd); in hostapd_config_fill()
1823 bss->private_key_passwd = os_strdup(pos); in hostapd_config_fill()
1825 bss->check_crl = atoi(pos); in hostapd_config_fill()
1827 os_free(bss->dh_file); in hostapd_config_fill()
1828 bss->dh_file = os_strdup(pos); in hostapd_config_fill()
1830 bss->fragment_size = atoi(pos); in hostapd_config_fill()
1833 os_free(bss->pac_opaque_encr_key); in hostapd_config_fill()
1834 bss->pac_opaque_encr_key = os_malloc(16); in hostapd_config_fill()
1835 if (bss->pac_opaque_encr_key == NULL) { in hostapd_config_fill()
1839 } else if (hexstr2bin(pos, bss->pac_opaque_encr_key, in hostapd_config_fill()
1852 os_free(bss->eap_fast_a_id); in hostapd_config_fill()
1853 bss->eap_fast_a_id = os_malloc(idlen / 2); in hostapd_config_fill()
1854 if (bss->eap_fast_a_id == NULL || in hostapd_config_fill()
1855 hexstr2bin(pos, bss->eap_fast_a_id, in hostapd_config_fill()
1862 bss->eap_fast_a_id_len = idlen / 2; in hostapd_config_fill()
1865 os_free(bss->eap_fast_a_id_info); in hostapd_config_fill()
1866 bss->eap_fast_a_id_info = os_strdup(pos); in hostapd_config_fill()
1868 bss->eap_fast_prov = atoi(pos); in hostapd_config_fill()
1870 bss->pac_key_lifetime = atoi(pos); in hostapd_config_fill()
1872 bss->pac_key_refresh_time = atoi(pos); in hostapd_config_fill()
1876 os_free(bss->eap_sim_db); in hostapd_config_fill()
1877 bss->eap_sim_db = os_strdup(pos); in hostapd_config_fill()
1879 bss->eap_sim_aka_result_ind = atoi(pos); in hostapd_config_fill()
1883 bss->tnc = atoi(pos); in hostapd_config_fill()
1887 bss->pwd_group = atoi(pos); in hostapd_config_fill()
1892 bss->eap_req_id_text = os_strdup(pos); in hostapd_config_fill()
1893 if (bss->eap_req_id_text == NULL) { in hostapd_config_fill()
1900 bss->eap_req_id_text_len = in hostapd_config_fill()
1901 os_strlen(bss->eap_req_id_text); in hostapd_config_fill()
1902 term = os_strstr(bss->eap_req_id_text, "\\0"); in hostapd_config_fill()
1906 bss->eap_req_id_text_len - in hostapd_config_fill()
1907 (term - bss->eap_req_id_text) - 1); in hostapd_config_fill()
1908 bss->eap_req_id_text_len--; in hostapd_config_fill()
1911 bss->default_wep_key_len = atoi(pos); in hostapd_config_fill()
1912 if (bss->default_wep_key_len > 13) { in hostapd_config_fill()
1916 bss->default_wep_key_len, in hostapd_config_fill()
1918 bss->default_wep_key_len * 8); in hostapd_config_fill()
1922 bss->individual_wep_key_len = atoi(pos); in hostapd_config_fill()
1923 if (bss->individual_wep_key_len < 0 || in hostapd_config_fill()
1924 bss->individual_wep_key_len > 13) { in hostapd_config_fill()
1927 bss->individual_wep_key_len, in hostapd_config_fill()
1928 bss->individual_wep_key_len * 8); in hostapd_config_fill()
1932 bss->wep_rekeying_period = atoi(pos); in hostapd_config_fill()
1933 if (bss->wep_rekeying_period < 0) { in hostapd_config_fill()
1936 line, bss->wep_rekeying_period); in hostapd_config_fill()
1940 bss->eap_reauth_period = atoi(pos); in hostapd_config_fill()
1941 if (bss->eap_reauth_period < 0) { in hostapd_config_fill()
1944 line, bss->eap_reauth_period); in hostapd_config_fill()
1948 bss->eapol_key_index_workaround = atoi(pos); in hostapd_config_fill()
1951 bss->ieee802_11f = 1; in hostapd_config_fill()
1952 os_strlcpy(bss->iapp_iface, pos, in hostapd_config_fill()
1953 sizeof(bss->iapp_iface)); in hostapd_config_fill()
1956 if (hostapd_parse_ip_addr(pos, &bss->own_ip_addr)) { in hostapd_config_fill()
1962 bss->nas_identifier = os_strdup(pos); in hostapd_config_fill()
1966 &bss->radius->auth_servers, in hostapd_config_fill()
1967 &bss->radius->num_auth_servers, pos, 1812, in hostapd_config_fill()
1968 &bss->radius->auth_server)) { in hostapd_config_fill()
1973 } else if (bss->radius->auth_server && in hostapd_config_fill()
1975 bss->radius->auth_server->port = atoi(pos); in hostapd_config_fill()
1976 } else if (bss->radius->auth_server && in hostapd_config_fill()
1985 bss->radius->auth_server->shared_secret = in hostapd_config_fill()
1987 bss->radius->auth_server->shared_secret_len = len; in hostapd_config_fill()
1990 &bss->radius->acct_servers, in hostapd_config_fill()
1991 &bss->radius->num_acct_servers, pos, 1813, in hostapd_config_fill()
1992 &bss->radius->acct_server)) { in hostapd_config_fill()
1997 } else if (bss->radius->acct_server && in hostapd_config_fill()
1999 bss->radius->acct_server->port = atoi(pos); in hostapd_config_fill()
2000 } else if (bss->radius->acct_server && in hostapd_config_fill()
2009 bss->radius->acct_server->shared_secret = in hostapd_config_fill()
2011 bss->radius->acct_server->shared_secret_len = len; in hostapd_config_fill()
2014 bss->radius->retry_primary_interval = atoi(pos); in hostapd_config_fill()
2017 bss->acct_interim_interval = atoi(pos); in hostapd_config_fill()
2019 bss->radius_request_cui = atoi(pos); in hostapd_config_fill()
2027 } else if (bss->radius_auth_req_attr == NULL) { in hostapd_config_fill()
2028 bss->radius_auth_req_attr = attr; in hostapd_config_fill()
2030 a = bss->radius_auth_req_attr; in hostapd_config_fill()
2042 } else if (bss->radius_acct_req_attr == NULL) { in hostapd_config_fill()
2043 bss->radius_acct_req_attr = attr; in hostapd_config_fill()
2045 a = bss->radius_acct_req_attr; in hostapd_config_fill()
2051 bss->radius_das_port = atoi(pos); in hostapd_config_fill()
2053 if (hostapd_parse_das_client(bss, pos) < 0) { in hostapd_config_fill()
2059 bss->radius_das_time_window = atoi(pos); in hostapd_config_fill()
2062 bss->radius_das_require_event_timestamp = atoi(pos); in hostapd_config_fill()
2065 bss->auth_algs = atoi(pos); in hostapd_config_fill()
2066 if (bss->auth_algs == 0) { in hostapd_config_fill()
2073 bss->max_num_sta = atoi(pos); in hostapd_config_fill()
2074 if (bss->max_num_sta < 0 || in hostapd_config_fill()
2075 bss->max_num_sta > MAX_STA_COUNT) { in hostapd_config_fill()
2078 "0..%d", line, bss->max_num_sta, in hostapd_config_fill()
2083 bss->wpa = atoi(pos); in hostapd_config_fill()
2085 bss->wpa_group_rekey = atoi(pos); in hostapd_config_fill()
2087 bss->wpa_strict_rekey = atoi(pos); in hostapd_config_fill()
2089 bss->wpa_gmk_rekey = atoi(pos); in hostapd_config_fill()
2091 bss->wpa_ptk_rekey = atoi(pos); in hostapd_config_fill()
2100 os_free(bss->ssid.wpa_passphrase); in hostapd_config_fill()
2101 bss->ssid.wpa_passphrase = os_strdup(pos); in hostapd_config_fill()
2102 os_free(bss->ssid.wpa_psk); in hostapd_config_fill()
2103 bss->ssid.wpa_psk = NULL; in hostapd_config_fill()
2106 os_free(bss->ssid.wpa_psk); in hostapd_config_fill()
2107 bss->ssid.wpa_psk = in hostapd_config_fill()
2109 if (bss->ssid.wpa_psk == NULL) in hostapd_config_fill()
2111 else if (hexstr2bin(pos, bss->ssid.wpa_psk->psk, in hostapd_config_fill()
2118 bss->ssid.wpa_psk->group = 1; in hostapd_config_fill()
2119 os_free(bss->ssid.wpa_passphrase); in hostapd_config_fill()
2120 bss->ssid.wpa_passphrase = NULL; in hostapd_config_fill()
2123 os_free(bss->ssid.wpa_psk_file); in hostapd_config_fill()
2124 bss->ssid.wpa_psk_file = os_strdup(pos); in hostapd_config_fill()
2125 if (!bss->ssid.wpa_psk_file) { in hostapd_config_fill()
2131 bss->wpa_key_mgmt = in hostapd_config_fill()
2133 if (bss->wpa_key_mgmt == -1) in hostapd_config_fill()
2136 bss->wpa_psk_radius = atoi(pos); in hostapd_config_fill()
2137 if (bss->wpa_psk_radius != PSK_RADIUS_IGNORED && in hostapd_config_fill()
2138 bss->wpa_psk_radius != PSK_RADIUS_ACCEPTED && in hostapd_config_fill()
2139 bss->wpa_psk_radius != PSK_RADIUS_REQUIRED) { in hostapd_config_fill()
2142 line, bss->wpa_psk_radius); in hostapd_config_fill()
2146 bss->wpa_pairwise = in hostapd_config_fill()
2148 if (bss->wpa_pairwise == -1 || in hostapd_config_fill()
2149 bss->wpa_pairwise == 0) in hostapd_config_fill()
2151 else if (bss->wpa_pairwise & in hostapd_config_fill()
2156 bss->wpa_pairwise, pos); in hostapd_config_fill()
2160 bss->rsn_pairwise = in hostapd_config_fill()
2162 if (bss->rsn_pairwise == -1 || in hostapd_config_fill()
2163 bss->rsn_pairwise == 0) in hostapd_config_fill()
2165 else if (bss->rsn_pairwise & in hostapd_config_fill()
2170 bss->rsn_pairwise, pos); in hostapd_config_fill()
2175 bss->rsn_preauth = atoi(pos); in hostapd_config_fill()
2177 bss->rsn_preauth_interfaces = os_strdup(pos); in hostapd_config_fill()
2181 bss->peerkey = atoi(pos); in hostapd_config_fill()
2186 hexstr2bin(pos, bss->mobility_domain, in hostapd_config_fill()
2195 hexstr2bin(pos, bss->r1_key_holder, in hostapd_config_fill()
2203 bss->r0_key_lifetime = atoi(pos); in hostapd_config_fill()
2205 bss->reassociation_deadline = atoi(pos); in hostapd_config_fill()
2207 if (add_r0kh(bss, pos) < 0) { in hostapd_config_fill()
2214 if (add_r1kh(bss, pos) < 0) { in hostapd_config_fill()
2221 bss->pmk_r1_push = atoi(pos); in hostapd_config_fill()
2223 bss->ft_over_ds = atoi(pos); in hostapd_config_fill()
2227 os_free(bss->ctrl_interface); in hostapd_config_fill()
2228 bss->ctrl_interface = os_strdup(pos); in hostapd_config_fill()
2237 bss->ctrl_interface_gid = grp->gr_gid; in hostapd_config_fill()
2238 bss->ctrl_interface_gid_set = 1; in hostapd_config_fill()
2241 bss->ctrl_interface_gid, group); in hostapd_config_fill()
2246 bss->ctrl_interface_gid = strtol(group, &endp, 10); in hostapd_config_fill()
2253 bss->ctrl_interface_gid_set = 1; in hostapd_config_fill()
2255 bss->ctrl_interface_gid); in hostapd_config_fill()
2260 os_free(bss->radius_server_clients); in hostapd_config_fill()
2261 bss->radius_server_clients = os_strdup(pos); in hostapd_config_fill()
2263 bss->radius_server_auth_port = atoi(pos); in hostapd_config_fill()
2265 bss->radius_server_ipv6 = atoi(pos); in hostapd_config_fill()
2268 os_free(bss->test_socket); in hostapd_config_fill()
2269 bss->test_socket = os_strdup(pos); in hostapd_config_fill()
2271 bss->use_pae_group_addr = atoi(pos); in hostapd_config_fill()
2288 bss->wps_rf_bands = WPS_RF_50GHZ; in hostapd_config_fill()
2291 bss->wps_rf_bands = WPS_RF_24GHZ; in hostapd_config_fill()
2294 bss->wps_rf_bands = in hostapd_config_fill()
2318 bss->dtim_period = atoi(pos); in hostapd_config_fill()
2319 if (bss->dtim_period < 1 || bss->dtim_period > 255) { in hostapd_config_fill()
2322 line, bss->dtim_period); in hostapd_config_fill()
2369 bss->ignore_broadcast_ssid = atoi(pos); in hostapd_config_fill()
2371 bss->ssid.wep.idx = atoi(pos); in hostapd_config_fill()
2372 if (bss->ssid.wep.idx > 3) { in hostapd_config_fill()
2375 bss->ssid.wep.idx); in hostapd_config_fill()
2382 if (hostapd_config_read_wep(&bss->ssid.wep, in hostapd_config_fill()
2390 bss->ssid.dynamic_vlan = atoi(pos); in hostapd_config_fill()
2392 if (hostapd_config_read_vlan_file(bss, pos)) { in hostapd_config_fill()
2398 bss->ssid.vlan_naming = atoi(pos); in hostapd_config_fill()
2399 if (bss->ssid.vlan_naming >= DYNAMIC_VLAN_NAMING_END || in hostapd_config_fill()
2400 bss->ssid.vlan_naming < 0) { in hostapd_config_fill()
2403 bss->ssid.vlan_naming); in hostapd_config_fill()
2408 bss->ssid.vlan_tagged_interface = os_strdup(pos); in hostapd_config_fill()
2423 bss->wmm_enabled = atoi(pos); in hostapd_config_fill()
2425 bss->wmm_uapsd = atoi(pos); in hostapd_config_fill()
2441 if (hwaddr_aton(pos, bss->bssid)) { in hostapd_config_fill()
2448 bss->ieee80211w = atoi(pos); in hostapd_config_fill()
2450 bss->assoc_sa_query_max_timeout = atoi(pos); in hostapd_config_fill()
2451 if (bss->assoc_sa_query_max_timeout == 0) { in hostapd_config_fill()
2458 bss->assoc_sa_query_retry_timeout = atoi(pos); in hostapd_config_fill()
2459 if (bss->assoc_sa_query_retry_timeout == 0) { in hostapd_config_fill()
2499 bss->max_listen_interval = atoi(pos); in hostapd_config_fill()
2501 bss->disable_pmksa_caching = atoi(pos); in hostapd_config_fill()
2503 bss->okc = atoi(pos); in hostapd_config_fill()
2506 bss->wps_state = atoi(pos); in hostapd_config_fill()
2507 if (bss->wps_state < 0 || bss->wps_state > 2) { in hostapd_config_fill()
2513 bss->wps_independent = atoi(pos); in hostapd_config_fill()
2515 bss->ap_setup_locked = atoi(pos); in hostapd_config_fill()
2517 if (uuid_str2bin(pos, bss->uuid)) { in hostapd_config_fill()
2523 os_free(bss->wps_pin_requests); in hostapd_config_fill()
2524 bss->wps_pin_requests = os_strdup(pos); in hostapd_config_fill()
2531 os_free(bss->device_name); in hostapd_config_fill()
2532 bss->device_name = os_strdup(pos); in hostapd_config_fill()
2539 os_free(bss->manufacturer); in hostapd_config_fill()
2540 bss->manufacturer = os_strdup(pos); in hostapd_config_fill()
2547 os_free(bss->model_name); in hostapd_config_fill()
2548 bss->model_name = os_strdup(pos); in hostapd_config_fill()
2555 os_free(bss->model_number); in hostapd_config_fill()
2556 bss->model_number = os_strdup(pos); in hostapd_config_fill()
2563 os_free(bss->serial_number); in hostapd_config_fill()
2564 bss->serial_number = os_strdup(pos); in hostapd_config_fill()
2566 if (wps_dev_type_str2bin(pos, bss->device_type)) in hostapd_config_fill()
2569 os_free(bss->config_methods); in hostapd_config_fill()
2570 bss->config_methods = os_strdup(pos); in hostapd_config_fill()
2572 if (hexstr2bin(pos, bss->os_version, 4)) { in hostapd_config_fill()
2578 os_free(bss->ap_pin); in hostapd_config_fill()
2579 bss->ap_pin = os_strdup(pos); in hostapd_config_fill()
2581 bss->skip_cred_build = atoi(pos); in hostapd_config_fill()
2583 os_free(bss->extra_cred); in hostapd_config_fill()
2584 bss->extra_cred = in hostapd_config_fill()
2585 (u8 *) os_readfile(pos, &bss->extra_cred_len); in hostapd_config_fill()
2586 if (bss->extra_cred == NULL) { in hostapd_config_fill()
2593 bss->wps_cred_processing = atoi(pos); in hostapd_config_fill()
2595 os_free(bss->ap_settings); in hostapd_config_fill()
2596 bss->ap_settings = in hostapd_config_fill()
2597 (u8 *) os_readfile(pos, &bss->ap_settings_len); in hostapd_config_fill()
2598 if (bss->ap_settings == NULL) { in hostapd_config_fill()
2605 bss->upnp_iface = os_strdup(pos); in hostapd_config_fill()
2607 os_free(bss->friendly_name); in hostapd_config_fill()
2608 bss->friendly_name = os_strdup(pos); in hostapd_config_fill()
2610 os_free(bss->manufacturer_url); in hostapd_config_fill()
2611 bss->manufacturer_url = os_strdup(pos); in hostapd_config_fill()
2613 os_free(bss->model_description); in hostapd_config_fill()
2614 bss->model_description = os_strdup(pos); in hostapd_config_fill()
2616 os_free(bss->model_url); in hostapd_config_fill()
2617 bss->model_url = os_strdup(pos); in hostapd_config_fill()
2619 os_free(bss->upc); in hostapd_config_fill()
2620 bss->upc = os_strdup(pos); in hostapd_config_fill()
2622 bss->pbc_in_m1 = atoi(pos); in hostapd_config_fill()
2625 bss->wps_nfc_dev_pw_id = atoi(pos); in hostapd_config_fill()
2626 if (bss->wps_nfc_dev_pw_id < 0x10 || in hostapd_config_fill()
2627 bss->wps_nfc_dev_pw_id > 0xffff) { in hostapd_config_fill()
2632 bss->wps_nfc_pw_from_config = 1; in hostapd_config_fill()
2634 wpabuf_free(bss->wps_nfc_dh_pubkey); in hostapd_config_fill()
2635 bss->wps_nfc_dh_pubkey = hostapd_parse_bin(pos); in hostapd_config_fill()
2636 bss->wps_nfc_pw_from_config = 1; in hostapd_config_fill()
2638 wpabuf_free(bss->wps_nfc_dh_privkey); in hostapd_config_fill()
2639 bss->wps_nfc_dh_privkey = hostapd_parse_bin(pos); in hostapd_config_fill()
2640 bss->wps_nfc_pw_from_config = 1; in hostapd_config_fill()
2642 wpabuf_free(bss->wps_nfc_dev_pw); in hostapd_config_fill()
2643 bss->wps_nfc_dev_pw = hostapd_parse_bin(pos); in hostapd_config_fill()
2644 bss->wps_nfc_pw_from_config = 1; in hostapd_config_fill()
2651 bss->p2p |= P2P_MANAGE; in hostapd_config_fill()
2653 bss->p2p &= ~P2P_MANAGE; in hostapd_config_fill()
2656 bss->p2p |= P2P_ALLOW_CROSS_CONNECTION; in hostapd_config_fill()
2658 bss->p2p &= ~P2P_ALLOW_CROSS_CONNECTION; in hostapd_config_fill()
2661 bss->disassoc_low_ack = atoi(pos); in hostapd_config_fill()
2665 bss->tdls |= TDLS_PROHIBIT; in hostapd_config_fill()
2667 bss->tdls &= ~TDLS_PROHIBIT; in hostapd_config_fill()
2671 bss->tdls |= TDLS_PROHIBIT_CHAN_SWITCH; in hostapd_config_fill()
2673 bss->tdls &= ~TDLS_PROHIBIT_CHAN_SWITCH; in hostapd_config_fill()
2680 bss->time_advertisement = atoi(pos); in hostapd_config_fill()
2689 os_free(bss->time_zone); in hostapd_config_fill()
2690 bss->time_zone = os_strdup(pos); in hostapd_config_fill()
2691 if (bss->time_zone == NULL) in hostapd_config_fill()
2695 bss->wnm_sleep_mode = atoi(pos); in hostapd_config_fill()
2697 bss->bss_transition = atoi(pos); in hostapd_config_fill()
2701 bss->interworking = atoi(pos); in hostapd_config_fill()
2703 bss->access_network_type = atoi(pos); in hostapd_config_fill()
2704 if (bss->access_network_type < 0 || in hostapd_config_fill()
2705 bss->access_network_type > 15) { in hostapd_config_fill()
2711 bss->internet = atoi(pos); in hostapd_config_fill()
2713 bss->asra = atoi(pos); in hostapd_config_fill()
2715 bss->esr = atoi(pos); in hostapd_config_fill()
2717 bss->uesa = atoi(pos); in hostapd_config_fill()
2719 bss->venue_group = atoi(pos); in hostapd_config_fill()
2720 bss->venue_info_set = 1; in hostapd_config_fill()
2722 bss->venue_type = atoi(pos); in hostapd_config_fill()
2723 bss->venue_info_set = 1; in hostapd_config_fill()
2725 if (hwaddr_aton(pos, bss->hessid)) { in hostapd_config_fill()
2731 if (parse_roaming_consortium(bss, pos, line) < 0) in hostapd_config_fill()
2734 if (parse_venue_name(bss, pos, line) < 0) in hostapd_config_fill()
2750 os_free(bss->network_auth_type); in hostapd_config_fill()
2751 bss->network_auth_type = in hostapd_config_fill()
2753 if (bss->network_auth_type == NULL) { in hostapd_config_fill()
2757 *bss->network_auth_type = auth_type; in hostapd_config_fill()
2758 WPA_PUT_LE16(bss->network_auth_type + 1, in hostapd_config_fill()
2761 os_memcpy(bss->network_auth_type + 3, in hostapd_config_fill()
2763 bss->network_auth_type_len = 3 + redirect_url_len; in hostapd_config_fill()
2765 if (hexstr2bin(pos, &bss->ipaddr_type_availability, 1)) in hostapd_config_fill()
2770 bss->ipaddr_type_configured = 0; in hostapd_config_fill()
2774 bss->ipaddr_type_configured = 1; in hostapd_config_fill()
2813 os_free(bss->domain_name); in hostapd_config_fill()
2814 bss->domain_name = domain_list; in hostapd_config_fill()
2815 bss->domain_name_len = domain_list_len; in hostapd_config_fill()
2817 if (parse_3gpp_cell_net(bss, pos, line) < 0) in hostapd_config_fill()
2820 if (parse_nai_realm(bss, pos, line) < 0) in hostapd_config_fill()
2823 bss->gas_frag_limit = atoi(pos); in hostapd_config_fill()
2825 bss->gas_comeback_delay = atoi(pos); in hostapd_config_fill()
2829 os_free(bss->dump_msk_file); in hostapd_config_fill()
2830 bss->dump_msk_file = os_strdup(pos); in hostapd_config_fill()
2834 bss->hs20 = atoi(pos); in hostapd_config_fill()
2836 bss->disable_dgaf = atoi(pos); in hostapd_config_fill()
2838 if (hs20_parse_oper_friendly_name(bss, pos, line) < 0) in hostapd_config_fill()
2841 if (hs20_parse_wan_metrics(bss, pos, line) < 0) { in hostapd_config_fill()
2846 if (hs20_parse_conn_capab(bss, pos, line) < 0) { in hostapd_config_fill()
2875 os_free(bss->hs20_operating_class); in hostapd_config_fill()
2876 bss->hs20_operating_class = oper_class; in hostapd_config_fill()
2877 bss->hs20_operating_class_len = oper_class_len; in hostapd_config_fill()
2889 wpabuf_free(bss->vendor_elements); in hostapd_config_fill()
2890 bss->vendor_elements = NULL; in hostapd_config_fill()
2905 wpabuf_free(bss->vendor_elements); in hostapd_config_fill()
2906 bss->vendor_elements = elems; in hostapd_config_fill()
2908 bss->sae_anti_clogging_threshold = atoi(pos); in hostapd_config_fill()
2910 if (hostapd_parse_rates(&bss->sae_groups, pos)) { in hostapd_config_fill()
2926 static void hostapd_set_security_params(struct hostapd_bss_config *bss) in hostapd_set_security_params() argument
2928 if (bss->individual_wep_key_len == 0) { in hostapd_set_security_params()
2931 bss->broadcast_key_idx_min = 0; in hostapd_set_security_params()
2934 if ((bss->wpa & 2) && bss->rsn_pairwise == 0) in hostapd_set_security_params()
2935 bss->rsn_pairwise = bss->wpa_pairwise; in hostapd_set_security_params()
2936 bss->wpa_group = wpa_select_ap_group_cipher(bss->wpa, bss->wpa_pairwise, in hostapd_set_security_params()
2937 bss->rsn_pairwise); in hostapd_set_security_params()
2939 bss->radius->auth_server = bss->radius->auth_servers; in hostapd_set_security_params()
2940 bss->radius->acct_server = bss->radius->acct_servers; in hostapd_set_security_params()
2942 if (bss->wpa && bss->ieee802_1x) { in hostapd_set_security_params()
2943 bss->ssid.security_policy = SECURITY_WPA; in hostapd_set_security_params()
2944 } else if (bss->wpa) { in hostapd_set_security_params()
2945 bss->ssid.security_policy = SECURITY_WPA_PSK; in hostapd_set_security_params()
2946 } else if (bss->ieee802_1x) { in hostapd_set_security_params()
2948 bss->ssid.security_policy = SECURITY_IEEE_802_1X; in hostapd_set_security_params()
2949 bss->ssid.wep.default_len = bss->default_wep_key_len; in hostapd_set_security_params()
2950 if (bss->default_wep_key_len) in hostapd_set_security_params()
2951 cipher = bss->default_wep_key_len >= 13 ? in hostapd_set_security_params()
2953 bss->wpa_group = cipher; in hostapd_set_security_params()
2954 bss->wpa_pairwise = cipher; in hostapd_set_security_params()
2955 bss->rsn_pairwise = cipher; in hostapd_set_security_params()
2956 } else if (bss->ssid.wep.keys_set) { in hostapd_set_security_params()
2958 if (bss->ssid.wep.len[0] >= 13) in hostapd_set_security_params()
2960 bss->ssid.security_policy = SECURITY_STATIC_WEP; in hostapd_set_security_params()
2961 bss->wpa_group = cipher; in hostapd_set_security_params()
2962 bss->wpa_pairwise = cipher; in hostapd_set_security_params()
2963 bss->rsn_pairwise = cipher; in hostapd_set_security_params()
2965 bss->ssid.security_policy = SECURITY_PLAINTEXT; in hostapd_set_security_params()
2966 bss->wpa_group = WPA_CIPHER_NONE; in hostapd_set_security_params()
2967 bss->wpa_pairwise = WPA_CIPHER_NONE; in hostapd_set_security_params()
2968 bss->rsn_pairwise = WPA_CIPHER_NONE; in hostapd_set_security_params()
2981 struct hostapd_bss_config *bss; in hostapd_config_read() local
3010 bss = conf->last_bss = conf->bss; in hostapd_config_read()
3013 bss = conf->last_bss; in hostapd_config_read()
3038 errors += hostapd_config_fill(conf, bss, buf, pos, line); in hostapd_config_read()
3044 hostapd_set_security_params(&conf->bss[i]); in hostapd_config_read()
3063 struct hostapd_bss_config *bss, char *field, char *value) in hostapd_set_iface() argument
3068 errors = hostapd_config_fill(conf, bss, field, value, 0); in hostapd_set_iface()
3076 hostapd_set_security_params(&conf->bss[i]); in hostapd_set_iface()