aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/main.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-08-25 09:43:27 (GMT)
committerJouni Malinen <j@w1.fi>2012-08-25 10:47:05 (GMT)
commit3776ac73b28f988db4bbb6c7e61e9ad8b28cd15e (patch)
tree4db1fbb7500e54556a60854378654a241e7f0f3e /hostapd/main.c
parent27b80b5b4cfa0f675722545f9e796c508af1eafb (diff)
downloadhostap-3776ac73b28f988db4bbb6c7e61e9ad8b28cd15e.zip
hostap-3776ac73b28f988db4bbb6c7e61e9ad8b28cd15e.tar.gz
hostap-3776ac73b28f988db4bbb6c7e61e9ad8b28cd15e.tar.bz2
Move hostapd global callback functions into hapd_interfaces
These function pointers are going to be the same for each interface so there is no need to keep them in struct hostapd_iface. Moving them to struct hapd_interfaces makes it easier to add interfaces at run time. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'hostapd/main.c')
-rw-r--r--hostapd/main.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/hostapd/main.c b/hostapd/main.c
index 35b4da9..d1790a4 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -166,14 +166,9 @@ static struct hostapd_iface * hostapd_init(const char *config_file)
if (hapd_iface == NULL)
goto fail;
- hapd_iface->reload_config = hostapd_reload_config;
- hapd_iface->config_read_cb = hostapd_config_read;
hapd_iface->config_fname = os_strdup(config_file);
if (hapd_iface->config_fname == NULL)
goto fail;
- hapd_iface->ctrl_iface_init = hostapd_ctrl_iface_init;
- hapd_iface->ctrl_iface_deinit = hostapd_ctrl_iface_deinit;
- hapd_iface->for_each_interface = hostapd_for_each_interface;
conf = hostapd_config_read(hapd_iface->config_fname);
if (conf == NULL)
@@ -540,6 +535,13 @@ int main(int argc, char *argv[])
if (os_program_init())
return -1;
+ os_memset(&interfaces, 0, sizeof(interfaces));
+ interfaces.reload_config = hostapd_reload_config;
+ interfaces.config_read_cb = hostapd_config_read;
+ interfaces.for_each_interface = hostapd_for_each_interface;
+ interfaces.ctrl_iface_init = hostapd_ctrl_iface_init;
+ interfaces.ctrl_iface_deinit = hostapd_ctrl_iface_deinit;
+
for (;;) {
c = getopt(argc, argv, "Bde:f:hKP:tv");
if (c < 0)