#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/un.h>
#include "wpa_ctrl.h"
Include dependency graph for wpa_ctrl.c:
Go to the source code of this file.
Functions | |
wpa_ctrl * | wpa_ctrl_open (const char *ctrl_path) |
Open a control interface to wpa_supplicant/hostapd. | |
void | wpa_ctrl_close (struct wpa_ctrl *ctrl) |
Close a control interface to wpa_supplicant/hostapd. | |
int | wpa_ctrl_request (struct wpa_ctrl *ctrl, const char *cmd, size_t cmd_len, char *reply, size_t *reply_len, void(*msg_cb)(char *msg, size_t len)) |
Send a command to wpa_supplicant/hostapd. | |
int | wpa_ctrl_attach (struct wpa_ctrl *ctrl) |
Register as an event monitor for the control interface. | |
int | wpa_ctrl_detach (struct wpa_ctrl *ctrl) |
Unregister event monitor from the control interface. | |
int | wpa_ctrl_recv (struct wpa_ctrl *ctrl, char *reply, size_t *reply_len) |
Receive a pending control interface message. | |
int | wpa_ctrl_pending (struct wpa_ctrl *ctrl) |
Check whether there are pending event messages. | |
int | wpa_ctrl_get_fd (struct wpa_ctrl *ctrl) |
Get file descriptor used by the control interface. |
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
Definition in file wpa_ctrl.c.
|
Register as an event monitor for the control interface.
Definition at line 200 of file wpa_ctrl.c. |
|
Close a control interface to wpa_supplicant/hostapd.
Definition at line 128 of file wpa_ctrl.c. |
|
Unregister event monitor from the control interface.
Definition at line 206 of file wpa_ctrl.c. |
|
Get file descriptor used by the control interface.
The returned file descriptor must not be used directly for sending or receiving packets; instead, the library functions wpa_ctrl_request() and wpa_ctrl_recv() must be used for this. Definition at line 238 of file wpa_ctrl.c. |
|
Open a control interface to wpa_supplicant/hostapd.
Definition at line 56 of file wpa_ctrl.c. |
|
Check whether there are pending event messages.
Definition at line 224 of file wpa_ctrl.c. |
|
Receive a pending control interface message.
Definition at line 212 of file wpa_ctrl.c. |
|
Send a command to wpa_supplicant/hostapd.
msg_cb can be used to register a callback function that will be called for unsolicited messages received while waiting for the command response. These messages may be received if wpa_ctrl_request() is called at the same time as wpa_supplicant/hostapd is sending such a message. This can happen only if the program has used wpa_ctrl_attach() to register itself as a monitor for event messages. Alternatively to msg_cb, programs can register two control interface connections and use one of them for commands and the other one for receiving event messages, in other words, call wpa_ctrl_attach() only for the control interface connection that will be used for event messages. Definition at line 138 of file wpa_ctrl.c. |