Lines Matching refs:cmd

192 static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, char *cmd, int print)  in _wpa_ctrl_command()  argument
203 ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, in _wpa_ctrl_command()
206 printf("'%s' command timed out.\n", cmd); in _wpa_ctrl_command()
209 printf("'%s' command failed.\n", cmd); in _wpa_ctrl_command()
220 static inline int wpa_ctrl_command(struct wpa_ctrl *ctrl, char *cmd) in wpa_ctrl_command() argument
222 return _wpa_ctrl_command(ctrl, cmd, 1); in wpa_ctrl_command()
226 static int write_cmd(char *buf, size_t buflen, const char *cmd, int argc, in write_cmd() argument
235 res = os_snprintf(pos, end - pos, "%s", cmd); in write_cmd()
256 static int hostapd_cli_cmd(struct wpa_ctrl *ctrl, const char *cmd, in hostapd_cli_cmd() argument
263 cmd, min_args, min_args > 1 ? "s are" : " is"); in hostapd_cli_cmd()
266 if (write_cmd(buf, sizeof(buf), cmd, argc, argv) < 0) in hostapd_cli_cmd()
446 char cmd[256]; in hostapd_cli_cmd_wps_check_pin() local
456 res = os_snprintf(cmd, sizeof(cmd), "WPS_CHECK_PIN %s %s", in hostapd_cli_cmd_wps_check_pin()
459 res = os_snprintf(cmd, sizeof(cmd), "WPS_CHECK_PIN %s", in hostapd_cli_cmd_wps_check_pin()
461 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_wps_check_pin()
465 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_wps_check_pin()
513 char cmd[64]; in hostapd_cli_cmd_wps_nfc_config_token() local
522 res = os_snprintf(cmd, sizeof(cmd), "WPS_NFC_CONFIG_TOKEN %s", in hostapd_cli_cmd_wps_nfc_config_token()
524 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_wps_nfc_config_token()
528 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_wps_nfc_config_token()
535 char cmd[64]; in hostapd_cli_cmd_wps_nfc_token() local
544 res = os_snprintf(cmd, sizeof(cmd), "WPS_NFC_TOKEN %s", argv[0]); in hostapd_cli_cmd_wps_nfc_token()
545 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_wps_nfc_token()
549 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_wps_nfc_token()
556 char cmd[64]; in hostapd_cli_cmd_nfc_get_handover_sel() local
565 res = os_snprintf(cmd, sizeof(cmd), "NFC_GET_HANDOVER_SEL %s %s", in hostapd_cli_cmd_nfc_get_handover_sel()
567 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_nfc_get_handover_sel()
571 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_nfc_get_handover_sel()
724 static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, char *cmd, in wpa_ctrl_command_sta() argument
736 ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, in wpa_ctrl_command_sta()
739 printf("'%s' command timed out.\n", cmd); in wpa_ctrl_command_sta()
742 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)) == 0); in hostapd_cli_cmd_all_sta()
885 char cmd[256]; in hostapd_cli_cmd_level() local
891 snprintf(cmd, sizeof(cmd), "LEVEL %s", argv[0]); in hostapd_cli_cmd_level()
892 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_level()
951 char cmd[256]; in hostapd_cli_cmd_set() local
960 res = os_snprintf(cmd, sizeof(cmd), "SET %s %s", argv[0], argv[1]); in hostapd_cli_cmd_set()
961 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_set()
965 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_set()
971 char cmd[256]; in hostapd_cli_cmd_get() local
980 res = os_snprintf(cmd, sizeof(cmd), "GET %s", argv[0]); in hostapd_cli_cmd_get()
981 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_get()
985 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_get()
992 char cmd[256]; in hostapd_cli_cmd_fst() local
1002 total = os_snprintf(cmd, sizeof(cmd), "FST-MANAGER"); in hostapd_cli_cmd_fst()
1005 res = os_snprintf(cmd + total, sizeof(cmd) - total, " %s", in hostapd_cli_cmd_fst()
1007 if (os_snprintf_error(sizeof(cmd) - total, res)) { in hostapd_cli_cmd_fst()
1013 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_fst()
1021 char cmd[256]; in hostapd_cli_cmd_chan_switch() local
1036 res = os_snprintf(cmd, sizeof(cmd), "CHAN_SWITCH %s %s", in hostapd_cli_cmd_chan_switch()
1038 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_chan_switch()
1045 tmp = cmd + total; in hostapd_cli_cmd_chan_switch()
1046 res = os_snprintf(tmp, sizeof(cmd) - total, " %s", argv[i]); in hostapd_cli_cmd_chan_switch()
1047 if (os_snprintf_error(sizeof(cmd) - total, res)) { in hostapd_cli_cmd_chan_switch()
1053 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_chan_switch()
1080 char cmd[256]; in hostapd_cli_cmd_vendor() local
1089 res = os_snprintf(cmd, sizeof(cmd), "VENDOR %s %s %s", argv[0], argv[1], in hostapd_cli_cmd_vendor()
1091 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_vendor()
1095 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_vendor()
1109 char cmd[256]; in hostapd_cli_cmd_log_level() local
1112 res = os_snprintf(cmd, sizeof(cmd), "LOG_LEVEL%s%s%s%s", in hostapd_cli_cmd_log_level()
1117 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_log_level()
1121 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_log_level()
1147 const char *cmd; member
1213 const struct hostapd_cli_cmd *cmd, *match = NULL; in wpa_request() local
1217 cmd = hostapd_cli_commands; in wpa_request()
1218 while (cmd->cmd) { in wpa_request()
1219 if (strncasecmp(cmd->cmd, argv[0], strlen(argv[0])) == 0) { in wpa_request()
1220 match = cmd; in wpa_request()
1221 if (os_strcasecmp(cmd->cmd, argv[0]) == 0) { in wpa_request()
1228 cmd++; in wpa_request()
1233 cmd = hostapd_cli_commands; in wpa_request()
1234 while (cmd->cmd) { in wpa_request()
1235 if (strncasecmp(cmd->cmd, argv[0], strlen(argv[0])) == in wpa_request()
1237 printf(" %s", cmd->cmd); in wpa_request()
1239 cmd++; in wpa_request()
1279 static int tokenize_cmd(char *cmd, char *argv[]) in tokenize_cmd() argument
1284 pos = cmd; in tokenize_cmd()
1339 static void hostapd_cli_edit_cmd_cb(void *ctx, char *cmd) in hostapd_cli_edit_cmd_cb() argument
1343 argc = tokenize_cmd(cmd, argv); in hostapd_cli_edit_cmd_cb()