Lines Matching full:pos

81 	char *pos;  in set_bssid_filter()  local
85 pos = val; in set_bssid_filter()
86 while (pos) { in set_bssid_filter()
87 if (*pos == '\0') in set_bssid_filter()
89 if (hwaddr_aton(pos, addr)) { in set_bssid_filter()
102 pos = os_strchr(pos, ' '); in set_bssid_filter()
103 if (pos) in set_bssid_filter()
104 pos++; in set_bssid_filter()
118 char *pos; in set_disallow_aps() local
130 pos = val; in set_disallow_aps()
131 while (pos) { in set_disallow_aps()
132 if (*pos == '\0') in set_disallow_aps()
134 if (os_strncmp(pos, "bssid ", 6) == 0) { in set_disallow_aps()
136 pos += 6; in set_disallow_aps()
137 res = hwaddr_aton2(pos, addr); in set_disallow_aps()
142 "BSSID value '%s'", pos); in set_disallow_aps()
145 pos += res; in set_disallow_aps()
155 } else if (os_strncmp(pos, "ssid ", 5) == 0) { in set_disallow_aps()
157 pos += 5; in set_disallow_aps()
159 end = pos; in set_disallow_aps()
175 if ((end - pos) & 0x01 || in set_disallow_aps()
176 end - pos > 2 * SSID_MAX_LEN || in set_disallow_aps()
177 hexstr2bin(pos, ssid[ssid_count].ssid, in set_disallow_aps()
178 (end - pos) / 2) < 0) { in set_disallow_aps()
182 "SSID value '%s'", pos); in set_disallow_aps()
185 ssid[ssid_count].ssid_len = (end - pos) / 2; in set_disallow_aps()
190 pos = end; in set_disallow_aps()
193 "'%s'", pos); in set_disallow_aps()
199 pos = os_strchr(pos, ' '); in set_disallow_aps()
200 if (pos) in set_disallow_aps()
201 pos++; in set_disallow_aps()
241 static int wpas_ctrl_set_blob(struct wpa_supplicant *wpa_s, char *pos) in wpas_ctrl_set_blob() argument
243 char *name = pos; in wpas_ctrl_set_blob()
247 pos = os_strchr(pos, ' '); in wpas_ctrl_set_blob()
248 if (pos == NULL) in wpas_ctrl_set_blob()
250 *pos++ = '\0'; in wpas_ctrl_set_blob()
251 len = os_strlen(pos); in wpas_ctrl_set_blob()
266 if (hexstr2bin(pos, blob->data, len / 2) < 0) { in wpas_ctrl_set_blob()
283 char *pos; in wpas_ctrl_pno() local
292 pos = os_strstr(params, "freq="); in wpas_ctrl_pno()
293 if (pos) in wpas_ctrl_pno()
295 pos + 5); in wpas_ctrl_pno()
389 char *pos; in wpas_ctrl_set_relative_band_adjust() local
393 pos = os_strchr(cmd, ':'); in wpas_ctrl_set_relative_band_adjust()
394 if (!pos) in wpas_ctrl_set_relative_band_adjust()
396 pos++; in wpas_ctrl_set_relative_band_adjust()
397 adjust_rssi = atoi(pos); in wpas_ctrl_set_relative_band_adjust()
441 const char *pos = val; in wpas_ctrl_iface_set_dso() local
444 if (hwaddr_aton(pos, bssid)) in wpas_ctrl_iface_set_dso()
446 pos = os_strchr(pos, ' '); in wpas_ctrl_iface_set_dso()
456 if (!pos) { in wpas_ctrl_iface_set_dso()
464 pos++; in wpas_ctrl_iface_set_dso()
468 if (sscanf(pos, "%d %d %d %d %d", in wpas_ctrl_iface_set_dso()
628 char *pos; in wpa_supplicant_ctrl_iface_set() local
631 pos = os_strchr(value, ','); in wpa_supplicant_ctrl_iface_set()
632 if (pos == NULL) in wpa_supplicant_ctrl_iface_set()
634 pos++; in wpa_supplicant_ctrl_iface_set()
635 bk = atoi(pos); in wpa_supplicant_ctrl_iface_set()
636 pos = os_strchr(pos, ','); in wpa_supplicant_ctrl_iface_set()
637 if (pos == NULL) in wpa_supplicant_ctrl_iface_set()
639 pos++; in wpa_supplicant_ctrl_iface_set()
640 vi = atoi(pos); in wpa_supplicant_ctrl_iface_set()
641 pos = os_strchr(pos, ','); in wpa_supplicant_ctrl_iface_set()
642 if (pos == NULL) in wpa_supplicant_ctrl_iface_set()
644 pos++; in wpa_supplicant_ctrl_iface_set()
645 vo = atoi(pos); in wpa_supplicant_ctrl_iface_set()
767 char *pos; in wpa_supplicant_ctrl_iface_set() local
771 pos = value; in wpa_supplicant_ctrl_iface_set()
772 while (pos && pos[0]) { in wpa_supplicant_ctrl_iface_set()
775 group = atoi(pos); in wpa_supplicant_ctrl_iface_set()
783 pos = os_strchr(pos, ' '); in wpa_supplicant_ctrl_iface_set()
784 if (!pos) in wpa_supplicant_ctrl_iface_set()
786 pos++; in wpa_supplicant_ctrl_iface_set()
1167 char *pos, *end; in wpa_supplicant_ctrl_iface_tdls_chan_switch() local
1177 pos = os_strchr(cmd, ' '); in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1178 if (pos == NULL) in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1180 *pos++ = '\0'; in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1182 oper_class = strtol(pos, &end, 10); in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1183 if (pos == end) { in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1189 pos = end; in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1190 freq_params.freq = atoi(pos); in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1198 const char *pos2 = os_strstr(pos, " " #str "="); \ in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1211 freq_params.ht_enabled = !!os_strstr(pos, " ht"); in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1212 freq_params.vht_enabled = !!os_strstr(pos, " vht"); in wpa_supplicant_ctrl_iface_tdls_chan_switch()
1381 char *pos; in wpa_supplicant_ctrl_iface_wps_pbc() local
1407 pos = os_strstr(cmd, " multi_ap="); in wpa_supplicant_ctrl_iface_wps_pbc()
1408 if (pos) { in wpa_supplicant_ctrl_iface_wps_pbc()
1409 pos += 10; in wpa_supplicant_ctrl_iface_wps_pbc()
1410 multi_ap = atoi(pos); in wpa_supplicant_ctrl_iface_wps_pbc()
1450 char *pos; in wpa_supplicant_ctrl_iface_wps_pin() local
1453 pos = os_strchr(pin, ' '); in wpa_supplicant_ctrl_iface_wps_pin()
1454 if (pos) { in wpa_supplicant_ctrl_iface_wps_pin()
1455 *pos++ = '\0'; in wpa_supplicant_ctrl_iface_wps_pin()
1456 timeout = atoi(pos); in wpa_supplicant_ctrl_iface_wps_pin()
1494 char *pos; in wpa_supplicant_ctrl_iface_wps_check_pin() local
1499 for (pos = cmd, len = 0; *pos != '\0'; pos++) { in wpa_supplicant_ctrl_iface_wps_check_pin()
1500 if (*pos < '0' || *pos > '9') in wpa_supplicant_ctrl_iface_wps_check_pin()
1502 pin[len++] = *pos; in wpa_supplicant_ctrl_iface_wps_check_pin()
1557 char *pos; in wpa_supplicant_ctrl_iface_wps_nfc_config_token() local
1559 pos = os_strchr(cmd, ' '); in wpa_supplicant_ctrl_iface_wps_nfc_config_token()
1560 if (pos) in wpa_supplicant_ctrl_iface_wps_nfc_config_token()
1561 *pos++ = '\0'; in wpa_supplicant_ctrl_iface_wps_nfc_config_token()
1569 buf = wpas_wps_nfc_config_token(wpa_s, ndef, pos); in wpa_supplicant_ctrl_iface_wps_nfc_config_token()
1614 struct wpa_supplicant *wpa_s, char *pos) in wpa_supplicant_ctrl_iface_wps_nfc_tag_read() argument
1622 freq = strstr(pos, " freq="); in wpa_supplicant_ctrl_iface_wps_nfc_tag_read()
1629 len = os_strlen(pos); in wpa_supplicant_ctrl_iface_wps_nfc_tag_read()
1637 if (hexstr2bin(pos, wpabuf_put(buf, len), len) < 0) { in wpa_supplicant_ctrl_iface_wps_nfc_tag_read()
1701 char *pos; in wpas_ctrl_nfc_get_handover_req() local
1704 pos = os_strchr(cmd, ' '); in wpas_ctrl_nfc_get_handover_req()
1705 if (pos == NULL) in wpas_ctrl_nfc_get_handover_req()
1707 *pos++ = '\0'; in wpas_ctrl_nfc_get_handover_req()
1716 if (os_strcmp(pos, "WPS") == 0 || os_strcmp(pos, "WPS-CR") == 0) { in wpas_ctrl_nfc_get_handover_req()
1724 if (os_strcmp(pos, "P2P-CR") == 0) { in wpas_ctrl_nfc_get_handover_req()
1784 char *pos, *pos2; in wpas_ctrl_nfc_get_handover_sel() local
1787 pos = os_strchr(cmd, ' '); in wpas_ctrl_nfc_get_handover_sel()
1788 if (pos == NULL) in wpas_ctrl_nfc_get_handover_sel()
1790 *pos++ = '\0'; in wpas_ctrl_nfc_get_handover_sel()
1799 pos2 = os_strchr(pos, ' '); in wpas_ctrl_nfc_get_handover_sel()
1802 if (os_strcmp(pos, "WPS") == 0 || os_strcmp(pos, "WPS-CR") == 0) { in wpas_ctrl_nfc_get_handover_sel()
1807 os_strcmp(pos, "WPS-CR") == 0, pos2); in wpas_ctrl_nfc_get_handover_sel()
1811 if (os_strcmp(pos, "P2P-CR") == 0) { in wpas_ctrl_nfc_get_handover_sel()
1816 if (os_strcmp(pos, "P2P-CR-TAG") == 0) { in wpas_ctrl_nfc_get_handover_sel()
1832 char *pos, *role, *type, *pos2; in wpas_ctrl_nfc_report_handover() local
1846 pos = os_strchr(role, ' '); in wpas_ctrl_nfc_report_handover()
1847 if (pos == NULL) { in wpas_ctrl_nfc_report_handover()
1851 *pos++ = '\0'; in wpas_ctrl_nfc_report_handover()
1853 type = pos; in wpas_ctrl_nfc_report_handover()
1854 pos = os_strchr(type, ' '); in wpas_ctrl_nfc_report_handover()
1855 if (pos == NULL) { in wpas_ctrl_nfc_report_handover()
1859 *pos++ = '\0'; in wpas_ctrl_nfc_report_handover()
1861 pos2 = os_strchr(pos, ' '); in wpas_ctrl_nfc_report_handover()
1868 len = os_strlen(pos); in wpas_ctrl_nfc_report_handover()
1880 if (hexstr2bin(pos, wpabuf_put(req, len), len) < 0) { in wpas_ctrl_nfc_report_handover()
2002 char *pos; in wpa_supplicant_ctrl_iface_wps_ap_pin() local
2008 pos = os_strchr(cmd, ' '); in wpa_supplicant_ctrl_iface_wps_ap_pin()
2009 if (pos) in wpa_supplicant_ctrl_iface_wps_ap_pin()
2010 *pos++ = '\0'; in wpa_supplicant_ctrl_iface_wps_ap_pin()
2018 if (pos) in wpa_supplicant_ctrl_iface_wps_ap_pin()
2019 timeout = atoi(pos); in wpa_supplicant_ctrl_iface_wps_ap_pin()
2035 if (pos == NULL) in wpa_supplicant_ctrl_iface_wps_ap_pin()
2037 pin = pos; in wpa_supplicant_ctrl_iface_wps_ap_pin()
2038 pos = os_strchr(pos, ' '); in wpa_supplicant_ctrl_iface_wps_ap_pin()
2039 if (pos) { in wpa_supplicant_ctrl_iface_wps_ap_pin()
2040 *pos++ = '\0'; in wpa_supplicant_ctrl_iface_wps_ap_pin()
2041 timeout = atoi(pos); in wpa_supplicant_ctrl_iface_wps_ap_pin()
2059 char *uuid = cmd, *pin, *pos; in wpa_supplicant_ctrl_iface_wps_er_pin() local
2065 pos = os_strchr(pin, ' '); in wpa_supplicant_ctrl_iface_wps_er_pin()
2066 if (pos) { in wpa_supplicant_ctrl_iface_wps_er_pin()
2067 *pos++ = '\0'; in wpa_supplicant_ctrl_iface_wps_er_pin()
2068 if (hwaddr_aton(pos, addr_buf) == 0) in wpa_supplicant_ctrl_iface_wps_er_pin()
2207 char *pos, *id_pos; in wpa_supplicant_ctrl_iface_ctrl_rsp() local
2211 pos = os_strchr(rsp, '-'); in wpa_supplicant_ctrl_iface_ctrl_rsp()
2212 if (pos == NULL) in wpa_supplicant_ctrl_iface_ctrl_rsp()
2214 *pos++ = '\0'; in wpa_supplicant_ctrl_iface_ctrl_rsp()
2215 id_pos = pos; in wpa_supplicant_ctrl_iface_ctrl_rsp()
2216 pos = os_strchr(pos, ':'); in wpa_supplicant_ctrl_iface_ctrl_rsp()
2217 if (pos == NULL) in wpa_supplicant_ctrl_iface_ctrl_rsp()
2219 *pos++ = '\0'; in wpa_supplicant_ctrl_iface_ctrl_rsp()
2223 (u8 *) pos, os_strlen(pos)); in wpa_supplicant_ctrl_iface_ctrl_rsp()
2233 pos); in wpa_supplicant_ctrl_iface_ctrl_rsp()
2245 char *pos, *end, tmp[30]; in wpa_supplicant_ctrl_iface_status() local
2257 pos = buf; in wpa_supplicant_ctrl_iface_status()
2261 ret = os_snprintf(pos, end - pos, "bssid=" MACSTR "\n", in wpa_supplicant_ctrl_iface_status()
2263 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2264 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2265 pos += ret; in wpa_supplicant_ctrl_iface_status()
2266 ret = os_snprintf(pos, end - pos, "freq=%u\n", in wpa_supplicant_ctrl_iface_status()
2268 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2269 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2270 pos += ret; in wpa_supplicant_ctrl_iface_status()
2283 ret = os_snprintf(pos, end - pos, "ssid=%s\nid=%d\n", in wpa_supplicant_ctrl_iface_status()
2286 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2287 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2288 pos += ret; in wpa_supplicant_ctrl_iface_status()
2294 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2297 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2298 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2299 pos += ret; in wpa_supplicant_ctrl_iface_status()
2302 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2305 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2306 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2307 pos += ret; in wpa_supplicant_ctrl_iface_status()
2312 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2316 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2320 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2324 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2328 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2333 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2340 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2341 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2342 pos += ret; in wpa_supplicant_ctrl_iface_status()
2348 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2353 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2354 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2355 pos += ret; in wpa_supplicant_ctrl_iface_status()
2360 pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, in wpa_supplicant_ctrl_iface_status()
2361 end - pos, in wpa_supplicant_ctrl_iface_status()
2365 pos += wpa_sm_get_status(wpa_s->wpa, pos, end - pos, verbose); in wpa_supplicant_ctrl_iface_status()
2374 ret = os_snprintf(pos, end - pos, "sae_group=%d\n" in wpa_supplicant_ctrl_iface_status()
2380 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2381 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2382 pos += ret; in wpa_supplicant_ctrl_iface_status()
2386 ret = os_snprintf(pos, end - pos, "wpa_state=%s\n", in wpa_supplicant_ctrl_iface_status()
2388 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2389 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2390 pos += ret; in wpa_supplicant_ctrl_iface_status()
2394 ret = os_snprintf(pos, end - pos, "ip_address=%s\n", tmp); in wpa_supplicant_ctrl_iface_status()
2395 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2396 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2397 pos += ret; in wpa_supplicant_ctrl_iface_status()
2402 ret = os_snprintf(pos, end - pos, "p2p_device_address=" MACSTR in wpa_supplicant_ctrl_iface_status()
2404 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2405 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2406 pos += ret; in wpa_supplicant_ctrl_iface_status()
2410 ret = os_snprintf(pos, end - pos, "address=" MACSTR "\n", in wpa_supplicant_ctrl_iface_status()
2412 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2413 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2414 pos += ret; in wpa_supplicant_ctrl_iface_status()
2417 ret = os_snprintf(pos, end - pos, "ap_mld_addr=" MACSTR "\n", in wpa_supplicant_ctrl_iface_status()
2419 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2420 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2421 pos += ret; in wpa_supplicant_ctrl_iface_status()
2435 ret = os_snprintf(pos, end - pos, "hs20=%d\n", release); in wpa_supplicant_ctrl_iface_status()
2436 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2437 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2438 pos += ret; in wpa_supplicant_ctrl_iface_status()
2452 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2455 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2456 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2457 pos += ret; in wpa_supplicant_ctrl_iface_status()
2476 ret = os_snprintf(pos, end - pos, "home_sp=%s\n", in wpa_supplicant_ctrl_iface_status()
2478 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2479 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2480 pos += ret; in wpa_supplicant_ctrl_iface_status()
2497 ret = os_snprintf(pos, end - pos, "sp_type=%s\n", type); in wpa_supplicant_ctrl_iface_status()
2498 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2499 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2500 pos += ret; in wpa_supplicant_ctrl_iface_status()
2509 res = eapol_sm_get_status(wpa_s->eapol, pos, end - pos, in wpa_supplicant_ctrl_iface_status()
2512 pos += res; in wpa_supplicant_ctrl_iface_status()
2516 res = ieee802_1x_kay_get_status(wpa_s->kay, pos, end - pos); in wpa_supplicant_ctrl_iface_status()
2518 pos += res; in wpa_supplicant_ctrl_iface_status()
2523 char *start = pos; in wpa_supplicant_ctrl_iface_status()
2525 ret = os_snprintf(pos, end - pos, "eap_session_id="); in wpa_supplicant_ctrl_iface_status()
2526 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2528 pos += ret; in wpa_supplicant_ctrl_iface_status()
2529 ret = wpa_snprintf_hex(pos, end - pos, sess_id, sess_id_len); in wpa_supplicant_ctrl_iface_status()
2532 pos += ret; in wpa_supplicant_ctrl_iface_status()
2533 ret = os_snprintf(pos, end - pos, "\n"); in wpa_supplicant_ctrl_iface_status()
2534 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2536 pos += ret; in wpa_supplicant_ctrl_iface_status()
2539 res = rsn_preauth_get_status(wpa_s->wpa, pos, end - pos, verbose); in wpa_supplicant_ctrl_iface_status()
2541 pos += res; in wpa_supplicant_ctrl_iface_status()
2547 ret = os_snprintf(pos, end - pos, "uuid=%s\n", uuid_str); in wpa_supplicant_ctrl_iface_status()
2548 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2549 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2550 pos += ret; in wpa_supplicant_ctrl_iface_status()
2555 ret = os_snprintf(pos, end - pos, "ieee80211ac=1\n"); in wpa_supplicant_ctrl_iface_status()
2556 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2557 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2558 pos += ret; in wpa_supplicant_ctrl_iface_status()
2563 ret = os_snprintf(pos, end - pos, "bss_max_idle_period=%d\n", in wpa_supplicant_ctrl_iface_status()
2565 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2566 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2567 pos += ret; in wpa_supplicant_ctrl_iface_status()
2572 ret = os_snprintf(pos, end - pos, "ssid_verified=1\n"); in wpa_supplicant_ctrl_iface_status()
2573 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2574 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2575 pos += ret; in wpa_supplicant_ctrl_iface_status()
2579 ret = os_snprintf(pos, end - pos, "bigtk_set=1\n"); in wpa_supplicant_ctrl_iface_status()
2580 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_status()
2581 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2582 pos += ret; in wpa_supplicant_ctrl_iface_status()
2621 return pos - buf; in wpa_supplicant_ctrl_iface_status()
2628 char *pos; in wpa_supplicant_ctrl_iface_bssid() local
2634 pos = os_strchr(cmd, ' '); in wpa_supplicant_ctrl_iface_bssid()
2635 if (pos == NULL) in wpa_supplicant_ctrl_iface_bssid()
2637 *pos++ = '\0'; in wpa_supplicant_ctrl_iface_bssid()
2639 wpa_printf(MSG_DEBUG, "CTRL_IFACE: id=%d bssid='%s'", id, pos); in wpa_supplicant_ctrl_iface_bssid()
2640 if (hwaddr_aton(pos, bssid)) { in wpa_supplicant_ctrl_iface_bssid()
2641 wpa_printf(MSG_DEBUG ,"CTRL_IFACE: invalid BSSID '%s'", pos); in wpa_supplicant_ctrl_iface_bssid()
2665 char *pos, *end; in wpa_supplicant_ctrl_iface_bssid_ignore() local
2670 pos = buf; in wpa_supplicant_ctrl_iface_bssid_ignore()
2674 ret = os_snprintf(pos, end - pos, MACSTR "\n", in wpa_supplicant_ctrl_iface_bssid_ignore()
2676 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_bssid_ignore()
2677 return pos - buf; in wpa_supplicant_ctrl_iface_bssid_ignore()
2678 pos += ret; in wpa_supplicant_ctrl_iface_bssid_ignore()
2681 return pos - buf; in wpa_supplicant_ctrl_iface_bssid_ignore()
2716 char *pos, *end, *stamp; in wpa_supplicant_ctrl_iface_log_level() local
2721 pos = buf; in wpa_supplicant_ctrl_iface_log_level()
2723 ret = os_snprintf(pos, end - pos, "Current level: %s\n" in wpa_supplicant_ctrl_iface_log_level()
2727 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_log_level()
2762 char *pos, *end, *prev; in wpa_supplicant_ctrl_iface_list_networks() local
2766 pos = buf; in wpa_supplicant_ctrl_iface_list_networks()
2768 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_list_networks()
2770 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_networks()
2771 return pos - buf; in wpa_supplicant_ctrl_iface_list_networks()
2772 pos += ret; in wpa_supplicant_ctrl_iface_list_networks()
2787 prev = pos; in wpa_supplicant_ctrl_iface_list_networks()
2788 ret = os_snprintf(pos, end - pos, "%d\t%s", in wpa_supplicant_ctrl_iface_list_networks()
2791 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_networks()
2793 pos += ret; in wpa_supplicant_ctrl_iface_list_networks()
2795 ret = os_snprintf(pos, end - pos, "\t" MACSTR, in wpa_supplicant_ctrl_iface_list_networks()
2798 ret = os_snprintf(pos, end - pos, "\tany"); in wpa_supplicant_ctrl_iface_list_networks()
2800 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_networks()
2802 pos += ret; in wpa_supplicant_ctrl_iface_list_networks()
2803 ret = os_snprintf(pos, end - pos, "\t%s%s%s%s", in wpa_supplicant_ctrl_iface_list_networks()
2811 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_networks()
2813 pos += ret; in wpa_supplicant_ctrl_iface_list_networks()
2814 ret = os_snprintf(pos, end - pos, "\n"); in wpa_supplicant_ctrl_iface_list_networks()
2815 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_networks()
2817 pos += ret; in wpa_supplicant_ctrl_iface_list_networks()
2822 return pos - buf; in wpa_supplicant_ctrl_iface_list_networks()
2826 static char * wpa_supplicant_cipher_txt(char *pos, char *end, int cipher) in wpa_supplicant_cipher_txt() argument
2829 ret = os_snprintf(pos, end - pos, "-"); in wpa_supplicant_cipher_txt()
2830 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_cipher_txt()
2831 return pos; in wpa_supplicant_cipher_txt()
2832 pos += ret; in wpa_supplicant_cipher_txt()
2833 ret = wpa_write_ciphers(pos, end, cipher, "+"); in wpa_supplicant_cipher_txt()
2835 return pos; in wpa_supplicant_cipher_txt()
2836 pos += ret; in wpa_supplicant_cipher_txt()
2837 return pos; in wpa_supplicant_cipher_txt()
2841 static char * wpa_supplicant_ie_txt(char *pos, char *end, const char *proto, in wpa_supplicant_ie_txt() argument
2848 ret = os_snprintf(pos, end - pos, "[%s-", proto); in wpa_supplicant_ie_txt()
2849 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2850 return pos; in wpa_supplicant_ie_txt()
2851 pos += ret; in wpa_supplicant_ie_txt()
2854 ret = os_snprintf(pos, end - pos, "?]"); in wpa_supplicant_ie_txt()
2855 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2856 return pos; in wpa_supplicant_ie_txt()
2857 pos += ret; in wpa_supplicant_ie_txt()
2858 return pos; in wpa_supplicant_ie_txt()
2861 start = pos; in wpa_supplicant_ie_txt()
2863 ret = os_snprintf(pos, end - pos, "%sEAP", in wpa_supplicant_ie_txt()
2864 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2865 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2866 return pos; in wpa_supplicant_ie_txt()
2867 pos += ret; in wpa_supplicant_ie_txt()
2870 ret = os_snprintf(pos, end - pos, "%sPSK", in wpa_supplicant_ie_txt()
2871 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2872 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2873 return pos; in wpa_supplicant_ie_txt()
2874 pos += ret; in wpa_supplicant_ie_txt()
2877 ret = os_snprintf(pos, end - pos, "%sNone", in wpa_supplicant_ie_txt()
2878 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2879 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2880 return pos; in wpa_supplicant_ie_txt()
2881 pos += ret; in wpa_supplicant_ie_txt()
2884 ret = os_snprintf(pos, end - pos, "%sSAE", in wpa_supplicant_ie_txt()
2885 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2886 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2887 return pos; in wpa_supplicant_ie_txt()
2888 pos += ret; in wpa_supplicant_ie_txt()
2891 ret = os_snprintf(pos, end - pos, "%sSAE-EXT-KEY", in wpa_supplicant_ie_txt()
2892 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2893 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2894 return pos; in wpa_supplicant_ie_txt()
2895 pos += ret; in wpa_supplicant_ie_txt()
2899 ret = os_snprintf(pos, end - pos, "%sFT/EAP", in wpa_supplicant_ie_txt()
2900 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2901 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2902 return pos; in wpa_supplicant_ie_txt()
2903 pos += ret; in wpa_supplicant_ie_txt()
2906 ret = os_snprintf(pos, end - pos, "%sFT/PSK", in wpa_supplicant_ie_txt()
2907 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2908 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2909 return pos; in wpa_supplicant_ie_txt()
2910 pos += ret; in wpa_supplicant_ie_txt()
2913 ret = os_snprintf(pos, end - pos, "%sFT/SAE", in wpa_supplicant_ie_txt()
2914 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2915 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2916 return pos; in wpa_supplicant_ie_txt()
2917 pos += ret; in wpa_supplicant_ie_txt()
2920 ret = os_snprintf(pos, end - pos, "%sFT/SAE-EXT-KEY", in wpa_supplicant_ie_txt()
2921 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2922 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2923 return pos; in wpa_supplicant_ie_txt()
2924 pos += ret; in wpa_supplicant_ie_txt()
2928 ret = os_snprintf(pos, end - pos, "%sEAP-SHA256", in wpa_supplicant_ie_txt()
2929 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2930 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2931 return pos; in wpa_supplicant_ie_txt()
2932 pos += ret; in wpa_supplicant_ie_txt()
2935 ret = os_snprintf(pos, end - pos, "%sPSK-SHA256", in wpa_supplicant_ie_txt()
2936 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2937 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2938 return pos; in wpa_supplicant_ie_txt()
2939 pos += ret; in wpa_supplicant_ie_txt()
2944 ret = os_snprintf(pos, end - pos, "%sEAP-SUITE-B", in wpa_supplicant_ie_txt()
2945 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2946 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2947 return pos; in wpa_supplicant_ie_txt()
2948 pos += ret; in wpa_supplicant_ie_txt()
2954 ret = os_snprintf(pos, end - pos, "%sEAP-SUITE-B-192", in wpa_supplicant_ie_txt()
2955 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2956 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2957 return pos; in wpa_supplicant_ie_txt()
2958 pos += ret; in wpa_supplicant_ie_txt()
2964 ret = os_snprintf(pos, end - pos, "%sFILS-SHA256", in wpa_supplicant_ie_txt()
2965 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2966 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2967 return pos; in wpa_supplicant_ie_txt()
2968 pos += ret; in wpa_supplicant_ie_txt()
2971 ret = os_snprintf(pos, end - pos, "%sFILS-SHA384", in wpa_supplicant_ie_txt()
2972 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2973 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2974 return pos; in wpa_supplicant_ie_txt()
2975 pos += ret; in wpa_supplicant_ie_txt()
2979 ret = os_snprintf(pos, end - pos, "%sFT-FILS-SHA256", in wpa_supplicant_ie_txt()
2980 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2981 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2982 return pos; in wpa_supplicant_ie_txt()
2983 pos += ret; in wpa_supplicant_ie_txt()
2986 ret = os_snprintf(pos, end - pos, "%sFT-FILS-SHA384", in wpa_supplicant_ie_txt()
2987 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2988 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
2989 return pos; in wpa_supplicant_ie_txt()
2990 pos += ret; in wpa_supplicant_ie_txt()
2997 ret = os_snprintf(pos, end - pos, "%sOWE", in wpa_supplicant_ie_txt()
2998 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
2999 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
3000 return pos; in wpa_supplicant_ie_txt()
3001 pos += ret; in wpa_supplicant_ie_txt()
3007 ret = os_snprintf(pos, end - pos, "%sDPP", in wpa_supplicant_ie_txt()
3008 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
3009 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
3010 return pos; in wpa_supplicant_ie_txt()
3011 pos += ret; in wpa_supplicant_ie_txt()
3016 ret = os_snprintf(pos, end - pos, "%sOSEN", in wpa_supplicant_ie_txt()
3017 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
3018 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
3019 return pos; in wpa_supplicant_ie_txt()
3020 pos += ret; in wpa_supplicant_ie_txt()
3025 ret = os_snprintf(pos, end - pos, "%sEAP-SHA384", in wpa_supplicant_ie_txt()
3026 pos == start ? "" : "+"); in wpa_supplicant_ie_txt()
3027 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
3028 return pos; in wpa_supplicant_ie_txt()
3029 pos += ret; in wpa_supplicant_ie_txt()
3033 pos = wpa_supplicant_cipher_txt(pos, end, data.pairwise_cipher); in wpa_supplicant_ie_txt()
3036 ret = os_snprintf(pos, end - pos, "-preauth"); in wpa_supplicant_ie_txt()
3037 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
3038 return pos; in wpa_supplicant_ie_txt()
3039 pos += ret; in wpa_supplicant_ie_txt()
3042 ret = os_snprintf(pos, end - pos, "]"); in wpa_supplicant_ie_txt()
3043 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ie_txt()
3044 return pos; in wpa_supplicant_ie_txt()
3045 pos += ret; in wpa_supplicant_ie_txt()
3047 return pos; in wpa_supplicant_ie_txt()
3053 char *pos, char *end, in wpa_supplicant_wps_ie_txt_buf() argument
3060 return pos; in wpa_supplicant_wps_ie_txt_buf()
3070 ret = os_snprintf(pos, end - pos, "%s", txt); in wpa_supplicant_wps_ie_txt_buf()
3071 if (!os_snprintf_error(end - pos, ret)) in wpa_supplicant_wps_ie_txt_buf()
3072 pos += ret; in wpa_supplicant_wps_ie_txt_buf()
3074 return pos; in wpa_supplicant_wps_ie_txt_buf()
3080 char *pos, char *end, in wpa_supplicant_wps_ie_txt() argument
3086 return wpa_supplicant_wps_ie_txt_buf(wpa_s, pos, end, wps_ie); in wpa_supplicant_wps_ie_txt()
3088 return pos; in wpa_supplicant_wps_ie_txt()
3098 char *pos, *end; in wpa_supplicant_ctrl_iface_scan_result() local
3111 pos = buf; in wpa_supplicant_ctrl_iface_scan_result()
3114 ret = os_snprintf(pos, end - pos, MACSTR "\t%d\t%d\t", in wpa_supplicant_ctrl_iface_scan_result()
3116 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3118 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3121 pos = wpa_supplicant_ie_txt(pos, end, "WPA", ie, 2 + ie[1]); in wpa_supplicant_ctrl_iface_scan_result()
3124 pos = wpa_supplicant_ie_txt(pos, end, mesh ? "RSN" : "WPA2", in wpa_supplicant_ctrl_iface_scan_result()
3129 ret = os_snprintf(pos, end - pos, "[SAE-H2E]"); in wpa_supplicant_ctrl_iface_scan_result()
3130 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3132 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3135 ret = os_snprintf(pos, end - pos, "[SAE-PK]"); in wpa_supplicant_ctrl_iface_scan_result()
3136 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3138 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3142 pos = wpa_supplicant_ie_txt(pos, end, "OSEN", in wpa_supplicant_ctrl_iface_scan_result()
3146 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_scan_result()
3148 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3150 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3152 pos = wpa_supplicant_wps_ie_txt(wpa_s, pos, end, bss); in wpa_supplicant_ctrl_iface_scan_result()
3154 ret = os_snprintf(pos, end - pos, "[WEP]"); in wpa_supplicant_ctrl_iface_scan_result()
3155 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3157 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3160 ret = os_snprintf(pos, end - pos, "[MESH]"); in wpa_supplicant_ctrl_iface_scan_result()
3161 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3163 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3169 ret = os_snprintf(pos, end - pos, "[EDMG]"); in wpa_supplicant_ctrl_iface_scan_result()
3170 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3172 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3175 ret = os_snprintf(pos, end - pos, "[DMG]"); in wpa_supplicant_ctrl_iface_scan_result()
3176 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3178 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3193 ret = os_snprintf(pos, end - pos, "%s", s); in wpa_supplicant_ctrl_iface_scan_result()
3194 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3196 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3199 ret = os_snprintf(pos, end - pos, "[IBSS]"); in wpa_supplicant_ctrl_iface_scan_result()
3200 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3202 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3205 ret = os_snprintf(pos, end - pos, "[ESS]"); in wpa_supplicant_ctrl_iface_scan_result()
3206 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3208 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3212 ret = os_snprintf(pos, end - pos, "[P2P]"); in wpa_supplicant_ctrl_iface_scan_result()
3213 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3215 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3219 ret = os_snprintf(pos, end - pos, "[HS20]"); in wpa_supplicant_ctrl_iface_scan_result()
3220 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3222 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3227 ret = os_snprintf(pos, end - pos, "[FILS]"); in wpa_supplicant_ctrl_iface_scan_result()
3228 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3230 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3235 ret = os_snprintf(pos, end - pos, "[FST]"); in wpa_supplicant_ctrl_iface_scan_result()
3236 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3238 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3242 ret = os_snprintf(pos, end - pos, "[UTF-8]"); in wpa_supplicant_ctrl_iface_scan_result()
3243 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3245 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3248 ret = os_snprintf(pos, end - pos, "\t%s", in wpa_supplicant_ctrl_iface_scan_result()
3250 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3252 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3254 ret = os_snprintf(pos, end - pos, "\n"); in wpa_supplicant_ctrl_iface_scan_result()
3255 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_result()
3257 pos += ret; in wpa_supplicant_ctrl_iface_scan_result()
3259 return pos - buf; in wpa_supplicant_ctrl_iface_scan_result()
3266 char *pos, *end; in wpa_supplicant_ctrl_iface_scan_results() local
3270 pos = buf; in wpa_supplicant_ctrl_iface_scan_results()
3272 ret = os_snprintf(pos, end - pos, "bssid / frequency / signal level / " in wpa_supplicant_ctrl_iface_scan_results()
3274 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_scan_results()
3275 return pos - buf; in wpa_supplicant_ctrl_iface_scan_results()
3276 pos += ret; in wpa_supplicant_ctrl_iface_scan_results()
3279 ret = wpa_supplicant_ctrl_iface_scan_result(wpa_s, bss, pos, in wpa_supplicant_ctrl_iface_scan_results()
3280 end - pos); in wpa_supplicant_ctrl_iface_scan_results()
3281 if (ret < 0 || ret >= end - pos) in wpa_supplicant_ctrl_iface_scan_results()
3282 return pos - buf; in wpa_supplicant_ctrl_iface_scan_results()
3283 pos += ret; in wpa_supplicant_ctrl_iface_scan_results()
3286 return pos - buf; in wpa_supplicant_ctrl_iface_scan_results()
3295 char *pos, ifname[IFNAMSIZ + 1]; in wpa_supplicant_ctrl_iface_mesh_interface_add() local
3299 pos = os_strstr(cmd, "ifname="); in wpa_supplicant_ctrl_iface_mesh_interface_add()
3300 if (pos) { in wpa_supplicant_ctrl_iface_mesh_interface_add()
3301 pos += 7; in wpa_supplicant_ctrl_iface_mesh_interface_add()
3302 os_strlcpy(ifname, pos, sizeof(ifname)); in wpa_supplicant_ctrl_iface_mesh_interface_add()
3416 char *pos; in wpa_supplicant_ctrl_iface_mesh_peer_add() local
3418 pos = os_strstr(cmd, " duration="); in wpa_supplicant_ctrl_iface_mesh_peer_add()
3419 if (pos) { in wpa_supplicant_ctrl_iface_mesh_peer_add()
3420 *pos = '\0'; in wpa_supplicant_ctrl_iface_mesh_peer_add()
3421 duration = atoi(pos + 10); in wpa_supplicant_ctrl_iface_mesh_peer_add()
3439 char *pos; in wpa_supplicant_ctrl_iface_mesh_link_probe() local
3446 pos = os_strstr(cmd, " payload="); in wpa_supplicant_ctrl_iface_mesh_link_probe()
3447 if (pos) { in wpa_supplicant_ctrl_iface_mesh_link_probe()
3448 pos = pos + 9; in wpa_supplicant_ctrl_iface_mesh_link_probe()
3449 payload_len = os_strlen(pos); in wpa_supplicant_ctrl_iface_mesh_link_probe()
3466 if (payload_len && hexstr2bin(pos, buf + ETH_HLEN, payload_len) < 0) in wpa_supplicant_ctrl_iface_mesh_link_probe()
3483 char *pos; in wpa_supplicant_ctrl_iface_select_network() local
3506 pos = os_strstr(cmd, " freq="); in wpa_supplicant_ctrl_iface_select_network()
3507 if (pos) { in wpa_supplicant_ctrl_iface_select_network()
3508 int *freqs = freq_range_to_channel_list(wpa_s, pos + 6); in wpa_supplicant_ctrl_iface_select_network()
3853 char *pos, *end; in wpa_supplicant_ctrl_iface_list_creds() local
3857 pos = buf; in wpa_supplicant_ctrl_iface_list_creds()
3859 ret = os_snprintf(pos, end - pos, in wpa_supplicant_ctrl_iface_list_creds()
3861 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_creds()
3862 return pos - buf; in wpa_supplicant_ctrl_iface_list_creds()
3863 pos += ret; in wpa_supplicant_ctrl_iface_list_creds()
3867 ret = os_snprintf(pos, end - pos, "%d\t%s\t%s\t%s\t%s\n", in wpa_supplicant_ctrl_iface_list_creds()
3872 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_ctrl_iface_list_creds()
3873 return pos - buf; in wpa_supplicant_ctrl_iface_list_creds()
3874 pos += ret; in wpa_supplicant_ctrl_iface_list_creds()
3879 return pos - buf; in wpa_supplicant_ctrl_iface_list_creds()
4107 char *pos, *end; in ctrl_iface_get_capability_pairwise() local
4111 pos = buf; in ctrl_iface_get_capability_pairwise()
4112 end = pos + buflen; in ctrl_iface_get_capability_pairwise()
4129 ret = os_snprintf(pos, end - pos, "%s%s", in ctrl_iface_get_capability_pairwise()
4130 pos == buf ? "" : " ", in ctrl_iface_get_capability_pairwise()
4132 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_pairwise()
4133 return pos - buf; in ctrl_iface_get_capability_pairwise()
4134 pos += ret; in ctrl_iface_get_capability_pairwise()
4138 return pos - buf; in ctrl_iface_get_capability_pairwise()
4147 char *pos, *end; in ctrl_iface_get_capability_group() local
4151 pos = buf; in ctrl_iface_get_capability_group()
4152 end = pos + buflen; in ctrl_iface_get_capability_group()
4177 ret = os_snprintf(pos, end - pos, "%s%s", in ctrl_iface_get_capability_group()
4178 pos == buf ? "" : " ", in ctrl_iface_get_capability_group()
4180 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_group()
4181 return pos - buf; in ctrl_iface_get_capability_group()
4182 pos += ret; in ctrl_iface_get_capability_group()
4186 return pos - buf; in ctrl_iface_get_capability_group()
4195 char *pos, *end; in ctrl_iface_get_capability_group_mgmt() local
4198 pos = buf; in ctrl_iface_get_capability_group_mgmt()
4199 end = pos + buflen; in ctrl_iface_get_capability_group_mgmt()
4206 ret = os_snprintf(pos, end - pos, "%s%s", in ctrl_iface_get_capability_group_mgmt()
4207 pos == buf ? "" : " ", in ctrl_iface_get_capability_group_mgmt()
4209 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_group_mgmt()
4210 return pos - buf; in ctrl_iface_get_capability_group_mgmt()
4211 pos += ret; in ctrl_iface_get_capability_group_mgmt()
4215 return pos - buf; in ctrl_iface_get_capability_group_mgmt()
4262 char *pos, *end; in ctrl_iface_get_capability_key_mgmt() local
4265 pos = buf; in ctrl_iface_get_capability_key_mgmt()
4266 end = pos + buflen; in ctrl_iface_get_capability_key_mgmt()
4289 ret = os_snprintf(pos, end - pos, "NONE IEEE8021X"); in ctrl_iface_get_capability_key_mgmt()
4290 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4291 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4292 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4296 ret = os_snprintf(pos, end - pos, " WPA-EAP"); in ctrl_iface_get_capability_key_mgmt()
4297 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4298 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4299 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4304 ret = os_snprintf(pos, end - pos, " WPA-PSK"); in ctrl_iface_get_capability_key_mgmt()
4305 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4306 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4307 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4311 ret = os_snprintf(pos, end - pos, " WPA-NONE"); in ctrl_iface_get_capability_key_mgmt()
4312 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4313 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4314 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4318 ret = os_snprintf(pos, end - pos, " WAPI-PSK"); in ctrl_iface_get_capability_key_mgmt()
4319 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4320 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4321 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4325 ret = os_snprintf(pos, end - pos, " TPK-HANDSHAKE"); in ctrl_iface_get_capability_key_mgmt()
4326 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4327 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4328 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4332 ret = os_snprintf(pos, end - pos, " CCKM"); in ctrl_iface_get_capability_key_mgmt()
4333 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4334 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4335 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4340 ret = os_snprintf(pos, end - pos, " WPA-EAP-SUITE-B"); in ctrl_iface_get_capability_key_mgmt()
4341 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4342 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4343 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4348 ret = os_snprintf(pos, end - pos, " WPA-EAP-SUITE-B-192"); in ctrl_iface_get_capability_key_mgmt()
4349 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4350 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4351 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4356 ret = os_snprintf(pos, end - pos, " OWE"); in ctrl_iface_get_capability_key_mgmt()
4357 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4358 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4359 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4364 ret = os_snprintf(pos, end - pos, " DPP"); in ctrl_iface_get_capability_key_mgmt()
4365 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4366 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4367 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4372 ret = os_snprintf(pos, end - pos, " FILS-SHA256"); in ctrl_iface_get_capability_key_mgmt()
4373 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4374 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4375 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4378 ret = os_snprintf(pos, end - pos, " FILS-SHA384"); in ctrl_iface_get_capability_key_mgmt()
4379 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4380 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4381 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4385 ret = os_snprintf(pos, end - pos, " FT-FILS-SHA256"); in ctrl_iface_get_capability_key_mgmt()
4386 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4387 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4388 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4391 ret = os_snprintf(pos, end - pos, " FT-FILS-SHA384"); in ctrl_iface_get_capability_key_mgmt()
4392 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4393 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4394 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4400 ret = os_snprintf(pos, end - pos, " FT-PSK"); in ctrl_iface_get_capability_key_mgmt()
4401 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4402 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4403 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4406 ret = os_snprintf(pos, end - pos, " FT-EAP"); in ctrl_iface_get_capability_key_mgmt()
4407 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4408 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4409 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4413 ret = os_snprintf(pos, end - pos, " FT-SAE"); in ctrl_iface_get_capability_key_mgmt()
4414 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4415 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4416 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4419 ret = os_snprintf(pos, end - pos, " FT-SAE-EXT-KEY"); in ctrl_iface_get_capability_key_mgmt()
4420 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4421 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4422 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4427 ret = os_snprintf(pos, end - pos, " FT-EAP-SHA384"); in ctrl_iface_get_capability_key_mgmt()
4428 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4429 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4430 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4436 ret = os_snprintf(pos, end - pos, " SAE"); in ctrl_iface_get_capability_key_mgmt()
4437 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4438 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4439 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4442 ret = os_snprintf(pos, end - pos, " SAE-EXT-KEY"); in ctrl_iface_get_capability_key_mgmt()
4443 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4444 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4445 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4450 ret = os_snprintf(pos, end - pos, " WPA-EAP-SHA256"); in ctrl_iface_get_capability_key_mgmt()
4451 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4452 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4453 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4457 ret = os_snprintf(pos, end - pos, " WPA-PSK-SHA256"); in ctrl_iface_get_capability_key_mgmt()
4458 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4459 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4460 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4465 ret = os_snprintf(pos, end - pos, " OSEN"); in ctrl_iface_get_capability_key_mgmt()
4466 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_key_mgmt()
4467 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4468 pos += ret; in ctrl_iface_get_capability_key_mgmt()
4472 return pos - buf; in ctrl_iface_get_capability_key_mgmt()
4481 char *pos, *end; in ctrl_iface_get_capability_proto() local
4484 pos = buf; in ctrl_iface_get_capability_proto()
4485 end = pos + buflen; in ctrl_iface_get_capability_proto()
4498 ret = os_snprintf(pos, end - pos, "%sRSN", in ctrl_iface_get_capability_proto()
4499 pos == buf ? "" : " "); in ctrl_iface_get_capability_proto()
4500 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_proto()
4501 return pos - buf; in ctrl_iface_get_capability_proto()
4502 pos += ret; in ctrl_iface_get_capability_proto()
4507 ret = os_snprintf(pos, end - pos, "%sWPA", in ctrl_iface_get_capability_proto()
4508 pos == buf ? "" : " "); in ctrl_iface_get_capability_proto()
4509 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_proto()
4510 return pos - buf; in ctrl_iface_get_capability_proto()
4511 pos += ret; in ctrl_iface_get_capability_proto()
4514 return pos - buf; in ctrl_iface_get_capability_proto()
4524 char *pos, *end; in ctrl_iface_get_capability_auth_alg() local
4527 pos = buf; in ctrl_iface_get_capability_auth_alg()
4528 end = pos + buflen; in ctrl_iface_get_capability_auth_alg()
4540 ret = os_snprintf(pos, end - pos, "%sOPEN", in ctrl_iface_get_capability_auth_alg()
4541 pos == buf ? "" : " "); in ctrl_iface_get_capability_auth_alg()
4542 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4543 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4544 pos += ret; in ctrl_iface_get_capability_auth_alg()
4548 ret = os_snprintf(pos, end - pos, "%sSHARED", in ctrl_iface_get_capability_auth_alg()
4549 pos == buf ? "" : " "); in ctrl_iface_get_capability_auth_alg()
4550 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4551 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4552 pos += ret; in ctrl_iface_get_capability_auth_alg()
4556 ret = os_snprintf(pos, end - pos, "%sLEAP", in ctrl_iface_get_capability_auth_alg()
4557 pos == buf ? "" : " "); in ctrl_iface_get_capability_auth_alg()
4558 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4559 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4560 pos += ret; in ctrl_iface_get_capability_auth_alg()
4565 ret = os_snprintf(pos, end - pos, "%sSAE", in ctrl_iface_get_capability_auth_alg()
4566 pos == buf ? "" : " "); in ctrl_iface_get_capability_auth_alg()
4567 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4568 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4569 pos += ret; in ctrl_iface_get_capability_auth_alg()
4575 ret = os_snprintf(pos, end - pos, "%sFILS_SK_WITHOUT_PFS", in ctrl_iface_get_capability_auth_alg()
4576 pos == buf ? "" : " "); in ctrl_iface_get_capability_auth_alg()
4577 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4578 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4579 pos += ret; in ctrl_iface_get_capability_auth_alg()
4584 ret = os_snprintf(pos, end - pos, "%sFILS_SK_WITH_PFS", in ctrl_iface_get_capability_auth_alg()
4585 pos == buf ? "" : " "); in ctrl_iface_get_capability_auth_alg()
4586 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4587 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4588 pos += ret; in ctrl_iface_get_capability_auth_alg()
4594 ret = os_snprintf(pos, end - pos, "%sPASN", in ctrl_iface_get_capability_auth_alg()
4595 pos == buf ? "" : " "); in ctrl_iface_get_capability_auth_alg()
4596 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_auth_alg()
4597 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4598 pos += ret; in ctrl_iface_get_capability_auth_alg()
4602 return pos - buf; in ctrl_iface_get_capability_auth_alg()
4611 char *pos, *end; in ctrl_iface_get_capability_modes() local
4614 pos = buf; in ctrl_iface_get_capability_modes()
4615 end = pos + buflen; in ctrl_iface_get_capability_modes()
4627 ret = os_snprintf(pos, end - pos, "%sIBSS", in ctrl_iface_get_capability_modes()
4628 pos == buf ? "" : " "); in ctrl_iface_get_capability_modes()
4629 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_modes()
4630 return pos - buf; in ctrl_iface_get_capability_modes()
4631 pos += ret; in ctrl_iface_get_capability_modes()
4635 ret = os_snprintf(pos, end - pos, "%sAP", in ctrl_iface_get_capability_modes()
4636 pos == buf ? "" : " "); in ctrl_iface_get_capability_modes()
4637 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_modes()
4638 return pos - buf; in ctrl_iface_get_capability_modes()
4639 pos += ret; in ctrl_iface_get_capability_modes()
4644 ret = os_snprintf(pos, end - pos, "%sMESH", in ctrl_iface_get_capability_modes()
4645 pos == buf ? "" : " "); in ctrl_iface_get_capability_modes()
4646 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_modes()
4647 return pos - buf; in ctrl_iface_get_capability_modes()
4648 pos += ret; in ctrl_iface_get_capability_modes()
4652 return pos - buf; in ctrl_iface_get_capability_modes()
4661 char *pos, *end, *hmode; in ctrl_iface_get_capability_channels() local
4663 pos = buf; in ctrl_iface_get_capability_channels()
4664 end = pos + buflen; in ctrl_iface_get_capability_channels()
4683 ret = os_snprintf(pos, end - pos, "Mode[%s] Channels:", hmode); in ctrl_iface_get_capability_channels()
4684 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_channels()
4685 return pos - buf; in ctrl_iface_get_capability_channels()
4686 pos += ret; in ctrl_iface_get_capability_channels()
4691 ret = os_snprintf(pos, end - pos, " %d", chnl[i].chan); in ctrl_iface_get_capability_channels()
4692 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_channels()
4693 return pos - buf; in ctrl_iface_get_capability_channels()
4694 pos += ret; in ctrl_iface_get_capability_channels()
4696 ret = os_snprintf(pos, end - pos, "\n"); in ctrl_iface_get_capability_channels()
4697 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_channels()
4698 return pos - buf; in ctrl_iface_get_capability_channels()
4699 pos += ret; in ctrl_iface_get_capability_channels()
4702 return pos - buf; in ctrl_iface_get_capability_channels()
4711 char *pos, *end, *hmode; in ctrl_iface_get_capability_freq() local
4713 pos = buf; in ctrl_iface_get_capability_freq()
4714 end = pos + buflen; in ctrl_iface_get_capability_freq()
4733 ret = os_snprintf(pos, end - pos, "Mode[%s] Channels:\n", in ctrl_iface_get_capability_freq()
4735 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_freq()
4736 return pos - buf; in ctrl_iface_get_capability_freq()
4737 pos += ret; in ctrl_iface_get_capability_freq()
4742 ret = os_snprintf(pos, end - pos, " %d = %d MHz%s%s\n", in ctrl_iface_get_capability_freq()
4749 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_freq()
4750 return pos - buf; in ctrl_iface_get_capability_freq()
4751 pos += ret; in ctrl_iface_get_capability_freq()
4753 ret = os_snprintf(pos, end - pos, "\n"); in ctrl_iface_get_capability_freq()
4754 if (os_snprintf_error(end - pos, ret)) in ctrl_iface_get_capability_freq()
4755 return pos - buf; in ctrl_iface_get_capability_freq()
4756 pos += ret; in ctrl_iface_get_capability_freq()
4759 return pos - buf; in ctrl_iface_get_capability_freq()
4971 static char * anqp_add_hex(char *pos, char *end, const char *title, in anqp_add_hex() argument
4974 char *start = pos; in anqp_add_hex()
4982 ret = os_snprintf(pos, end - pos, "%s=", title); in anqp_add_hex()
4983 if (os_snprintf_error(end - pos, ret)) in anqp_add_hex()
4985 pos += ret; in anqp_add_hex()
4989 ret = os_snprintf(pos, end - pos, "%02x", *d++); in anqp_add_hex()
4990 if (os_snprintf_error(end - pos, ret)) in anqp_add_hex()
4992 pos += ret; in anqp_add_hex()
4995 ret = os_snprintf(pos, end - pos, "\n"); in anqp_add_hex()
4996 if (os_snprintf_error(end - pos, ret)) in anqp_add_hex()
4998 pos += ret; in anqp_add_hex()
5000 return pos; in anqp_add_hex()
5006 static int print_fils_indication(struct wpa_bss *bss, char *pos, char *end) in print_fils_indication() argument
5008 char *start = pos; in print_fils_indication()
5023 ret = os_snprintf(pos, end - pos, "fils_info=%04x\n", info); in print_fils_indication()
5024 if (os_snprintf_error(end - pos, ret)) in print_fils_indication()
5026 pos += ret; in print_fils_indication()
5032 ret = os_snprintf(pos, end - pos, "fils_cache_id=%02x%02x\n", in print_fils_indication()
5034 if (os_snprintf_error(end - pos, ret)) in print_fils_indication()
5036 pos += ret; in print_fils_indication()
5044 ret = os_snprintf(pos, end - pos, "fils_hessid=" MACSTR "\n", in print_fils_indication()
5046 if (os_snprintf_error(end - pos, ret)) in print_fils_indication()
5048 pos += ret; in print_fils_indication()
5056 ret = os_snprintf(pos, end - pos, "fils_realms="); in print_fils_indication()
5057 if (os_snprintf_error(end - pos, ret)) in print_fils_indication()
5059 pos += ret; in print_fils_indication()
5061 ret = wpa_snprintf_hex(pos, end - pos, ie, realms * 2); in print_fils_indication()
5064 pos += ret; in print_fils_indication()
5066 ret = os_snprintf(pos, end - pos, "\n"); in print_fils_indication()
5067 if (os_snprintf_error(end - pos, ret)) in print_fils_indication()
5069 pos += ret; in print_fils_indication()
5072 return pos - start; in print_fils_indication()
5077 static int print_rnr(struct wpa_bss *bss, char *pos, char *end) in print_rnr() argument
5079 char *start = pos; in print_rnr()
5104 ret = os_snprintf(pos, end - pos, in print_rnr()
5108 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5110 pos += ret; in print_rnr()
5115 ret = os_snprintf(pos, end - pos, in print_rnr()
5117 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5121 pos += ret; in print_rnr()
5125 ret = os_snprintf(pos, end - pos, in print_rnr()
5128 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5132 pos += ret; in print_rnr()
5136 ret = os_snprintf(pos, end - pos, in print_rnr()
5139 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5143 pos += ret; in print_rnr()
5147 ret = os_snprintf(pos, end - pos, in print_rnr()
5149 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5153 pos += ret; in print_rnr()
5157 ret = os_snprintf(pos, end - pos, in print_rnr()
5159 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5163 pos += ret; in print_rnr()
5167 ret = os_snprintf(pos, end - pos, in print_rnr()
5170 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5174 pos += ret; in print_rnr()
5179 ret = os_snprintf(pos, end - pos, "\n"); in print_rnr()
5180 if (os_snprintf_error(end - pos, ret)) in print_rnr()
5182 pos += ret; in print_rnr()
5187 return pos - start; in print_rnr()
5191 static int print_ml(struct wpa_bss *bss, char *pos, char *end) in print_ml() argument
5194 char *start = pos; in print_ml()
5216 ret = os_snprintf(pos, end - pos, in print_ml()
5219 if (os_snprintf_error(end - pos, ret)) in print_ml()
5221 pos += ret; in print_ml()
5233 ret = os_snprintf(pos, end - pos, ", MLD addr=" MACSTR, MAC2STR(ie)); in print_ml()
5234 if (os_snprintf_error(end - pos, ret)) in print_ml()
5236 pos += ret; in print_ml()
5245 ret = os_snprintf(pos, end - pos, ", link ID=%u", *ie & 0x0f); in print_ml()
5246 if (os_snprintf_error(end - pos, ret)) in print_ml()
5248 pos += ret; in print_ml()
5257 ret = os_snprintf(pos, end - pos, in print_ml()
5259 if (os_snprintf_error(end - pos, ret)) in print_ml()
5261 pos += ret; in print_ml()
5270 ret = os_snprintf(pos, end - pos, ", MSD Info=0x%x", in print_ml()
5272 if (os_snprintf_error(end - pos, ret)) in print_ml()
5274 pos += ret; in print_ml()
5283 ret = os_snprintf(pos, end - pos, ", EML capabilities=0x%x", in print_ml()
5285 if (os_snprintf_error(end - pos, ret)) in print_ml()
5287 pos += ret; in print_ml()
5296 ret = os_snprintf(pos, end - pos, ", MLD capabilities=0x%x", in print_ml()
5298 if (os_snprintf_error(end - pos, ret)) in print_ml()
5300 pos += ret; in print_ml()
5309 ret = os_snprintf(pos, end - pos, ", MLD ID=0x%x", *ie); in print_ml()
5310 if (os_snprintf_error(end - pos, ret)) in print_ml()
5312 pos += ret; in print_ml()
5317 ret = os_snprintf(pos, end - pos, "\n"); in print_ml()
5318 if (os_snprintf_error(end - pos, ret)) in print_ml()
5320 pos += ret; in print_ml()
5322 return pos - start; in print_ml()
5331 char *pos, *end; in print_bss_info() local
5334 pos = buf; in print_bss_info()
5338 ret = os_snprintf(pos, end - pos, "id=%u\n", bss->id); in print_bss_info()
5339 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5341 pos += ret; in print_bss_info()
5345 ret = os_snprintf(pos, end - pos, "bssid=" MACSTR "\n", in print_bss_info()
5347 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5349 pos += ret; in print_bss_info()
5353 ret = os_snprintf(pos, end - pos, "freq=%d\n", bss->freq); in print_bss_info()
5354 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5356 pos += ret; in print_bss_info()
5360 ret = os_snprintf(pos, end - pos, "beacon_int=%d\n", in print_bss_info()
5362 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5364 pos += ret; in print_bss_info()
5368 ret = os_snprintf(pos, end - pos, "capabilities=0x%04x\n", in print_bss_info()
5370 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5372 pos += ret; in print_bss_info()
5376 ret = os_snprintf(pos, end - pos, "qual=%d\n", bss->qual); in print_bss_info()
5377 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5379 pos += ret; in print_bss_info()
5383 ret = os_snprintf(pos, end - pos, "noise=%d\n", bss->noise); in print_bss_info()
5384 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5386 pos += ret; in print_bss_info()
5390 ret = os_snprintf(pos, end - pos, "level=%d\n", bss->level); in print_bss_info()
5391 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5393 pos += ret; in print_bss_info()
5397 ret = os_snprintf(pos, end - pos, "tsf=%016llu\n", in print_bss_info()
5399 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5401 pos += ret; in print_bss_info()
5408 ret = os_snprintf(pos, end - pos, "age=%d\n", in print_bss_info()
5410 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5412 pos += ret; in print_bss_info()
5416 ret = os_snprintf(pos, end - pos, "ie="); in print_bss_info()
5417 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5419 pos += ret; in print_bss_info()
5423 ret = os_snprintf(pos, end - pos, "%02x", *ie++); in print_bss_info()
5424 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5426 pos += ret; in print_bss_info()
5429 ret = os_snprintf(pos, end - pos, "\n"); in print_bss_info()
5430 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5432 pos += ret; in print_bss_info()
5436 ret = os_snprintf(pos, end - pos, "flags="); in print_bss_info()
5437 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5439 pos += ret; in print_bss_info()
5445 pos = wpa_supplicant_ie_txt(pos, end, "WPA", ie, in print_bss_info()
5449 pos = wpa_supplicant_ie_txt(pos, end, in print_bss_info()
5454 ret = os_snprintf(pos, end - pos, "[SAE-H2E]"); in print_bss_info()
5455 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5457 pos += ret; in print_bss_info()
5460 ret = os_snprintf(pos, end - pos, "[SAE-PK]"); in print_bss_info()
5461 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5463 pos += ret; in print_bss_info()
5467 pos = wpa_supplicant_ie_txt(pos, end, "OSEN", in print_bss_info()
5472 pos, end - pos, in print_bss_info()
5474 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5476 pos += ret; in print_bss_info()
5478 pos = wpa_supplicant_wps_ie_txt(wpa_s, pos, end, bss); in print_bss_info()
5481 ret = os_snprintf(pos, end - pos, "[WEP]"); in print_bss_info()
5482 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5484 pos += ret; in print_bss_info()
5488 ret = os_snprintf(pos, end - pos, "[MESH]"); in print_bss_info()
5489 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5491 pos += ret; in print_bss_info()
5496 ret = os_snprintf(pos, end - pos, "[DMG]"); in print_bss_info()
5497 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5499 pos += ret; in print_bss_info()
5514 ret = os_snprintf(pos, end - pos, "%s", s); in print_bss_info()
5515 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5517 pos += ret; in print_bss_info()
5520 ret = os_snprintf(pos, end - pos, "[IBSS]"); in print_bss_info()
5521 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5523 pos += ret; in print_bss_info()
5526 ret = os_snprintf(pos, end - pos, "[ESS]"); in print_bss_info()
5527 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5529 pos += ret; in print_bss_info()
5534 ret = os_snprintf(pos, end - pos, "[P2P]"); in print_bss_info()
5535 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5537 pos += ret; in print_bss_info()
5541 ret = os_snprintf(pos, end - pos, "[HS20]"); in print_bss_info()
5542 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5544 pos += ret; in print_bss_info()
5549 ret = os_snprintf(pos, end - pos, "[FILS]"); in print_bss_info()
5550 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5552 pos += ret; in print_bss_info()
5557 ret = os_snprintf(pos, end - pos, "[FST]"); in print_bss_info()
5558 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5560 pos += ret; in print_bss_info()
5564 ret = os_snprintf(pos, end - pos, "[UTF-8]"); in print_bss_info()
5565 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5567 pos += ret; in print_bss_info()
5570 ret = os_snprintf(pos, end - pos, "\n"); in print_bss_info()
5571 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5573 pos += ret; in print_bss_info()
5577 ret = os_snprintf(pos, end - pos, "ssid=%s\n", in print_bss_info()
5579 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5581 pos += ret; in print_bss_info()
5587 ret = wpas_wps_scan_result_text(ie, bss->ie_len, pos, end); in print_bss_info()
5588 if (ret >= end - pos) in print_bss_info()
5591 pos += ret; in print_bss_info()
5598 ret = wpas_p2p_scan_result_text(ie, bss->ie_len, pos, end); in print_bss_info()
5599 if (ret >= end - pos) in print_bss_info()
5602 pos += ret; in print_bss_info()
5614 ret = os_snprintf(pos, end - pos, "wfd_subelems="); in print_bss_info()
5615 if (os_snprintf_error(end - pos, ret)) { in print_bss_info()
5619 pos += ret; in print_bss_info()
5621 pos += wpa_snprintf_hex(pos, end - pos, in print_bss_info()
5626 ret = os_snprintf(pos, end - pos, "\n"); in print_bss_info()
5627 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5629 pos += ret; in print_bss_info()
5639 pos = anqp_add_hex(pos, end, "anqp_capability_list", in print_bss_info()
5641 pos = anqp_add_hex(pos, end, "anqp_venue_name", in print_bss_info()
5643 pos = anqp_add_hex(pos, end, "anqp_network_auth_type", in print_bss_info()
5645 pos = anqp_add_hex(pos, end, "anqp_roaming_consortium", in print_bss_info()
5647 pos = anqp_add_hex(pos, end, "anqp_ip_addr_type_availability", in print_bss_info()
5649 pos = anqp_add_hex(pos, end, "anqp_nai_realm", in print_bss_info()
5651 pos = anqp_add_hex(pos, end, "anqp_3gpp", anqp->anqp_3gpp); in print_bss_info()
5652 pos = anqp_add_hex(pos, end, "anqp_domain_name", in print_bss_info()
5654 pos = anqp_add_hex(pos, end, "anqp_fils_realm_info", in print_bss_info()
5657 pos = anqp_add_hex(pos, end, "hs20_capability_list", in print_bss_info()
5659 pos = anqp_add_hex(pos, end, "hs20_operator_friendly_name", in print_bss_info()
5661 pos = anqp_add_hex(pos, end, "hs20_wan_metrics", in print_bss_info()
5663 pos = anqp_add_hex(pos, end, "hs20_connection_capability", in print_bss_info()
5665 pos = anqp_add_hex(pos, end, "hs20_operating_class", in print_bss_info()
5667 pos = anqp_add_hex(pos, end, "hs20_osu_providers_list", in print_bss_info()
5669 pos = anqp_add_hex(pos, end, "hs20_operator_icon_metadata", in print_bss_info()
5671 pos = anqp_add_hex(pos, end, "hs20_osu_providers_nai_list", in print_bss_info()
5681 pos = anqp_add_hex(pos, end, title, elem->payload); in print_bss_info()
5683 ret = os_snprintf(pos, end - pos, in print_bss_info()
5686 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5688 pos += ret; in print_bss_info()
5697 ret = wpas_mesh_scan_result_text(ie, bss->ie_len, pos, end); in print_bss_info()
5698 if (ret >= end - pos) in print_bss_info()
5701 pos += ret; in print_bss_info()
5706 ret = os_snprintf(pos, end - pos, "snr=%d\n", bss->snr); in print_bss_info()
5707 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5709 pos += ret; in print_bss_info()
5713 ret = os_snprintf(pos, end - pos, "est_throughput=%d\n", in print_bss_info()
5715 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5717 pos += ret; in print_bss_info()
5722 ret = fst_ctrl_iface_mb_info(bss->bssid, pos, end - pos); in print_bss_info()
5723 if (ret < 0 || ret >= end - pos) in print_bss_info()
5725 pos += ret; in print_bss_info()
5730 ret = os_snprintf(pos, end - pos, "update_idx=%u\n", in print_bss_info()
5732 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5734 pos += ret; in print_bss_info()
5738 ret = os_snprintf(pos, end - pos, "beacon_ie="); in print_bss_info()
5739 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5741 pos += ret; in print_bss_info()
5746 ret = os_snprintf(pos, end - pos, "%02x", *ie++); in print_bss_info()
5747 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5749 pos += ret; in print_bss_info()
5752 ret = os_snprintf(pos, end - pos, "\n"); in print_bss_info()
5753 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5755 pos += ret; in print_bss_info()
5760 ret = print_fils_indication(bss, pos, end); in print_bss_info()
5761 pos += ret; in print_bss_info()
5767 ret = os_snprintf(pos, end - pos, in print_bss_info()
5770 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5772 pos += ret; in print_bss_info()
5776 pos += print_rnr(bss, pos, end); in print_bss_info()
5779 pos += print_ml(bss, pos, end); in print_bss_info()
5782 ret = os_snprintf(pos, end - pos, "====\n"); in print_bss_info()
5783 if (os_snprintf_error(end - pos, ret)) in print_bss_info()
5785 pos += ret; in print_bss_info()
5788 return pos - buf; in print_bss_info()
6074 char *pos; in p2p_ctrl_find() local
6094 pos = os_strstr(cmd, "dev_id="); in p2p_ctrl_find()
6095 if (pos) { in p2p_ctrl_find()
6096 pos += 7; in p2p_ctrl_find()
6097 if (hwaddr_aton(pos, dev_id)) in p2p_ctrl_find()
6102 pos = os_strstr(cmd, "dev_type="); in p2p_ctrl_find()
6103 if (pos) { in p2p_ctrl_find()
6104 pos += 9; in p2p_ctrl_find()
6105 if (wps_dev_type_str2bin(pos, dev_type) < 0) in p2p_ctrl_find()
6110 pos = os_strstr(cmd, "delay="); in p2p_ctrl_find()
6111 if (pos) { in p2p_ctrl_find()
6112 pos += 6; in p2p_ctrl_find()
6113 search_delay = atoi(pos); in p2p_ctrl_find()
6117 pos = os_strstr(cmd, "freq="); in p2p_ctrl_find()
6118 if (pos) { in p2p_ctrl_find()
6119 pos += 5; in p2p_ctrl_find()
6120 freq = atoi(pos); in p2p_ctrl_find()
6126 pos = os_strstr(cmd, " seek="); in p2p_ctrl_find()
6127 if (pos) in p2p_ctrl_find()
6128 pos += 6; in p2p_ctrl_find()
6129 while (pos && seek_count < P2P_MAX_QUERY_HASH + 1) { in p2p_ctrl_find()
6132 _seek[seek_count++] = pos; in p2p_ctrl_find()
6134 term = os_strchr(pos, ' '); in p2p_ctrl_find()
6138 pos = os_strstr(term + 1, "seek="); in p2p_ctrl_find()
6139 if (pos) in p2p_ctrl_find()
6140 pos += 5; in p2p_ctrl_find()
6153 static int p2ps_ctrl_parse_cpt_priority(const char *pos, u8 *cpt) in p2ps_ctrl_parse_cpt_priority() argument
6161 for (i = 0; (token = cstr_token(pos, ": \t", &last)); i++) { in p2ps_ctrl_parse_cpt_priority()
6198 char *pos; in p2p_parse_asp_provision_cmd() local
6205 pos = os_strstr(cmd, "info="); in p2p_parse_asp_provision_cmd()
6206 if (pos) { in p2p_parse_asp_provision_cmd()
6207 pos += 5; in p2p_parse_asp_provision_cmd()
6208 info_len = os_strlen(pos); in p2p_parse_asp_provision_cmd()
6213 info_len = utf8_unescape(pos, info_len, in p2p_parse_asp_provision_cmd()
6232 pos = os_strstr(cmd, "status="); in p2p_parse_asp_provision_cmd()
6233 if (pos) in p2p_parse_asp_provision_cmd()
6234 p2ps_prov->status = atoi(pos + 7); in p2p_parse_asp_provision_cmd()
6238 pos = os_strstr(cmd, "adv_id="); in p2p_parse_asp_provision_cmd()
6239 if (!pos || sscanf(pos + 7, "%llx", &val) != 1 || val > 0xffffffffULL) in p2p_parse_asp_provision_cmd()
6243 pos = os_strstr(cmd, "method="); in p2p_parse_asp_provision_cmd()
6244 if (pos) in p2p_parse_asp_provision_cmd()
6245 p2ps_prov->method = strtol(pos + 7, NULL, 16); in p2p_parse_asp_provision_cmd()
6249 pos = os_strstr(cmd, "session="); in p2p_parse_asp_provision_cmd()
6250 if (!pos || sscanf(pos + 8, "%llx", &val) != 1 || val > 0xffffffffULL) in p2p_parse_asp_provision_cmd()
6254 pos = os_strstr(cmd, "adv_mac="); in p2p_parse_asp_provision_cmd()
6255 if (!pos || hwaddr_aton(pos + 8, p2ps_prov->adv_mac)) in p2p_parse_asp_provision_cmd()
6258 pos = os_strstr(cmd, "session_mac="); in p2p_parse_asp_provision_cmd()
6259 if (!pos || hwaddr_aton(pos + 12, p2ps_prov->session_mac)) in p2p_parse_asp_provision_cmd()
6262 pos = os_strstr(cmd, "cpt="); in p2p_parse_asp_provision_cmd()
6263 if (pos) { in p2p_parse_asp_provision_cmd()
6264 if (p2ps_ctrl_parse_cpt_priority(pos + 4, in p2p_parse_asp_provision_cmd()
6275 pos = os_strstr(cmd, "tstCap="); in p2p_parse_asp_provision_cmd()
6276 if (pos) { in p2p_parse_asp_provision_cmd()
6277 role = strtol(pos + 7, NULL, 16); in p2p_parse_asp_provision_cmd()
6279 pos = os_strstr(cmd, "role="); in p2p_parse_asp_provision_cmd()
6280 if (pos) { in p2p_parse_asp_provision_cmd()
6281 role = strtol(pos + 5, NULL, 16); in p2p_parse_asp_provision_cmd()
6301 char *pos; in p2p_ctrl_asp_provision_resp() local
6310 pos = cmd + 17; in p2p_ctrl_asp_provision_resp()
6311 if (*pos != ' ') in p2p_ctrl_asp_provision_resp()
6314 p2ps_prov = p2p_parse_asp_provision_cmd(pos); in p2p_ctrl_asp_provision_resp()
6332 char *pos; in p2p_ctrl_asp_provision() local
6342 pos = cmd + 17; in p2p_ctrl_asp_provision()
6343 if (*pos != ' ') in p2p_ctrl_asp_provision()
6346 p2ps_prov = p2p_parse_asp_provision_cmd(pos); in p2p_ctrl_asp_provision()
6361 char *pos, *pos2; in p2p_ctrl_connect() local
6396 pos = cmd + 17; in p2p_ctrl_connect()
6397 if (*pos != ' ') in p2p_ctrl_connect()
6399 pos++; in p2p_ctrl_connect()
6401 persistent_group = os_strstr(pos, " persistent") != NULL; in p2p_ctrl_connect()
6402 pos2 = os_strstr(pos, " persistent="); in p2p_ctrl_connect()
6415 join = os_strstr(pos, " join") != NULL; in p2p_ctrl_connect()
6416 allow_6ghz = os_strstr(pos, " allow_6ghz") != NULL; in p2p_ctrl_connect()
6417 auth = os_strstr(pos, " auth") != NULL; in p2p_ctrl_connect()
6418 automatic = os_strstr(pos, " auto") != NULL; in p2p_ctrl_connect()
6419 pd = os_strstr(pos, " provdisc") != NULL; in p2p_ctrl_connect()
6426 pos2 = os_strstr(pos, " go_intent="); in p2p_ctrl_connect()
6434 pos2 = os_strstr(pos, " freq="); in p2p_ctrl_connect()
6442 pos2 = os_strstr(pos, " freq2="); in p2p_ctrl_connect()
6446 pos2 = os_strstr(pos, " max_oper_chwidth="); in p2p_ctrl_connect()
6457 pos2 = os_strstr(pos, " ssid="); in p2p_ctrl_connect()
6473 if (os_strncmp(pos, "pin", 3) == 0) { in p2p_ctrl_connect()
6476 } else if (os_strncmp(pos, "pbc", 3) == 0) { in p2p_ctrl_connect()
6478 } else if (os_strstr(pos, "p2ps") != NULL) { in p2p_ctrl_connect()
6481 pin = pos; in p2p_ctrl_connect()
6482 pos = os_strchr(pin, ' '); in p2p_ctrl_connect()
6484 if (pos) { in p2p_ctrl_connect()
6485 *pos++ = '\0'; in p2p_ctrl_connect()
6486 if (os_strncmp(pos, "display", 7) == 0) in p2p_ctrl_connect()
6537 char *pos; in p2p_ctrl_prov_disc() local
6545 pos = cmd + 17; in p2p_ctrl_prov_disc()
6546 if (*pos != ' ') in p2p_ctrl_prov_disc()
6548 pos++; in p2p_ctrl_prov_disc()
6550 if (os_strstr(pos, " join") != NULL) in p2p_ctrl_prov_disc()
6552 else if (os_strstr(pos, " auto") != NULL) in p2p_ctrl_prov_disc()
6555 return wpas_p2p_prov_disc(wpa_s, addr, pos, use, NULL); in p2p_ctrl_prov_disc()
6580 char *pos; in p2p_ctrl_serv_disc_req() local
6589 pos = cmd + 17; in p2p_ctrl_serv_disc_req()
6590 if (*pos != ' ') in p2p_ctrl_serv_disc_req()
6592 pos++; in p2p_ctrl_serv_disc_req()
6594 if (os_strncmp(pos, "upnp ", 5) == 0) { in p2p_ctrl_serv_disc_req()
6596 pos += 5; in p2p_ctrl_serv_disc_req()
6597 if (hexstr2bin(pos, &version, 1) < 0) in p2p_ctrl_serv_disc_req()
6599 pos += 2; in p2p_ctrl_serv_disc_req()
6600 if (*pos != ' ') in p2p_ctrl_serv_disc_req()
6602 pos++; in p2p_ctrl_serv_disc_req()
6603 ref = wpas_p2p_sd_request_upnp(wpa_s, dst, version, pos); in p2p_ctrl_serv_disc_req()
6605 } else if (os_strncmp(pos, "wifi-display ", 13) == 0) { in p2p_ctrl_serv_disc_req()
6606 ref = wpas_p2p_sd_request_wifi_display(wpa_s, dst, pos + 13); in p2p_ctrl_serv_disc_req()
6608 } else if (os_strncmp(pos, "asp ", 4) == 0) { in p2p_ctrl_serv_disc_req()
6613 pos += 4; in p2p_ctrl_serv_disc_req()
6614 if (sscanf(pos, "%x", &id) != 1 || id > 0xff) in p2p_ctrl_serv_disc_req()
6617 pos = os_strchr(pos, ' '); in p2p_ctrl_serv_disc_req()
6618 if (pos == NULL || pos[1] == '\0' || pos[1] == ' ') in p2p_ctrl_serv_disc_req()
6621 svc_str = pos + 1; in p2p_ctrl_serv_disc_req()
6623 pos = os_strchr(svc_str, ' '); in p2p_ctrl_serv_disc_req()
6625 if (pos) in p2p_ctrl_serv_disc_req()
6626 *pos++ = '\0'; in p2p_ctrl_serv_disc_req()
6629 if (pos && pos[0] && pos[0] != ' ') { in p2p_ctrl_serv_disc_req()
6630 len = os_strlen(pos); in p2p_ctrl_serv_disc_req()
6633 len = utf8_unescape(pos, len, pos, len); in p2p_ctrl_serv_disc_req()
6637 svc_info = pos; in p2p_ctrl_serv_disc_req()
6643 len = os_strlen(pos); in p2p_ctrl_serv_disc_req()
6650 if (hexstr2bin(pos, wpabuf_put(tlvs, len), len) < 0) { in p2p_ctrl_serv_disc_req()
6685 char *pos, *pos2; in p2p_ctrl_serv_disc_resp() local
6688 pos = os_strchr(cmd, ' '); in p2p_ctrl_serv_disc_resp()
6689 if (pos == NULL) in p2p_ctrl_serv_disc_resp()
6691 *pos++ = '\0'; in p2p_ctrl_serv_disc_resp()
6696 if (hwaddr_aton(pos, dst)) in p2p_ctrl_serv_disc_resp()
6698 pos += 17; in p2p_ctrl_serv_disc_resp()
6699 if (*pos != ' ') in p2p_ctrl_serv_disc_resp()
6701 pos++; in p2p_ctrl_serv_disc_resp()
6703 pos2 = os_strchr(pos, ' '); in p2p_ctrl_serv_disc_resp()
6707 dialog_token = atoi(pos); in p2p_ctrl_serv_disc_resp()
6740 char *pos; in p2p_ctrl_service_add_bonjour() local
6745 pos = os_strchr(cmd, ' '); in p2p_ctrl_service_add_bonjour()
6746 if (pos == NULL) in p2p_ctrl_service_add_bonjour()
6748 *pos++ = '\0'; in p2p_ctrl_service_add_bonjour()
6761 len = os_strlen(pos); in p2p_ctrl_service_add_bonjour()
6768 ret = hexstr2bin(pos, wpabuf_put(resp, len), len); in p2p_ctrl_service_add_bonjour()
6784 char *pos; in p2p_ctrl_service_add_upnp() local
6787 pos = os_strchr(cmd, ' '); in p2p_ctrl_service_add_upnp()
6788 if (pos == NULL) in p2p_ctrl_service_add_upnp()
6790 *pos++ = '\0'; in p2p_ctrl_service_add_upnp()
6795 return wpas_p2p_service_add_upnp(wpa_s, version, pos); in p2p_ctrl_service_add_upnp()
6802 char *pos; in p2p_ctrl_service_add_asp() local
6809 pos = os_strchr(cmd, ' '); in p2p_ctrl_service_add_asp()
6810 if (pos == NULL) in p2p_ctrl_service_add_asp()
6812 *pos++ = '\0'; in p2p_ctrl_service_add_asp()
6828 cmd = pos; in p2p_ctrl_service_add_asp()
6829 pos = os_strchr(cmd, ' '); in p2p_ctrl_service_add_asp()
6830 if (pos == NULL) in p2p_ctrl_service_add_asp()
6832 *pos++ = '\0'; in p2p_ctrl_service_add_asp()
6848 if (sscanf(pos, "%x", &svc_state) != 1 || svc_state > 0xff) in p2p_ctrl_service_add_asp()
6851 pos = os_strchr(pos, ' '); in p2p_ctrl_service_add_asp()
6852 if (pos == NULL) in p2p_ctrl_service_add_asp()
6856 pos++; in p2p_ctrl_service_add_asp()
6857 if (sscanf(pos, "%x", &config_methods) != 1) in p2p_ctrl_service_add_asp()
6864 pos = os_strchr(pos, ' '); in p2p_ctrl_service_add_asp()
6865 if (pos == NULL) in p2p_ctrl_service_add_asp()
6868 pos++; in p2p_ctrl_service_add_asp()
6869 adv_str = pos; in p2p_ctrl_service_add_asp()
6872 if (!pos[0] || pos[0] == ' ') in p2p_ctrl_service_add_asp()
6876 pos = os_strchr(pos, ' '); in p2p_ctrl_service_add_asp()
6877 if (pos != NULL) in p2p_ctrl_service_add_asp()
6878 *pos++ = '\0'; in p2p_ctrl_service_add_asp()
6880 cpt_prio_str = (pos && pos[0]) ? os_strstr(pos, "cpt=") : NULL; in p2p_ctrl_service_add_asp()
6882 pos = os_strchr(pos, ' '); in p2p_ctrl_service_add_asp()
6883 if (pos != NULL) in p2p_ctrl_service_add_asp()
6884 *pos++ = '\0'; in p2p_ctrl_service_add_asp()
6894 if (pos && pos[0]) { in p2p_ctrl_service_add_asp()
6899 svc_info = os_strstr(pos, "svc_info='"); in p2p_ctrl_service_add_asp()
6916 char *pos; in p2p_ctrl_service_add() local
6918 pos = os_strchr(cmd, ' '); in p2p_ctrl_service_add()
6919 if (pos == NULL) in p2p_ctrl_service_add()
6921 *pos++ = '\0'; in p2p_ctrl_service_add()
6924 return p2p_ctrl_service_add_bonjour(wpa_s, pos); in p2p_ctrl_service_add()
6926 return p2p_ctrl_service_add_upnp(wpa_s, pos); in p2p_ctrl_service_add()
6928 return p2p_ctrl_service_add_asp(wpa_s, 0, pos); in p2p_ctrl_service_add()
6961 char *pos; in p2p_ctrl_service_del_upnp() local
6964 pos = os_strchr(cmd, ' '); in p2p_ctrl_service_del_upnp()
6965 if (pos == NULL) in p2p_ctrl_service_del_upnp()
6967 *pos++ = '\0'; in p2p_ctrl_service_del_upnp()
6972 return wpas_p2p_service_del_upnp(wpa_s, version, pos); in p2p_ctrl_service_del_upnp()
6994 char *pos; in p2p_ctrl_service_del() local
6996 pos = os_strchr(cmd, ' '); in p2p_ctrl_service_del()
6997 if (pos == NULL) in p2p_ctrl_service_del()
6999 *pos++ = '\0'; in p2p_ctrl_service_del()
7002 return p2p_ctrl_service_del_bonjour(wpa_s, pos); in p2p_ctrl_service_del()
7004 return p2p_ctrl_service_del_upnp(wpa_s, pos); in p2p_ctrl_service_del()
7006 return p2p_ctrl_service_del_asp(wpa_s, pos); in p2p_ctrl_service_del()
7014 char *pos; in p2p_ctrl_service_replace() local
7016 pos = os_strchr(cmd, ' '); in p2p_ctrl_service_replace()
7017 if (pos == NULL) in p2p_ctrl_service_replace()
7019 *pos++ = '\0'; in p2p_ctrl_service_replace()
7022 return p2p_ctrl_service_add_asp(wpa_s, 1, pos); in p2p_ctrl_service_replace()
7044 char *pos; in p2p_ctrl_invite_persistent() local
7054 pos = os_strstr(cmd, " peer="); in p2p_ctrl_invite_persistent()
7055 if (pos) { in p2p_ctrl_invite_persistent()
7056 pos += 6; in p2p_ctrl_invite_persistent()
7057 if (hwaddr_aton(pos, peer)) in p2p_ctrl_invite_persistent()
7069 pos = os_strstr(cmd, " freq="); in p2p_ctrl_invite_persistent()
7070 if (pos) { in p2p_ctrl_invite_persistent()
7071 pos += 6; in p2p_ctrl_invite_persistent()
7072 freq = atoi(pos); in p2p_ctrl_invite_persistent()
7077 pos = os_strstr(cmd, " pref="); in p2p_ctrl_invite_persistent()
7078 if (pos) { in p2p_ctrl_invite_persistent()
7079 pos += 6; in p2p_ctrl_invite_persistent()
7080 pref_freq = atoi(pos); in p2p_ctrl_invite_persistent()
7091 pos = os_strstr(cmd, "freq2="); in p2p_ctrl_invite_persistent()
7092 if (pos) in p2p_ctrl_invite_persistent()
7093 freq2 = atoi(pos + 6); in p2p_ctrl_invite_persistent()
7095 pos = os_strstr(cmd, " max_oper_chwidth="); in p2p_ctrl_invite_persistent()
7096 if (pos) in p2p_ctrl_invite_persistent()
7097 chwidth = atoi(pos + 18); in p2p_ctrl_invite_persistent()
7116 char *pos; in p2p_ctrl_invite_group() local
7120 pos = os_strstr(cmd, " peer="); in p2p_ctrl_invite_group()
7121 if (!pos) in p2p_ctrl_invite_group()
7124 *pos = '\0'; in p2p_ctrl_invite_group()
7125 pos += 6; in p2p_ctrl_invite_group()
7126 if (hwaddr_aton(pos, peer)) { in p2p_ctrl_invite_group()
7127 wpa_printf(MSG_DEBUG, "P2P: Invalid MAC address '%s'", pos); in p2p_ctrl_invite_group()
7131 allow_6ghz = os_strstr(pos, " allow_6ghz") != NULL; in p2p_ctrl_invite_group()
7133 pos = os_strstr(pos, " go_dev_addr="); in p2p_ctrl_invite_group()
7134 if (pos) { in p2p_ctrl_invite_group()
7135 pos += 13; in p2p_ctrl_invite_group()
7136 if (hwaddr_aton(pos, go_dev_addr)) { in p2p_ctrl_invite_group()
7138 pos); in p2p_ctrl_invite_group()
7320 char *pos, *end; in p2p_ctrl_peer() local
7357 pos = buf; in p2p_ctrl_peer()
7360 res = os_snprintf(pos, end - pos, MACSTR "\n" in p2p_ctrl_peer()
7383 if (os_snprintf_error(end - pos, res)) in p2p_ctrl_peer()
7384 return pos - buf; in p2p_ctrl_peer()
7385 pos += res; in p2p_ctrl_peer()
7391 res = os_snprintf(pos, end - pos, "sec_dev_type=%s\n", in p2p_ctrl_peer()
7394 if (os_snprintf_error(end - pos, res)) in p2p_ctrl_peer()
7395 return pos - buf; in p2p_ctrl_peer()
7396 pos += res; in p2p_ctrl_peer()
7401 res = os_snprintf(pos, end - pos, "persistent=%d\n", ssid->id); in p2p_ctrl_peer()
7402 if (os_snprintf_error(end - pos, res)) in p2p_ctrl_peer()
7403 return pos - buf; in p2p_ctrl_peer()
7404 pos += res; in p2p_ctrl_peer()
7407 res = p2p_get_peer_info_txt(info, pos, end - pos); in p2p_ctrl_peer()
7409 return pos - buf; in p2p_ctrl_peer()
7410 pos += res; in p2p_ctrl_peer()
7413 res = os_snprintf(pos, end - pos, "vendor_elems="); in p2p_ctrl_peer()
7414 if (os_snprintf_error(end - pos, res)) in p2p_ctrl_peer()
7415 return pos - buf; in p2p_ctrl_peer()
7416 pos += res; in p2p_ctrl_peer()
7418 pos += wpa_snprintf_hex(pos, end - pos, in p2p_ctrl_peer()
7422 res = os_snprintf(pos, end - pos, "\n"); in p2p_ctrl_peer()
7423 if (os_snprintf_error(end - pos, res)) in p2p_ctrl_peer()
7424 return pos - buf; in p2p_ctrl_peer()
7425 pos += res; in p2p_ctrl_peer()
7428 return pos - buf; in p2p_ctrl_peer()
7479 char *pos; in p2p_ctrl_set() local
7483 pos = os_strchr(param, ' '); in p2p_ctrl_set()
7484 op_class = pos ? atoi(pos) : 81; in p2p_ctrl_set()
7496 char *pos; in p2p_ctrl_set() local
7500 pos = os_strchr(param, ','); in p2p_ctrl_set()
7501 if (pos == NULL) in p2p_ctrl_set()
7503 pos++; in p2p_ctrl_set()
7504 start = atoi(pos); in p2p_ctrl_set()
7505 pos = os_strchr(pos, ','); in p2p_ctrl_set()
7506 if (pos == NULL) in p2p_ctrl_set()
7508 pos++; in p2p_ctrl_set()
7509 duration = atoi(pos); in p2p_ctrl_set()
7586 char *pos; in p2p_ctrl_set() local
7589 pos = os_strchr(param, ','); in p2p_ctrl_set()
7590 if (pos == NULL) in p2p_ctrl_set()
7592 pos++; in p2p_ctrl_set()
7593 bk = atoi(pos); in p2p_ctrl_set()
7594 pos = os_strchr(pos, ','); in p2p_ctrl_set()
7595 if (pos == NULL) in p2p_ctrl_set()
7597 pos++; in p2p_ctrl_set()
7598 vi = atoi(pos); in p2p_ctrl_set()
7599 pos = os_strchr(pos, ','); in p2p_ctrl_set()
7600 if (pos == NULL) in p2p_ctrl_set()
7602 pos++; in p2p_ctrl_set()
7603 vo = atoi(pos); in p2p_ctrl_set()
7625 char *pos; in p2p_ctrl_set() local
7627 pos = param; in p2p_ctrl_set()
7629 min_disc_int = atoi(pos); in p2p_ctrl_set()
7630 pos = os_strchr(pos, ' '); in p2p_ctrl_set()
7631 if (pos == NULL) in p2p_ctrl_set()
7633 *pos++ = '\0'; in p2p_ctrl_set()
7635 max_disc_int = atoi(pos); in p2p_ctrl_set()
7636 pos = os_strchr(pos, ' '); in p2p_ctrl_set()
7637 if (pos == NULL) in p2p_ctrl_set()
7639 *pos++ = '\0'; in p2p_ctrl_set()
7641 max_disc_tu = atoi(pos); in p2p_ctrl_set()
7702 char *pos, *pos2; in p2p_ctrl_presence_req() local
7706 pos = os_strchr(cmd, ' '); in p2p_ctrl_presence_req()
7707 if (pos == NULL) in p2p_ctrl_presence_req()
7709 *pos++ = '\0'; in p2p_ctrl_presence_req()
7712 pos2 = os_strchr(pos, ' '); in p2p_ctrl_presence_req()
7715 int1 = atoi(pos); in p2p_ctrl_presence_req()
7720 pos = os_strchr(pos2, ' '); in p2p_ctrl_presence_req()
7721 if (pos == NULL) in p2p_ctrl_presence_req()
7723 *pos++ = '\0'; in p2p_ctrl_presence_req()
7725 int2 = atoi(pos); in p2p_ctrl_presence_req()
7734 char *pos; in p2p_ctrl_ext_listen() local
7738 pos = os_strchr(cmd, ' '); in p2p_ctrl_ext_listen()
7739 if (pos == NULL) in p2p_ctrl_ext_listen()
7741 *pos++ = '\0'; in p2p_ctrl_ext_listen()
7743 interval = atoi(pos); in p2p_ctrl_ext_listen()
7752 const char *pos; in p2p_ctrl_remove_client() local
7756 pos = cmd; in p2p_ctrl_remove_client()
7757 if (os_strncmp(pos, "iface=", 6) == 0) { in p2p_ctrl_remove_client()
7759 pos += 6; in p2p_ctrl_remove_client()
7761 if (hwaddr_aton(pos, peer)) in p2p_ctrl_remove_client()
7831 char *pos; in ctrl_interworking_select() local
7835 pos = os_strstr(param, "freq="); in ctrl_interworking_select()
7836 if (pos) { in ctrl_interworking_select()
7837 freqs = freq_range_to_channel_list(wpa_s, pos + 5); in ctrl_interworking_select()
7895 char *pos; in get_anqp() local
7905 pos = dst + used; in get_anqp()
7906 if (*pos == ' ') in get_anqp()
7907 pos++; in get_anqp()
7909 if (os_strncmp(pos, "freq=", 5) == 0) { in get_anqp()
7910 freq = atoi(pos + 5); in get_anqp()
7911 pos = os_strchr(pos, ' '); in get_anqp()
7912 if (!pos) in get_anqp()
7914 pos++; in get_anqp()
7918 if (os_strncmp(pos, "hs20:", 5) == 0) { in get_anqp()
7920 int num = atoi(pos + 5); in get_anqp()
7927 } else if (os_strncmp(pos, "mbo:", 4) == 0) { in get_anqp()
7929 int num = atoi(pos + 4); in get_anqp()
7938 id[num_id] = atoi(pos); in get_anqp()
7942 pos = os_strchr(pos + 1, ','); in get_anqp()
7943 if (pos == NULL) in get_anqp()
7945 pos++; in get_anqp()
7961 char *pos, *end; in gas_request() local
7968 pos = cmd + used; in gas_request()
7969 while (*pos == ' ') in gas_request()
7970 pos++; in gas_request()
7973 end = os_strchr(pos, ' '); in gas_request()
7975 len = end - pos; in gas_request()
7977 len = os_strlen(pos); in gas_request()
7986 if (hexstr2bin(pos, wpabuf_put(advproto, len), len) < 0) in gas_request()
7991 pos = end + 1; in gas_request()
7992 while (*pos == ' ') in gas_request()
7993 pos++; in gas_request()
7995 len = os_strlen(pos); in gas_request()
8005 if (hexstr2bin(pos, wpabuf_put(query, len), len) < 0) in gas_request()
8026 char *pos; in gas_response_get() local
8035 pos = cmd + used; in gas_response_get()
8036 while (*pos == ' ') in gas_response_get()
8037 pos++; in gas_response_get()
8038 dialog_token = atoi(pos); in gas_response_get()
8055 pos = os_strchr(pos, ' '); in gas_response_get()
8056 if (pos) { in gas_response_get()
8057 start = atoi(pos); in gas_response_get()
8060 pos = os_strchr(pos, ','); in gas_response_get()
8061 if (pos == NULL) in gas_response_get()
8063 pos++; in gas_response_get()
8064 requested_len = atoi(pos); in gas_response_get()
8100 char *pos; in get_hs20_anqp() local
8106 pos = dst + used; in get_hs20_anqp()
8107 if (*pos == ' ') in get_hs20_anqp()
8108 pos++; in get_hs20_anqp()
8110 int num = atoi(pos); in get_hs20_anqp()
8114 pos = os_strchr(pos + 1, ','); in get_hs20_anqp()
8115 if (pos == NULL) in get_hs20_anqp()
8117 pos++; in get_hs20_anqp()
8305 char *pos; in wpas_ctrl_iface_wnm_sleep() local
8316 pos = os_strstr(cmd, " interval="); in wpas_ctrl_iface_wnm_sleep()
8317 if (pos) in wpas_ctrl_iface_wnm_sleep()
8318 intval = atoi(pos + 10); in wpas_ctrl_iface_wnm_sleep()
8320 pos = os_strstr(cmd, " tfs_req="); in wpas_ctrl_iface_wnm_sleep()
8321 if (pos) { in wpas_ctrl_iface_wnm_sleep()
8324 pos += 9; in wpas_ctrl_iface_wnm_sleep()
8325 end = os_strchr(pos, ' '); in wpas_ctrl_iface_wnm_sleep()
8327 len = end - pos; in wpas_ctrl_iface_wnm_sleep()
8329 len = os_strlen(pos); in wpas_ctrl_iface_wnm_sleep()
8336 if (hexstr2bin(pos, wpabuf_put(tfs_req, len), len) < 0) { in wpas_ctrl_iface_wnm_sleep()
8399 char *pos, *end; in wpa_supplicant_signal_poll() local
8405 pos = buf; in wpa_supplicant_signal_poll()
8408 ret = os_snprintf(pos, end - pos, "RSSI=%d\nLINKSPEED=%lu\n" in wpa_supplicant_signal_poll()
8412 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_signal_poll()
8414 pos += ret; in wpa_supplicant_signal_poll()
8417 ret = os_snprintf(pos, end - pos, "WIDTH=%s\n", in wpa_supplicant_signal_poll()
8419 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_signal_poll()
8421 pos += ret; in wpa_supplicant_signal_poll()
8425 ret = os_snprintf(pos, end - pos, "CENTER_FRQ1=%d\n", in wpa_supplicant_signal_poll()
8427 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_signal_poll()
8429 pos += ret; in wpa_supplicant_signal_poll()
8433 ret = os_snprintf(pos, end - pos, "CENTER_FRQ2=%d\n", in wpa_supplicant_signal_poll()
8435 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_signal_poll()
8437 pos += ret; in wpa_supplicant_signal_poll()
8441 ret = os_snprintf(pos, end - pos, in wpa_supplicant_signal_poll()
8443 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_signal_poll()
8445 pos += ret; in wpa_supplicant_signal_poll()
8449 ret = os_snprintf(pos, end - pos, in wpa_supplicant_signal_poll()
8452 if (os_snprintf_error(end - pos, ret)) in wpa_supplicant_signal_poll()
8454 pos += ret; in wpa_supplicant_signal_poll()
8457 return pos - buf; in wpa_supplicant_signal_poll()
8464 const char *pos; in wpas_ctrl_iface_signal_monitor() local
8473 pos = os_strstr(cmd, "THRESHOLD="); in wpas_ctrl_iface_signal_monitor()
8474 if (pos) in wpas_ctrl_iface_signal_monitor()
8475 threshold = atoi(pos + 10); in wpas_ctrl_iface_signal_monitor()
8476 pos = os_strstr(cmd, "HYSTERESIS="); in wpas_ctrl_iface_signal_monitor()
8477 if (pos) in wpas_ctrl_iface_signal_monitor()
8478 hysteresis = atoi(pos + 11); in wpas_ctrl_iface_signal_monitor()
8489 char *pos = wpa_s->get_pref_freq_list_override; in wpas_ctrl_iface_get_pref_freq_list_override() local
8496 while (pos) { in wpas_ctrl_iface_get_pref_freq_list_override()
8497 if (atoi(pos) == (int) if_type) in wpas_ctrl_iface_get_pref_freq_list_override()
8499 pos = os_strchr(pos, ' '); in wpas_ctrl_iface_get_pref_freq_list_override()
8500 if (pos) in wpas_ctrl_iface_get_pref_freq_list_override()
8501 pos++; in wpas_ctrl_iface_get_pref_freq_list_override()
8503 if (!pos) in wpas_ctrl_iface_get_pref_freq_list_override()
8505 pos = os_strchr(pos, ':'); in wpas_ctrl_iface_get_pref_freq_list_override()
8506 if (!pos) in wpas_ctrl_iface_get_pref_freq_list_override()
8508 pos++; in wpas_ctrl_iface_get_pref_freq_list_override()
8509 end = os_strchr(pos, ' '); in wpas_ctrl_iface_get_pref_freq_list_override()
8510 while (pos && (!end || pos < end) && count < *num) { in wpas_ctrl_iface_get_pref_freq_list_override()
8511 freq_list[count].freq = atoi(pos); in wpas_ctrl_iface_get_pref_freq_list_override()
8513 pos = os_strchr(pos, ','); in wpas_ctrl_iface_get_pref_freq_list_override()
8514 if (pos) in wpas_ctrl_iface_get_pref_freq_list_override()
8515 pos++; in wpas_ctrl_iface_get_pref_freq_list_override()
8530 char *pos, *end; in wpas_ctrl_iface_get_pref_freq_list() local
8533 pos = buf; in wpas_ctrl_iface_get_pref_freq_list()
8561 ret = os_snprintf(pos, end - pos, "%s%u", in wpas_ctrl_iface_get_pref_freq_list()
8563 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_get_pref_freq_list()
8565 pos += ret; in wpas_ctrl_iface_get_pref_freq_list()
8568 return pos - buf; in wpas_ctrl_iface_get_pref_freq_list()
8576 char *pos, *end; in wpas_ctrl_iface_driver_flags() local
8583 pos = buf + ret; in wpas_ctrl_iface_driver_flags()
8588 ret = os_snprintf(pos, end - pos, "%s\n", in wpas_ctrl_iface_driver_flags()
8590 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_driver_flags()
8592 pos += ret; in wpas_ctrl_iface_driver_flags()
8596 return pos - buf; in wpas_ctrl_iface_driver_flags()
8604 char *pos, *end; in wpas_ctrl_iface_driver_flags2() local
8611 pos = buf + ret; in wpas_ctrl_iface_driver_flags2()
8616 ret = os_snprintf(pos, end - pos, "%s\n", in wpas_ctrl_iface_driver_flags2()
8618 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_driver_flags2()
8620 pos += ret; in wpas_ctrl_iface_driver_flags2()
8624 return pos - buf; in wpas_ctrl_iface_driver_flags2()
8677 char *pos, *temp = NULL; in wpa_supplicant_vendor_cmd() local
8688 vendor_id = strtoul(cmd, &pos, 16); in wpa_supplicant_vendor_cmd()
8689 if (!isblank((unsigned char) *pos)) in wpa_supplicant_vendor_cmd()
8692 subcmd = strtoul(pos, &pos, 10); in wpa_supplicant_vendor_cmd()
8694 if (*pos != '\0') { in wpa_supplicant_vendor_cmd()
8695 if (!isblank((unsigned char) *pos++)) in wpa_supplicant_vendor_cmd()
8698 temp = os_strchr(pos, ' '); in wpa_supplicant_vendor_cmd()
8699 data_len = temp ? (size_t) (temp - pos) : os_strlen(pos); in wpa_supplicant_vendor_cmd()
8708 if (hexstr2bin(pos, data, data_len)) { in wpa_supplicant_vendor_cmd()
8716 pos = os_strstr(cmd, "nested="); in wpa_supplicant_vendor_cmd()
8717 if (pos) in wpa_supplicant_vendor_cmd()
8718 nested_attr_flag = atoi(pos + 7) ? NESTED_ATTR_USED : in wpa_supplicant_vendor_cmd()
9009 char *pos, *end; in wpas_ctrl_radio_work_show() local
9012 pos = buf; in wpas_ctrl_radio_work_show()
9022 ret = os_snprintf(pos, end - pos, "%s@%s:%u:%u:%ld.%06ld\n", in wpas_ctrl_radio_work_show()
9025 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_radio_work_show()
9027 pos += ret; in wpas_ctrl_radio_work_show()
9030 return pos - buf; in wpas_ctrl_radio_work_show()
9084 char *pos, *pos2; in wpas_ctrl_radio_work_add() local
9095 pos = os_strchr(cmd, ' '); in wpas_ctrl_radio_work_add()
9096 if (pos) { in wpas_ctrl_radio_work_add()
9097 type_len = pos - cmd; in wpas_ctrl_radio_work_add()
9098 pos++; in wpas_ctrl_radio_work_add()
9100 pos2 = os_strstr(pos, "freq="); in wpas_ctrl_radio_work_add()
9104 pos2 = os_strstr(pos, "timeout="); in wpas_ctrl_radio_work_add()
9212 const char *pos = value; in scan_id_list_parse() local
9214 while (pos) { in scan_id_list_parse()
9215 if (*pos == ' ' || *pos == '\0') in scan_id_list_parse()
9219 scan_id[(*scan_id_count)++] = atoi(pos); in scan_id_list_parse()
9220 pos = os_strchr(pos, ','); in scan_id_list_parse()
9221 if (pos) in scan_id_list_parse()
9222 pos++; in scan_id_list_parse()
9232 char *pos; in wpas_ctrl_scan() local
9271 pos = os_strstr(params, "freq="); in wpas_ctrl_scan()
9272 if (pos) { in wpas_ctrl_scan()
9274 pos + 5); in wpas_ctrl_scan()
9281 pos = os_strstr(params, "passive="); in wpas_ctrl_scan()
9282 if (pos) in wpas_ctrl_scan()
9283 manual_scan_passive = !!atoi(pos + 8); in wpas_ctrl_scan()
9285 pos = os_strstr(params, "use_id="); in wpas_ctrl_scan()
9286 if (pos) in wpas_ctrl_scan()
9287 manual_scan_use_id = atoi(pos + 7); in wpas_ctrl_scan()
9289 pos = os_strstr(params, "only_new=1"); in wpas_ctrl_scan()
9290 if (pos) in wpas_ctrl_scan()
9293 pos = os_strstr(params, "scan_id="); in wpas_ctrl_scan()
9294 if (pos && scan_id_list_parse(wpa_s, pos + 8, &scan_id_count, in wpas_ctrl_scan()
9300 pos = os_strstr(params, "bssid="); in wpas_ctrl_scan()
9301 if (pos) { in wpas_ctrl_scan()
9304 pos += 6; in wpas_ctrl_scan()
9305 if (hwaddr_aton(pos, bssid)) { in wpas_ctrl_scan()
9306 wpa_printf(MSG_ERROR, "Invalid BSSID %s", pos); in wpas_ctrl_scan()
9316 pos = os_strstr(params, "non_coloc_6ghz="); in wpas_ctrl_scan()
9317 if (pos) in wpas_ctrl_scan()
9318 manual_non_coloc_6ghz = !!atoi(pos + 15); in wpas_ctrl_scan()
9320 pos = params; in wpas_ctrl_scan()
9321 while (pos && *pos != '\0') { in wpas_ctrl_scan()
9322 if (os_strncmp(pos, "ssid ", 5) == 0) { in wpas_ctrl_scan()
9325 pos += 5; in wpas_ctrl_scan()
9326 end = pos; in wpas_ctrl_scan()
9342 if ((end - pos) & 0x01 || in wpas_ctrl_scan()
9343 end - pos > 2 * SSID_MAX_LEN || in wpas_ctrl_scan()
9344 hexstr2bin(pos, ssid[ssid_count].ssid, in wpas_ctrl_scan()
9345 (end - pos) / 2) < 0) { in wpas_ctrl_scan()
9348 pos); in wpas_ctrl_scan()
9352 ssid[ssid_count].ssid_len = (end - pos) / 2; in wpas_ctrl_scan()
9357 pos = end; in wpas_ctrl_scan()
9360 pos = os_strchr(pos, ' '); in wpas_ctrl_scan()
9361 if (pos) in wpas_ctrl_scan()
9362 pos++; in wpas_ctrl_scan()
9462 char *pos, *param; in wpas_ctrl_iface_mgmt_tx() local
9473 pos = cmd; in wpas_ctrl_iface_mgmt_tx()
9474 used = hwaddr_aton2(pos, da); in wpas_ctrl_iface_mgmt_tx()
9477 pos += used; in wpas_ctrl_iface_mgmt_tx()
9478 while (*pos == ' ') in wpas_ctrl_iface_mgmt_tx()
9479 pos++; in wpas_ctrl_iface_mgmt_tx()
9480 used = hwaddr_aton2(pos, bssid); in wpas_ctrl_iface_mgmt_tx()
9483 pos += used; in wpas_ctrl_iface_mgmt_tx()
9485 param = os_strstr(pos, " freq="); in wpas_ctrl_iface_mgmt_tx()
9491 param = os_strstr(pos, " no_cck="); in wpas_ctrl_iface_mgmt_tx()
9497 param = os_strstr(pos, " wait_time="); in wpas_ctrl_iface_mgmt_tx()
9503 param = os_strstr(pos, " action="); in wpas_ctrl_iface_mgmt_tx()
9540 char *pos, *param; in wpas_ctrl_iface_mgmt_rx_process() local
9553 pos = cmd; in wpas_ctrl_iface_mgmt_rx_process()
9554 param = os_strstr(pos, "freq="); in wpas_ctrl_iface_mgmt_rx_process()
9560 param = os_strstr(pos, " datarate="); in wpas_ctrl_iface_mgmt_rx_process()
9566 param = os_strstr(pos, " ssi_signal="); in wpas_ctrl_iface_mgmt_rx_process()
9572 param = os_strstr(pos, " frame="); in wpas_ctrl_iface_mgmt_rx_process()
9612 char *pos, *end; in wpas_ctrl_iface_driver_scan_res() local
9636 pos = os_strstr(param, " flags="); in wpas_ctrl_iface_driver_scan_res()
9637 if (pos) in wpas_ctrl_iface_driver_scan_res()
9638 res->flags = strtol(pos + 7, NULL, 16); in wpas_ctrl_iface_driver_scan_res()
9640 pos = os_strstr(param, " bssid="); in wpas_ctrl_iface_driver_scan_res()
9641 if (pos && hwaddr_aton(pos + 7, res->bssid)) in wpas_ctrl_iface_driver_scan_res()
9644 pos = os_strstr(param, " freq="); in wpas_ctrl_iface_driver_scan_res()
9645 if (pos) in wpas_ctrl_iface_driver_scan_res()
9646 res->freq = atoi(pos + 6); in wpas_ctrl_iface_driver_scan_res()
9648 pos = os_strstr(param, " beacon_int="); in wpas_ctrl_iface_driver_scan_res()
9649 if (pos) in wpas_ctrl_iface_driver_scan_res()
9650 res->beacon_int = atoi(pos + 12); in wpas_ctrl_iface_driver_scan_res()
9652 pos = os_strstr(param, " caps="); in wpas_ctrl_iface_driver_scan_res()
9653 if (pos) in wpas_ctrl_iface_driver_scan_res()
9654 res->caps = strtol(pos + 6, NULL, 16); in wpas_ctrl_iface_driver_scan_res()
9656 pos = os_strstr(param, " qual="); in wpas_ctrl_iface_driver_scan_res()
9657 if (pos) in wpas_ctrl_iface_driver_scan_res()
9658 res->qual = atoi(pos + 6); in wpas_ctrl_iface_driver_scan_res()
9660 pos = os_strstr(param, " noise="); in wpas_ctrl_iface_driver_scan_res()
9661 if (pos) in wpas_ctrl_iface_driver_scan_res()
9662 res->noise = atoi(pos + 7); in wpas_ctrl_iface_driver_scan_res()
9664 pos = os_strstr(param, " level="); in wpas_ctrl_iface_driver_scan_res()
9665 if (pos) in wpas_ctrl_iface_driver_scan_res()
9666 res->level = atoi(pos + 7); in wpas_ctrl_iface_driver_scan_res()
9668 pos = os_strstr(param, " tsf="); in wpas_ctrl_iface_driver_scan_res()
9669 if (pos) in wpas_ctrl_iface_driver_scan_res()
9670 res->tsf = strtoll(pos + 5, NULL, 16); in wpas_ctrl_iface_driver_scan_res()
9672 pos = os_strstr(param, " age="); in wpas_ctrl_iface_driver_scan_res()
9673 if (pos) in wpas_ctrl_iface_driver_scan_res()
9674 res->age = atoi(pos + 5); in wpas_ctrl_iface_driver_scan_res()
9676 pos = os_strstr(param, " est_throughput="); in wpas_ctrl_iface_driver_scan_res()
9677 if (pos) in wpas_ctrl_iface_driver_scan_res()
9678 res->est_throughput = atoi(pos + 16); in wpas_ctrl_iface_driver_scan_res()
9680 pos = os_strstr(param, " snr="); in wpas_ctrl_iface_driver_scan_res()
9681 if (pos) in wpas_ctrl_iface_driver_scan_res()
9682 res->snr = atoi(pos + 5); in wpas_ctrl_iface_driver_scan_res()
9684 pos = os_strstr(param, " parent_tsf="); in wpas_ctrl_iface_driver_scan_res()
9685 if (pos) in wpas_ctrl_iface_driver_scan_res()
9686 res->parent_tsf = strtoll(pos + 7, NULL, 16); in wpas_ctrl_iface_driver_scan_res()
9688 pos = os_strstr(param, " tsf_bssid="); in wpas_ctrl_iface_driver_scan_res()
9689 if (pos && hwaddr_aton(pos + 11, res->tsf_bssid)) in wpas_ctrl_iface_driver_scan_res()
9692 pos = os_strstr(param, " ie="); in wpas_ctrl_iface_driver_scan_res()
9693 if (pos) { in wpas_ctrl_iface_driver_scan_res()
9694 pos += 4; in wpas_ctrl_iface_driver_scan_res()
9695 end = os_strchr(pos, ' '); in wpas_ctrl_iface_driver_scan_res()
9697 end = pos + os_strlen(pos); in wpas_ctrl_iface_driver_scan_res()
9698 res->ie_len = (end - pos) / 2; in wpas_ctrl_iface_driver_scan_res()
9699 if (hexstr2bin(pos, (u8 *) (res + 1), res->ie_len)) in wpas_ctrl_iface_driver_scan_res()
9703 pos = os_strstr(param, " beacon_ie="); in wpas_ctrl_iface_driver_scan_res()
9704 if (pos) { in wpas_ctrl_iface_driver_scan_res()
9705 pos += 11; in wpas_ctrl_iface_driver_scan_res()
9706 end = os_strchr(pos, ' '); in wpas_ctrl_iface_driver_scan_res()
9708 end = pos + os_strlen(pos); in wpas_ctrl_iface_driver_scan_res()
9709 res->beacon_ie_len = (end - pos) / 2; in wpas_ctrl_iface_driver_scan_res()
9710 if (hexstr2bin(pos, ((u8 *) (res + 1)) + res->ie_len, in wpas_ctrl_iface_driver_scan_res()
9740 char *str, *pos; in wpas_ctrl_iface_driver_event_assoc() local
9748 pos = os_strchr(str, '='); in wpas_ctrl_iface_driver_event_assoc()
9749 if (!pos) in wpas_ctrl_iface_driver_event_assoc()
9751 *pos++ = '\0'; in wpas_ctrl_iface_driver_event_assoc()
9754 ai->reassoc = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9757 req_ies = wpabuf_parse_bin(pos); in wpas_ctrl_iface_driver_event_assoc()
9764 resp_ies = wpabuf_parse_bin(pos); in wpas_ctrl_iface_driver_event_assoc()
9771 resp_frame = wpabuf_parse_bin(pos); in wpas_ctrl_iface_driver_event_assoc()
9778 beacon_ies = wpabuf_parse_bin(pos); in wpas_ctrl_iface_driver_event_assoc()
9784 ai->freq = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9786 ai->wmm_params.info_bitmap = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9788 ai->wmm_params.uapsd_queues = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9790 if (hwaddr_aton(pos, addr)) in wpas_ctrl_iface_driver_event_assoc()
9794 ai->authorized = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9797 key_replay_ctr = wpabuf_parse_bin(pos); in wpas_ctrl_iface_driver_event_assoc()
9804 ptk_kck = wpabuf_parse_bin(pos); in wpas_ctrl_iface_driver_event_assoc()
9811 ptk_kek = wpabuf_parse_bin(pos); in wpas_ctrl_iface_driver_event_assoc()
9817 ai->subnet_status = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9819 ai->fils_erp_next_seq_num = atoi(pos); in wpas_ctrl_iface_driver_event_assoc()
9822 fils_pmk = wpabuf_parse_bin(pos); in wpas_ctrl_iface_driver_event_assoc()
9828 if (hexstr2bin(pos, fils_pmkid, PMKID_LEN) < 0) in wpas_ctrl_iface_driver_event_assoc()
9853 char *pos, *param; in wpas_ctrl_iface_driver_event() local
9861 pos = cmd; in wpas_ctrl_iface_driver_event()
9862 param = os_strchr(pos, ' '); in wpas_ctrl_iface_driver_event()
9899 char *pos; in wpas_ctrl_iface_eapol_rx() local
9906 pos = cmd; in wpas_ctrl_iface_eapol_rx()
9907 used = hwaddr_aton2(pos, src); in wpas_ctrl_iface_eapol_rx()
9910 pos += used; in wpas_ctrl_iface_eapol_rx()
9911 while (*pos == ' ') in wpas_ctrl_iface_eapol_rx()
9912 pos++; in wpas_ctrl_iface_eapol_rx()
9914 len = os_strlen(pos); in wpas_ctrl_iface_eapol_rx()
9923 if (hexstr2bin(pos, buf, len) < 0) { in wpas_ctrl_iface_eapol_rx()
9937 char *pos; in wpas_ctrl_iface_eapol_tx() local
9945 pos = cmd; in wpas_ctrl_iface_eapol_tx()
9946 used = hwaddr_aton2(pos, dst); in wpas_ctrl_iface_eapol_tx()
9949 pos += used; in wpas_ctrl_iface_eapol_tx()
9950 while (*pos == ' ') in wpas_ctrl_iface_eapol_tx()
9951 pos++; in wpas_ctrl_iface_eapol_tx()
9953 len = os_strlen(pos); in wpas_ctrl_iface_eapol_tx()
9959 if (!buf || hexstr2bin(pos, buf, len) < 0) { in wpas_ctrl_iface_eapol_tx()
9978 const u16 *pos = buf; in ipv4_hdr_checksum() local
9981 sum += *pos++; in ipv4_hdr_checksum()
9999 const u8 *pos; in wpas_data_test_rx() local
10012 pos = &buf[sizeof(*eth) + sizeof(ip)]; in wpas_data_test_rx()
10021 if (*pos != (u8) i) { in wpas_data_test_rx()
10026 pos++; in wpas_data_test_rx()
10040 char *pos; in wpas_ctrl_iface_data_test_config() local
10055 pos = os_strstr(cmd, " ifname="); in wpas_ctrl_iface_data_test_config()
10056 if (pos) in wpas_ctrl_iface_data_test_config()
10057 ifname = pos + 8; in wpas_ctrl_iface_data_test_config()
10076 char *pos, *pos2; in wpas_ctrl_iface_data_test_tx() local
10092 pos = cmd; in wpas_ctrl_iface_data_test_tx()
10093 used = hwaddr_aton2(pos, dst); in wpas_ctrl_iface_data_test_tx()
10096 pos += used; in wpas_ctrl_iface_data_test_tx()
10097 while (*pos == ' ') in wpas_ctrl_iface_data_test_tx()
10098 pos++; in wpas_ctrl_iface_data_test_tx()
10099 used = hwaddr_aton2(pos, src); in wpas_ctrl_iface_data_test_tx()
10102 pos += used; in wpas_ctrl_iface_data_test_tx()
10104 val = strtol(pos, &pos2, 0); in wpas_ctrl_iface_data_test_tx()
10109 pos = os_strstr(pos2, " len="); in wpas_ctrl_iface_data_test_tx()
10110 if (pos) { in wpas_ctrl_iface_data_test_tx()
10111 i = atoi(pos + 5); in wpas_ctrl_iface_data_test_tx()
10308 const char *pos = cmd; in wpas_ctrl_key_request() local
10311 error = atoi(pos); in wpas_ctrl_key_request()
10312 pos = os_strchr(pos, ' '); in wpas_ctrl_key_request()
10313 if (!pos) in wpas_ctrl_key_request()
10315 pairwise = atoi(pos); in wpas_ctrl_key_request()
10458 char *pos = cmd; in wpas_ctrl_vendor_elem_add() local
10464 frame = atoi(pos); in wpas_ctrl_vendor_elem_add()
10469 pos = os_strchr(pos, ' '); in wpas_ctrl_vendor_elem_add()
10470 if (pos == NULL) in wpas_ctrl_vendor_elem_add()
10472 pos++; in wpas_ctrl_vendor_elem_add()
10474 len = os_strlen(pos); in wpas_ctrl_vendor_elem_add()
10485 if (hexstr2bin(pos, wpabuf_put(buf, len), len) < 0) { in wpas_ctrl_vendor_elem_add()
10540 char *pos = cmd; in wpas_ctrl_vendor_elem_remove() local
10547 frame = atoi(pos); in wpas_ctrl_vendor_elem_remove()
10552 pos = os_strchr(pos, ' '); in wpas_ctrl_vendor_elem_remove()
10553 if (pos == NULL) in wpas_ctrl_vendor_elem_remove()
10555 pos++; in wpas_ctrl_vendor_elem_remove()
10557 if (*pos == '*') { in wpas_ctrl_vendor_elem_remove()
10567 len = os_strlen(pos); in wpas_ctrl_vendor_elem_remove()
10578 if (hexstr2bin(pos, buf, len) < 0) { in wpas_ctrl_vendor_elem_remove()
10626 const u8 *pos = data, *end; in wpas_ctrl_neighbor_rep_cb() local
10628 if (pos[0] != WLAN_EID_NEIGHBOR_REPORT || in wpas_ctrl_neighbor_rep_cb()
10642 pos += 2; in wpas_ctrl_neighbor_rep_cb()
10643 end = pos + nr_len; in wpas_ctrl_neighbor_rep_cb()
10645 nr = pos; in wpas_ctrl_neighbor_rep_cb()
10646 pos += NR_IE_MIN_LEN; in wpas_ctrl_neighbor_rep_cb()
10650 while (end - pos > 2) { in wpas_ctrl_neighbor_rep_cb()
10653 s_id = *pos++; in wpas_ctrl_neighbor_rep_cb()
10654 s_len = *pos++; in wpas_ctrl_neighbor_rep_cb()
10655 if (s_len > end - pos) in wpas_ctrl_neighbor_rep_cb()
10662 switch (pos[2]) { in wpas_ctrl_neighbor_rep_cb()
10667 pos, s_len); in wpas_ctrl_neighbor_rep_cb()
10673 pos, s_len); in wpas_ctrl_neighbor_rep_cb()
10678 pos += s_len; in wpas_ctrl_neighbor_rep_cb()
10841 char *pos, *pos2, *end; in wpas_ctrl_iface_pmksa_get() local
10849 pos = buf; in wpas_ctrl_iface_pmksa_get()
10866 pos2 = pos; in wpas_ctrl_iface_pmksa_get()
10907 pos = pos2; in wpas_ctrl_iface_pmksa_get()
10910 return pos - buf; in wpas_ctrl_iface_pmksa_get()
10919 char *pos, *pos2; in wpas_ctrl_iface_pmksa_add() local
10935 pos = os_strchr(cmd, ' '); in wpas_ctrl_iface_pmksa_add()
10936 if (!pos) in wpas_ctrl_iface_pmksa_add()
10938 pos++; in wpas_ctrl_iface_pmksa_add()
10944 if (hwaddr_aton(pos, entry->aa)) in wpas_ctrl_iface_pmksa_add()
10947 pos = os_strchr(pos, ' '); in wpas_ctrl_iface_pmksa_add()
10948 if (!pos) in wpas_ctrl_iface_pmksa_add()
10950 pos++; in wpas_ctrl_iface_pmksa_add()
10952 if (hexstr2bin(pos, entry->pmkid, PMKID_LEN) < 0) in wpas_ctrl_iface_pmksa_add()
10955 pos = os_strchr(pos, ' '); in wpas_ctrl_iface_pmksa_add()
10956 if (!pos) in wpas_ctrl_iface_pmksa_add()
10958 pos++; in wpas_ctrl_iface_pmksa_add()
10960 pos2 = os_strchr(pos, ' '); in wpas_ctrl_iface_pmksa_add()
10963 entry->pmk_len = (pos2 - pos) / 2; in wpas_ctrl_iface_pmksa_add()
10965 hexstr2bin(pos, entry->pmk, entry->pmk_len) < 0) in wpas_ctrl_iface_pmksa_add()
10968 pos = os_strchr(pos, ' '); in wpas_ctrl_iface_pmksa_add()
10969 if (!pos) in wpas_ctrl_iface_pmksa_add()
10971 pos++; in wpas_ctrl_iface_pmksa_add()
10973 if (sscanf(pos, "%d %d %d %d", &reauth_time, &expiration, in wpas_ctrl_iface_pmksa_add()
10979 pos = os_strchr(pos, ' '); in wpas_ctrl_iface_pmksa_add()
10980 if (!pos) { in wpas_ctrl_iface_pmksa_add()
10985 pos++; in wpas_ctrl_iface_pmksa_add()
10987 if (pos) { in wpas_ctrl_iface_pmksa_add()
10988 if (hexstr2bin(pos, entry->fils_cache_id, in wpas_ctrl_iface_pmksa_add()
11052 const char *pos; in wpas_ctrl_iface_fils_hlp_req_add() local
11063 pos = os_strchr(cmd, ' '); in wpas_ctrl_iface_fils_hlp_req_add()
11064 if (!pos) in wpas_ctrl_iface_fils_hlp_req_add()
11066 pos++; in wpas_ctrl_iface_fils_hlp_req_add()
11067 req->pkt = wpabuf_parse_bin(pos); in wpas_ctrl_iface_fils_hlp_req_add()
11099 const char *pos, *end; in wpas_ctrl_iface_configure_mscs() local
11121 pos = os_strstr(cmd, "up_bitmap="); in wpas_ctrl_iface_configure_mscs()
11122 if (!pos) in wpas_ctrl_iface_configure_mscs()
11125 val = hex2byte(pos + 10); in wpas_ctrl_iface_configure_mscs()
11130 pos = os_strstr(cmd, "up_limit="); in wpas_ctrl_iface_configure_mscs()
11131 if (!pos) in wpas_ctrl_iface_configure_mscs()
11134 robust_av->up_limit = atoi(pos + 9); in wpas_ctrl_iface_configure_mscs()
11136 pos = os_strstr(cmd, "stream_timeout="); in wpas_ctrl_iface_configure_mscs()
11137 if (!pos) in wpas_ctrl_iface_configure_mscs()
11140 robust_av->stream_timeout = atoi(pos + 15); in wpas_ctrl_iface_configure_mscs()
11144 pos = os_strstr(cmd, "frame_classifier="); in wpas_ctrl_iface_configure_mscs()
11145 if (!pos) in wpas_ctrl_iface_configure_mscs()
11148 pos += 17; in wpas_ctrl_iface_configure_mscs()
11149 end = os_strchr(pos, ' '); in wpas_ctrl_iface_configure_mscs()
11151 end = pos + os_strlen(pos); in wpas_ctrl_iface_configure_mscs()
11153 frame_classifier_len = (end - pos) / 2; in wpas_ctrl_iface_configure_mscs()
11155 hexstr2bin(pos, robust_av->frame_classifier, frame_classifier_len)) in wpas_ctrl_iface_configure_mscs()
11271 const char *pos = cmd; in wpas_ctrl_iface_pasn_driver() local
11276 if (os_strncmp(pos, "auth ", 5) == 0) in wpas_ctrl_iface_pasn_driver()
11278 else if (os_strncmp(pos, "del ", 4) == 0) in wpas_ctrl_iface_pasn_driver()
11284 pos = os_strchr(pos, ' '); in wpas_ctrl_iface_pasn_driver()
11285 if (!pos) in wpas_ctrl_iface_pasn_driver()
11287 pos++; in wpas_ctrl_iface_pasn_driver()
11288 while (hwaddr_aton(pos, addr) == 0) { in wpas_ctrl_iface_pasn_driver()
11298 pos = os_strchr(pos, ' '); in wpas_ctrl_iface_pasn_driver()
11299 if (!pos) in wpas_ctrl_iface_pasn_driver()
11301 pos++; in wpas_ctrl_iface_pasn_driver()
11317 const char *pos, *end; in set_type4_frame_classifier() local
11334 pos = os_strstr(cmd, "src_ip="); in set_type4_frame_classifier()
11335 if (pos) { in set_type4_frame_classifier()
11336 pos += 7; in set_type4_frame_classifier()
11337 end = os_strchr(pos, ' '); in set_type4_frame_classifier()
11339 end = pos + os_strlen(pos); in set_type4_frame_classifier()
11341 alen = end - pos; in set_type4_frame_classifier()
11344 os_memcpy(addr, pos, alen); in set_type4_frame_classifier()
11363 pos = os_strstr(cmd, "dst_ip="); in set_type4_frame_classifier()
11364 if (pos) { in set_type4_frame_classifier()
11365 pos += 7; in set_type4_frame_classifier()
11366 end = os_strchr(pos, ' '); in set_type4_frame_classifier()
11368 end = pos + os_strlen(pos); in set_type4_frame_classifier()
11370 alen = end - pos; in set_type4_frame_classifier()
11373 os_memcpy(addr, pos, alen); in set_type4_frame_classifier()
11392 pos = os_strstr(cmd, "src_port="); in set_type4_frame_classifier()
11393 if (pos && atoi(pos + 9) > 0) { in set_type4_frame_classifier()
11395 param->ip_params.v4.src_port = atoi(pos + 9); in set_type4_frame_classifier()
11397 param->ip_params.v6.src_port = atoi(pos + 9); in set_type4_frame_classifier()
11401 pos = os_strstr(cmd, "dst_port="); in set_type4_frame_classifier()
11402 if (pos && atoi(pos + 9) > 0) { in set_type4_frame_classifier()
11404 param->ip_params.v4.dst_port = atoi(pos + 9); in set_type4_frame_classifier()
11406 param->ip_params.v6.dst_port = atoi(pos + 9); in set_type4_frame_classifier()
11410 pos = os_strstr(cmd, "dscp="); in set_type4_frame_classifier()
11411 if (pos && atoi(pos + 5) > 0) { in set_type4_frame_classifier()
11413 param->ip_params.v4.dscp = atoi(pos + 5); in set_type4_frame_classifier()
11415 param->ip_params.v6.dscp = atoi(pos + 5); in set_type4_frame_classifier()
11420 pos = os_strstr(cmd, "protocol="); in set_type4_frame_classifier()
11421 if (pos) { in set_type4_frame_classifier()
11422 if (os_strstr(pos, "udp")) { in set_type4_frame_classifier()
11424 } else if (os_strstr(pos, "tcp")) { in set_type4_frame_classifier()
11426 } else if (os_strstr(pos, "esp")) { in set_type4_frame_classifier()
11435 pos = os_strstr(cmd, "next_header="); in set_type4_frame_classifier()
11436 if (pos) { in set_type4_frame_classifier()
11437 if (os_strstr(pos, "udp")) { in set_type4_frame_classifier()
11439 } else if (os_strstr(pos, "tcp")) { in set_type4_frame_classifier()
11441 } else if (os_strstr(pos, "esp")) { in set_type4_frame_classifier()
11451 pos = os_strstr(cmd, "flow_label="); in set_type4_frame_classifier()
11452 if (pos) { in set_type4_frame_classifier()
11453 pos += 11; in set_type4_frame_classifier()
11454 end = os_strchr(pos, ' '); in set_type4_frame_classifier()
11456 end = pos + os_strlen(pos); in set_type4_frame_classifier()
11458 if (end - pos != 6 || in set_type4_frame_classifier()
11459 hexstr2bin(pos, param->ip_params.v6.flow_label, in set_type4_frame_classifier()
11478 const char *pos, *end; in set_type10_frame_classifier() local
11481 pos = os_strstr(cmd, "prot_instance="); in set_type10_frame_classifier()
11482 if (!pos) { in set_type10_frame_classifier()
11486 param->prot_instance = atoi(pos + 14); in set_type10_frame_classifier()
11488 pos = os_strstr(cmd, "prot_number="); in set_type10_frame_classifier()
11489 if (!pos) { in set_type10_frame_classifier()
11493 if (os_strstr(pos, "udp")) { in set_type10_frame_classifier()
11495 } else if (os_strstr(pos, "tcp")) { in set_type10_frame_classifier()
11497 } else if (os_strstr(pos, "esp")) { in set_type10_frame_classifier()
11504 pos = os_strstr(cmd, "filter_value="); in set_type10_frame_classifier()
11505 if (!pos) { in set_type10_frame_classifier()
11511 pos += 13; in set_type10_frame_classifier()
11512 end = os_strchr(pos, ' '); in set_type10_frame_classifier()
11514 end = pos + os_strlen(pos); in set_type10_frame_classifier()
11516 filter_len = (end - pos) / 2; in set_type10_frame_classifier()
11521 if (hexstr2bin(pos, param->filter_value, filter_len)) { in set_type10_frame_classifier()
11522 wpa_printf(MSG_ERROR, "Invalid filter_value %s", pos); in set_type10_frame_classifier()
11526 pos = os_strstr(cmd, "filter_mask="); in set_type10_frame_classifier()
11527 if (!pos) { in set_type10_frame_classifier()
11533 pos += 12; in set_type10_frame_classifier()
11534 end = os_strchr(pos, ' '); in set_type10_frame_classifier()
11536 end = pos + os_strlen(pos); in set_type10_frame_classifier()
11538 if (filter_len != (size_t) (end - pos) / 2) { in set_type10_frame_classifier()
11541 filter_len, (size_t) (end - pos) / 2); in set_type10_frame_classifier()
11549 if (hexstr2bin(pos, param->filter_mask, filter_len)) { in set_type10_frame_classifier()
11550 wpa_printf(MSG_ERROR, "Invalid filter mask %s", pos); in set_type10_frame_classifier()
11565 static int scs_parse_type4(struct tclas_element *elem, const char *pos) in scs_parse_type4() argument
11569 if (set_type4_frame_classifier(pos, &type4_param) == -1) { in scs_parse_type4()
11580 static int scs_parse_type10(struct tclas_element *elem, const char *pos) in scs_parse_type10() argument
11584 if (set_type10_frame_classifier(pos, &type10_param) == -1) { in scs_parse_type10()
11598 char *pos1, *pos; in wpas_ctrl_iface_configure_scs() local
11713 pos = os_strstr(pos1, "classifier_type="); in wpas_ctrl_iface_configure_scs()
11714 if (!pos) { in wpas_ctrl_iface_configure_scs()
11720 while (pos) { in wpas_ctrl_iface_configure_scs()
11724 val = atoi(pos + 16); in wpas_ctrl_iface_configure_scs()
11732 pos += 16; in wpas_ctrl_iface_configure_scs()
11734 next_tclas_elem = os_strstr(pos, "classifier_type="); in wpas_ctrl_iface_configure_scs()
11737 pos[next_tclas_elem - pos - 1] = '\0'; in wpas_ctrl_iface_configure_scs()
11742 if (scs_parse_type4(&elem, pos) < 0) in wpas_ctrl_iface_configure_scs()
11746 if (scs_parse_type10(&elem, pos) < 0) in wpas_ctrl_iface_configure_scs()
11762 pos = next_tclas_elem; in wpas_ctrl_iface_configure_scs()
11920 char *pos; in wpas_ctrl_iface_send_dscp_resp() local
11942 pos = os_strstr(cmd, "policy_id="); in wpas_ctrl_iface_send_dscp_resp()
11943 while (pos) { in wpas_ctrl_iface_send_dscp_resp()
11949 pos += 10; in wpas_ctrl_iface_send_dscp_resp()
11950 policy[num_policies].id = atoi(pos); in wpas_ctrl_iface_send_dscp_resp()
11956 pos = os_strstr(pos, "status="); in wpas_ctrl_iface_send_dscp_resp()
11957 if (!pos) { in wpas_ctrl_iface_send_dscp_resp()
11963 pos += 7; in wpas_ctrl_iface_send_dscp_resp()
11964 policy[num_policies].status = atoi(pos); in wpas_ctrl_iface_send_dscp_resp()
11967 pos = os_strstr(pos, "policy_id"); in wpas_ctrl_iface_send_dscp_resp()
11985 char *pos; in wpas_ctrl_iface_send_dscp_query() local
12001 pos = os_strstr(cmd, "domain_name="); in wpas_ctrl_iface_send_dscp_query()
12002 if (!pos || !os_strlen(pos + 12)) { in wpas_ctrl_iface_send_dscp_query()
12007 return wpas_send_dscp_query(wpa_s, pos + 12, os_strlen(pos + 12)); in wpas_ctrl_iface_send_dscp_query()
12017 char *pos, *end; in wpas_ctrl_iface_mlo_signal_poll() local
12027 pos = buf; in wpas_ctrl_iface_mlo_signal_poll()
12031 ret = os_snprintf(pos, end - pos, in wpas_ctrl_iface_mlo_signal_poll()
12038 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_signal_poll()
12040 pos += ret; in wpas_ctrl_iface_mlo_signal_poll()
12043 ret = os_snprintf(pos, end - pos, "WIDTH=%s\n", in wpas_ctrl_iface_mlo_signal_poll()
12046 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_signal_poll()
12048 pos += ret; in wpas_ctrl_iface_mlo_signal_poll()
12052 ret = os_snprintf(pos, end - pos, "CENTER_FRQ1=%d\n", in wpas_ctrl_iface_mlo_signal_poll()
12054 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_signal_poll()
12056 pos += ret; in wpas_ctrl_iface_mlo_signal_poll()
12060 ret = os_snprintf(pos, end - pos, "CENTER_FRQ2=%d\n", in wpas_ctrl_iface_mlo_signal_poll()
12062 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_signal_poll()
12064 pos += ret; in wpas_ctrl_iface_mlo_signal_poll()
12068 ret = os_snprintf(pos, end - pos, in wpas_ctrl_iface_mlo_signal_poll()
12071 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_signal_poll()
12073 pos += ret; in wpas_ctrl_iface_mlo_signal_poll()
12078 pos, end - pos, "AVG_BEACON_RSSI=%d\n", in wpas_ctrl_iface_mlo_signal_poll()
12080 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_signal_poll()
12082 pos += ret; in wpas_ctrl_iface_mlo_signal_poll()
12086 return pos - buf; in wpas_ctrl_iface_mlo_signal_poll()
12094 char *pos, *end; in wpas_ctrl_iface_mlo_status() local
12099 pos = buf; in wpas_ctrl_iface_mlo_status()
12103 ret = os_snprintf(pos, end - pos, "link_id=%d\nfreq=%u\n" in wpas_ctrl_iface_mlo_status()
12109 if (os_snprintf_error(end - pos, ret)) in wpas_ctrl_iface_mlo_status()
12110 return pos - buf; in wpas_ctrl_iface_mlo_status()
12111 pos += ret; in wpas_ctrl_iface_mlo_status()
12114 return pos - buf; in wpas_ctrl_iface_mlo_status()
12231 char *pos = token + 10; in wpas_ctrl_nan_publish() local
12233 if (os_strcmp(pos, "all") == 0) { in wpas_ctrl_nan_publish()
12240 while (pos && pos[0]) { in wpas_ctrl_nan_publish()
12241 int_array_add_unique(&freq_list, atoi(pos)); in wpas_ctrl_nan_publish()
12242 pos = os_strchr(pos, ','); in wpas_ctrl_nan_publish()
12243 if (pos) in wpas_ctrl_nan_publish()
12244 pos++; in wpas_ctrl_nan_publish()
13592 char *pos, *extra; in wpa_supplicant_global_iface_add() local
13607 iface.ifname = pos = cmd; in wpa_supplicant_global_iface_add()
13608 pos = os_strchr(pos, '\t'); in wpa_supplicant_global_iface_add()
13609 if (pos) in wpa_supplicant_global_iface_add()
13610 *pos++ = '\0'; in wpa_supplicant_global_iface_add()
13613 if (pos == NULL) in wpa_supplicant_global_iface_add()
13616 iface.confname = pos; in wpa_supplicant_global_iface_add()
13617 pos = os_strchr(pos, '\t'); in wpa_supplicant_global_iface_add()
13618 if (pos) in wpa_supplicant_global_iface_add()
13619 *pos++ = '\0'; in wpa_supplicant_global_iface_add()
13622 if (pos == NULL) in wpa_supplicant_global_iface_add()
13625 iface.driver = pos; in wpa_supplicant_global_iface_add()
13626 pos = os_strchr(pos, '\t'); in wpa_supplicant_global_iface_add()
13627 if (pos) in wpa_supplicant_global_iface_add()
13628 *pos++ = '\0'; in wpa_supplicant_global_iface_add()
13631 if (pos == NULL) in wpa_supplicant_global_iface_add()
13634 iface.ctrl_interface = pos; in wpa_supplicant_global_iface_add()
13635 pos = os_strchr(pos, '\t'); in wpa_supplicant_global_iface_add()
13636 if (pos) in wpa_supplicant_global_iface_add()
13637 *pos++ = '\0'; in wpa_supplicant_global_iface_add()
13640 if (pos == NULL) in wpa_supplicant_global_iface_add()
13643 iface.driver_param = pos; in wpa_supplicant_global_iface_add()
13644 pos = os_strchr(pos, '\t'); in wpa_supplicant_global_iface_add()
13645 if (pos) in wpa_supplicant_global_iface_add()
13646 *pos++ = '\0'; in wpa_supplicant_global_iface_add()
13649 if (pos == NULL) in wpa_supplicant_global_iface_add()
13652 iface.bridge_ifname = pos; in wpa_supplicant_global_iface_add()
13653 pos = os_strchr(pos, '\t'); in wpa_supplicant_global_iface_add()
13654 if (pos) in wpa_supplicant_global_iface_add()
13655 *pos++ = '\0'; in wpa_supplicant_global_iface_add()
13658 if (pos == NULL) in wpa_supplicant_global_iface_add()
13661 extra = pos; in wpa_supplicant_global_iface_add()
13662 pos = os_strchr(pos, '\t'); in wpa_supplicant_global_iface_add()
13663 if (pos) in wpa_supplicant_global_iface_add()
13664 *pos++ = '\0'; in wpa_supplicant_global_iface_add()
13670 if (!pos) in wpa_supplicant_global_iface_add()
13673 if (os_strcmp(pos, "sta") == 0) { in wpa_supplicant_global_iface_add()
13675 } else if (os_strcmp(pos, "ap") == 0) { in wpa_supplicant_global_iface_add()
13680 pos); in wpa_supplicant_global_iface_add()
13772 char *pos, *end; in wpa_supplicant_global_iface_list() local
13790 pos = buf; in wpa_supplicant_global_iface_list()
13793 res = os_snprintf(pos, end - pos, "%s\t%s\t%s\n", in wpa_supplicant_global_iface_list()
13796 if (os_snprintf_error(end - pos, res)) { in wpa_supplicant_global_iface_list()
13797 *pos = '\0'; in wpa_supplicant_global_iface_list()
13800 pos += res; in wpa_supplicant_global_iface_list()
13805 return pos - buf; in wpa_supplicant_global_iface_list()
13814 char *pos, *end; in wpa_supplicant_global_iface_interfaces() local
13822 pos = buf; in wpa_supplicant_global_iface_interfaces()
13827 res = os_snprintf(pos, end - pos, "%s ctrl_iface=%s\n", in wpa_supplicant_global_iface_interfaces()
13832 res = os_snprintf(pos, end - pos, "%s\n", in wpa_supplicant_global_iface_interfaces()
13835 if (os_snprintf_error(end - pos, res)) { in wpa_supplicant_global_iface_interfaces()
13836 *pos = '\0'; in wpa_supplicant_global_iface_interfaces()
13839 pos += res; in wpa_supplicant_global_iface_interfaces()
13842 return pos - buf; in wpa_supplicant_global_iface_interfaces()
14085 char *pos, *end; in wpas_global_ctrl_iface_status() local
14089 pos = buf; in wpas_global_ctrl_iface_status()
14094 ret = os_snprintf(pos, end - pos, "p2p_device_address=" MACSTR in wpas_global_ctrl_iface_status()
14099 if (os_snprintf_error(end - pos, ret)) in wpas_global_ctrl_iface_status()
14100 return pos - buf; in wpas_global_ctrl_iface_status()
14101 pos += ret; in wpas_global_ctrl_iface_status()
14103 ret = os_snprintf(pos, end - pos, "p2p_state=DISABLED\n"); in wpas_global_ctrl_iface_status()
14104 if (os_snprintf_error(end - pos, ret)) in wpas_global_ctrl_iface_status()
14105 return pos - buf; in wpas_global_ctrl_iface_status()
14106 pos += ret; in wpas_global_ctrl_iface_status()
14111 ret = os_snprintf(pos, end - pos, "wifi_display=%d\n", in wpas_global_ctrl_iface_status()
14113 if (os_snprintf_error(end - pos, ret)) in wpas_global_ctrl_iface_status()
14114 return pos - buf; in wpas_global_ctrl_iface_status()
14115 pos += ret; in wpas_global_ctrl_iface_status()
14119 ret = os_snprintf(pos, end - pos, "ifname=%s\n" in wpas_global_ctrl_iface_status()
14122 if (os_snprintf_error(end - pos, ret)) in wpas_global_ctrl_iface_status()
14123 return pos - buf; in wpas_global_ctrl_iface_status()
14124 pos += ret; in wpas_global_ctrl_iface_status()
14127 return pos - buf; in wpas_global_ctrl_iface_status()
14193 char *pos = os_strchr(buf + 7, ' '); in wpa_supplicant_global_ctrl_iface_process() local
14194 if (pos) { in wpa_supplicant_global_ctrl_iface_process()
14195 *pos++ = '\0'; in wpa_supplicant_global_ctrl_iface_process()
14197 buf + 7, pos, in wpa_supplicant_global_ctrl_iface_process()