Lines Matching refs:bss
23 static void hostapd_config_free_vlan(struct hostapd_bss_config *bss)
27 vlan = bss->vlan;
35 bss->vlan = NULL;
39 void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
41 bss->logger_syslog_level = HOSTAPD_LEVEL_INFO;
42 bss->logger_stdout_level = HOSTAPD_LEVEL_INFO;
43 bss->logger_syslog = (unsigned int) -1;
44 bss->logger_stdout = (unsigned int) -1;
46 bss->auth_algs = WPA_AUTH_ALG_OPEN | WPA_AUTH_ALG_SHARED;
48 bss->wep_rekeying_period = 300;
50 bss->broadcast_key_idx_min = 1;
51 bss->broadcast_key_idx_max = 2;
52 bss->eap_reauth_period = 3600;
54 bss->wpa_group_rekey = 600;
55 bss->wpa_gmk_rekey = 86400;
56 bss->wpa_key_mgmt = WPA_KEY_MGMT_PSK;
57 bss->wpa_pairwise = WPA_CIPHER_TKIP;
58 bss->wpa_group = WPA_CIPHER_TKIP;
59 bss->rsn_pairwise = 0;
61 bss->max_num_sta = MAX_STA_COUNT;
63 bss->dtim_period = 2;
65 bss->radius_server_auth_port = 1812;
66 bss->ap_max_inactivity = AP_MAX_INACTIVITY;
67 bss->eapol_version = EAPOL_VERSION;
69 bss->max_listen_interval = 65535;
71 bss->pwd_group = 19; /* ECC: GF(p=256) */
74 bss->assoc_sa_query_max_timeout = 1000;
75 bss->assoc_sa_query_retry_timeout = 201;
76 bss->group_mgmt_cipher = WPA_CIPHER_AES_128_CMAC;
80 bss->eap_fast_prov = 3;
81 bss->pac_key_lifetime = 7 * 24 * 60 * 60;
82 bss->pac_key_refresh_time = 1 * 24 * 60 * 60;
86 bss->wmm_enabled = -1;
89 bss->ft_over_ds = 1;
92 bss->radius_das_time_window = 300;
94 bss->sae_anti_clogging_threshold = 5;
103 struct hostapd_bss_config *bss;
126 bss = os_zalloc(sizeof(*bss));
127 if (conf == NULL || bss == NULL) {
131 os_free(bss);
134 conf->bss = os_calloc(1, sizeof(struct hostapd_bss_config *));
135 if (conf->bss == NULL) {
137 os_free(bss);
140 conf->bss[0] = bss;
142 bss->radius = os_zalloc(sizeof(*bss->radius));
143 if (bss->radius == NULL) {
144 os_free(conf->bss);
146 os_free(bss);
150 hostapd_config_defaults_bss(bss);
564 hostapd_config_free_bss(conf->bss[i]);
565 os_free(conf->bss);
684 static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
688 if (full_config && bss->ieee802_1x && !bss->eap_server &&
689 !bss->radius->auth_servers) {
695 if (bss->wpa) {
698 wep = bss->default_wep_key_len > 0 ||
699 bss->individual_wep_key_len > 0;
701 if (bss->ssid.wep.keys_set) {
713 if (full_config && bss->wpa &&
714 bss->wpa_psk_radius != PSK_RADIUS_IGNORED &&
715 bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) {
721 if (full_config && bss->wpa && (bss->wpa_key_mgmt & WPA_KEY_MGMT_PSK) &&
722 bss->ssid.wpa_psk == NULL && bss->ssid.wpa_passphrase == NULL &&
723 bss->ssid.wpa_psk_file == NULL &&
724 (bss->wpa_psk_radius != PSK_RADIUS_REQUIRED ||
725 bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH)) {
731 if (full_config && hostapd_mac_comp_empty(bss->bssid) != 0) {
735 if (conf->bss[i] != bss &&
736 (hostapd_mac_comp(conf->bss[i]->bssid,
737 bss->bssid) == 0)) {
740 MAC2STR(bss->bssid),
741 conf->bss[i]->iface, bss->iface);
748 if (full_config && wpa_key_mgmt_ft(bss->wpa_key_mgmt) &&
749 (bss->nas_identifier == NULL ||
750 os_strlen(bss->nas_identifier) < 1 ||
751 os_strlen(bss->nas_identifier) > FT_R0KH_ID_MAX_LEN)) {
762 bss->disable_11n = 1;
768 bss->ssid.security_policy == SECURITY_STATIC_WEP) {
769 bss->disable_11n = 1;
774 if (full_config && conf->ieee80211n && bss->wpa &&
775 !(bss->wpa_pairwise & WPA_CIPHER_CCMP) &&
776 !(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP |
779 bss->disable_11n = 1;
787 if (full_config && bss->wps_state && bss->ignore_broadcast_ssid) {
790 bss->wps_state = 0;
793 if (full_config && bss->wps_state &&
794 bss->ssid.wep.keys_set && bss->wpa == 0) {
797 bss->wps_state = 0;
800 if (full_config && bss->wps_state && bss->wpa &&
801 (!(bss->wpa & 2) ||
802 !(bss->rsn_pairwise & WPA_CIPHER_CCMP))) {
805 bss->wps_state = 0;
810 if (full_config && bss->hs20 &&
811 (!(bss->wpa & 2) ||
812 !(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP |
856 if (hostapd_config_check_bss(conf->bss[i], conf, full_config))
864 void hostapd_set_security_params(struct hostapd_bss_config *bss,
867 if (bss->individual_wep_key_len == 0) {
870 bss->broadcast_key_idx_min = 0;
873 if ((bss->wpa & 2) && bss->rsn_pairwise == 0)
874 bss->rsn_pairwise = bss->wpa_pairwise;
875 bss->wpa_group = wpa_select_ap_group_cipher(bss->wpa, bss->wpa_pairwise,
876 bss->rsn_pairwise);
879 bss->radius->auth_server = bss->radius->auth_servers;
880 bss->radius->acct_server = bss->radius->acct_servers;
883 if (bss->wpa && bss->ieee802_1x) {
884 bss->ssid.security_policy = SECURITY_WPA;
885 } else if (bss->wpa) {
886 bss->ssid.security_policy = SECURITY_WPA_PSK;
887 } else if (bss->ieee802_1x) {
889 bss->ssid.security_policy = SECURITY_IEEE_802_1X;
890 bss->ssid.wep.default_len = bss->default_wep_key_len;
891 if (bss->default_wep_key_len)
892 cipher = bss->default_wep_key_len >= 13 ?
894 bss->wpa_group = cipher;
895 bss->wpa_pairwise = cipher;
896 bss->rsn_pairwise = cipher;
897 } else if (bss->ssid.wep.keys_set) {
899 if (bss->ssid.wep.len[0] >= 13)
901 bss->ssid.security_policy = SECURITY_STATIC_WEP;
902 bss->wpa_group = cipher;
903 bss->wpa_pairwise = cipher;
904 bss->rsn_pairwise = cipher;
905 } else if (bss->osen) {
906 bss->ssid.security_policy = SECURITY_OSEN;
907 bss->wpa_group = WPA_CIPHER_CCMP;
908 bss->wpa_pairwise = 0;
909 bss->rsn_pairwise = WPA_CIPHER_CCMP;
911 bss->ssid.security_policy = SECURITY_PLAINTEXT;
912 bss->wpa_group = WPA_CIPHER_NONE;
913 bss->wpa_pairwise = WPA_CIPHER_NONE;
914 bss->rsn_pairwise = WPA_CIPHER_NONE;