aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/ctrl.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-11-17 19:11:35 (GMT)
committerJouni Malinen <j@w1.fi>2013-11-17 19:39:22 (GMT)
commitc99a721e5b803bc6710aac0583121ef80df38d1a (patch)
tree44617b9d9f20c8af559db87f8adde7fc20448bd1 /wlantest/ctrl.c
parent0e91337d543ce6d1d26e1fc4590e758ef102bfd3 (diff)
downloadhostap-c99a721e5b803bc6710aac0583121ef80df38d1a.zip
hostap-c99a721e5b803bc6710aac0583121ef80df38d1a.tar.gz
hostap-c99a721e5b803bc6710aac0583121ef80df38d1a.tar.bz2
wlantest: Add RELOG command to reopen log/capture files
This can be used similarly to the wpa_supplicant RELOG command to rotate log and capture files. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wlantest/ctrl.c')
-rw-r--r--wlantest/ctrl.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/wlantest/ctrl.c b/wlantest/ctrl.c
index bed5d6c..86bd672 100644
--- a/wlantest/ctrl.c
+++ b/wlantest/ctrl.c
@@ -1,6 +1,6 @@
/*
* wlantest control interface
- * Copyright (c) 2010, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2010-2013, Jouni Malinen <j@w1.fi>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
@@ -1187,6 +1187,14 @@ static void ctrl_send_(struct wlantest *wt, int sock, u8 *cmd, size_t clen)
}
+static void ctrl_relog(struct wlantest *wt, int sock)
+{
+ int res = wlantest_relog(wt);
+ ctrl_send_simple(wt, sock, res ? WLANTEST_CTRL_FAILURE :
+ WLANTEST_CTRL_SUCCESS);
+}
+
+
static void ctrl_read(int sock, void *eloop_ctx, void *sock_ctx)
{
struct wlantest *wt = eloop_ctx;
@@ -1270,6 +1278,9 @@ static void ctrl_read(int sock, void *eloop_ctx, void *sock_ctx)
case WLANTEST_CTRL_SEND:
ctrl_send_(wt, sock, buf + 4, len - 4);
break;
+ case WLANTEST_CTRL_RELOG:
+ ctrl_relog(wt, sock);
+ break;
default:
ctrl_send_simple(wt, sock, WLANTEST_CTRL_UNKNOWN_CMD);
break;