From 27b80b5b4cfa0f675722545f9e796c508af1eafb Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 25 Aug 2012 13:33:29 +0300 Subject: [PATCH] wpa_cli: Add a 'raw' command for sending unprocessed data This can be used to test new control interface commands and to use commands that may not yet be supported by wpa_cli. Signed-hostap: Jouni Malinen --- wpa_supplicant/wpa_cli.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index 53ed05daa..794b20b46 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -2091,6 +2091,14 @@ static int wpa_cli_cmd_autoscan(struct wpa_ctrl *ctrl, int argc, char *argv[]) #endif /* CONFIG_AUTOSCAN */ +static int wpa_cli_cmd_raw(struct wpa_ctrl *ctrl, int argc, char *argv[]) +{ + if (argc == 0) + return -1; + return wpa_cli_cmd(ctrl, argv[0], 0, argc - 1, &argv[1]); +} + + enum wpa_cli_cmd_flags { cli_cmd_flag_none = 0x00, cli_cmd_flag_sensitive = 0x01 @@ -2488,6 +2496,8 @@ static struct wpa_cli_cmd wpa_cli_commands[] = { { "autoscan", wpa_cli_cmd_autoscan, cli_cmd_flag_none, "[params] = Set or unset (if none) autoscan parameters" }, #endif /* CONFIG_AUTOSCAN */ + { "raw", wpa_cli_cmd_raw, cli_cmd_flag_sensitive, + " = Sent unprocessed command" }, { NULL, NULL, cli_cmd_flag_none, NULL } };