2010-10-23 23:39:54 +00:00
|
|
|
--- a/hostapd/ctrl_iface.c
|
|
|
|
+++ b/hostapd/ctrl_iface.c
|
2018-03-27 17:24:27 +00:00
|
|
|
@@ -60,6 +60,7 @@
|
2016-01-28 17:19:13 +00:00
|
|
|
#include "fst/fst_ctrl_iface.h"
|
2012-03-27 10:42:47 +00:00
|
|
|
#include "config_file.h"
|
2010-10-23 23:39:54 +00:00
|
|
|
#include "ctrl_iface.h"
|
|
|
|
+#include "config_file.h"
|
|
|
|
|
|
|
|
|
2016-01-28 17:19:13 +00:00
|
|
|
#define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256
|
2018-03-27 17:24:27 +00:00
|
|
|
@@ -78,6 +79,7 @@ static void hostapd_ctrl_iface_send(stru
|
2016-06-15 15:11:43 +00:00
|
|
|
enum wpa_msg_type type,
|
|
|
|
const char *buf, size_t len);
|
2010-10-23 23:39:54 +00:00
|
|
|
|
|
|
|
+static char *reload_opts = NULL;
|
|
|
|
|
2016-06-15 15:11:43 +00:00
|
|
|
static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd,
|
|
|
|
struct sockaddr_storage *from,
|
2018-03-27 17:24:27 +00:00
|
|
|
@@ -129,6 +131,61 @@ static int hostapd_ctrl_iface_new_sta(st
|
2010-11-09 01:36:36 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2010-10-23 23:39:54 +00:00
|
|
|
|
|
|
|
+static char *get_option(char *opt, char *str)
|
|
|
|
+{
|
|
|
|
+ int len = strlen(str);
|
|
|
|
+
|
|
|
|
+ if (!strncmp(opt, str, len))
|
|
|
|
+ return opt + len;
|
|
|
|
+ else
|
|
|
|
+ return NULL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static struct hostapd_config *hostapd_ctrl_iface_config_read(const char *fname)
|
|
|
|
+{
|
|
|
|
+ struct hostapd_config *conf;
|
|
|
|
+ char *opt, *val;
|
|
|
|
+
|
|
|
|
+ conf = hostapd_config_read(fname);
|
|
|
|
+ if (!conf)
|
|
|
|
+ return NULL;
|
|
|
|
+
|
|
|
|
+ for (opt = strtok(reload_opts, " ");
|
|
|
|
+ opt;
|
|
|
|
+ opt = strtok(NULL, " ")) {
|
|
|
|
+
|
|
|
|
+ if ((val = get_option(opt, "channel=")))
|
|
|
|
+ conf->channel = atoi(val);
|
|
|
|
+ else if ((val = get_option(opt, "ht_capab=")))
|
|
|
|
+ conf->ht_capab = atoi(val);
|
|
|
|
+ else if ((val = get_option(opt, "ht_capab_mask=")))
|
|
|
|
+ conf->ht_capab &= atoi(val);
|
|
|
|
+ else if ((val = get_option(opt, "sec_chan=")))
|
|
|
|
+ conf->secondary_channel = atoi(val);
|
2012-08-29 16:06:24 +00:00
|
|
|
+ else if ((val = get_option(opt, "hw_mode=")))
|
2010-10-23 23:39:54 +00:00
|
|
|
+ conf->hw_mode = atoi(val);
|
|
|
|
+ else if ((val = get_option(opt, "ieee80211n=")))
|
|
|
|
+ conf->ieee80211n = atoi(val);
|
|
|
|
+ else
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return conf;
|
|
|
|
+}
|
|
|
|
+
|
2012-09-13 12:38:51 +00:00
|
|
|
+static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt)
|
2010-10-23 23:39:54 +00:00
|
|
|
+{
|
2012-09-13 12:38:51 +00:00
|
|
|
+ struct hostapd_config * (*config_read_cb)(const char *config_fname);
|
2010-10-23 23:39:54 +00:00
|
|
|
+ struct hostapd_iface *iface = hapd->iface;
|
|
|
|
+
|
2012-09-13 12:38:51 +00:00
|
|
|
+ config_read_cb = iface->interfaces->config_read_cb;
|
|
|
|
+ iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read;
|
2010-10-23 23:39:54 +00:00
|
|
|
+ reload_opts = txt;
|
|
|
|
+
|
|
|
|
+ hostapd_reload_config(iface);
|
|
|
|
+
|
2012-09-13 12:38:51 +00:00
|
|
|
+ iface->interfaces->config_read_cb = config_read_cb;
|
2010-10-23 23:39:54 +00:00
|
|
|
+}
|
|
|
|
|
2010-11-09 01:36:36 +00:00
|
|
|
#ifdef CONFIG_IEEE80211W
|
|
|
|
#ifdef NEED_AP_MLME
|
2018-04-28 19:12:19 +00:00
|
|
|
@@ -3031,6 +3088,8 @@ static int hostapd_ctrl_iface_receive_pr
|
2014-04-06 12:13:55 +00:00
|
|
|
} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
|
|
|
|
reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
|
|
|
|
reply_size);
|
2012-09-13 12:38:51 +00:00
|
|
|
+ } else if (os_strncmp(buf, "UPDATE ", 7) == 0) {
|
|
|
|
+ hostapd_ctrl_iface_update(hapd, buf + 7);
|
2015-03-26 23:33:47 +00:00
|
|
|
} else if (os_strcmp(buf, "ERP_FLUSH") == 0) {
|
|
|
|
ieee802_1x_erp_flush(hapd);
|
|
|
|
#ifdef RADIUS_SERVER
|
|
|
|
--- a/src/ap/ctrl_iface_ap.c
|
|
|
|
+++ b/src/ap/ctrl_iface_ap.c
|
2018-04-28 19:12:19 +00:00
|
|
|
@@ -864,7 +864,13 @@ int hostapd_parse_csa_settings(const cha
|
2014-04-06 12:13:55 +00:00
|
|
|
|
2015-03-26 23:33:47 +00:00
|
|
|
int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
|
|
|
|
{
|
|
|
|
- return hostapd_drv_stop_ap(hapd);
|
|
|
|
+ struct hostapd_iface *iface = hapd->iface;
|
|
|
|
+ int i;
|
|
|
|
+
|
|
|
|
+ for (i = 0; i < iface->num_bss; i++)
|
|
|
|
+ hostapd_drv_stop_ap(iface->bss[i]);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
}
|
2016-06-15 15:11:43 +00:00
|
|
|
|
|
|
|
|