• Home
  • Raw
  • Download

Lines Matching refs:cmd

45 static void print_help(FILE *stream, const char *cmd);
190 static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd, int print) in _wpa_ctrl_command() argument
201 ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, in _wpa_ctrl_command()
204 printf("'%s' command timed out.\n", cmd); in _wpa_ctrl_command()
207 printf("'%s' command failed.\n", cmd); in _wpa_ctrl_command()
218 static inline int wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd) in wpa_ctrl_command() argument
220 return _wpa_ctrl_command(ctrl, cmd, 1); in wpa_ctrl_command()
224 static int hostapd_cli_cmd(struct wpa_ctrl *ctrl, const char *cmd, in hostapd_cli_cmd() argument
231 cmd, min_args, min_args > 1 ? "s are" : " is"); in hostapd_cli_cmd()
234 if (write_cmd(buf, sizeof(buf), cmd, argc, argv) < 0) in hostapd_cli_cmd()
445 char cmd[256]; in hostapd_cli_cmd_wps_check_pin() local
455 res = os_snprintf(cmd, sizeof(cmd), "WPS_CHECK_PIN %s %s", in hostapd_cli_cmd_wps_check_pin()
458 res = os_snprintf(cmd, sizeof(cmd), "WPS_CHECK_PIN %s", in hostapd_cli_cmd_wps_check_pin()
460 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_wps_check_pin()
464 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_wps_check_pin()
512 char cmd[64]; in hostapd_cli_cmd_wps_nfc_config_token() local
521 res = os_snprintf(cmd, sizeof(cmd), "WPS_NFC_CONFIG_TOKEN %s", in hostapd_cli_cmd_wps_nfc_config_token()
523 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_wps_nfc_config_token()
527 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_wps_nfc_config_token()
534 char cmd[64]; in hostapd_cli_cmd_wps_nfc_token() local
543 res = os_snprintf(cmd, sizeof(cmd), "WPS_NFC_TOKEN %s", argv[0]); in hostapd_cli_cmd_wps_nfc_token()
544 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_wps_nfc_token()
548 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_wps_nfc_token()
555 char cmd[64]; in hostapd_cli_cmd_nfc_get_handover_sel() local
564 res = os_snprintf(cmd, sizeof(cmd), "NFC_GET_HANDOVER_SEL %s %s", in hostapd_cli_cmd_nfc_get_handover_sel()
566 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_nfc_get_handover_sel()
570 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_nfc_get_handover_sel()
723 static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, const char *cmd, in wpa_ctrl_command_sta() argument
735 ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, in wpa_ctrl_command_sta()
738 printf("'%s' command timed out.\n", cmd); in wpa_ctrl_command_sta()
741 printf("'%s' command failed.\n", cmd); in wpa_ctrl_command_sta()
763 char addr[32], cmd[64]; in hostapd_cli_cmd_all_sta() local
768 snprintf(cmd, sizeof(cmd), "STA-NEXT %s", addr); in hostapd_cli_cmd_all_sta()
769 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr), 1) == 0); in hostapd_cli_cmd_all_sta()
778 char addr[32], cmd[64]; in hostapd_cli_cmd_list_sta() local
785 os_snprintf(cmd, sizeof(cmd), "STA-NEXT %s", addr); in hostapd_cli_cmd_list_sta()
786 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr), 0) == 0); in hostapd_cli_cmd_list_sta()
917 char cmd[256]; in hostapd_cli_cmd_level() local
923 snprintf(cmd, sizeof(cmd), "LEVEL %s", argv[0]); in hostapd_cli_cmd_level()
924 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_level()
930 char addr[32], cmd[64]; in update_stations() local
942 os_snprintf(cmd, sizeof(cmd), "STA-NEXT %s", addr); in update_stations()
943 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr), 0) == 0); in update_stations()
1027 char cmd[2048]; in hostapd_cli_cmd_set() local
1036 res = os_snprintf(cmd, sizeof(cmd), "SET %s %s", argv[0], argv[1]); in hostapd_cli_cmd_set()
1037 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_set()
1041 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_set()
1085 char cmd[256]; in hostapd_cli_cmd_get() local
1094 res = os_snprintf(cmd, sizeof(cmd), "GET %s", argv[0]); in hostapd_cli_cmd_get()
1095 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_get()
1099 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_get()
1131 char cmd[256]; in hostapd_cli_cmd_fst() local
1141 total = os_snprintf(cmd, sizeof(cmd), "FST-MANAGER"); in hostapd_cli_cmd_fst()
1144 res = os_snprintf(cmd + total, sizeof(cmd) - total, " %s", in hostapd_cli_cmd_fst()
1146 if (os_snprintf_error(sizeof(cmd) - total, res)) { in hostapd_cli_cmd_fst()
1152 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_fst()
1160 char cmd[256]; in hostapd_cli_cmd_chan_switch() local
1175 res = os_snprintf(cmd, sizeof(cmd), "CHAN_SWITCH %s %s", in hostapd_cli_cmd_chan_switch()
1177 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_chan_switch()
1184 tmp = cmd + total; in hostapd_cli_cmd_chan_switch()
1185 res = os_snprintf(tmp, sizeof(cmd) - total, " %s", argv[i]); in hostapd_cli_cmd_chan_switch()
1186 if (os_snprintf_error(sizeof(cmd) - total, res)) { in hostapd_cli_cmd_chan_switch()
1192 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_chan_switch()
1226 char cmd[256]; in hostapd_cli_cmd_vendor() local
1235 res = os_snprintf(cmd, sizeof(cmd), "VENDOR %s %s %s", argv[0], argv[1], in hostapd_cli_cmd_vendor()
1237 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_vendor()
1241 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_vendor()
1255 char cmd[256]; in hostapd_cli_cmd_log_level() local
1258 res = os_snprintf(cmd, sizeof(cmd), "LOG_LEVEL%s%s%s%s", in hostapd_cli_cmd_log_level()
1263 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_log_level()
1267 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_log_level()
1295 char cmd[2048]; in hostapd_cli_cmd_set_neighbor() local
1303 res = os_snprintf(cmd, sizeof(cmd), "SET_NEIGHBOR %s %s %s %s %s %s", in hostapd_cli_cmd_set_neighbor()
1306 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_set_neighbor()
1310 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_set_neighbor()
1317 char cmd[400]; in hostapd_cli_cmd_remove_neighbor() local
1325 res = os_snprintf(cmd, sizeof(cmd), "REMOVE_NEIGHBOR %s %s", in hostapd_cli_cmd_remove_neighbor()
1327 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_remove_neighbor()
1331 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_remove_neighbor()
1338 char cmd[256]; in hostapd_cli_cmd_req_lci() local
1346 res = os_snprintf(cmd, sizeof(cmd), "REQ_LCI %s", argv[0]); in hostapd_cli_cmd_req_lci()
1347 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_req_lci()
1351 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_req_lci()
1512 const char *cmd; member
1697 static void print_cmd_help(FILE *stream, const struct hostapd_cli_cmd *cmd, in print_cmd_help() argument
1703 if (cmd->usage == NULL) in print_cmd_help()
1705 fprintf(stream, "%s%s ", pad, cmd->cmd); in print_cmd_help()
1706 for (n = 0; (c = cmd->usage[n]); n++) { in print_cmd_help()
1715 static void print_help(FILE *stream, const char *cmd) in print_help() argument
1720 for (n = 0; hostapd_cli_commands[n].cmd; n++) { in print_help()
1721 if (cmd == NULL || str_starts(hostapd_cli_commands[n].cmd, cmd)) in print_help()
1729 const struct hostapd_cli_cmd *cmd, *match = NULL; in wpa_request() local
1733 cmd = hostapd_cli_commands; in wpa_request()
1734 while (cmd->cmd) { in wpa_request()
1735 if (strncasecmp(cmd->cmd, argv[0], strlen(argv[0])) == 0) { in wpa_request()
1736 match = cmd; in wpa_request()
1737 if (os_strcasecmp(cmd->cmd, argv[0]) == 0) { in wpa_request()
1744 cmd++; in wpa_request()
1749 cmd = hostapd_cli_commands; in wpa_request()
1750 while (cmd->cmd) { in wpa_request()
1751 if (strncasecmp(cmd->cmd, argv[0], strlen(argv[0])) == in wpa_request()
1753 printf(" %s", cmd->cmd); in wpa_request()
1755 cmd++; in wpa_request()
1848 static void hostapd_cli_edit_cmd_cb(void *ctx, char *cmd) in hostapd_cli_edit_cmd_cb() argument
1852 argc = tokenize_cmd(cmd, argv); in hostapd_cli_edit_cmd_cb()
1874 for (i = 0; hostapd_cli_commands[i].cmd; i++) { in list_cmd_list()
1875 res[i] = os_strdup(hostapd_cli_commands[i].cmd); in list_cmd_list()
1884 static char ** hostapd_cli_cmd_completion(const char *cmd, const char *str, in hostapd_cli_cmd_completion() argument
1889 for (i = 0; hostapd_cli_commands[i].cmd; i++) { in hostapd_cli_cmd_completion()
1890 if (os_strcasecmp(hostapd_cli_commands[i].cmd, cmd) != 0) in hostapd_cli_cmd_completion()
1911 char *cmd; in hostapd_cli_edit_completion_cb() local
1917 cmd = os_malloc(pos + 1); in hostapd_cli_edit_completion_cb()
1918 if (cmd == NULL) in hostapd_cli_edit_completion_cb()
1920 os_memcpy(cmd, str, pos); in hostapd_cli_edit_completion_cb()
1921 cmd[end - str] = '\0'; in hostapd_cli_edit_completion_cb()
1922 res = hostapd_cli_cmd_completion(cmd, str, pos); in hostapd_cli_edit_completion_cb()
1923 os_free(cmd); in hostapd_cli_edit_completion_cb()