aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorKyeyoon Park <kyeyoonp@qca.qualcomm.com>2013-10-29 14:29:49 (GMT)
committerJouni Malinen <j@w1.fi>2013-10-31 20:00:31 (GMT)
commita1fb5692af634ea5b1d60bce5f8825c00182ac20 (patch)
tree5ff26e8f62ab4c53db467aaca6f13cbfdf388b12 /hostapd
parent66936c6af813fc52676e639dd9cb12121f79366a (diff)
downloadhostap-a1fb5692af634ea5b1d60bce5f8825c00182ac20.zip
hostap-a1fb5692af634ea5b1d60bce5f8825c00182ac20.tar.gz
hostap-a1fb5692af634ea5b1d60bce5f8825c00182ac20.tar.bz2
hostapd: Make hostapd_interface_init_bss() available externally
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/main.c97
1 files changed, 0 insertions, 97 deletions
diff --git a/hostapd/main.c b/hostapd/main.c
index 29afec9..d6f9258 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -273,103 +273,6 @@ hostapd_interface_init(struct hapd_interfaces *interfaces,
}
-static struct hostapd_iface *
-hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy,
- const char *config_fname, int debug)
-{
- struct hostapd_iface *new_iface = NULL, *iface = NULL;
- struct hostapd_data *hapd;
- int k;
- size_t i, bss_idx;
-
- if (!phy || !*phy)
- return NULL;
-
- for (i = 0; i < interfaces->count; i++) {
- if (os_strcmp(interfaces->iface[i]->phy, phy) == 0) {
- iface = interfaces->iface[i];
- break;
- }
- }
-
- wpa_printf(MSG_ERROR, "Configuration file: %s (phy %s)%s",
- config_fname, phy, iface ? "" : " --> new PHY");
- if (iface) {
- struct hostapd_config *conf;
- struct hostapd_bss_config **tmp_conf;
- struct hostapd_data **tmp_bss;
- struct hostapd_bss_config *bss;
-
- /* Add new BSS to existing iface */
- conf = hostapd_config_read(config_fname);
- if (conf == NULL)
- return NULL;
- if (conf->num_bss > 1) {
- wpa_printf(MSG_ERROR, "Multiple BSSes specified in BSS-config");
- hostapd_config_free(conf);
- return NULL;
- }
-
- tmp_conf = os_realloc_array(
- iface->conf->bss, iface->conf->num_bss + 1,
- sizeof(struct hostapd_bss_config *));
- tmp_bss = os_realloc_array(iface->bss, iface->num_bss + 1,
- sizeof(struct hostapd_data *));
- if (tmp_bss)
- iface->bss = tmp_bss;
- if (tmp_conf) {
- iface->conf->bss = tmp_conf;
- iface->conf->last_bss = tmp_conf[0];
- }
- if (tmp_bss == NULL || tmp_conf == NULL) {
- hostapd_config_free(conf);
- return NULL;
- }
- bss = iface->conf->bss[iface->conf->num_bss] = conf->bss[0];
- iface->conf->num_bss++;
-
- hapd = hostapd_alloc_bss_data(iface, iface->conf, bss);
- if (hapd == NULL) {
- iface->conf->num_bss--;
- hostapd_config_free(conf);
- return NULL;
- }
- iface->conf->last_bss = bss;
- iface->bss[iface->num_bss] = hapd;
- hapd->msg_ctx = hapd;
-
- bss_idx = iface->num_bss++;
- conf->num_bss--;
- conf->bss[0] = NULL;
- hostapd_config_free(conf);
- } else {
- /* Add a new iface with the first BSS */
- new_iface = iface = hostapd_init(interfaces, config_fname);
- if (!iface)
- return NULL;
- os_strlcpy(iface->phy, phy, sizeof(iface->phy));
- iface->interfaces = interfaces;
- bss_idx = 0;
- }
-
- for (k = 0; k < debug; k++) {
- if (iface->bss[bss_idx]->conf->logger_stdout_level > 0)
- iface->bss[bss_idx]->conf->logger_stdout_level--;
- }
-
- if (iface->conf->bss[bss_idx]->iface[0] == '\0' &&
- !hostapd_drv_none(iface->bss[bss_idx])) {
- wpa_printf(MSG_ERROR, "Interface name not specified in %s",
- config_fname);
- if (new_iface)
- hostapd_interface_deinit_free(new_iface);
- return NULL;
- }
-
- return iface;
-}
-
-
static int hostapd_interface_init2(struct hostapd_iface *iface)
{
if (iface->init_done)