aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hostapd_cli.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-08-06 09:46:39 (GMT)
committerJouni Malinen <j@w1.fi>2016-08-06 09:46:39 (GMT)
commitac81b3948bba66af3d2845332d6ef8f75d0a918f (patch)
treebf195d8104a2a174f5cc4e02078a76bfb1284f75 /hostapd/hostapd_cli.c
parenta6d56a3965188a618494f7e439e9d1758a0af786 (diff)
downloadhostap-ac81b3948bba66af3d2845332d6ef8f75d0a918f.zip
hostap-ac81b3948bba66af3d2845332d6ef8f75d0a918f.tar.gz
hostap-ac81b3948bba66af3d2845332d6ef8f75d0a918f.tar.bz2
cli: Share a common tokenize_cmd() implementation
wpa_cli and hostapd_cli had identical copies of this function. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'hostapd/hostapd_cli.c')
-rw-r--r--hostapd/hostapd_cli.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index 196f512..04819d1 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -1478,38 +1478,6 @@ static void hostapd_cli_receive(int sock, void *eloop_ctx, void *sock_ctx)
}
-#define max_args 10
-
-static int tokenize_cmd(char *cmd, char *argv[])
-{
- char *pos;
- int argc = 0;
-
- pos = cmd;
- for (;;) {
- while (*pos == ' ')
- pos++;
- if (*pos == '\0')
- break;
- argv[argc] = pos;
- argc++;
- if (argc == max_args)
- break;
- if (*pos == '"') {
- char *pos2 = os_strrchr(pos, '"');
- if (pos2)
- pos = pos2 + 1;
- }
- while (*pos != '\0' && *pos != ' ')
- pos++;
- if (*pos == ' ')
- *pos++ = '\0';
- }
-
- return argc;
-}
-
-
static void hostapd_cli_ping(void *eloop_ctx, void *timeout_ctx)
{
if (ctrl_conn && _wpa_ctrl_command(ctrl_conn, "PING", 0)) {