22 #include <sys/socket.h> 28 #define CONFIG_CTRL_IFACE_CLIENT_DIR "/tmp" 29 #define CONFIG_CTRL_IFACE_CLIENT_PREFIX "wpa_ctrl_" 76 char *reply,
size_t *reply_len);
struct sockaddr_un dest
目标套接字地址的结构
int wpa_ctrl_pending(struct wpa_ctrl *ctrl)
检查是否存在挂起(pending)的事件消息
struct sockaddr_un local
本地套接字地址的结构
int wpa_ctrl_send(struct wpa_ctrl *ctrl, const char *cmd, size_t cmd_len)
向wpa_supplicant/hostapd发送命令,但不会等待响应
void wpa_ctrl_close(struct wpa_ctrl *ctrl)
关闭wpa_supplicant/hostapd的控制接口
int wpa_ctrl_attach(struct wpa_ctrl *ctrl)
注册为控制接口的事件监视器
struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path)
打开wpa_supplicant/hostapd的控制接口
int wpa_ctrl_recv(struct wpa_ctrl *ctrl, char *reply, size_t *reply_len)
接收挂起(pending)的控制接口消息
int wpa_ctrl_request(struct wpa_ctrl *ctrl, const char *cmd, size_t cmd_len, char *reply, size_t *reply_len)
发送指令到wpa_supplicant/hostapd
int wpa_ctrl_detach(struct wpa_ctrl *ctrl)
从控制接口注销事件监视器
int wpa_ctrl_get_fd(struct wpa_ctrl *ctrl)
获取控制接口使用的文件描述符