Lines Matching refs:cmd
173 static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, char *cmd, int print) in _wpa_ctrl_command() argument
184 ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, in _wpa_ctrl_command()
187 printf("'%s' command timed out.\n", cmd); in _wpa_ctrl_command()
190 printf("'%s' command failed.\n", cmd); in _wpa_ctrl_command()
201 static inline int wpa_ctrl_command(struct wpa_ctrl *ctrl, char *cmd) in wpa_ctrl_command() argument
203 return _wpa_ctrl_command(ctrl, cmd, 1); in wpa_ctrl_command()
381 char cmd[256]; in hostapd_cli_cmd_wps_check_pin() local
391 res = os_snprintf(cmd, sizeof(cmd), "WPS_CHECK_PIN %s %s", in hostapd_cli_cmd_wps_check_pin()
394 res = os_snprintf(cmd, sizeof(cmd), "WPS_CHECK_PIN %s", in hostapd_cli_cmd_wps_check_pin()
396 if (res < 0 || (size_t) res >= sizeof(cmd) - 1) { in hostapd_cli_cmd_wps_check_pin()
400 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_wps_check_pin()
448 char cmd[64]; in hostapd_cli_cmd_wps_nfc_config_token() local
457 res = os_snprintf(cmd, sizeof(cmd), "WPS_NFC_CONFIG_TOKEN %s", in hostapd_cli_cmd_wps_nfc_config_token()
459 if (res < 0 || (size_t) res >= sizeof(cmd) - 1) { in hostapd_cli_cmd_wps_nfc_config_token()
463 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_wps_nfc_config_token()
470 char cmd[64]; in hostapd_cli_cmd_wps_nfc_token() local
479 res = os_snprintf(cmd, sizeof(cmd), "WPS_NFC_TOKEN %s", argv[0]); in hostapd_cli_cmd_wps_nfc_token()
480 if (res < 0 || (size_t) res >= sizeof(cmd) - 1) { in hostapd_cli_cmd_wps_nfc_token()
484 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_wps_nfc_token()
491 char cmd[64]; in hostapd_cli_cmd_nfc_get_handover_sel() local
500 res = os_snprintf(cmd, sizeof(cmd), "NFC_GET_HANDOVER_SEL %s %s", in hostapd_cli_cmd_nfc_get_handover_sel()
502 if (res < 0 || (size_t) res >= sizeof(cmd) - 1) { in hostapd_cli_cmd_nfc_get_handover_sel()
506 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_nfc_get_handover_sel()
632 static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, char *cmd, in wpa_ctrl_command_sta() argument
644 ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, in wpa_ctrl_command_sta()
647 printf("'%s' command timed out.\n", cmd); in wpa_ctrl_command_sta()
650 printf("'%s' command failed.\n", cmd); in wpa_ctrl_command_sta()
671 char addr[32], cmd[64]; in hostapd_cli_cmd_all_sta() local
676 snprintf(cmd, sizeof(cmd), "STA-NEXT %s", addr); in hostapd_cli_cmd_all_sta()
677 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr)) == 0); in hostapd_cli_cmd_all_sta()
793 char cmd[256]; in hostapd_cli_cmd_level() local
799 snprintf(cmd, sizeof(cmd), "LEVEL %s", argv[0]); in hostapd_cli_cmd_level()
800 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_level()
857 char cmd[256]; in hostapd_cli_cmd_set() local
866 res = os_snprintf(cmd, sizeof(cmd), "SET %s %s", argv[0], argv[1]); in hostapd_cli_cmd_set()
867 if (res < 0 || (size_t) res >= sizeof(cmd) - 1) { in hostapd_cli_cmd_set()
871 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_set()
877 char cmd[256]; in hostapd_cli_cmd_get() local
886 res = os_snprintf(cmd, sizeof(cmd), "GET %s", argv[0]); in hostapd_cli_cmd_get()
887 if (res < 0 || (size_t) res >= sizeof(cmd) - 1) { in hostapd_cli_cmd_get()
891 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_get()
898 char cmd[256]; in hostapd_cli_cmd_chan_switch() local
913 res = os_snprintf(cmd, sizeof(cmd), "CHAN_SWITCH %s %s", in hostapd_cli_cmd_chan_switch()
915 if (res < 0 || (size_t) res >= sizeof(cmd) - 1) { in hostapd_cli_cmd_chan_switch()
922 tmp = cmd + total; in hostapd_cli_cmd_chan_switch()
923 res = os_snprintf(tmp, sizeof(cmd) - total, " %s", argv[i]); in hostapd_cli_cmd_chan_switch()
924 if (res < 0 || (size_t) res >= sizeof(cmd) - total - 1) { in hostapd_cli_cmd_chan_switch()
930 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_chan_switch()
936 char cmd[256]; in hostapd_cli_cmd_vendor() local
945 res = os_snprintf(cmd, sizeof(cmd), "VENDOR %s %s %s", argv[0], argv[1], in hostapd_cli_cmd_vendor()
947 if (res < 0 || (size_t) res >= sizeof(cmd) - 1) { in hostapd_cli_cmd_vendor()
951 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_vendor()
956 const char *cmd; member
1010 struct hostapd_cli_cmd *cmd, *match = NULL; in wpa_request() local
1014 cmd = hostapd_cli_commands; in wpa_request()
1015 while (cmd->cmd) { in wpa_request()
1016 if (strncasecmp(cmd->cmd, argv[0], strlen(argv[0])) == 0) { in wpa_request()
1017 match = cmd; in wpa_request()
1018 if (os_strcasecmp(cmd->cmd, argv[0]) == 0) { in wpa_request()
1025 cmd++; in wpa_request()
1030 cmd = hostapd_cli_commands; in wpa_request()
1031 while (cmd->cmd) { in wpa_request()
1032 if (strncasecmp(cmd->cmd, argv[0], strlen(argv[0])) == in wpa_request()
1034 printf(" %s", cmd->cmd); in wpa_request()
1036 cmd++; in wpa_request()
1076 static int tokenize_cmd(char *cmd, char *argv[]) in tokenize_cmd() argument
1081 pos = cmd; in tokenize_cmd()
1136 static void hostapd_cli_edit_cmd_cb(void *ctx, char *cmd) in hostapd_cli_edit_cmd_cb() argument
1140 argc = tokenize_cmd(cmd, argv); in hostapd_cli_edit_cmd_cb()