Lines Matching full:ctrl
106 printf("wpa_cli [-p<path to ctrl sockets>] [-i<ifname>] [-hvB] "
108 " [-P<pid file>] [-g<global ctrl>] [-G<ping interval>] "
399 static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, char *cmd, int print)
416 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len,
435 static int wpa_ctrl_command(struct wpa_ctrl *ctrl, char *cmd)
437 return _wpa_ctrl_command(ctrl, cmd, 1);
471 static int wpa_cli_cmd(struct wpa_ctrl *ctrl, const char *cmd, int min_args,
483 return wpa_ctrl_command(ctrl, buf);
487 static int wpa_cli_cmd_ifname(struct wpa_ctrl *ctrl, int argc, char *argv[])
489 return wpa_ctrl_command(ctrl, "IFNAME");
493 static int wpa_cli_cmd_status(struct wpa_ctrl *ctrl, int argc, char *argv[])
496 return wpa_ctrl_command(ctrl, "STATUS-VERBOSE");
498 return wpa_ctrl_command(ctrl, "STATUS-WPS");
499 return wpa_ctrl_command(ctrl, "STATUS");
503 static int wpa_cli_cmd_ping(struct wpa_ctrl *ctrl, int argc, char *argv[])
505 return wpa_ctrl_command(ctrl, "PING");
509 static int wpa_cli_cmd_relog(struct wpa_ctrl *ctrl, int argc, char *argv[])
511 return wpa_ctrl_command(ctrl, "RELOG");
515 static int wpa_cli_cmd_note(struct wpa_ctrl *ctrl, int argc, char *argv[])
517 return wpa_cli_cmd(ctrl, "NOTE", 1, argc, argv);
521 static int wpa_cli_cmd_mib(struct wpa_ctrl *ctrl, int argc, char *argv[])
523 return wpa_ctrl_command(ctrl, "MIB");
527 static int wpa_cli_cmd_pmksa(struct wpa_ctrl *ctrl, int argc, char *argv[])
529 return wpa_ctrl_command(ctrl, "PMKSA");
533 static int wpa_cli_cmd_help(struct wpa_ctrl *ctrl, int argc, char *argv[])
555 static int wpa_cli_cmd_license(struct wpa_ctrl *ctrl, int argc, char *argv[])
562 static int wpa_cli_cmd_quit(struct wpa_ctrl *ctrl, int argc, char *argv[])
571 static int wpa_cli_cmd_set(struct wpa_ctrl *ctrl, int argc, char *argv[])
582 return wpa_ctrl_command(ctrl, cmd);
585 return wpa_cli_cmd(ctrl, "SET", 2, argc, argv);
649 static int wpa_cli_cmd_get(struct wpa_ctrl *ctrl, int argc, char *argv[])
651 return wpa_cli_cmd(ctrl, "GET", 1, argc, argv);
655 static int wpa_cli_cmd_logoff(struct wpa_ctrl *ctrl, int argc, char *argv[])
657 return wpa_ctrl_command(ctrl, "LOGOFF");
661 static int wpa_cli_cmd_logon(struct wpa_ctrl *ctrl, int argc, char *argv[])
663 return wpa_ctrl_command(ctrl, "LOGON");
667 static int wpa_cli_cmd_reassociate(struct wpa_ctrl *ctrl, int argc,
670 return wpa_ctrl_command(ctrl, "REASSOCIATE");
674 static int wpa_cli_cmd_preauthenticate(struct wpa_ctrl *ctrl, int argc,
677 return wpa_cli_cmd(ctrl, "PREAUTH", 1, argc, argv);
681 static int wpa_cli_cmd_ap_scan(struct wpa_ctrl *ctrl, int argc, char *argv[])
683 return wpa_cli_cmd(ctrl, "AP_SCAN", 1, argc, argv);
687 static int wpa_cli_cmd_scan_interval(struct wpa_ctrl *ctrl, int argc,
690 return wpa_cli_cmd(ctrl, "SCAN_INTERVAL", 1, argc, argv);
694 static int wpa_cli_cmd_bss_expire_age(struct wpa_ctrl *ctrl, int argc,
697 return wpa_cli_cmd(ctrl, "BSS_EXPIRE_AGE", 1, argc, argv);
701 static int wpa_cli_cmd_bss_expire_count(struct wpa_ctrl *ctrl, int argc,
704 return wpa_cli_cmd(ctrl, "BSS_EXPIRE_COUNT", 1, argc, argv);
708 static int wpa_cli_cmd_bss_flush(struct wpa_ctrl *ctrl, int argc, char *argv[])
721 return wpa_ctrl_command(ctrl, cmd);
725 static int wpa_cli_cmd_stkstart(struct wpa_ctrl *ctrl, int argc,
728 return wpa_cli_cmd(ctrl, "STKSTART", 1, argc, argv);
732 static int wpa_cli_cmd_ft_ds(struct wpa_ctrl *ctrl, int argc, char *argv[])
734 return wpa_cli_cmd(ctrl, "FT_DS", 1, argc, argv);
738 static int wpa_cli_cmd_wps_pbc(struct wpa_ctrl *ctrl, int argc, char *argv[])
740 return wpa_cli_cmd(ctrl, "WPS_PBC", 0, argc, argv);
744 static int wpa_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc, char *argv[])
754 return wpa_cli_cmd(ctrl, "WPS_PIN", 1, argc, argv);
758 static int wpa_cli_cmd_wps_check_pin(struct wpa_ctrl *ctrl, int argc,
761 return wpa_cli_cmd(ctrl, "WPS_CHECK_PIN", 1, argc, argv);
765 static int wpa_cli_cmd_wps_cancel(struct wpa_ctrl *ctrl, int argc,
768 return wpa_ctrl_command(ctrl, "WPS_CANCEL");
774 static int wpa_cli_cmd_wps_nfc(struct wpa_ctrl *ctrl, int argc, char *argv[])
776 return wpa_cli_cmd(ctrl, "WPS_NFC", 0, argc, argv);
780 static int wpa_cli_cmd_wps_nfc_config_token(struct wpa_ctrl *ctrl, int argc,
783 return wpa_cli_cmd(ctrl, "WPS_NFC_CONFIG_TOKEN", 1, argc, argv);
787 static int wpa_cli_cmd_wps_nfc_token(struct wpa_ctrl *ctrl, int argc,
790 return wpa_cli_cmd(ctrl, "WPS_NFC_TOKEN", 1, argc, argv);
794 static int wpa_cli_cmd_wps_nfc_tag_read(struct wpa_ctrl *ctrl, int argc,
813 ret = wpa_ctrl_command(ctrl, buf);
820 static int wpa_cli_cmd_nfc_get_handover_req(struct wpa_ctrl *ctrl, int argc,
823 return wpa_cli_cmd(ctrl, "NFC_GET_HANDOVER_REQ", 2, argc, argv);
827 static int wpa_cli_cmd_nfc_get_handover_sel(struct wpa_ctrl *ctrl, int argc,
830 return wpa_cli_cmd(ctrl, "NFC_GET_HANDOVER_SEL", 2, argc, argv);
834 static int wpa_cli_cmd_nfc_rx_handover_req(struct wpa_ctrl *ctrl, int argc,
853 ret = wpa_ctrl_command(ctrl, buf);
860 static int wpa_cli_cmd_nfc_rx_handover_sel(struct wpa_ctrl *ctrl, int argc,
879 ret = wpa_ctrl_command(ctrl, buf);
886 static int wpa_cli_cmd_nfc_report_handover(struct wpa_ctrl *ctrl, int argc,
889 return wpa_cli_cmd(ctrl, "NFC_REPORT_HANDOVER", 4, argc, argv);
895 static int wpa_cli_cmd_wps_reg(struct wpa_ctrl *ctrl, int argc, char *argv[])
948 return wpa_ctrl_command(ctrl, cmd);
952 static int wpa_cli_cmd_wps_ap_pin(struct wpa_ctrl *ctrl, int argc,
955 return wpa_cli_cmd(ctrl, "WPS_AP_PIN", 1, argc, argv);
959 static int wpa_cli_cmd_wps_er_start(struct wpa_ctrl *ctrl, int argc,
962 return wpa_cli_cmd(ctrl, "WPS_ER_START", 0, argc, argv);
966 static int wpa_cli_cmd_wps_er_stop(struct wpa_ctrl *ctrl, int argc,
969 return wpa_ctrl_command(ctrl, "WPS_ER_STOP");
974 static int wpa_cli_cmd_wps_er_pin(struct wpa_ctrl *ctrl, int argc,
986 return wpa_cli_cmd(ctrl, "WPS_ER_PIN", 2, argc, argv);
990 static int wpa_cli_cmd_wps_er_pbc(struct wpa_ctrl *ctrl, int argc,
993 return wpa_cli_cmd(ctrl, "WPS_ER_PBC", 1, argc, argv);
997 static int wpa_cli_cmd_wps_er_learn(struct wpa_ctrl *ctrl, int argc,
1007 return wpa_cli_cmd(ctrl, "WPS_ER_LEARN", 2, argc, argv);
1011 static int wpa_cli_cmd_wps_er_set_config(struct wpa_ctrl *ctrl, int argc,
1022 return wpa_cli_cmd(ctrl, "WPS_ER_SET_CONFIG", 2, argc, argv);
1026 static int wpa_cli_cmd_wps_er_config(struct wpa_ctrl *ctrl, int argc,
1073 return wpa_ctrl_command(ctrl, cmd);
1078 static int wpa_cli_cmd_wps_er_nfc_config_token(struct wpa_ctrl *ctrl, int argc,
1089 return wpa_cli_cmd(ctrl, "WPS_ER_NFC_CONFIG_TOKEN", 2, argc, argv);
1094 static int wpa_cli_cmd_ibss_rsn(struct wpa_ctrl *ctrl, int argc, char *argv[])
1096 return wpa_cli_cmd(ctrl, "IBSS_RSN", 1, argc, argv);
1100 static int wpa_cli_cmd_level(struct wpa_ctrl *ctrl, int argc, char *argv[])
1102 return wpa_cli_cmd(ctrl, "LEVEL", 1, argc, argv);
1106 static int wpa_cli_cmd_identity(struct wpa_ctrl *ctrl, int argc, char *argv[])
1135 return wpa_ctrl_command(ctrl, cmd);
1139 static int wpa_cli_cmd_password(struct wpa_ctrl *ctrl, int argc, char *argv[])
1168 return wpa_ctrl_command(ctrl, cmd);
1172 static int wpa_cli_cmd_new_password(struct wpa_ctrl *ctrl, int argc,
1202 return wpa_ctrl_command(ctrl, cmd);
1206 static int wpa_cli_cmd_pin(struct wpa_ctrl *ctrl, int argc, char *argv[])
1234 return wpa_ctrl_command(ctrl, cmd);
1238 static int wpa_cli_cmd_otp(struct wpa_ctrl *ctrl, int argc, char *argv[])
1267 return wpa_ctrl_command(ctrl, cmd);
1271 static int wpa_cli_cmd_passphrase(struct wpa_ctrl *ctrl, int argc,
1301 return wpa_ctrl_command(ctrl, cmd);
1305 static int wpa_cli_cmd_bssid(struct wpa_ctrl *ctrl, int argc, char *argv[])
1313 return wpa_cli_cmd(ctrl, "BSSID", 2, argc, argv);
1317 static int wpa_cli_cmd_blacklist(struct wpa_ctrl *ctrl, int argc, char *argv[])
1319 return wpa_cli_cmd(ctrl, "BLACKLIST", 0, argc, argv);
1323 static int wpa_cli_cmd_log_level(struct wpa_ctrl *ctrl, int argc, char *argv[])
1325 return wpa_cli_cmd(ctrl, "LOG_LEVEL", 0, argc, argv);
1329 static int wpa_cli_cmd_list_networks(struct wpa_ctrl *ctrl, int argc,
1332 return wpa_ctrl_command(ctrl, "LIST_NETWORKS");
1336 static int wpa_cli_cmd_select_network(struct wpa_ctrl *ctrl, int argc,
1339 return wpa_cli_cmd(ctrl, "SELECT_NETWORK", 1, argc, argv);
1343 static int wpa_cli_cmd_enable_network(struct wpa_ctrl *ctrl, int argc,
1346 return wpa_cli_cmd(ctrl, "ENABLE_NETWORK", 1, argc, argv);
1350 static int wpa_cli_cmd_disable_network(struct wpa_ctrl *ctrl, int argc,
1353 return wpa_cli_cmd(ctrl, "DISABLE_NETWORK", 1, argc, argv);
1357 static int wpa_cli_cmd_add_network(struct wpa_ctrl *ctrl, int argc,
1360 return wpa_ctrl_command(ctrl, "ADD_NETWORK");
1364 static int wpa_cli_cmd_remove_network(struct wpa_ctrl *ctrl, int argc,
1367 return wpa_cli_cmd(ctrl, "REMOVE_NETWORK", 1, argc, argv);
1392 ctrl, int argc,
1406 return wpa_cli_cmd(ctrl, "SET_NETWORK", 3, argc, argv);
1410 static int wpa_cli_cmd_get_network(struct wpa_ctrl *ctrl, int argc,
1424 return wpa_cli_cmd(ctrl, "GET_NETWORK", 2, argc, argv);
1428 static int wpa_cli_cmd_list_creds(struct wpa_ctrl *ctrl, int argc,
1431 return wpa_ctrl_command(ctrl, "LIST_CREDS");
1435 static int wpa_cli_cmd_add_cred(struct wpa_ctrl *ctrl, int argc, char *argv[])
1437 return wpa_ctrl_command(ctrl, "ADD_CRED");
1441 static int wpa_cli_cmd_remove_cred(struct wpa_ctrl *ctrl, int argc,
1444 return wpa_cli_cmd(ctrl, "REMOVE_CRED", 1, argc, argv);
1448 static int wpa_cli_cmd_set_cred(struct wpa_ctrl *ctrl, int argc, char *argv[])
1456 return wpa_cli_cmd(ctrl, "SET_CRED", 3, argc, argv);
1460 static int wpa_cli_cmd_disconnect(struct wpa_ctrl *ctrl, int argc,
1463 return wpa_ctrl_command(ctrl, "DISCONNECT");
1467 static int wpa_cli_cmd_reconnect(struct wpa_ctrl *ctrl, int argc,
1470 return wpa_ctrl_command(ctrl, "RECONNECT");
1474 static int wpa_cli_cmd_save_config(struct wpa_ctrl *ctrl, int argc,
1477 return wpa_ctrl_command(ctrl, "SAVE_CONFIG");
1481 static int wpa_cli_cmd_scan(struct wpa_ctrl *ctrl, int argc, char *argv[])
1483 return wpa_cli_cmd(ctrl, "SCAN", 0, argc, argv);
1487 static int wpa_cli_cmd_scan_results(struct wpa_ctrl *ctrl, int argc,
1490 return wpa_ctrl_command(ctrl, "SCAN_RESULTS");
1494 static int wpa_cli_cmd_bss(struct wpa_ctrl *ctrl, int argc, char *argv[])
1496 return wpa_cli_cmd(ctrl, "BSS", 1, argc, argv);
1515 static int wpa_cli_cmd_get_capability(struct wpa_ctrl *ctrl, int argc,
1530 return wpa_cli_cmd(ctrl, "GET_CAPABILITY", 1, argc, argv);
1534 static int wpa_cli_list_interfaces(struct wpa_ctrl *ctrl)
1537 return wpa_ctrl_command(ctrl, "INTERFACES");
1541 static int wpa_cli_cmd_interface(struct wpa_ctrl *ctrl, int argc, char *argv[])
1544 wpa_cli_list_interfaces(ctrl);
1562 static int wpa_cli_cmd_reconfigure(struct wpa_ctrl *ctrl, int argc,
1565 return wpa_ctrl_command(ctrl, "RECONFIGURE");
1569 static int wpa_cli_cmd_terminate(struct wpa_ctrl *ctrl, int argc,
1572 return wpa_ctrl_command(ctrl, "TERMINATE");
1576 static int wpa_cli_cmd_interface_add(struct wpa_ctrl *ctrl, int argc,
1603 return wpa_ctrl_command(ctrl, cmd);
1607 static int wpa_cli_cmd_interface_remove(struct wpa_ctrl *ctrl, int argc,
1610 return wpa_cli_cmd(ctrl, "INTERFACE_REMOVE", 1, argc, argv);
1614 static int wpa_cli_cmd_interface_list(struct wpa_ctrl *ctrl, int argc,
1617 return wpa_ctrl_command(ctrl, "INTERFACE_LIST");
1622 static int wpa_cli_cmd_sta(struct wpa_ctrl *ctrl, int argc, char *argv[])
1624 return wpa_cli_cmd(ctrl, "STA", 1, argc, argv);
1628 static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, char *cmd,
1640 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len,
1664 static int wpa_cli_cmd_all_sta(struct wpa_ctrl *ctrl, int argc, char *argv[])
1668 if (wpa_ctrl_command_sta(ctrl, "STA-FIRST", addr, sizeof(addr)))
1672 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr)) == 0);
1678 static int wpa_cli_cmd_deauthenticate(struct wpa_ctrl *ctrl, int argc,
1681 return wpa_cli_cmd(ctrl, "DEAUTHENTICATE", 1, argc, argv);
1685 static int wpa_cli_cmd_disassociate(struct wpa_ctrl *ctrl, int argc,
1688 return wpa_cli_cmd(ctrl, "DISASSOCIATE", 1, argc, argv);
1693 static int wpa_cli_cmd_suspend(struct wpa_ctrl *ctrl, int argc, char *argv[])
1695 return wpa_ctrl_command(ctrl, "SUSPEND");
1699 static int wpa_cli_cmd_resume(struct wpa_ctrl *ctrl, int argc, char *argv[])
1701 return wpa_ctrl_command(ctrl, "RESUME");
1705 static int wpa_cli_cmd_drop_sa(struct wpa_ctrl *ctrl, int argc, char *argv[])
1707 return wpa_ctrl_command(ctrl, "DROP_SA");
1711 static int wpa_cli_cmd_roam(struct wpa_ctrl *ctrl, int argc, char *argv[])
1713 return wpa_cli_cmd(ctrl, "ROAM", 1, argc, argv);
1719 static int wpa_cli_cmd_p2p_find(struct wpa_ctrl *ctrl, int argc, char *argv[])
1721 return wpa_cli_cmd(ctrl, "P2P_FIND", 0, argc, argv);
1754 static int wpa_cli_cmd_p2p_stop_find(struct wpa_ctrl *ctrl, int argc,
1757 return wpa_ctrl_command(ctrl, "P2P_STOP_FIND");
1761 static int wpa_cli_cmd_p2p_connect(struct wpa_ctrl *ctrl, int argc,
1764 return wpa_cli_cmd(ctrl, "P2P_CONNECT", 2, argc, argv);
1783 static int wpa_cli_cmd_p2p_listen(struct wpa_ctrl *ctrl, int argc,
1786 return wpa_cli_cmd(ctrl, "P2P_LISTEN", 0, argc, argv);
1790 static int wpa_cli_cmd_p2p_group_remove(struct wpa_ctrl *ctrl, int argc,
1793 return wpa_cli_cmd(ctrl, "P2P_GROUP_REMOVE", 1, argc, argv);
1812 static int wpa_cli_cmd_p2p_group_add(struct wpa_ctrl *ctrl, int argc,
1815 return wpa_cli_cmd(ctrl, "P2P_GROUP_ADD", 0, argc, argv);
1819 static int wpa_cli_cmd_p2p_prov_disc(struct wpa_ctrl *ctrl, int argc,
1829 return wpa_cli_cmd(ctrl, "P2P_PROV_DISC", 2, argc, argv);
1833 static int wpa_cli_cmd_p2p_get_passphrase(struct wpa_ctrl *ctrl, int argc,
1836 return wpa_ctrl_command(ctrl, "P2P_GET_PASSPHRASE");
1840 static int wpa_cli_cmd_p2p_serv_disc_req(struct wpa_ctrl *ctrl, int argc,
1855 return wpa_ctrl_command(ctrl, cmd);
1859 static int wpa_cli_cmd_p2p_serv_disc_cancel_req(struct wpa_ctrl *ctrl,
1862 return wpa_cli_cmd(ctrl, "P2P_SERV_DISC_CANCEL_REQ", 1, argc, argv);
1866 static int wpa_cli_cmd_p2p_serv_disc_resp(struct wpa_ctrl *ctrl, int argc,
1883 return wpa_ctrl_command(ctrl, cmd);
1887 static int wpa_cli_cmd_p2p_service_update(struct wpa_ctrl *ctrl, int argc,
1890 return wpa_ctrl_command(ctrl, "P2P_SERVICE_UPDATE");
1894 static int wpa_cli_cmd_p2p_serv_disc_external(struct wpa_ctrl *ctrl,
1897 return wpa_cli_cmd(ctrl, "P2P_SERV_DISC_EXTERNAL", 1, argc, argv);
1901 static int wpa_cli_cmd_p2p_service_flush(struct wpa_ctrl *ctrl, int argc,
1904 return wpa_ctrl_command(ctrl, "P2P_SERVICE_FLUSH");
1908 static int wpa_cli_cmd_p2p_service_add(struct wpa_ctrl *ctrl, int argc,
1931 return wpa_ctrl_command(ctrl, cmd);
1935 static int wpa_cli_cmd_p2p_service_del(struct wpa_ctrl *ctrl, int argc,
1958 return wpa_ctrl_command(ctrl, cmd);
1962 static int wpa_cli_cmd_p2p_reject(struct wpa_ctrl *ctrl,
1965 return wpa_cli_cmd(ctrl, "P2P_REJECT", 1, argc, argv);
1969 static int wpa_cli_cmd_p2p_invite(struct wpa_ctrl *ctrl,
1972 return wpa_cli_cmd(ctrl, "P2P_INVITE", 1, argc, argv);
1976 static int wpa_cli_cmd_p2p_peer(struct wpa_ctrl *ctrl, int argc, char *argv[])
1978 return wpa_cli_cmd(ctrl, "P2P_PEER", 1, argc, argv);
1997 static int wpa_ctrl_command_p2p_peer(struct wpa_ctrl *ctrl, char *cmd,
2008 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len,
2033 static int wpa_cli_cmd_p2p_peers(struct wpa_ctrl *ctrl, int argc, char *argv[])
2040 if (wpa_ctrl_command_p2p_peer(ctrl, "P2P_PEER FIRST",
2045 } while (wpa_ctrl_command_p2p_peer(ctrl, cmd, addr, sizeof(addr),
2052 static int wpa_cli_cmd_p2p_set(struct wpa_ctrl *ctrl, int argc, char *argv[])
2054 return wpa_cli_cmd(ctrl, "P2P_SET", 2, argc, argv);
2102 static int wpa_cli_cmd_p2p_flush(struct wpa_ctrl *ctrl, int argc, char *argv[])
2104 return wpa_ctrl_command(ctrl, "P2P_FLUSH");
2108 static int wpa_cli_cmd_p2p_cancel(struct wpa_ctrl *ctrl, int argc,
2111 return wpa_ctrl_command(ctrl, "P2P_CANCEL");
2115 static int wpa_cli_cmd_p2p_unauthorize(struct wpa_ctrl *ctrl, int argc,
2118 return wpa_cli_cmd(ctrl, "P2P_UNAUTHORIZE", 1, argc, argv);
2122 static int wpa_cli_cmd_p2p_presence_req(struct wpa_ctrl *ctrl, int argc,
2133 return wpa_cli_cmd(ctrl, "P2P_PRESENCE_REQ", 0, argc, argv);
2137 static int wpa_cli_cmd_p2p_ext_listen(struct wpa_ctrl *ctrl, int argc,
2149 return wpa_cli_cmd(ctrl, "P2P_EXT_LISTEN", 0, argc, argv);
2153 static int wpa_cli_cmd_p2p_remove_client(struct wpa_ctrl *ctrl, int argc,
2156 return wpa_cli_cmd(ctrl, "P2P_REMOVE_CLIENT", 1, argc, argv);
2163 static int wpa_cli_cmd_wfd_subelem_set(struct wpa_ctrl *ctrl, int argc,
2180 return wpa_ctrl_command(ctrl, cmd);
2184 static int wpa_cli_cmd_wfd_subelem_get(struct wpa_ctrl *ctrl, int argc,
2201 return wpa_ctrl_command(ctrl, cmd);
2207 static int wpa_cli_cmd_fetch_anqp(struct wpa_ctrl *ctrl, int argc,
2210 return wpa_ctrl_command(ctrl, "FETCH_ANQP");
2214 static int wpa_cli_cmd_stop_fetch_anqp(struct wpa_ctrl *ctrl, int argc,
2217 return wpa_ctrl_command(ctrl, "STOP_FETCH_ANQP");
2221 static int wpa_cli_cmd_interworking_select(struct wpa_ctrl *ctrl, int argc,
2224 return wpa_cli_cmd(ctrl, "INTERWORKING_SELECT", 0, argc, argv);
2228 static int wpa_cli_cmd_interworking_connect(struct wpa_ctrl *ctrl, int argc,
2231 return wpa_cli_cmd(ctrl, "INTERWORKING_CONNECT", 1, argc, argv);
2235 static int wpa_cli_cmd_anqp_get(struct wpa_ctrl *ctrl, int argc, char *argv[])
2237 return wpa_cli_cmd(ctrl, "ANQP_GET", 2, argc, argv);
2241 static int wpa_cli_cmd_gas_request(struct wpa_ctrl *ctrl, int argc,
2244 return wpa_cli_cmd(ctrl, "GAS_REQUEST", 2, argc, argv);
2248 static int wpa_cli_cmd_gas_response_get(struct wpa_ctrl *ctrl, int argc,
2251 return wpa_cli_cmd(ctrl, "GAS_RESPONSE_GET", 2, argc, argv);
2258 static int wpa_cli_cmd_hs20_anqp_get(struct wpa_ctrl *ctrl, int argc,
2261 return wpa_cli_cmd(ctrl, "HS20_ANQP_GET", 2, argc, argv);
2265 static int wpa_cli_cmd_get_nai_home_realm_list(struct wpa_ctrl *ctrl, int argc,
2280 return wpa_ctrl_command(ctrl, cmd);
2286 static int wpa_cli_cmd_sta_autoconnect(struct wpa_ctrl *ctrl, int argc,
2289 return wpa_cli_cmd(ctrl, "STA_AUTOCONNECT", 1, argc, argv);
2293 static int wpa_cli_cmd_tdls_discover(struct wpa_ctrl *ctrl, int argc,
2296 return wpa_cli_cmd(ctrl, "TDLS_DISCOVER", 1, argc, argv);
2300 static int wpa_cli_cmd_tdls_setup(struct wpa_ctrl *ctrl, int argc,
2303 return wpa_cli_cmd(ctrl, "TDLS_SETUP", 1, argc, argv);
2307 static int wpa_cli_cmd_tdls_teardown(struct wpa_ctrl *ctrl, int argc,
2310 return wpa_cli_cmd(ctrl, "TDLS_TEARDOWN", 1, argc, argv);
2314 static int wpa_cli_cmd_signal_poll(struct wpa_ctrl *ctrl, int argc,
2317 return wpa_ctrl_command(ctrl, "SIGNAL_POLL");
2321 static int wpa_cli_cmd_pktcnt_poll(struct wpa_ctrl *ctrl, int argc,
2324 return wpa_ctrl_command(ctrl, "PKTCNT_POLL");
2328 static int wpa_cli_cmd_reauthenticate(struct wpa_ctrl *ctrl, int argc,
2331 return wpa_ctrl_command(ctrl, "REAUTHENTICATE");
2337 static int wpa_cli_cmd_autoscan(struct wpa_ctrl *ctrl, int argc, char *argv[])
2340 return wpa_ctrl_command(ctrl, "AUTOSCAN ");
2342 return wpa_cli_cmd(ctrl, "AUTOSCAN", 0, argc, argv);
2350 static int wpa_cli_cmd_wnm_sleep(struct wpa_ctrl *ctrl, int argc, char *argv[])
2352 return wpa_cli_cmd(ctrl, "WNM_SLEEP", 0, argc, argv);
2356 static int wpa_cli_cmd_wnm_bss_query(struct wpa_ctrl *ctrl, int argc, char *argv[])
2358 return wpa_cli_cmd(ctrl, "WNM_BSS_QUERY", 1, argc, argv);
2364 static int wpa_cli_cmd_raw(struct wpa_ctrl *ctrl, int argc, char *argv[])
2368 return wpa_cli_cmd(ctrl, argv[0], 0, argc - 1, &argv[1]);
2373 static int wpa_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc, char *argv[])
2389 return wpa_ctrl_command(ctrl, cmd);
2394 static int wpa_cli_cmd_flush(struct wpa_ctrl *ctrl, int argc, char *argv[])
2396 return wpa_ctrl_command(ctrl, "FLUSH");
2407 int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
3003 static int wpa_request(struct wpa_ctrl *ctrl, int argc, char *argv[])
3051 ret = match->handler(ctrl, argc - 1, &argv[1]);
3292 static void wpa_cli_recv_pending(struct wpa_ctrl *ctrl, int action_monitor)
3298 while (wpa_ctrl_pending(ctrl) > 0) {
3301 if (wpa_ctrl_recv(ctrl, buf, &len) == 0) {
3322 if (wpa_ctrl_pending(ctrl) < 0) {
3429 static void update_bssid_list(struct wpa_ctrl *ctrl)
3437 if (ctrl == NULL)
3439 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len, NULL);
3460 static void update_ifnames(struct wpa_ctrl *ctrl)
3471 if (ctrl == NULL)
3473 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len, NULL);
3540 static void wpa_cli_action(struct wpa_ctrl *ctrl)
3552 fd = wpa_ctrl_get_fd(ctrl);
3566 wpa_cli_recv_pending(ctrl, 1);
3570 if (wpa_ctrl_request(ctrl, "PING", 4, buf, &len,
3640 struct wpa_ctrl *ctrl;
3643 ctrl = wpa_ctrl_open(NULL);
3644 if (ctrl == NULL)
3648 ret = wpa_ctrl_request(ctrl, "INTERFACES", 10, buf, &len, NULL);
3656 wpa_ctrl_close(ctrl);