WPS ER: Add preliminary PBC support
[libeap.git] / wpa_supplicant / wpa_cli.c
index 84dc8c0..11a1e46 100644 (file)
@@ -572,6 +572,28 @@ static int wpa_cli_cmd_wps_er_pin(struct wpa_ctrl *ctrl, int argc,
 }
 
 
+static int wpa_cli_cmd_wps_er_pbc(struct wpa_ctrl *ctrl, int argc,
+                                 char *argv[])
+{
+       char cmd[256];
+       int res;
+
+       if (argc != 1) {
+               printf("Invalid WPS_ER_PBC command: need one argument:\n"
+                      "- UUID: Specify the Enrollee\n");
+               return -1;
+       }
+
+       res = os_snprintf(cmd, sizeof(cmd), "WPS_ER_PBC %s",
+                         argv[0]);
+       if (res < 0 || (size_t) res >= sizeof(cmd) - 1) {
+               printf("Too long WPS_ER_PBC command.\n");
+               return -1;
+       }
+       return wpa_ctrl_command(ctrl, cmd);
+}
+
+
 static int wpa_cli_cmd_ibss_rsn(struct wpa_ctrl *ctrl, int argc, char *argv[])
 {
        char cmd[256];
@@ -1445,6 +1467,9 @@ static struct wpa_cli_cmd wpa_cli_commands[] = {
        { "wps_er_pin", wpa_cli_cmd_wps_er_pin,
          cli_cmd_flag_sensitive,
          "<UUID> <PIN> = add an Enrollee PIN to External Registrar" },
+       { "wps_er_pbc", wpa_cli_cmd_wps_er_pbc,
+         cli_cmd_flag_none,
+         "<UUID> = accept an Enrollee PBC using External Registrar" },
        { "ibss_rsn", wpa_cli_cmd_ibss_rsn,
          cli_cmd_flag_none,
          "<addr> = request RSN authentication with <addr> in IBSS" },