Lines Matching refs:bss

23 static void hostapd_config_free_vlan(struct hostapd_bss_config *bss)  in hostapd_config_free_vlan()  argument
27 vlan = bss->vlan; in hostapd_config_free_vlan()
35 bss->vlan = NULL; in hostapd_config_free_vlan()
39 void hostapd_config_defaults_bss(struct hostapd_bss_config *bss) in hostapd_config_defaults_bss() argument
41 dl_list_init(&bss->anqp_elem); in hostapd_config_defaults_bss()
43 bss->logger_syslog_level = HOSTAPD_LEVEL_INFO; in hostapd_config_defaults_bss()
44 bss->logger_stdout_level = HOSTAPD_LEVEL_INFO; in hostapd_config_defaults_bss()
45 bss->logger_syslog = (unsigned int) -1; in hostapd_config_defaults_bss()
46 bss->logger_stdout = (unsigned int) -1; in hostapd_config_defaults_bss()
48 bss->auth_algs = WPA_AUTH_ALG_OPEN | WPA_AUTH_ALG_SHARED; in hostapd_config_defaults_bss()
50 bss->wep_rekeying_period = 300; in hostapd_config_defaults_bss()
52 bss->broadcast_key_idx_min = 1; in hostapd_config_defaults_bss()
53 bss->broadcast_key_idx_max = 2; in hostapd_config_defaults_bss()
54 bss->eap_reauth_period = 3600; in hostapd_config_defaults_bss()
56 bss->wpa_group_rekey = 600; in hostapd_config_defaults_bss()
57 bss->wpa_gmk_rekey = 86400; in hostapd_config_defaults_bss()
58 bss->wpa_key_mgmt = WPA_KEY_MGMT_PSK; in hostapd_config_defaults_bss()
59 bss->wpa_pairwise = WPA_CIPHER_TKIP; in hostapd_config_defaults_bss()
60 bss->wpa_group = WPA_CIPHER_TKIP; in hostapd_config_defaults_bss()
61 bss->rsn_pairwise = 0; in hostapd_config_defaults_bss()
63 bss->max_num_sta = MAX_STA_COUNT; in hostapd_config_defaults_bss()
65 bss->dtim_period = 2; in hostapd_config_defaults_bss()
67 bss->radius_server_auth_port = 1812; in hostapd_config_defaults_bss()
68 bss->eap_sim_db_timeout = 1; in hostapd_config_defaults_bss()
69 bss->ap_max_inactivity = AP_MAX_INACTIVITY; in hostapd_config_defaults_bss()
70 bss->eapol_version = EAPOL_VERSION; in hostapd_config_defaults_bss()
72 bss->max_listen_interval = 65535; in hostapd_config_defaults_bss()
74 bss->pwd_group = 19; /* ECC: GF(p=256) */ in hostapd_config_defaults_bss()
77 bss->assoc_sa_query_max_timeout = 1000; in hostapd_config_defaults_bss()
78 bss->assoc_sa_query_retry_timeout = 201; in hostapd_config_defaults_bss()
79 bss->group_mgmt_cipher = WPA_CIPHER_AES_128_CMAC; in hostapd_config_defaults_bss()
83 bss->eap_fast_prov = 3; in hostapd_config_defaults_bss()
84 bss->pac_key_lifetime = 7 * 24 * 60 * 60; in hostapd_config_defaults_bss()
85 bss->pac_key_refresh_time = 1 * 24 * 60 * 60; in hostapd_config_defaults_bss()
89 bss->wmm_enabled = -1; in hostapd_config_defaults_bss()
92 bss->ft_over_ds = 1; in hostapd_config_defaults_bss()
95 bss->radius_das_time_window = 300; in hostapd_config_defaults_bss()
97 bss->sae_anti_clogging_threshold = 5; in hostapd_config_defaults_bss()
106 struct hostapd_bss_config *bss; in hostapd_config_defaults() local
129 bss = os_zalloc(sizeof(*bss)); in hostapd_config_defaults()
130 if (conf == NULL || bss == NULL) { in hostapd_config_defaults()
134 os_free(bss); in hostapd_config_defaults()
137 conf->bss = os_calloc(1, sizeof(struct hostapd_bss_config *)); in hostapd_config_defaults()
138 if (conf->bss == NULL) { in hostapd_config_defaults()
140 os_free(bss); in hostapd_config_defaults()
143 conf->bss[0] = bss; in hostapd_config_defaults()
145 bss->radius = os_zalloc(sizeof(*bss->radius)); in hostapd_config_defaults()
146 if (bss->radius == NULL) { in hostapd_config_defaults()
147 os_free(conf->bss); in hostapd_config_defaults()
149 os_free(bss); in hostapd_config_defaults()
153 hostapd_config_defaults_bss(bss); in hostapd_config_defaults()
600 hostapd_config_free_bss(conf->bss[i]); in hostapd_config_free()
601 os_free(conf->bss); in hostapd_config_free()
739 static int hostapd_config_check_bss(struct hostapd_bss_config *bss, in hostapd_config_check_bss() argument
743 if (full_config && bss->ieee802_1x && !bss->eap_server && in hostapd_config_check_bss()
744 !bss->radius->auth_servers) { in hostapd_config_check_bss()
750 if (bss->wpa) { in hostapd_config_check_bss()
753 wep = bss->default_wep_key_len > 0 || in hostapd_config_check_bss()
754 bss->individual_wep_key_len > 0; in hostapd_config_check_bss()
756 if (bss->ssid.wep.keys_set) { in hostapd_config_check_bss()
768 if (full_config && bss->wpa && in hostapd_config_check_bss()
769 bss->wpa_psk_radius != PSK_RADIUS_IGNORED && in hostapd_config_check_bss()
770 bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) { in hostapd_config_check_bss()
776 if (full_config && bss->wpa && (bss->wpa_key_mgmt & WPA_KEY_MGMT_PSK) && in hostapd_config_check_bss()
777 bss->ssid.wpa_psk == NULL && bss->ssid.wpa_passphrase == NULL && in hostapd_config_check_bss()
778 bss->ssid.wpa_psk_file == NULL && in hostapd_config_check_bss()
779 (bss->wpa_psk_radius != PSK_RADIUS_REQUIRED || in hostapd_config_check_bss()
780 bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH)) { in hostapd_config_check_bss()
786 if (full_config && !is_zero_ether_addr(bss->bssid)) { in hostapd_config_check_bss()
790 if (conf->bss[i] != bss && in hostapd_config_check_bss()
791 (hostapd_mac_comp(conf->bss[i]->bssid, in hostapd_config_check_bss()
792 bss->bssid) == 0)) { in hostapd_config_check_bss()
795 MAC2STR(bss->bssid), in hostapd_config_check_bss()
796 conf->bss[i]->iface, bss->iface); in hostapd_config_check_bss()
803 if (full_config && wpa_key_mgmt_ft(bss->wpa_key_mgmt) && in hostapd_config_check_bss()
804 (bss->nas_identifier == NULL || in hostapd_config_check_bss()
805 os_strlen(bss->nas_identifier) < 1 || in hostapd_config_check_bss()
806 os_strlen(bss->nas_identifier) > FT_R0KH_ID_MAX_LEN)) { in hostapd_config_check_bss()
817 bss->disable_11n = 1; in hostapd_config_check_bss()
823 bss->ssid.security_policy == SECURITY_STATIC_WEP) { in hostapd_config_check_bss()
824 bss->disable_11n = 1; in hostapd_config_check_bss()
829 if (full_config && conf->ieee80211n && bss->wpa && in hostapd_config_check_bss()
830 !(bss->wpa_pairwise & WPA_CIPHER_CCMP) && in hostapd_config_check_bss()
831 !(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP | in hostapd_config_check_bss()
834 bss->disable_11n = 1; in hostapd_config_check_bss()
842 if (full_config && bss->wps_state && bss->ignore_broadcast_ssid) { in hostapd_config_check_bss()
845 bss->wps_state = 0; in hostapd_config_check_bss()
848 if (full_config && bss->wps_state && in hostapd_config_check_bss()
849 bss->ssid.wep.keys_set && bss->wpa == 0) { in hostapd_config_check_bss()
852 bss->wps_state = 0; in hostapd_config_check_bss()
855 if (full_config && bss->wps_state && bss->wpa && in hostapd_config_check_bss()
856 (!(bss->wpa & 2) || in hostapd_config_check_bss()
857 !(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP)))) { in hostapd_config_check_bss()
860 bss->wps_state = 0; in hostapd_config_check_bss()
865 if (full_config && bss->hs20 && in hostapd_config_check_bss()
866 (!(bss->wpa & 2) || in hostapd_config_check_bss()
867 !(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP | in hostapd_config_check_bss()
878 if (full_config && bss->mbo_enabled && (bss->wpa & 2) && in hostapd_config_check_bss()
879 bss->ieee80211w == NO_MGMT_FRAME_PROTECTION) { in hostapd_config_check_bss()
948 if (hostapd_config_check_bss(conf->bss[i], conf, full_config)) in hostapd_config_check()
956 void hostapd_set_security_params(struct hostapd_bss_config *bss, in hostapd_set_security_params() argument
959 if (bss->individual_wep_key_len == 0) { in hostapd_set_security_params()
962 bss->broadcast_key_idx_min = 0; in hostapd_set_security_params()
965 if ((bss->wpa & 2) && bss->rsn_pairwise == 0) in hostapd_set_security_params()
966 bss->rsn_pairwise = bss->wpa_pairwise; in hostapd_set_security_params()
967 bss->wpa_group = wpa_select_ap_group_cipher(bss->wpa, bss->wpa_pairwise, in hostapd_set_security_params()
968 bss->rsn_pairwise); in hostapd_set_security_params()
971 bss->radius->auth_server = bss->radius->auth_servers; in hostapd_set_security_params()
972 bss->radius->acct_server = bss->radius->acct_servers; in hostapd_set_security_params()
975 if (bss->wpa && bss->ieee802_1x) { in hostapd_set_security_params()
976 bss->ssid.security_policy = SECURITY_WPA; in hostapd_set_security_params()
977 } else if (bss->wpa) { in hostapd_set_security_params()
978 bss->ssid.security_policy = SECURITY_WPA_PSK; in hostapd_set_security_params()
979 } else if (bss->ieee802_1x) { in hostapd_set_security_params()
981 bss->ssid.security_policy = SECURITY_IEEE_802_1X; in hostapd_set_security_params()
982 bss->ssid.wep.default_len = bss->default_wep_key_len; in hostapd_set_security_params()
983 if (full_config && bss->default_wep_key_len) { in hostapd_set_security_params()
984 cipher = bss->default_wep_key_len >= 13 ? in hostapd_set_security_params()
986 } else if (full_config && bss->ssid.wep.keys_set) { in hostapd_set_security_params()
987 if (bss->ssid.wep.len[0] >= 13) in hostapd_set_security_params()
992 bss->wpa_group = cipher; in hostapd_set_security_params()
993 bss->wpa_pairwise = cipher; in hostapd_set_security_params()
994 bss->rsn_pairwise = cipher; in hostapd_set_security_params()
996 bss->wpa_key_mgmt = WPA_KEY_MGMT_IEEE8021X_NO_WPA; in hostapd_set_security_params()
997 } else if (bss->ssid.wep.keys_set) { in hostapd_set_security_params()
999 if (bss->ssid.wep.len[0] >= 13) in hostapd_set_security_params()
1001 bss->ssid.security_policy = SECURITY_STATIC_WEP; in hostapd_set_security_params()
1002 bss->wpa_group = cipher; in hostapd_set_security_params()
1003 bss->wpa_pairwise = cipher; in hostapd_set_security_params()
1004 bss->rsn_pairwise = cipher; in hostapd_set_security_params()
1006 bss->wpa_key_mgmt = WPA_KEY_MGMT_NONE; in hostapd_set_security_params()
1007 } else if (bss->osen) { in hostapd_set_security_params()
1008 bss->ssid.security_policy = SECURITY_OSEN; in hostapd_set_security_params()
1009 bss->wpa_group = WPA_CIPHER_CCMP; in hostapd_set_security_params()
1010 bss->wpa_pairwise = 0; in hostapd_set_security_params()
1011 bss->rsn_pairwise = WPA_CIPHER_CCMP; in hostapd_set_security_params()
1013 bss->ssid.security_policy = SECURITY_PLAINTEXT; in hostapd_set_security_params()
1015 bss->wpa_group = WPA_CIPHER_NONE; in hostapd_set_security_params()
1016 bss->wpa_pairwise = WPA_CIPHER_NONE; in hostapd_set_security_params()
1017 bss->rsn_pairwise = WPA_CIPHER_NONE; in hostapd_set_security_params()
1018 bss->wpa_key_mgmt = WPA_KEY_MGMT_NONE; in hostapd_set_security_params()