]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - wlantest/ctrl.c
wlantest: Add flush command for dropping all BSS data
[thirdparty/hostap.git] / wlantest / ctrl.c
index 3f880295b04d63c7269a107a404c6051287776d8..f2526eb2b1dbbe49a586e5e3e4e5cc58b14483c4 100644 (file)
@@ -149,6 +149,14 @@ static void ctrl_list_sta(struct wlantest *wt, int sock, u8 *cmd, size_t clen)
 }
 
 
+static void ctrl_flush(struct wlantest *wt, int sock)
+{
+       wpa_printf(MSG_DEBUG, "Drop all collected BSS data");
+       bss_flush(wt);
+       ctrl_send_simple(wt, sock, WLANTEST_CTRL_SUCCESS);
+}
+
+
 static void ctrl_read(int sock, void *eloop_ctx, void *sock_ctx)
 {
        struct wlantest *wt = eloop_ctx;
@@ -193,6 +201,9 @@ static void ctrl_read(int sock, void *eloop_ctx, void *sock_ctx)
        case WLANTEST_CTRL_LIST_STA:
                ctrl_list_sta(wt, sock, buf + 4, len - 4);
                break;
+       case WLANTEST_CTRL_FLUSH:
+               ctrl_flush(wt, sock);
+               break;
        default:
                ctrl_send_simple(wt, sock, WLANTEST_CTRL_UNKNOWN_CMD);
                break;