Lines Matching refs:ctrl
201 static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, char *cmd, int print) in _wpa_ctrl_command() argument
212 ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len, in _wpa_ctrl_command()
229 static int wpa_ctrl_command(struct wpa_ctrl *ctrl, char *cmd) in wpa_ctrl_command() argument
231 return _wpa_ctrl_command(ctrl, cmd, 1); in wpa_ctrl_command()
235 static int wpa_cli_cmd_status(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_status() argument
238 return wpa_ctrl_command(ctrl, verbose ? "STATUS-VERBOSE" : "STATUS"); in wpa_cli_cmd_status()
242 static int wpa_cli_cmd_ping(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_ping() argument
244 return wpa_ctrl_command(ctrl, "PING"); in wpa_cli_cmd_ping()
248 static int wpa_cli_cmd_mib(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_mib() argument
250 return wpa_ctrl_command(ctrl, "MIB"); in wpa_cli_cmd_mib()
254 static int wpa_cli_cmd_pmksa(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_pmksa() argument
256 return wpa_ctrl_command(ctrl, "PMKSA"); in wpa_cli_cmd_pmksa()
260 static int wpa_cli_cmd_help(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_help() argument
267 static int wpa_cli_cmd_license(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_license() argument
274 static int wpa_cli_cmd_quit(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_quit() argument
301 static int wpa_cli_cmd_set(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_set() argument
322 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_set()
326 static int wpa_cli_cmd_logoff(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_logoff() argument
328 return wpa_ctrl_command(ctrl, "LOGOFF"); in wpa_cli_cmd_logoff()
332 static int wpa_cli_cmd_logon(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_logon() argument
334 return wpa_ctrl_command(ctrl, "LOGON"); in wpa_cli_cmd_logon()
338 static int wpa_cli_cmd_reassociate(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_reassociate() argument
341 return wpa_ctrl_command(ctrl, "REASSOCIATE"); in wpa_cli_cmd_reassociate()
345 static int wpa_cli_cmd_preauthenticate(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_preauthenticate() argument
362 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_preauthenticate()
366 static int wpa_cli_cmd_ap_scan(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_ap_scan() argument
381 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_ap_scan()
385 static int wpa_cli_cmd_stkstart(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_stkstart() argument
402 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_stkstart()
406 static int wpa_cli_cmd_ft_ds(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_ft_ds() argument
422 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_ft_ds()
426 static int wpa_cli_cmd_wps_pbc(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_wps_pbc() argument
433 return wpa_ctrl_command(ctrl, "WPS_PBC"); in wpa_cli_cmd_wps_pbc()
442 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_wps_pbc()
446 static int wpa_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_wps_pin() argument
466 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_wps_pin()
475 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_wps_pin()
479 static int wpa_cli_cmd_wps_reg(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_wps_reg() argument
496 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_wps_reg()
500 static int wpa_cli_cmd_level(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_level() argument
515 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_level()
519 static int wpa_cli_cmd_identity(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_identity() argument
548 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_identity()
552 static int wpa_cli_cmd_password(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_password() argument
581 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_password()
585 static int wpa_cli_cmd_new_password(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_new_password() argument
615 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_new_password()
619 static int wpa_cli_cmd_pin(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_pin() argument
647 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_pin()
651 static int wpa_cli_cmd_otp(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_otp() argument
680 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_otp()
684 static int wpa_cli_cmd_passphrase(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_passphrase() argument
714 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_passphrase()
718 static int wpa_cli_cmd_bssid(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_bssid() argument
746 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_bssid()
751 static int wpa_cli_cmd_scan_interval(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_scan_interval() argument
767 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_scan_interval()
771 static int wpa_cli_cmd_blacklist(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_blacklist() argument
793 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_blacklist()
797 static int wpa_cli_cmd_log_level(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_log_level() argument
819 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_log_level()
824 static int wpa_cli_cmd_list_networks(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_list_networks() argument
827 return wpa_ctrl_command(ctrl, "LIST_NETWORKS"); in wpa_cli_cmd_list_networks()
831 static int wpa_cli_cmd_select_network(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_select_network() argument
848 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_select_network()
852 static int wpa_cli_cmd_enable_network(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_enable_network() argument
869 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_enable_network()
873 static int wpa_cli_cmd_disable_network(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_disable_network() argument
890 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_disable_network()
894 static int wpa_cli_cmd_add_network(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_add_network() argument
897 return wpa_ctrl_command(ctrl, "ADD_NETWORK"); in wpa_cli_cmd_add_network()
901 static int wpa_cli_cmd_remove_network(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_remove_network() argument
918 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_remove_network()
943 static int wpa_cli_cmd_set_network(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_set_network() argument
966 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_set_network()
970 static int wpa_cli_cmd_get_network(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_get_network() argument
993 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_get_network()
997 static int wpa_cli_cmd_disconnect(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_disconnect() argument
1000 return wpa_ctrl_command(ctrl, "DISCONNECT"); in wpa_cli_cmd_disconnect()
1004 static int wpa_cli_cmd_reconnect(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_reconnect() argument
1007 return wpa_ctrl_command(ctrl, "RECONNECT"); in wpa_cli_cmd_reconnect()
1011 static int wpa_cli_cmd_save_config(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_save_config() argument
1014 return wpa_ctrl_command(ctrl, "SAVE_CONFIG"); in wpa_cli_cmd_save_config()
1018 static int wpa_cli_cmd_scan(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_scan() argument
1020 return wpa_ctrl_command(ctrl, "SCAN"); in wpa_cli_cmd_scan()
1024 static int wpa_cli_cmd_scan_results(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_scan_results() argument
1027 return wpa_ctrl_command(ctrl, "SCAN_RESULTS"); in wpa_cli_cmd_scan_results()
1031 static int wpa_cli_cmd_bss(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_bss() argument
1047 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_bss()
1051 static int wpa_cli_cmd_get_capability(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_get_capability() argument
1075 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_get_capability()
1079 static int wpa_cli_list_interfaces(struct wpa_ctrl *ctrl) in wpa_cli_list_interfaces() argument
1082 return wpa_ctrl_command(ctrl, "INTERFACES"); in wpa_cli_list_interfaces()
1086 static int wpa_cli_cmd_interface(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_cli_cmd_interface() argument
1089 wpa_cli_list_interfaces(ctrl); in wpa_cli_cmd_interface()
1113 static int wpa_cli_cmd_reconfigure(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_reconfigure() argument
1116 return wpa_ctrl_command(ctrl, "RECONFIGURE"); in wpa_cli_cmd_reconfigure()
1120 static int wpa_cli_cmd_terminate(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_terminate() argument
1123 return wpa_ctrl_command(ctrl, "TERMINATE"); in wpa_cli_cmd_terminate()
1127 static int wpa_cli_cmd_interface_add(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_interface_add() argument
1154 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_interface_add()
1158 static int wpa_cli_cmd_interface_remove(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_interface_remove() argument
1174 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_interface_remove()
1178 static int wpa_cli_cmd_interface_list(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_interface_list() argument
1181 return wpa_ctrl_command(ctrl, "INTERFACE_LIST"); in wpa_cli_cmd_interface_list()
1185 static int wpa_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc, in wpa_cli_cmd_driver() argument
1201 return wpa_ctrl_command(ctrl, cmd); in wpa_cli_cmd_driver()
1212 int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
1439 static int wpa_request(struct wpa_ctrl *ctrl, int argc, char *argv[]) in wpa_request() argument
1478 ctrl = monitor_conn; in wpa_request()
1480 ret = match->handler(ctrl, argc - 1, &argv[1]); in wpa_request()
1608 static void wpa_cli_recv_pending(struct wpa_ctrl *ctrl, int in_read, in wpa_cli_recv_pending() argument
1612 if (ctrl == NULL) { in wpa_cli_recv_pending()
1616 while (wpa_ctrl_pending(ctrl) > 0) { in wpa_cli_recv_pending()
1619 if (wpa_ctrl_recv(ctrl, buf, &len) == 0) { in wpa_cli_recv_pending()
1635 if (wpa_ctrl_pending(ctrl) < 0) { in wpa_cli_recv_pending()
1799 static void wpa_cli_action(struct wpa_ctrl *ctrl) in wpa_cli_action() argument
1811 fd = wpa_ctrl_get_fd(ctrl); in wpa_cli_action()
1825 wpa_cli_recv_pending(ctrl, 0, 1); in wpa_cli_action()
1829 if (wpa_ctrl_request(ctrl, "PING", 4, buf, &len, in wpa_cli_action()
1916 struct wpa_ctrl *ctrl; in wpa_cli_get_default_ifname() local
1919 ctrl = wpa_ctrl_open(NULL); in wpa_cli_get_default_ifname()
1920 if (ctrl == NULL) in wpa_cli_get_default_ifname()
1924 ret = wpa_ctrl_request(ctrl, "INTERFACES", 10, buf, &len, NULL); in wpa_cli_get_default_ifname()
1932 wpa_ctrl_close(ctrl); in wpa_cli_get_default_ifname()