aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hostapd_cli.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-05-26 14:44:44 (GMT)
committerJouni Malinen <j@w1.fi>2009-05-26 14:44:44 (GMT)
commit077a781f7ab4e87955f1a97fcd0b939c74a57165 (patch)
tree067e2f656417d894709389c1abd4f1df6b45f11b /hostapd/hostapd_cli.c
parentb63303b86432561988ebaa61e13bc9c74457d7cf (diff)
downloadhostap-077a781f7ab4e87955f1a97fcd0b939c74a57165.zip
hostap-077a781f7ab4e87955f1a97fcd0b939c74a57165.tar.gz
hostap-077a781f7ab4e87955f1a97fcd0b939c74a57165.tar.bz2
WPS: Add support for setting timeout for PIN
hostapd_cli wps_pin command can now have an optional timeout parameter that sets the PIN lifetime in seconds. This can be used to reduce the likelihood of someone else using the PIN should an active PIN be left in the Registrar.
Diffstat (limited to 'hostapd/hostapd_cli.c')
-rw-r--r--hostapd/hostapd_cli.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index 340e9c3..84e8641 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -87,7 +87,7 @@ static const char *commands_help =
" sa_query <addr> send SA Query to a station\n"
#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_WPS
-" wps_pin <uuid> <pin> add WPS Enrollee PIN (Device Password)\n"
+" wps_pin <uuid> <pin> [timeout] add WPS Enrollee PIN (Device Password)\n"
" wps_pbc indicate button pushed to initiate PBC\n"
#ifdef CONFIG_WPS_OOB
" wps_oob <type> <path> <method> use WPS with out-of-band (UFD)\n"
@@ -263,12 +263,16 @@ 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, "
+ if (argc < 2) {
+ printf("Invalid 'wps_pin' command - at least two arguments, "
"UUID and PIN, are required.\n");
return -1;
}
- snprintf(buf, sizeof(buf), "WPS_PIN %s %s", argv[0], argv[1]);
+ if (argc > 2)
+ snprintf(buf, sizeof(buf), "WPS_PIN %s %s %s",
+ argv[0], argv[1], argv[2]);
+ else
+ snprintf(buf, sizeof(buf), "WPS_PIN %s %s", argv[0], argv[1]);
return wpa_ctrl_command(ctrl, buf);
}