Lines Matching full:ctrl
48 static void update_stations(struct wpa_ctrl *ctrl);
82 static void register_event_handler(struct wpa_ctrl *ctrl)
88 !eloop_register_read_sock(wpa_ctrl_get_fd(ctrl),
95 static void unregister_event_handler(struct wpa_ctrl *ctrl)
100 eloop_unregister_read_sock(wpa_ctrl_get_fd(ctrl));
193 static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd, int print)
204 ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len,
221 static inline int wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd)
223 return _wpa_ctrl_command(ctrl, cmd, 1);
227 static int hostapd_cli_cmd(struct wpa_ctrl *ctrl, const char *cmd,
239 return wpa_ctrl_command(ctrl, buf);
243 static int hostapd_cli_cmd_ping(struct wpa_ctrl *ctrl, int argc, char *argv[])
245 return wpa_ctrl_command(ctrl, "PING");
249 static int hostapd_cli_cmd_relog(struct wpa_ctrl *ctrl, int argc, char *argv[])
251 return wpa_ctrl_command(ctrl, "RELOG");
255 static int hostapd_cli_cmd_close_log(struct wpa_ctrl *ctrl, int argc,
258 return wpa_ctrl_command(ctrl, "CLOSE_LOG");
262 static int hostapd_cli_cmd_status(struct wpa_ctrl *ctrl, int argc, char *argv[])
265 return wpa_ctrl_command(ctrl, "STATUS-DRIVER");
266 return wpa_ctrl_command(ctrl, "STATUS");
270 static int hostapd_cli_cmd_mib(struct wpa_ctrl *ctrl, int argc, char *argv[])
275 return wpa_ctrl_command(ctrl, buf);
277 return wpa_ctrl_command(ctrl, "MIB");
323 static int hostapd_cli_cmd_sta(struct wpa_ctrl *ctrl, int argc, char *argv[])
335 return wpa_ctrl_command(ctrl, buf);
354 static int hostapd_cli_cmd_new_sta(struct wpa_ctrl *ctrl, int argc,
364 return wpa_ctrl_command(ctrl, buf);
368 static int hostapd_cli_cmd_deauthenticate(struct wpa_ctrl *ctrl, int argc,
382 return wpa_ctrl_command(ctrl, buf);
386 static int hostapd_cli_cmd_disassociate(struct wpa_ctrl *ctrl, int argc,
400 return wpa_ctrl_command(ctrl, buf);
405 static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc,
415 return wpa_ctrl_command(ctrl, buf);
420 static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc,
430 return wpa_ctrl_command(ctrl, buf);
435 static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
452 return wpa_ctrl_command(ctrl, buf);
456 static int hostapd_cli_cmd_wps_check_pin(struct wpa_ctrl *ctrl, int argc,
478 return wpa_ctrl_command(ctrl, cmd);
482 static int hostapd_cli_cmd_wps_pbc(struct wpa_ctrl *ctrl, int argc,
485 return wpa_ctrl_command(ctrl, "WPS_PBC");
489 static int hostapd_cli_cmd_wps_cancel(struct wpa_ctrl *ctrl, int argc,
492 return wpa_ctrl_command(ctrl, "WPS_CANCEL");
497 static int hostapd_cli_cmd_wps_nfc_tag_read(struct wpa_ctrl *ctrl, int argc,
516 ret = wpa_ctrl_command(ctrl, buf);
523 static int hostapd_cli_cmd_wps_nfc_config_token(struct wpa_ctrl *ctrl,
541 return wpa_ctrl_command(ctrl, cmd);
545 static int hostapd_cli_cmd_wps_nfc_token(struct wpa_ctrl *ctrl,
562 return wpa_ctrl_command(ctrl, cmd);
566 static int hostapd_cli_cmd_nfc_get_handover_sel(struct wpa_ctrl *ctrl,
584 return wpa_ctrl_command(ctrl, cmd);
590 static int hostapd_cli_cmd_wps_ap_pin(struct wpa_ctrl *ctrl, int argc,
607 return wpa_ctrl_command(ctrl, buf);
611 static int hostapd_cli_cmd_wps_get_status(struct wpa_ctrl *ctrl, int argc,
614 return wpa_ctrl_command(ctrl, "WPS_GET_STATUS");
618 static int hostapd_cli_cmd_wps_config(struct wpa_ctrl *ctrl, int argc,
658 return wpa_ctrl_command(ctrl, buf);
663 static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
679 return wpa_ctrl_command(ctrl, buf);
683 static int hostapd_cli_cmd_ess_disassoc(struct wpa_ctrl *ctrl, int argc,
699 return wpa_ctrl_command(ctrl, buf);
703 static int hostapd_cli_cmd_bss_tm_req(struct wpa_ctrl *ctrl, int argc,
726 return wpa_ctrl_command(ctrl, buf);
730 static int hostapd_cli_cmd_get_config(struct wpa_ctrl *ctrl, int argc,
733 return wpa_ctrl_command(ctrl, "GET_CONFIG");
737 static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, const char *cmd,
749 ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len,
774 static int hostapd_cli_cmd_all_sta(struct wpa_ctrl *ctrl, int argc,
779 if (wpa_ctrl_command_sta(ctrl, "STA-FIRST", addr, sizeof(addr), 1))
783 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr), 1) == 0);
789 static int hostapd_cli_cmd_list_sta(struct wpa_ctrl *ctrl, int argc,
794 if (wpa_ctrl_command_sta(ctrl, "STA-FIRST", addr, sizeof(addr), 0))
800 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr), 0) == 0);
806 static int hostapd_cli_cmd_help(struct wpa_ctrl *ctrl, int argc, char *argv[])
828 static int hostapd_cli_cmd_license(struct wpa_ctrl *ctrl, int argc,
836 static int hostapd_cli_cmd_set_qos_map_set(struct wpa_ctrl *ctrl,
852 return wpa_ctrl_command(ctrl, buf);
856 static int hostapd_cli_cmd_send_qos_map_conf(struct wpa_ctrl *ctrl,
871 return wpa_ctrl_command(ctrl, buf);
875 static int hostapd_cli_cmd_hs20_wnm_notif(struct wpa_ctrl *ctrl, int argc,
891 return wpa_ctrl_command(ctrl, buf);
895 static int hostapd_cli_cmd_hs20_deauth_req(struct wpa_ctrl *ctrl, int argc,
916 return wpa_ctrl_command(ctrl, buf);
920 static int hostapd_cli_cmd_quit(struct wpa_ctrl *ctrl, int argc, char *argv[])
929 static int hostapd_cli_cmd_level(struct wpa_ctrl *ctrl, int argc, char *argv[])
938 return wpa_ctrl_command(ctrl, cmd);
942 static void update_stations(struct wpa_ctrl *ctrl)
946 if (!ctrl || !interactive)
951 if (wpa_ctrl_command_sta(ctrl, "STA-FIRST", addr, sizeof(addr), 0))
957 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr), 0) == 0);
961 static void hostapd_cli_get_interfaces(struct wpa_ctrl *ctrl,
967 if (!ctrl || !interfaces)
983 static void hostapd_cli_list_interfaces(struct wpa_ctrl *ctrl)
1006 static int hostapd_cli_cmd_interface(struct wpa_ctrl *ctrl, int argc,
1010 hostapd_cli_list_interfaces(ctrl);
1039 static int hostapd_cli_cmd_set(struct wpa_ctrl *ctrl, int argc, char *argv[])
1055 return wpa_ctrl_command(ctrl, cmd);
1097 static int hostapd_cli_cmd_get(struct wpa_ctrl *ctrl, int argc, char *argv[])
1113 return wpa_ctrl_command(ctrl, cmd);
1143 static int hostapd_cli_cmd_fst(struct wpa_ctrl *ctrl, int argc, char *argv[])
1166 return wpa_ctrl_command(ctrl, cmd);
1172 static int hostapd_cli_cmd_color_change(struct wpa_ctrl *ctrl,
1175 return hostapd_cli_cmd(ctrl, "COLOR_CHANGE", 1, argc, argv);
1180 static int hostapd_cli_cmd_chan_switch(struct wpa_ctrl *ctrl,
1215 return wpa_ctrl_command(ctrl, cmd);
1219 static int hostapd_cli_cmd_notify_cw_change(struct wpa_ctrl *ctrl,
1222 return hostapd_cli_cmd(ctrl, "NOTIFY_CW_CHANGE", 1, argc, argv);
1226 static int hostapd_cli_cmd_enable(struct wpa_ctrl *ctrl, int argc,
1229 return wpa_ctrl_command(ctrl, "ENABLE");
1233 static int hostapd_cli_cmd_reload(struct wpa_ctrl *ctrl, int argc,
1236 return wpa_ctrl_command(ctrl, "RELOAD");
1240 static int hostapd_cli_cmd_reload_bss(struct wpa_ctrl *ctrl, int argc,
1243 return wpa_ctrl_command(ctrl, "RELOAD_BSS");
1247 static int hostapd_cli_cmd_reload_config(struct wpa_ctrl *ctrl, int argc,
1250 return wpa_ctrl_command(ctrl, "RELOAD_CONFIG");
1254 static int hostapd_cli_cmd_disable(struct wpa_ctrl *ctrl, int argc,
1257 return wpa_ctrl_command(ctrl, "DISABLE");
1261 static int hostapd_cli_cmd_enable_mld(struct wpa_ctrl *ctrl, int argc,
1264 return wpa_ctrl_command(ctrl, "ENABLE_MLD");
1268 static int hostapd_cli_cmd_disable_mld(struct wpa_ctrl *ctrl, int argc,
1271 return wpa_ctrl_command(ctrl, "DISABLE_MLD");
1275 static int hostapd_cli_cmd_update_beacon(struct wpa_ctrl *ctrl, int argc,
1278 return wpa_ctrl_command(ctrl, "UPDATE_BEACON");
1282 static int hostapd_cli_cmd_stop_ap(struct wpa_ctrl *ctrl, int argc,
1285 return wpa_ctrl_command(ctrl, "STOP_AP");
1289 static int hostapd_cli_cmd_vendor(struct wpa_ctrl *ctrl, int argc, char *argv[])
1307 return wpa_ctrl_command(ctrl, cmd);
1311 static int hostapd_cli_cmd_erp_flush(struct wpa_ctrl *ctrl, int argc,
1314 return wpa_ctrl_command(ctrl, "ERP_FLUSH");
1318 static int hostapd_cli_cmd_log_level(struct wpa_ctrl *ctrl, int argc,
1333 return wpa_ctrl_command(ctrl, cmd);
1337 static int hostapd_cli_cmd_raw(struct wpa_ctrl *ctrl, int argc, char *argv[])
1341 return hostapd_cli_cmd(ctrl, argv[0], 0, argc - 1, &argv[1]);
1345 static int hostapd_cli_cmd_pmksa(struct wpa_ctrl *ctrl, int argc, char *argv[])
1347 return wpa_ctrl_command(ctrl, "PMKSA");
1351 static int hostapd_cli_cmd_pmksa_flush(struct wpa_ctrl *ctrl, int argc,
1354 return wpa_ctrl_command(ctrl, "PMKSA_FLUSH");
1358 static int hostapd_cli_cmd_set_neighbor(struct wpa_ctrl *ctrl, int argc,
1376 return wpa_ctrl_command(ctrl, cmd);
1380 static int hostapd_cli_cmd_show_neighbor(struct wpa_ctrl *ctrl, int argc,
1383 return wpa_ctrl_command(ctrl, "SHOW_NEIGHBOR");
1387 static int hostapd_cli_cmd_remove_neighbor(struct wpa_ctrl *ctrl, int argc,
1390 return hostapd_cli_cmd(ctrl, "REMOVE_NEIGHBOR", 1, argc, argv);
1394 static int hostapd_cli_cmd_req_lci(struct wpa_ctrl *ctrl, int argc,
1410 return wpa_ctrl_command(ctrl, cmd);
1414 static int hostapd_cli_cmd_req_range(struct wpa_ctrl *ctrl, int argc,
1422 return hostapd_cli_cmd(ctrl, "REQ_RANGE", 4, argc, argv);
1426 static int hostapd_cli_cmd_driver_flags(struct wpa_ctrl *ctrl, int argc,
1429 return wpa_ctrl_command(ctrl, "DRIVER_FLAGS");
1433 static int hostapd_cli_cmd_driver_flags2(struct wpa_ctrl *ctrl, int argc,
1436 return wpa_ctrl_command(ctrl, "DRIVER_FLAGS2");
1442 static int hostapd_cli_cmd_dpp_qr_code(struct wpa_ctrl *ctrl, int argc,
1445 return hostapd_cli_cmd(ctrl, "DPP_QR_CODE", 1, argc, argv);
1449 static int hostapd_cli_cmd_dpp_bootstrap_gen(struct wpa_ctrl *ctrl, int argc,
1452 return hostapd_cli_cmd(ctrl, "DPP_BOOTSTRAP_GEN", 1, argc, argv);
1456 static int hostapd_cli_cmd_dpp_bootstrap_remove(struct wpa_ctrl *ctrl, int argc,
1459 return hostapd_cli_cmd(ctrl, "DPP_BOOTSTRAP_REMOVE", 1, argc, argv);
1463 static int hostapd_cli_cmd_dpp_bootstrap_get_uri(struct wpa_ctrl *ctrl,
1466 return hostapd_cli_cmd(ctrl, "DPP_BOOTSTRAP_GET_URI", 1, argc, argv);
1470 static int hostapd_cli_cmd_dpp_bootstrap_info(struct wpa_ctrl *ctrl, int argc,
1473 return hostapd_cli_cmd(ctrl, "DPP_BOOTSTRAP_INFO", 1, argc, argv);
1477 static int hostapd_cli_cmd_dpp_bootstrap_set(struct wpa_ctrl *ctrl, int argc,
1480 return hostapd_cli_cmd(ctrl, "DPP_BOOTSTRAP_SET", 1, argc, argv);
1484 static int hostapd_cli_cmd_dpp_auth_init(struct wpa_ctrl *ctrl, int argc,
1487 return hostapd_cli_cmd(ctrl, "DPP_AUTH_INIT", 1, argc, argv);
1491 static int hostapd_cli_cmd_dpp_listen(struct wpa_ctrl *ctrl, int argc,
1494 return hostapd_cli_cmd(ctrl, "DPP_LISTEN", 1, argc, argv);
1498 static int hostapd_cli_cmd_dpp_stop_listen(struct wpa_ctrl *ctrl, int argc,
1501 return wpa_ctrl_command(ctrl, "DPP_STOP_LISTEN");
1505 static int hostapd_cli_cmd_dpp_configurator_add(struct wpa_ctrl *ctrl, int argc,
1508 return hostapd_cli_cmd(ctrl, "DPP_CONFIGURATOR_ADD", 0, argc, argv);
1512 static int hostapd_cli_cmd_dpp_configurator_remove(struct wpa_ctrl *ctrl,
1515 return hostapd_cli_cmd(ctrl, "DPP_CONFIGURATOR_REMOVE", 1, argc, argv);
1519 static int hostapd_cli_cmd_dpp_configurator_get_key(struct wpa_ctrl *ctrl,
1522 return hostapd_cli_cmd(ctrl, "DPP_CONFIGURATOR_GET_KEY", 1, argc, argv);
1526 static int hostapd_cli_cmd_dpp_configurator_sign(struct wpa_ctrl *ctrl,
1529 return hostapd_cli_cmd(ctrl, "DPP_CONFIGURATOR_SIGN", 1, argc, argv);
1533 static int hostapd_cli_cmd_dpp_pkex_add(struct wpa_ctrl *ctrl, int argc,
1536 return hostapd_cli_cmd(ctrl, "DPP_PKEX_ADD", 1, argc, argv);
1540 static int hostapd_cli_cmd_dpp_pkex_remove(struct wpa_ctrl *ctrl, int argc,
1543 return hostapd_cli_cmd(ctrl, "DPP_PKEX_REMOVE", 1, argc, argv);
1549 static int hostapd_cli_cmd_dpp_controller_start(struct wpa_ctrl *ctrl, int argc,
1552 return hostapd_cli_cmd(ctrl, "DPP_CONTROLLER_START", 0, argc, argv);
1556 static int hostapd_cli_cmd_dpp_controller_stop(struct wpa_ctrl *ctrl, int argc,
1559 return wpa_ctrl_command(ctrl, "DPP_CONTROLLER_STOP");
1563 static int hostapd_cli_cmd_dpp_chirp(struct wpa_ctrl *ctrl, int argc,
1566 return hostapd_cli_cmd(ctrl, "DPP_CHIRP", 1, argc, argv);
1570 static int hostapd_cli_cmd_dpp_stop_chirp(struct wpa_ctrl *ctrl, int argc,
1573 return wpa_ctrl_command(ctrl, "DPP_STOP_CHIRP");
1580 static int hostapd_cli_cmd_dpp_push_button(struct wpa_ctrl *ctrl, int argc,
1583 return hostapd_cli_cmd(ctrl, "DPP_PUSH_BUTTON", 0, argc, argv);
1589 static int hostapd_cli_cmd_accept_macacl(struct wpa_ctrl *ctrl, int argc,
1592 return hostapd_cli_cmd(ctrl, "ACCEPT_ACL", 1, argc, argv);
1596 static int hostapd_cli_cmd_deny_macacl(struct wpa_ctrl *ctrl, int argc,
1599 return hostapd_cli_cmd(ctrl, "DENY_ACL", 1, argc, argv);
1603 static int hostapd_cli_cmd_poll_sta(struct wpa_ctrl *ctrl, int argc,
1606 return hostapd_cli_cmd(ctrl, "POLL_STA", 1, argc, argv);
1610 static int hostapd_cli_cmd_req_beacon(struct wpa_ctrl *ctrl, int argc,
1613 return hostapd_cli_cmd(ctrl, "REQ_BEACON", 2, argc, argv);
1617 static int hostapd_cli_cmd_req_link_measurement(struct wpa_ctrl *ctrl, int argc,
1620 return hostapd_cli_cmd(ctrl, "REQ_LINK_MEASUREMENT", 1, argc, argv);
1624 static int hostapd_cli_cmd_reload_wpa_psk(struct wpa_ctrl *ctrl, int argc,
1627 return wpa_ctrl_command(ctrl, "RELOAD_WPA_PSK");
1633 static int hostapd_cli_cmd_get_rxkhs(struct wpa_ctrl *ctrl, int argc,
1636 return wpa_ctrl_command(ctrl, "GET_RXKHS");
1640 static int hostapd_cli_cmd_reload_rxkhs(struct wpa_ctrl *ctrl, int argc,
1643 return wpa_ctrl_command(ctrl, "RELOAD_RXKHS");
1650 static int hostapd_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc, char *argv[])
1652 return hostapd_cli_cmd(ctrl, "DRIVER", 1, argc, argv);
1659 int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
1922 static void wpa_request(struct wpa_ctrl *ctrl, int argc, char *argv[])
1956 match->handler(ctrl, argc - 1, &argv[1]);
1989 static void hostapd_cli_recv_pending(struct wpa_ctrl *ctrl, int in_read,
1995 while (wpa_ctrl_pending(ctrl)) {
1998 if (wpa_ctrl_recv(ctrl, buf, &len) == 0) {
2168 struct wpa_ctrl *ctrl = eloop_ctx;
2174 if (wpa_ctrl_request(ctrl, "PING", 4, buf, &len,
2182 ctrl, NULL);
2189 struct wpa_ctrl *ctrl = eloop_ctx;
2191 hostapd_cli_recv_pending(ctrl, 0, 1);
2195 static void hostapd_cli_action(struct wpa_ctrl *ctrl)
2199 fd = wpa_ctrl_get_fd(ctrl);
2201 ctrl, NULL);
2202 eloop_register_read_sock(fd, hostapd_cli_action_receive, ctrl, NULL);
2204 eloop_cancel_timeout(hostapd_cli_action_ping, ctrl, NULL);