|
@@ -1,6 +1,6 @@
|
|
/*
|
|
/*
|
|
* hostapd - command line interface for hostapd daemon
|
|
* hostapd - command line interface for hostapd daemon
|
|
- * Copyright (c) 2004-2011, Jouni Malinen <j@w1.fi>
|
|
|
|
|
|
+ * Copyright (c) 2004-2012, Jouni Malinen <j@w1.fi>
|
|
*
|
|
*
|
|
* This software may be distributed under the terms of the BSD license.
|
|
* This software may be distributed under the terms of the BSD license.
|
|
* See README for more details.
|
|
* See README for more details.
|
|
@@ -74,6 +74,9 @@ static const char *commands_help =
|
|
#ifdef CONFIG_WPS_OOB
|
|
#ifdef CONFIG_WPS_OOB
|
|
" wps_oob <type> <path> <method> use WPS with out-of-band (UFD)\n"
|
|
" wps_oob <type> <path> <method> use WPS with out-of-band (UFD)\n"
|
|
#endif /* CONFIG_WPS_OOB */
|
|
#endif /* CONFIG_WPS_OOB */
|
|
|
|
+#ifdef CONFIG_WPS_NFC
|
|
|
|
+" wps_nfc_tag_read <hexdump> report read NFC tag with WPS data\n"
|
|
|
|
+#endif /* CONFIG_WPS_NFC */
|
|
" wps_ap_pin <cmd> [params..] enable/disable AP PIN\n"
|
|
" wps_ap_pin <cmd> [params..] enable/disable AP PIN\n"
|
|
" wps_config <SSID> <auth> <encr> <key> configure AP\n"
|
|
" wps_config <SSID> <auth> <encr> <key> configure AP\n"
|
|
#endif /* CONFIG_WPS */
|
|
#endif /* CONFIG_WPS */
|
|
@@ -433,6 +436,34 @@ static int hostapd_cli_cmd_wps_oob(struct wpa_ctrl *ctrl, int argc,
|
|
#endif /* CONFIG_WPS_OOB */
|
|
#endif /* CONFIG_WPS_OOB */
|
|
|
|
|
|
|
|
|
|
|
|
+#ifdef CONFIG_WPS_NFC
|
|
|
|
+static int hostapd_cli_cmd_wps_nfc_tag_read(struct wpa_ctrl *ctrl, int argc,
|
|
|
|
+ char *argv[])
|
|
|
|
+{
|
|
|
|
+ int ret;
|
|
|
|
+ char *buf;
|
|
|
|
+ size_t buflen;
|
|
|
|
+
|
|
|
|
+ if (argc != 1) {
|
|
|
|
+ printf("Invalid 'wps_nfc_tag_read' command - one argument "
|
|
|
|
+ "is required.\n");
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ buflen = 18 + os_strlen(argv[0]);
|
|
|
|
+ buf = os_malloc(buflen);
|
|
|
|
+ if (buf == NULL)
|
|
|
|
+ return -1;
|
|
|
|
+ os_snprintf(buf, buflen, "WPS_NFC_TAG_READ %s", argv[0]);
|
|
|
|
+
|
|
|
|
+ ret = wpa_ctrl_command(ctrl, buf);
|
|
|
|
+ os_free(buf);
|
|
|
|
+
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+#endif /* CONFIG_WPS_NFC */
|
|
|
|
+
|
|
|
|
+
|
|
static int hostapd_cli_cmd_wps_ap_pin(struct wpa_ctrl *ctrl, int argc,
|
|
static int hostapd_cli_cmd_wps_ap_pin(struct wpa_ctrl *ctrl, int argc,
|
|
char *argv[])
|
|
char *argv[])
|
|
{
|
|
{
|
|
@@ -730,6 +761,9 @@ static struct hostapd_cli_cmd hostapd_cli_commands[] = {
|
|
#ifdef CONFIG_WPS_OOB
|
|
#ifdef CONFIG_WPS_OOB
|
|
{ "wps_oob", hostapd_cli_cmd_wps_oob },
|
|
{ "wps_oob", hostapd_cli_cmd_wps_oob },
|
|
#endif /* CONFIG_WPS_OOB */
|
|
#endif /* CONFIG_WPS_OOB */
|
|
|
|
+#ifdef CONFIG_WPS_NFC
|
|
|
|
+ { "wps_nfc_tag_read", hostapd_cli_cmd_wps_nfc_tag_read },
|
|
|
|
+#endif /* CONFIG_WPS_NFC */
|
|
{ "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin },
|
|
{ "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin },
|
|
{ "wps_config", hostapd_cli_cmd_wps_config },
|
|
{ "wps_config", hostapd_cli_cmd_wps_config },
|
|
#endif /* CONFIG_WPS */
|
|
#endif /* CONFIG_WPS */
|