Renamed Ping procedure into SA Query procedure per 802.11w/D7.0
[wpasupplicant] / hostapd / hostapd_cli.c
index a3cef1b..e5285ae 100644 (file)
@@ -83,6 +83,10 @@ static const char *commands_help =
 "   sta <addr>           get MIB variables for one station\n"
 "   all_sta              get MIB variables for all stations\n"
 "   new_sta <addr>       add a new station\n"
+#ifdef CONFIG_WPS
+"   wps_pin <uuid> <pin> add WPS Enrollee PIN (Device Password)\n"
+"   wps_pbc              indicate button pushed to initiate PBC\n"
+#endif /* CONFIG_WPS */
 "   help                 show this usage help\n"
 "   interface [ifname]   show interfaces/select interface\n"
 "   level <debug level>  change debug level\n"
@@ -230,6 +234,29 @@ static int hostapd_cli_cmd_new_sta(struct wpa_ctrl *ctrl, int argc,
 }
 
 
+#ifdef CONFIG_WPS
+static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
+                                  char *argv[])
+{
+       char buf[64];
+       if (argc != 2) {
+               printf("Invalid 'wps_pin' command - exactly two arguments, "
+                      "UUID and PIN, are required.\n");
+               return -1;
+       }
+       snprintf(buf, sizeof(buf), "WPS_PIN %s %s", argv[0], argv[1]);
+       return wpa_ctrl_command(ctrl, buf);
+}
+
+
+static int hostapd_cli_cmd_wps_pbc(struct wpa_ctrl *ctrl, int argc,
+                                  char *argv[])
+{
+       return wpa_ctrl_command(ctrl, "WPS_PBC");
+}
+#endif /* CONFIG_WPS */
+
+
 static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, char *cmd,
                                char *addr, size_t addr_len)
 {
@@ -378,6 +405,10 @@ static struct hostapd_cli_cmd hostapd_cli_commands[] = {
        { "sta", hostapd_cli_cmd_sta },
        { "all_sta", hostapd_cli_cmd_all_sta },
        { "new_sta", hostapd_cli_cmd_new_sta },
+#ifdef CONFIG_WPS
+       { "wps_pin", hostapd_cli_cmd_wps_pin },
+       { "wps_pbc", hostapd_cli_cmd_wps_pbc },
+#endif /* CONFIG_WPS */
        { "help", hostapd_cli_cmd_help },
        { "interface", hostapd_cli_cmd_interface },
        { "level", hostapd_cli_cmd_level },