Home | History | Annotate | Download | only in wpa_supplicant

Lines Matching defs:cmd

98 static void print_help(const char *cmd);
403 static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, char *cmd, int print)
415 ifname_prefix, cmd);
417 cmd = buf;
420 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len,
423 printf("'%s' command timed out.\n", cmd);
426 printf("'%s' command failed.\n", cmd);
439 static int wpa_ctrl_command(struct wpa_ctrl *ctrl, char *cmd)
441 return _wpa_ctrl_command(ctrl, cmd, 1);
445 static int write_cmd(char *buf, size_t buflen, const char *cmd, int argc,
454 res = os_snprintf(pos, end - pos, "%s", cmd);
475 static int wpa_cli_cmd(struct wpa_ctrl *ctrl, const char *cmd, int min_args,
481 "required.\n", cmd, min_args,
485 if (write_cmd(buf, sizeof(buf), cmd, argc, argv) < 0)
586 char cmd[256];
590 res = os_snprintf(cmd, sizeof(cmd), "SET %s ", argv[0]);
591 if (os_snprintf_error(sizeof(cmd), res)) {
595 return wpa_ctrl_command(ctrl, cmd);
828 char cmd[256];
832 res = os_snprintf(cmd, sizeof(cmd), "BSS_FLUSH 0");
834 res = os_snprintf(cmd, sizeof(cmd), "BSS_FLUSH %s", argv[0]);
835 if (os_snprintf_error(sizeof(cmd), res)) {
839 return wpa_ctrl_command(ctrl, cmd);
963 char cmd[256];
967 res = os_snprintf(cmd, sizeof(cmd), "WPS_REG %s %s",
991 res = os_snprintf(cmd, sizeof(cmd),
1010 if (os_snprintf_error(sizeof(cmd), res)) {
1014 return wpa_ctrl_command(ctrl, cmd);
1095 char cmd[256];
1120 res = os_snprintf(cmd, sizeof(cmd),
1135 if (os_snprintf_error(sizeof(cmd), res)) {
1139 return wpa_ctrl_command(ctrl, cmd);
1174 char cmd[256], *pos, *end;
1183 end = cmd + sizeof(cmd);
1184 pos = cmd;
1201 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);
1241 char cmd[256], *pos, *end;
1250 end = cmd + sizeof(cmd);
1251 pos = cmd;
1268 return wpa_ctrl_command(ctrl, cmd);
1274 char cmd[256], *pos, *end;
1283 end = cmd + sizeof(cmd);
1284 pos = cmd;
1300 return wpa_ctrl_command(ctrl, cmd);
1306 char cmd[256], *pos, *end;
1315 end = cmd + sizeof(cmd);
1316 pos = cmd;
1333 return wpa_ctrl_command(ctrl, cmd);
1339 char cmd[256], *pos, *end;
1348 end = cmd + sizeof(cmd);
1349 pos = cmd;
1365 return wpa_ctrl_command(ctrl, cmd);
1372 char cmd[256], *pos, *end;
1381 end = cmd + sizeof(cmd);
1382 pos = cmd;
1399 return wpa_ctrl_command(ctrl, cmd);
1841 char cmd[256];
1856 res = os_snprintf(cmd, sizeof(cmd),
1862 if (os_snprintf_error(sizeof(cmd), res))
1864 cmd[sizeof(cmd) - 1] = '\0';
1865 return wpa_ctrl_command(ctrl, cmd);
1890 static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, char *cmd,
1902 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len,
1905 printf("'%s' command timed out.\n", cmd);
1908 printf("'%s' command failed.\n", cmd);
1928 char addr[32], cmd[64];
1933 os_snprintf(cmd, sizeof(cmd), "STA-NEXT %s", addr);
1934 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr)) == 0);
2153 char cmd[4096];
2161 if (write_cmd(cmd, sizeof(cmd), "P2P_SERV_DISC_REQ", argc, argv) < 0)
2163 return wpa_ctrl_command(ctrl, cmd);
2177 char cmd[4096];
2186 res = os_snprintf(cmd, sizeof(cmd), "P2P_SERV_DISC_RESP %s %s %s %s",
2188 if (os_snprintf_error(sizeof(cmd), res))
2190 cmd[sizeof(cmd) - 1] = '\0';
2191 return wpa_ctrl_command(ctrl, cmd);
2244 char cmd[4096];
2254 res = os_snprintf(cmd, sizeof(cmd),
2258 res = os_snprintf(cmd, sizeof(cmd),
2261 if (os_snprintf_error(sizeof(cmd), res))
2263 cmd[sizeof(cmd) - 1] = '\0';
2264 return wpa_ctrl_command(ctrl, cmd);
2303 static int wpa_ctrl_command_p2p_peer(struct wpa_ctrl *ctrl, char *cmd,
2314 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len,
2317 printf("'%s' command timed out.\n", cmd);
2320 printf("'%s' command failed.\n", cmd);
2341 char addr[32], cmd[64];
2350 os_snprintf(cmd, sizeof(cmd), "P2P_PEER NEXT-%s", addr);
2351 } while (wpa_ctrl_command_p2p_peer(ctrl, cmd, addr, sizeof(addr),
2472 char cmd[100];
2481 res = os_snprintf(cmd, sizeof(cmd), "WFD_SUBELEM_SET %s %s",
2483 if (os_snprintf_error(sizeof(cmd), res))
2485 cmd[sizeof(cmd) - 1] = '\0';
2486 return wpa_ctrl_command(ctrl, cmd);
2493 char cmd[100];
2502 res = os_snprintf(cmd, sizeof(cmd), "WFD_SUBELEM_GET %s",
2504 if (os_snprintf_error(sizeof(cmd), res))
2506 cmd[sizeof(cmd) - 1] = '\0';
2507 return wpa_ctrl_command(ctrl, cmd);
2581 char cmd[512];
2589 if (write_cmd(cmd, sizeof(cmd), "HS20_GET_NAI_HOME_REALM_LIST",
2593 return wpa_ctrl_command(ctrl, cmd);
2600 char cmd[512];
2608 if (write_cmd(cmd, sizeof(cmd), "HS20_ICON_REQUEST", argc, argv) < 0)
2611 return wpa_ctrl_command(ctrl, cmd);
2810 const char *cmd;
3202 "<cmd> [peer=addr] = invite peer" },
3365 static void print_cmd_help(const struct wpa_cli_cmd *cmd, const char *pad)
3370 printf("%s%s ", pad, cmd->cmd);
3371 for (n = 0; (c = cmd->usage[n]); n++) {
3380 static void print_help(const char *cmd)
3384 for (n = 0; wpa_cli_commands[n].cmd; n++) {
3385 if (cmd == NULL || str_starts(wpa_cli_commands[n].cmd, cmd))
3391 static int wpa_cli_edit_filter_history_cb(void *ctx, const char *cmd)
3397 delim = os_strchr(cmd, ' ');
3399 len = delim - cmd;
3401 len = os_strlen(cmd);
3403 for (n = 0; (c = wpa_cli_commands[n].cmd); n++) {
3404 if (os_strncasecmp(cmd, c, len) == 0 && len == os_strlen(c))
3425 for (i = 0; wpa_cli_commands[i].cmd; i++) {
3426 res[i] = os_strdup(wpa_cli_commands[i].cmd);
3451 static char ** wpa_cli_cmd_completion(const char *cmd, const char *str,
3456 for (i = 0; wpa_cli_commands[i].cmd; i++) {
3457 if (os_strcasecmp(wpa_cli_commands[i].cmd, cmd) == 0) {
3476 char *cmd;
3490 cmd = os_malloc(pos + 1);
3491 if (cmd == NULL)
3493 os_memcpy(cmd, str, pos);
3494 cmd[end - str] = '\0';
3495 res = wpa_cli_cmd_completion(cmd, str, pos);
3496 os_free(cmd);
3503 const struct wpa_cli_cmd *cmd, *match = NULL;
3518 cmd = wpa_cli_commands;
3519 while (cmd->cmd) {
3520 if (os_strncasecmp(cmd->cmd, argv[0], os_strlen(argv[0])) == 0)
3522 match = cmd;
3523 if (os_strcasecmp(cmd->cmd, argv[0]) == 0) {
3530 cmd++;
3535 cmd = wpa_cli_commands;
3536 while (cmd->cmd) {
3537 if (os_strncasecmp(cmd->cmd, argv[0],
3539 printf(" %s", cmd->cmd);
3541 cmd++;
3846 static int tokenize_cmd(char *cmd, char *argv[])
3851 pos = cmd;
3903 static void wpa_cli_edit_cmd_cb(void *ctx, char *cmd)
3907 argc = tokenize_cmd(cmd, argv);
3961 char *cmd = "BSS RANGE=ALL MASK=0x2";
3966 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len, NULL);
3992 char *cmd = "INTERFACES";
4000 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len, NULL);
4024 char *cmd = "LIST_NETWORKS";
4032 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len, NULL);