Lines Matching refs:pos
258 static int get_cmd_arg_num(const char *str, int pos)
262 for (i = 0; i <= pos; i++) {
265 while (i <= pos && str[i] != ' ')
445 char *pos, *end;
447 pos = buf;
450 res = os_snprintf(pos, end - pos, "%s", cmd);
451 if (res < 0 || res >= end - pos)
453 pos += res;
456 res = os_snprintf(pos, end - pos, " %s", argv[i]);
457 if (res < 0 || res >= end - pos)
459 pos += res;
540 static char ** wpa_cli_complete_help(const char *str, int pos)
542 int arg = get_cmd_arg_num(str, pos);
589 static char ** wpa_cli_complete_set(const char *str, int pos)
591 int arg = get_cmd_arg_num(str, pos);
1108 char cmd[256], *pos, *end;
1118 pos = cmd;
1119 ret = os_snprintf(pos, end - pos, WPA_CTRL_RSP "IDENTITY-%s:%s",
1121 if (ret < 0 || ret >= end - pos) {
1125 pos += ret;
1127 ret = os_snprintf(pos, end - pos, " %s", argv[i]);
1128 if (ret < 0 || ret >= end - pos) {
1132 pos += ret;
1141 char cmd[256], *pos, *end;
1151 pos = cmd;
1152 ret = os_snprintf(pos, end - pos, WPA_CTRL_RSP "PASSWORD-%s:%s",
1154 if (ret < 0 || ret >= end - pos) {
1158 pos += ret;
1160 ret = os_snprintf(pos, end - pos, " %s", argv[i]);
1161 if (ret < 0 || ret >= end - pos) {
1165 pos += ret;
1175 char cmd[256], *pos, *end;
1185 pos = cmd;
1186 ret = os_snprintf(pos, end - pos, WPA_CTRL_RSP "NEW_PASSWORD-%s:%s",
1188 if (ret < 0 || ret >= end - pos) {
1192 pos += ret;
1194 ret = os_snprintf(pos, end - pos, " %s", argv[i]);
1195 if (ret < 0 || ret >= end - pos) {
1199 pos += ret;
1208 char cmd[256], *pos, *end;
1218 pos = cmd;
1219 ret = os_snprintf(pos, end - pos, WPA_CTRL_RSP "PIN-%s:%s",
1221 if (ret < 0 || ret >= end - pos) {
1225 pos += ret;
1227 ret = os_snprintf(pos, end - pos, " %s", argv[i]);
1228 if (ret < 0 || ret >= end - pos) {
1232 pos += ret;
1240 char cmd[256], *pos, *end;
1250 pos = cmd;
1251 ret = os_snprintf(pos, end - pos, WPA_CTRL_RSP "OTP-%s:%s",
1253 if (ret < 0 || ret >= end - pos) {
1257 pos += ret;
1259 ret = os_snprintf(pos, end - pos, " %s", argv[i]);
1260 if (ret < 0 || ret >= end - pos) {
1264 pos += ret;
1274 char cmd[256], *pos, *end;
1284 pos = cmd;
1285 ret = os_snprintf(pos, end - pos, WPA_CTRL_RSP "PASSPHRASE-%s:%s",
1287 if (ret < 0 || ret >= end - pos) {
1291 pos += ret;
1293 ret = os_snprintf(pos, end - pos, " %s", argv[i]);
1294 if (ret < 0 || ret >= end - pos) {
1298 pos += ret;
1500 static char ** wpa_cli_complete_bss(const char *str, int pos)
1502 int arg = get_cmd_arg_num(str, pos);
1631 char buf[4096], *pos;
1655 pos = buf;
1656 while (*pos != '\0' && *pos != '\n')
1657 pos++;
1658 *pos = '\0';
1725 static char ** wpa_cli_complete_p2p_find(const char *str, int pos)
1728 int arg = get_cmd_arg_num(str, pos);
1768 static char ** wpa_cli_complete_p2p_connect(const char *str, int pos)
1770 int arg = get_cmd_arg_num(str, pos);
1797 static char ** wpa_cli_complete_p2p_group_remove(const char *str, int pos)
1799 int arg = get_cmd_arg_num(str, pos);
1982 static char ** wpa_cli_complete_p2p_peer(const char *str, int pos)
1984 int arg = get_cmd_arg_num(str, pos);
2001 char buf[4096], *pos;
2022 pos = buf;
2023 while (*pos != '\0' && *pos != '\n')
2024 pos++;
2025 *pos++ = '\0';
2027 if (!discovered || os_strstr(pos, "[PROBE_REQ_ONLY]") == NULL)
2058 static char ** wpa_cli_complete_p2p_set(const char *str, int pos)
2060 int arg = get_cmd_arg_num(str, pos);
2408 char ** (*completion)(const char *str, int pos);
2954 int pos)
2962 pos);
2974 static char ** wpa_cli_edit_completion_cb(void *ctx, const char *str, int pos)
2980 if (pos > 7 && os_strncasecmp(str, "IFNAME=", 7) == 0) {
2982 if (end && pos > end - str) {
2983 pos -= end - str + 1;
2989 if (end == NULL || str + pos < end)
2992 cmd = os_malloc(pos + 1);
2995 os_memcpy(cmd, str, pos);
2997 res = wpa_cli_cmd_completion(cmd, str, pos);
3094 const char *pos;
3097 pos = msg;
3098 if (*pos == '<') {
3100 pos = os_strchr(pos, '>');
3101 if (pos)
3102 pos++;
3104 pos = msg;
3107 if (str_match(pos, WPA_EVENT_CONNECTED)) {
3113 pos = os_strstr(pos, "[id=");
3114 if (pos)
3115 copy = os_strdup(pos + 4);
3143 } else if (str_match(pos, WPA_EVENT_DISCONNECTED)) {
3148 } else if (str_match(pos, P2P_EVENT_GROUP_STARTED)) {
3149 wpa_cli_exec(action_file, ctrl_ifname, pos);
3150 } else if (str_match(pos, P2P_EVENT_GROUP_REMOVED)) {
3151 wpa_cli_exec(action_file, ctrl_ifname, pos);
3152 } else if (str_match(pos, P2P_EVENT_CROSS_CONNECT_ENABLE)) {
3153 wpa_cli_exec(action_file, ctrl_ifname, pos);
3154 } else if (str_match(pos, P2P_EVENT_CROSS_CONNECT_DISABLE)) {
3155 wpa_cli_exec(action_file, ctrl_ifname, pos);
3156 } else if (str_match(pos, P2P_EVENT_GO_NEG_FAILURE)) {
3157 wpa_cli_exec(action_file, ctrl_ifname, pos);
3158 } else if (str_match(pos, WPS_EVENT_SUCCESS)) {
3159 wpa_cli_exec(action_file, ctrl_ifname, pos);
3160 } else if (str_match(pos, WPS_EVENT_FAIL)) {
3161 wpa_cli_exec(action_file, ctrl_ifname, pos);
3162 } else if (str_match(pos, AP_STA_CONNECTED)) {
3163 wpa_cli_exec(action_file, ctrl_ifname, pos);
3164 } else if (str_match(pos, AP_STA_DISCONNECTED)) {
3165 wpa_cli_exec(action_file, ctrl_ifname, pos);
3166 } else if (str_match(pos, ESS_DISASSOC_IMMINENT)) {
3167 wpa_cli_exec(action_file, ctrl_ifname, pos);
3168 } else if (str_match(pos, WPA_EVENT_TERMINATING)) {
3267 const char *pos = msg;
3269 if (*pos == '<') {
3271 pos = os_strchr(pos, '>');
3272 if (pos)
3273 pos++;
3275 pos = msg;
3278 if (str_match(pos, WPA_EVENT_TERMINATING) && ctrl_conn) {
3333 char *pos;
3336 pos = cmd;
3338 while (*pos == ' ')
3339 pos++;
3340 if (*pos == '\0')
3342 argv[argc] = pos;
3346 if (*pos == '"') {
3347 char *pos2 = os_strrchr(pos, '"');
3349 pos = pos2 + 1;
3351 while (*pos != '\0' && *pos != ' ')
3352 pos++;
3353 if (*pos == ' ')
3354 *pos++ = '\0';
3435 char *pos, *end;
3444 pos = buf;
3445 while (pos) {
3446 pos = os_strstr(pos, "bssid=");
3447 if (pos == NULL)
3449 pos += 6;
3450 end = os_strchr(pos, '\n');
3454 cli_txt_list_add(&bsses, pos);
3455 pos = end + 1;
3466 char *pos, *end;
3478 pos = buf;
3479 while (pos) {
3480 end = os_strchr(pos, '\n');
3484 ret = os_snprintf(txt, sizeof(txt), "ifname=%s", pos);
3487 pos = end + 1;
3638 char buf[4096], *pos;
3651 pos = os_strchr(buf, '\n');
3652 if (pos)
3653 *pos = '\0';