wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
ctrl_iface.h File Reference

WPA Supplicant / UNIX domain socket -based control interface. More...

Go to the source code of this file.

Functions

char * wpa_supplicant_ctrl_iface_process (struct wpa_supplicant *wpa_s, char *buf, size_t *resp_len)
 Process ctrl_iface command. More...
 
char * wpa_supplicant_global_ctrl_iface_process (struct wpa_global *global, char *buf, size_t *resp_len)
 Process global ctrl_iface command. More...
 
struct ctrl_iface_privwpa_supplicant_ctrl_iface_init (struct wpa_supplicant *wpa_s)
 Initialize control interface. More...
 
void wpa_supplicant_ctrl_iface_deinit (struct ctrl_iface_priv *priv)
 Deinitialize control interface. More...
 
void wpa_supplicant_ctrl_iface_wait (struct ctrl_iface_priv *priv)
 Wait for ctrl_iface monitor. More...
 
struct ctrl_iface_global_privwpa_supplicant_global_ctrl_iface_init (struct wpa_global *global)
 Initialize global control interface. More...
 
void wpa_supplicant_global_ctrl_iface_deinit (struct ctrl_iface_global_priv *priv)
 Deinitialize global ctrl interface. More...
 
void wpas_ctrl_radio_work_flush (struct wpa_supplicant *wpa_s)
 

Detailed Description

WPA Supplicant / UNIX domain socket -based control interface.

Function Documentation

void wpa_supplicant_ctrl_iface_deinit ( struct ctrl_iface_priv priv)

Deinitialize control interface.

Parameters
privPointer to private data from wpa_supplicant_ctrl_iface_init()

Deinitialize the control interface that was initialized with wpa_supplicant_ctrl_iface_init().

Required to be implemented in each control interface backend.

struct ctrl_iface_priv* wpa_supplicant_ctrl_iface_init ( struct wpa_supplicant wpa_s)

Initialize control interface.

Parameters
wpa_sPointer to wpa_supplicant data
Returns
Pointer to private data on success, NULL on failure

Initialize the control interface and start receiving commands from external programs.

Required to be implemented in each control interface backend.

char* wpa_supplicant_ctrl_iface_process ( struct wpa_supplicant wpa_s,
char *  buf,
size_t *  resp_len 
)

Process ctrl_iface command.

Parameters
wpa_sPointer to wpa_supplicant data
bufReceived command buffer (nul terminated string)
resp_lenVariable to be set to the response length
Returns
Response (*resp_len bytes) or NULL on failure

Control interface backends call this function when receiving a message that they do not process internally, i.e., anything else than ATTACH, DETACH, and LEVEL. The return response value is then sent to the external program that sent the command. Caller is responsible for freeing the buffer after this. If NULL is returned, *resp_len can be set to two special values: 1 = send "FAIL\n" response, 2 = send "OK\n" response. If *resp_len has any other value, no response is sent.

void wpa_supplicant_ctrl_iface_wait ( struct ctrl_iface_priv priv)

Wait for ctrl_iface monitor.

Parameters
privPointer to private data from wpa_supplicant_ctrl_iface_init()

Wait until the first message from an external program using the control interface is received. This function can be used to delay normal startup processing to allow control interface programs to attach with wpa_supplicant before normal operations are started.

Required to be implemented in each control interface backend.

void wpa_supplicant_global_ctrl_iface_deinit ( struct ctrl_iface_global_priv priv)

Deinitialize global ctrl interface.

Parameters
privPointer to private data from wpa_supplicant_global_ctrl_iface_init()

Deinitialize the global control interface that was initialized with wpa_supplicant_global_ctrl_iface_init().

Required to be implemented in each control interface backend.

struct ctrl_iface_global_priv* wpa_supplicant_global_ctrl_iface_init ( struct wpa_global global)

Initialize global control interface.

Parameters
globalPointer to global data from wpa_supplicant_init()
Returns
Pointer to private data on success, NULL on failure

Initialize the global control interface and start receiving commands from external programs.

Required to be implemented in each control interface backend.

char* wpa_supplicant_global_ctrl_iface_process ( struct wpa_global global,
char *  buf,
size_t *  resp_len 
)

Process global ctrl_iface command.

Parameters
globalPointer to global data from wpa_supplicant_init()
bufReceived command buffer (nul terminated string)
resp_lenVariable to be set to the response length
Returns
Response (*resp_len bytes) or NULL on failure

Control interface backends call this function when receiving a message from the global ctrl_iface connection. The return response value is then sent to the external program that sent the command. Caller is responsible for freeing the buffer after this. If NULL is returned, *resp_len can be set to two special values: 1 = send "FAIL\n" response, 2 = send "OK\n" response. If *resp_len has any other value, no response is sent.