⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ctrl_iface.doxygen

📁 hostapd源代码
💻 DOXYGEN
字号:
/**\page ctrl_iface_page Control interfacehostapd implements a control interface that can be used byexternal programs to control the operations of the hostapddaemon and to get status information and event notifications. There isa small C library, in a form of a single C file, wpa_ctrl.c, thatprovides helper functions to facilitate the use of the controlinterface. External programs can link this file into them and then usethe library functions documented in wpa_ctrl.h to interact with%wpa_supplicant. This library can also be used with C++. hostapd_cli.cis an example program using this library.There are multiple mechanisms for inter-process communication. Forexample, Linux version of hostapd is using UNIX domain sockets for thecontrol interface. The use of the functions defined in wpa_ctrl.h canbe used to hide the details of the used IPC from external programs.\section using_ctrl_iface Using the control interfaceExternal programs, e.g., a GUI or a configuration utility, that need tocommunicate with hostapd should link in wpa_ctrl.c. Thisallows them to use helper functions to open connection to the controlinterface with wpa_ctrl_open() and to send commands withwpa_ctrl_request().hostapd uses the control interface for two types of communication:commands and unsolicited event messages. Commands are a pair ofmessages, a request from the external program and a response fromhostapd. These can be executed using wpa_ctrl_request().Unsolicited event messages are sent by hostapd to the controlinterface connection without specific request from the external programfor receiving each message. However, the external program needs toattach to the control interface with wpa_ctrl_attach() to receive theseunsolicited messages.If the control interface connection is used both for commands andunsolicited event messages, there is potential for receiving anunsolicited message between the command request and response.wpa_ctrl_request() caller will need to supply a callback, msg_cb,for processing these messages. Often it is easier to open twocontrol interface connections by calling wpa_ctrl_open() twice andthen use one of the connections for commands and the other one forunsolicited messages. This way command request/response pairs willnot be broken by unsolicited messages. wpa_cli is an example of howto use only one connection for both purposes and wpa_gui demonstrateshow to use two separate connections.Once the control interface connection is not needed anymore, it shouldbe closed by calling wpa_ctrl_close(). If the connection was used forunsolicited event messages, it should be first detached by callingwpa_ctrl_detach().\section ctrl_iface_cmds Control interface commandsFollowing commands can be used with wpa_ctrl_request():\subsection ctrl_iface_PING PINGThis command can be used to test whether hostapd is replyingto the control interface commands. The expected reply is \c PONG if theconnection is open and hostapd is processing commands.*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -