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

WPA Supplicant / dbus-based control interface. More...

#include "includes.h"
#include <dbus/dbus.h>
#include "common.h"
#include "eloop.h"
#include "wps/wps.h"
#include "../config.h"
#include "../wpa_supplicant_i.h"
#include "../bss.h"
#include "dbus_old.h"
#include "dbus_old_handlers.h"
#include "dbus_common_i.h"

Functions

char * wpas_dbus_decompose_object_path (const char *path, char **network, char **bssid)
 Decompose an interface object path into parts. More...
 
DBusMessage * wpas_dbus_new_invalid_iface_error (DBusMessage *message)
 Return a new invalid interface error message. More...
 
DBusMessage * wpas_dbus_new_invalid_network_error (DBusMessage *message)
 Return a new invalid network error message. More...
 
void wpa_supplicant_dbus_notify_scan_results (struct wpa_supplicant *wpa_s)
 Send a scan results signal. More...
 
void wpa_supplicant_dbus_notify_state_change (struct wpa_supplicant *wpa_s, enum wpa_states new_state, enum wpa_states old_state)
 Send a state change signal. More...
 
void wpa_supplicant_dbus_notify_scanning (struct wpa_supplicant *wpa_s)
 send scanning status More...
 
void wpa_supplicant_dbus_notify_wps_cred (struct wpa_supplicant *wpa_s, const struct wps_credential *cred)
 
void wpa_supplicant_dbus_notify_certification (struct wpa_supplicant *wpa_s, int depth, const char *subject, const char *cert_hash, const struct wpabuf *cert)
 
int wpa_supplicant_dbus_ctrl_iface_init (struct wpas_dbus_priv *iface)
 Initialize dbus control interface. More...
 
int wpas_dbus_register_iface (struct wpa_supplicant *wpa_s)
 Register a new interface with dbus. More...
 
int wpas_dbus_unregister_iface (struct wpa_supplicant *wpa_s)
 Unregister an interface from dbus. More...
 
struct wpa_supplicantwpa_supplicant_get_iface_by_dbus_path (struct wpa_global *global, const char *path)
 Get a new network interface. More...
 

Detailed Description

WPA Supplicant / dbus-based control interface.

Function Documentation

int wpa_supplicant_dbus_ctrl_iface_init ( struct wpas_dbus_priv iface)

Initialize dbus control interface.

Parameters
globalPointer to global data from wpa_supplicant_init()
Returns
0 on success, -1 on failure

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

void wpa_supplicant_dbus_notify_scan_results ( struct wpa_supplicant wpa_s)

Send a scan results signal.

Parameters
wpa_swpa_supplicant network interface data
Returns
0 on success, -1 on failure

Notify listeners that this interface has updated scan results.

void wpa_supplicant_dbus_notify_scanning ( struct wpa_supplicant wpa_s)

send scanning status

Parameters
wpa_swpa_supplicant network interface data
Returns
0 on success, -1 on failure

Notify listeners of interface scanning state changes

void wpa_supplicant_dbus_notify_state_change ( struct wpa_supplicant wpa_s,
enum wpa_states  new_state,
enum wpa_states  old_state 
)

Send a state change signal.

Parameters
wpa_swpa_supplicant network interface data
new_statenew state wpa_supplicant is entering
old_stateold state wpa_supplicant is leaving
Returns
0 on success, -1 on failure

Notify listeners that wpa_supplicant has changed state

struct wpa_supplicant* wpa_supplicant_get_iface_by_dbus_path ( struct wpa_global global,
const char *  path 
)

Get a new network interface.

Parameters
globalPointer to global data from wpa_supplicant_init()
pathPointer to a dbus object path representing an interface
Returns
Pointer to the interface or NULL if not found
char* wpas_dbus_decompose_object_path ( const char *  path,
char **  network,
char **  bssid 
)

Decompose an interface object path into parts.

Parameters
pathThe dbus object path
network(out) the configured network this object path refers to, if any
bssid(out) the scanned bssid this object path refers to, if any
Returns
The object path of the network interface this path refers to

For a given object path, decomposes the object path into object id, network, and BSSID parts, if those parts exist.

DBusMessage* wpas_dbus_new_invalid_iface_error ( DBusMessage *  message)

Return a new invalid interface error message.

Parameters
messagePointer to incoming dbus message this error refers to
Returns
A dbus error message

Convenience function to create and return an invalid interface error

DBusMessage* wpas_dbus_new_invalid_network_error ( DBusMessage *  message)

Return a new invalid network error message.

Parameters
messagePointer to incoming dbus message this error refers to
Returns
a dbus error message

Convenience function to create and return an invalid network error

int wpas_dbus_register_iface ( struct wpa_supplicant wpa_s)

Register a new interface with dbus.

Parameters
wpa_swpa_supplicant interface description structure to register
Returns
0 on success, -1 on error

Registers a new interface with dbus and assigns it a dbus object path.

int wpas_dbus_unregister_iface ( struct wpa_supplicant wpa_s)

Unregister an interface from dbus.

Parameters
wpa_swpa_supplicant interface structure
Returns
0 on success, -1 on failure

Unregisters the interface with dbus