]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_cli: Add ACL and BTM control commands
authorChaoli Zhou <quic_zchaoli@quicinc.com>
Thu, 24 Feb 2022 08:27:58 +0000 (16:27 +0800)
committerJouni Malinen <j@w1.fi>
Thu, 24 Mar 2022 18:53:50 +0000 (20:53 +0200)
Add AP mode commands for ACL and BTM into wpa_cli similarly to the way
these were already available in hostapd_cli.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
wpa_supplicant/wpa_cli.c

index 033589f760d2eb750e19661a4d01083319721c7a..753d11032fb562d5cb8ff62f0731c73dc178088f 100644 (file)
@@ -2046,6 +2046,20 @@ static int wpa_cli_cmd_update_beacon(struct wpa_ctrl *ctrl, int argc,
        return wpa_ctrl_command(ctrl, "UPDATE_BEACON");
 }
 
+
+static int wpa_cli_cmd_accept_macacl(struct wpa_ctrl *ctrl, int argc,
+                                    char *argv[])
+{
+       return wpa_cli_cmd(ctrl, "ACCEPT_ACL", 1, argc, argv);
+}
+
+
+static int wpa_cli_cmd_deny_macacl(struct wpa_ctrl *ctrl, int argc,
+                                  char *argv[])
+{
+       return wpa_cli_cmd(ctrl, "DENY_ACL", 1, argc, argv);
+}
+
 #endif /* CONFIG_AP */
 
 
@@ -2894,6 +2908,31 @@ static int wpa_cli_cmd_wnm_bss_query(struct wpa_ctrl *ctrl, int argc, char *argv
 #endif /* CONFIG_WNM */
 
 
+#ifdef CONFIG_WNM_AP
+
+static int wpa_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
+                                        char *argv[])
+{
+       return wpa_cli_cmd(ctrl, "DISASSOC_IMMINENT", 2, argc, argv);
+}
+
+
+static int wpa_cli_cmd_ess_disassoc(struct wpa_ctrl *ctrl, int argc,
+                                   char *argv[])
+{
+       return wpa_cli_cmd(ctrl, "ESS_DISASSOC", 3, argc, argv);
+}
+
+
+static int wpa_cli_cmd_bss_tm_req(struct wpa_ctrl *ctrl, int argc,
+                                 char *argv[])
+{
+       return wpa_cli_cmd(ctrl, "BSS_TM_REQ", 1, argc, argv);
+}
+
+#endif /* CONFIG_WNM_AP */
+
+
 static int wpa_cli_cmd_raw(struct wpa_ctrl *ctrl, int argc, char *argv[])
 {
        if (argc == 0)
@@ -3599,6 +3638,10 @@ static const struct wpa_cli_cmd wpa_cli_commands[] = {
        { "update_beacon", wpa_cli_cmd_update_beacon, NULL,
          cli_cmd_flag_none,
          "= update Beacon frame contents"},
+       { "accept_acl", wpa_cli_cmd_accept_macacl, NULL, cli_cmd_flag_none,
+         "=Add/Delete/Show/Clear allow MAC ACL" },
+       { "deny_acl", wpa_cli_cmd_deny_macacl, NULL, cli_cmd_flag_none,
+         "=Add/Delete/Show/Clear deny MAC ACL" },
 #endif /* CONFIG_AP */
        { "suspend", wpa_cli_cmd_suspend, NULL, cli_cmd_flag_none,
          "= notification of suspend/hibernate" },
@@ -3845,6 +3888,14 @@ static const struct wpa_cli_cmd wpa_cli_commands[] = {
          " [neighbor=<BSSID>,<BSSID information>,<operating class>,<channel number>,<PHY type>[,<hexdump of optional subelements>]"
          " = Send BSS Transition Management Query" },
 #endif /* CONFIG_WNM */
+#ifdef CONFIG_WNM_AP
+       { "disassoc_imminent", wpa_cli_cmd_disassoc_imminent, NULL, cli_cmd_flag_none,
+         "= send Disassociation Imminent notification" },
+       { "ess_disassoc", wpa_cli_cmd_ess_disassoc, NULL, cli_cmd_flag_none,
+         "= send ESS Dissassociation Imminent notification" },
+       { "bss_tm_req", wpa_cli_cmd_bss_tm_req, NULL, cli_cmd_flag_none,
+         "= send BSS Transition Management Request" },
+#endif /* CONFIG_WNM_AP */
        { "raw", wpa_cli_cmd_raw, NULL, cli_cmd_flag_sensitive,
          "<params..> = Sent unprocessed command" },
        { "flush", wpa_cli_cmd_flush, NULL, cli_cmd_flag_none,