#endif /* CONFIG_NATIVE_WINDOWS */
#include "hostapd.h"
-#include "driver.h"
+#include "drivers/driver.h"
#include "sha1.h"
#include "eap_server/eap.h"
#include "radius/radius_client.h"
#define MAX_STA_COUNT 2007
-extern struct wpa_driver_ops *hostapd_drivers[];
+extern struct wpa_driver_ops *wpa_drivers[];
#ifndef CONFIG_NO_VLAN
}
-static struct hostapd_config * hostapd_config_defaults(void)
+struct hostapd_config * hostapd_config_defaults(void)
{
struct hostapd_config *conf;
struct hostapd_bss_config *bss;
}
/* set default driver based on configuration */
- conf->driver = hostapd_drivers[0];
+ conf->driver = wpa_drivers[0];
if (conf->driver == NULL) {
wpa_printf(MSG_ERROR, "No driver wrappers registered!");
os_free(conf);
} else if (os_strcmp(buf, "bridge") == 0) {
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
} else if (os_strcmp(buf, "driver") == 0) {
- int i;
+ int j;
/* clear to get error below if setting is invalid */
conf->driver = NULL;
- for (i = 0; hostapd_drivers[i]; i++) {
- if (os_strcmp(pos, hostapd_drivers[i]->name) ==
- 0) {
- conf->driver = hostapd_drivers[i];
+ for (j = 0; wpa_drivers[j]; j++) {
+ if (os_strcmp(pos, wpa_drivers[j]->name) == 0)
+ {
+ conf->driver = wpa_drivers[j];
break;
}
}
bss->ssid.vlan_tagged_interface = os_strdup(pos);
#endif /* CONFIG_FULL_DYNAMIC_VLAN */
#endif /* CONFIG_NO_VLAN */
- } else if (os_strcmp(buf, "passive_scan_interval") == 0) {
- conf->passive_scan_interval = atoi(pos);
- } else if (os_strcmp(buf, "passive_scan_listen") == 0) {
- conf->passive_scan_listen = atoi(pos);
- } else if (os_strcmp(buf, "passive_scan_mode") == 0) {
- conf->passive_scan_mode = atoi(pos);
} else if (os_strcmp(buf, "ap_table_max_size") == 0) {
conf->ap_table_max_size = atoi(pos);
} else if (os_strcmp(buf, "ap_table_expiration_time") == 0) {
errors++;
}
} else if (os_strcmp(buf, "bssid") == 0) {
- if (bss == conf->bss &&
- (!conf->driver || !conf->driver->init_bssid)) {
- wpa_printf(MSG_ERROR, "Line %d: bssid item "
- "not allowed for the default "
- "interface and this driver", line);
- errors++;
- } else if (hwaddr_aton(pos, bss->bssid)) {
+ if (hwaddr_aton(pos, bss->bssid)) {
wpa_printf(MSG_ERROR, "Line %d: invalid bssid "
"item", line);
errors++;
fclose(f);
- if (bss->individual_wep_key_len == 0) {
- /* individual keys are not use; can use key idx0 for broadcast
- * keys */
- bss->broadcast_key_idx_min = 0;
- }
-
- /* Select group cipher based on the enabled pairwise cipher suites */
- pairwise = 0;
- if (bss->wpa & 1)
- pairwise |= bss->wpa_pairwise;
- if (bss->wpa & 2) {
- if (bss->rsn_pairwise == 0)
- bss->rsn_pairwise = bss->wpa_pairwise;
- pairwise |= bss->rsn_pairwise;
- }
- if (pairwise & WPA_CIPHER_TKIP)
- bss->wpa_group = WPA_CIPHER_TKIP;
- else
- bss->wpa_group = WPA_CIPHER_CCMP;
-
for (i = 0; i < conf->num_bss; i++) {
bss = &conf->bss[i];
+ if (bss->individual_wep_key_len == 0) {
+ /* individual keys are not use; can use key idx0 for
+ * broadcast keys */
+ bss->broadcast_key_idx_min = 0;
+ }
+
+ /* Select group cipher based on the enabled pairwise cipher
+ * suites */
+ pairwise = 0;
+ if (bss->wpa & 1)
+ pairwise |= bss->wpa_pairwise;
+ if (bss->wpa & 2) {
+ if (bss->rsn_pairwise == 0)
+ bss->rsn_pairwise = bss->wpa_pairwise;
+ pairwise |= bss->rsn_pairwise;
+ }
+ if (pairwise & WPA_CIPHER_TKIP)
+ bss->wpa_group = WPA_CIPHER_TKIP;
+ else
+ bss->wpa_group = WPA_CIPHER_CCMP;
+
bss->radius->auth_server = bss->radius->auth_servers;
bss->radius->acct_server = bss->radius->acct_servers;