aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hostapd_cli.c
diff options
context:
space:
mode:
authorSrinivas Dasari <dasaris@qti.qualcomm.com>2015-08-02 09:34:21 (GMT)
committerJouni Malinen <j@w1.fi>2015-08-03 14:50:09 (GMT)
commit5c4f0511a20c316f2ac24396377b09a50a34fe04 (patch)
tree1f27e79b15f3c87aac70395cb8983d05c4e382c2 /hostapd/hostapd_cli.c
parentab62f96f55ebdda69a8fd173980c181adce0a1bf (diff)
downloadhostap-5c4f0511a20c316f2ac24396377b09a50a34fe04.zip
hostap-5c4f0511a20c316f2ac24396377b09a50a34fe04.tar.gz
hostap-5c4f0511a20c316f2ac24396377b09a50a34fe04.tar.bz2
hostapd: Add support to configure debug log level at runtime
Add support to read/configure log_level using hostapd control interface LOG_LEVEL command similarly to what was already supported in wpa_supplicant. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'hostapd/hostapd_cli.c')
-rw-r--r--hostapd/hostapd_cli.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index 320d56a..9ca50be 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -1039,6 +1039,25 @@ static int hostapd_cli_cmd_erp_flush(struct wpa_ctrl *ctrl, int argc,
}
+static int hostapd_cli_cmd_log_level(struct wpa_ctrl *ctrl, int argc,
+ char *argv[])
+{
+ char cmd[256];
+ int res;
+
+ res = os_snprintf(cmd, sizeof(cmd), "LOG_LEVEL%s%s%s%s",
+ argc >= 1 ? " " : "",
+ argc >= 1 ? argv[0] : "",
+ argc == 2 ? " " : "",
+ argc == 2 ? argv[1] : "");
+ if (os_snprintf_error(sizeof(cmd), res)) {
+ printf("Too long option\n");
+ return -1;
+ }
+ return wpa_ctrl_command(ctrl, cmd);
+}
+
+
struct hostapd_cli_cmd {
const char *cmd;
int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
@@ -1096,6 +1115,7 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
{ "reload", hostapd_cli_cmd_reload },
{ "disable", hostapd_cli_cmd_disable },
{ "erp_flush", hostapd_cli_cmd_erp_flush },
+ { "log_level", hostapd_cli_cmd_log_level },
{ NULL, NULL }
};