Home | History | Annotate | Download | only in wpa_supplicant

Lines Matching refs:cmd

68 static void print_help(const char *cmd);
221 static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd, int print)
233 ifname_prefix, cmd);
235 cmd = buf;
238 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len,
241 printf("'%s' command timed out.\n", cmd);
244 printf("'%s' command failed.\n", cmd);
257 static int wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd)
259 return _wpa_ctrl_command(ctrl, cmd, 1);
263 static int wpa_cli_cmd(struct wpa_ctrl *ctrl, const char *cmd, int min_args,
269 "required.\n", cmd, min_args,
273 if (write_cmd(buf, sizeof(buf), cmd, argc, argv) < 0)
411 char cmd[256];
415 res = os_snprintf(cmd, sizeof(cmd), "SET %s ", argv[0]);
416 if (os_snprintf_error(sizeof(cmd), res)) {
420 return wpa_ctrl_command(ctrl, cmd);
670 char cmd[256];
674 res = os_snprintf(cmd, sizeof(cmd), "BSS_FLUSH 0");
676 res = os_snprintf(cmd, sizeof(cmd), "BSS_FLUSH %s", argv[0]);
677 if (os_snprintf_error(sizeof(cmd), res)) {
681 return wpa_ctrl_command(ctrl, cmd);
798 char cmd[256];
802 res = os_snprintf(cmd, sizeof(cmd), "WPS_REG %s %s",
826 res = os_snprintf(cmd, sizeof(cmd),
845 if (os_snprintf_error(sizeof(cmd), res)) {
849 return wpa_ctrl_command(ctrl, cmd);
930 char cmd[256];
955 res = os_snprintf(cmd, sizeof(cmd),
970 if (os_snprintf_error(sizeof(cmd), res)) {
974 return wpa_ctrl_command(ctrl, cmd);
1009 char cmd[256], *pos, *end;
1018 end = cmd + sizeof(cmd);
1019 pos = cmd;
1036 return wpa_ctrl_command(ctrl, cmd);
1042 char cmd[256], *pos, *end;
1051 end = cmd + sizeof(cmd);
1052 pos = cmd;
1069 return wpa_ctrl_command(ctrl, cmd);
1076 char cmd[256], *pos, *end;
1085 end = cmd + sizeof(cmd);
1086 pos = cmd;
1103 return wpa_ctrl_command(ctrl, cmd);
1109 char cmd[256], *pos, *end;
1118 end = cmd + sizeof(cmd);
1119 pos = cmd;
1135 return wpa_ctrl_command(ctrl, cmd);
1141 char cmd[256], *pos, *end;
1150 end = cmd + sizeof(cmd);
1151 pos = cmd;
1168 return wpa_ctrl_command(ctrl, cmd);
1174 char cmd[256], *pos, *end;
1183 end = cmd + sizeof(cmd);
1184 pos = cmd;
1200 return wpa_ctrl_command(ctrl, cmd);
1207 char cmd[256], *pos, *end;
1216 end = cmd + sizeof(cmd);
1217 pos = cmd;
1234 return wpa_ctrl_command(ctrl, cmd);
1729 char cmd[256];
1744 res = os_snprintf(cmd, sizeof(cmd),
1751 if (os_snprintf_error(sizeof(cmd), res))
1753 cmd[sizeof(cmd) - 1] = '\0';
1754 return wpa_ctrl_command(ctrl, cmd);
1794 static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, const char *cmd,
1807 ifname_prefix, cmd);
1809 cmd = buf;
1812 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len,
1815 printf("'%s' command timed out.\n", cmd);
1818 printf("'%s' command failed.\n", cmd);
1840 char addr[32], cmd[64];
1845 os_snprintf(cmd, sizeof(cmd), "STA-NEXT %s", addr);
1846 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr), 1) == 0);
1855 char addr[32], cmd[64];
1862 os_snprintf(cmd, sizeof(cmd), "STA-NEXT %s", addr);
1863 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr), 0) == 0);
2134 char cmd[4096];
2142 if (write_cmd(cmd, sizeof(cmd), "P2P_SERV_DISC_REQ", argc, argv) < 0)
2144 return wpa_ctrl_command(ctrl, cmd);
2158 char cmd[4096];
2167 res = os_snprintf(cmd, sizeof(cmd), "P2P_SERV_DISC_RESP %s %s %s %s",
2169 if (os_snprintf_error(sizeof(cmd), res))
2171 cmd[sizeof(cmd) - 1] = '\0';
2172 return wpa_ctrl_command(ctrl, cmd);
2225 char cmd[4096];
2235 res = os_snprintf(cmd, sizeof(cmd),
2239 res = os_snprintf(cmd, sizeof(cmd),
2242 if (os_snprintf_error(sizeof(cmd), res))
2244 cmd[sizeof(cmd) - 1] = '\0';
2245 return wpa_ctrl_command(ctrl, cmd);
2284 static int wpa_ctrl_command_p2p_peer(struct wpa_ctrl *ctrl, const char *cmd,
2295 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len,
2298 printf("'%s' command timed out.\n", cmd);
2301 printf("'%s' command failed.\n", cmd);
2322 char addr[32], cmd[64];
2331 os_snprintf(cmd, sizeof(cmd), "P2P_PEER NEXT-%s", addr);
2332 } while (wpa_ctrl_command_p2p_peer(ctrl, cmd, addr, sizeof(addr),
2474 char cmd[100];
2483 res = os_snprintf(cmd, sizeof(cmd), "WFD_SUBELEM_SET %s %s",
2485 if (os_snprintf_error(sizeof(cmd), res))
2487 cmd[sizeof(cmd) - 1] = '\0';
2488 return wpa_ctrl_command(ctrl, cmd);
2495 char cmd[100];
2504 res = os_snprintf(cmd, sizeof(cmd), "WFD_SUBELEM_GET %s",
2506 if (os_snprintf_error(sizeof(cmd), res))
2508 cmd[sizeof(cmd) - 1] = '\0';
2509 return wpa_ctrl_command(ctrl, cmd);
2583 char cmd[512];
2591 if (write_cmd(cmd, sizeof(cmd), "HS20_GET_NAI_HOME_REALM_LIST",
2595 return wpa_ctrl_command(ctrl, cmd);
2602 char cmd[512];
2610 if (write_cmd(cmd, sizeof(cmd), "HS20_ICON_REQUEST", argc, argv) < 0)
2613 return wpa_ctrl_command(ctrl, cmd);
2928 const char *cmd;
3353 "<cmd> [peer=addr] = invite peer" },
3576 static void print_cmd_help(const struct wpa_cli_cmd *cmd, const char *pad)
3581 printf("%s%s ", pad, cmd->cmd);
3582 for (n = 0; (c = cmd->usage[n]); n++) {
3591 static void print_help(const char *cmd)
3595 for (n = 0; wpa_cli_commands[n].cmd; n++) {
3596 if (cmd == NULL || str_starts(wpa_cli_commands[n].cmd, cmd))
3602 static int wpa_cli_edit_filter_history_cb(void *ctx, const char *cmd)
3608 delim = os_strchr(cmd, ' ');
3610 len = delim - cmd;
3612 len = os_strlen(cmd);
3614 for (n = 0; (c = wpa_cli_commands[n].cmd); n++) {
3615 if (os_strncasecmp(cmd, c, len) == 0 && len == os_strlen(c))
3636 for (i = 0; wpa_cli_commands[i].cmd; i++) {
3637 res[i] = os_strdup(wpa_cli_commands[i].cmd);
3662 static char ** wpa_cli_cmd_completion(const char *cmd, const char *str,
3667 for (i = 0; wpa_cli_commands[i].cmd; i++) {
3668 if (os_strcasecmp(wpa_cli_commands[i].cmd, cmd) == 0) {
3687 char *cmd;
3701 cmd = os_malloc(pos + 1);
3702 if (cmd == NULL)
3704 os_memcpy(cmd, str, pos);
3705 cmd[end - str] = '\0';
3706 res = wpa_cli_cmd_completion(cmd, str, pos);
3707 os_free(cmd);
3714 const struct wpa_cli_cmd *cmd, *match = NULL;
3729 cmd = wpa_cli_commands;
3730 while (cmd->cmd) {
3731 if (os_strncasecmp(cmd->cmd, argv[0], os_strlen(argv[0])) == 0)
3733 match = cmd;
3734 if (os_strcasecmp(cmd->cmd, argv[0]) == 0) {
3741 cmd++;
3746 cmd = wpa_cli_commands;
3747 while (cmd->cmd) {
3748 if (os_strncasecmp(cmd->cmd, argv[0],
3750 printf(" %s", cmd->cmd);
3752 cmd++;
4093 static void wpa_cli_edit_cmd_cb(void *ctx, char *cmd)
4097 argc = tokenize_cmd(cmd, argv);
4151 const char *cmd = "BSS RANGE=ALL MASK=0x2";
4156 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len, NULL);
4182 const char *cmd = "INTERFACES";
4190 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len, NULL);
4214 const char *cmd = "LIST_NETWORKS";
4222 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len, NULL);
4244 char addr[32], cmd[64];
4256 os_snprintf(cmd, sizeof(cmd), "STA-NEXT %s", addr);
4257 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr), 0) == 0);