aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/wlantest_cli.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-11-19 15:45:19 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-19 15:45:19 (GMT)
commita16c859034e41ed17a7f2ed4e61a84b7ea99bf42 (patch)
treece56d5961028c6329b759d47ed894c2994372dfb /wlantest/wlantest_cli.c
parent990153b4dd482e016914cd8d1f54045f7e9d5530 (diff)
downloadhostap-a16c859034e41ed17a7f2ed4e61a84b7ea99bf42.zip
hostap-a16c859034e41ed17a7f2ed4e61a84b7ea99bf42.tar.gz
hostap-a16c859034e41ed17a7f2ed4e61a84b7ea99bf42.tar.bz2
wlantest: Add command for fetching wlantest version
Diffstat (limited to 'wlantest/wlantest_cli.c')
-rw-r--r--wlantest/wlantest_cli.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/wlantest/wlantest_cli.c b/wlantest/wlantest_cli.c
index 21f50c5..3aa783b 100644
--- a/wlantest/wlantest_cli.c
+++ b/wlantest/wlantest_cli.c
@@ -530,6 +530,32 @@ static int cmd_inject(int s, int argc, char *argv[])
}
+static int cmd_version(int s, int argc, char *argv[])
+{
+ u8 resp[WLANTEST_CTRL_MAX_RESP_LEN];
+ u8 buf[4];
+ char *version;
+ size_t len;
+ int rlen, i;
+
+ WPA_PUT_BE32(buf, WLANTEST_CTRL_VERSION);
+ rlen = cmd_send_and_recv(s, buf, sizeof(buf), resp, sizeof(resp));
+ if (rlen < 0)
+ return -1;
+
+ version = (char *) attr_get(resp + 4, rlen - 4, WLANTEST_ATTR_VERSION,
+ &len);
+ if (version == NULL)
+ return -1;
+
+ for (i = 0; i < len; i++)
+ putchar(version[i]);
+ printf("\n");
+
+ return 0;
+}
+
+
struct wlantest_cli_cmd {
const char *cmd;
int (*handler)(int s, int argc, char *argv[]);
@@ -552,6 +578,7 @@ static const struct wlantest_cli_cmd wlantest_cli_commands[] = {
"<counter> <BSSID> = get BSS counter value" },
{ "inject", cmd_inject,
"<frame> <prot> <sender> <BSSID> <STA/ff:ff:ff:ff:ff:ff>" },
+ { "version", cmd_version, "= get wlantest version" },
{ NULL, NULL, NULL }
};