wpa_supplicant / hostapd
2.5
|
WPA Supplicant / dbus-based control interface Copyright (c) 2009-2010, Witold Sowa witol Copyright (c) 2009, Jouni Malinen d.so wa@gm ail. comj@w1. fiMore...
#include "includes.h"
#include "common.h"
#include "common/ieee802_11_defs.h"
#include "wps/wps.h"
#include "../config.h"
#include "../wpa_supplicant_i.h"
#include "../bss.h"
#include "../wpas_glue.h"
#include "dbus_new_helpers.h"
#include "dbus_dict_helpers.h"
#include "dbus_new.h"
#include "dbus_new_handlers.h"
#include "dbus_common_i.h"
#include "dbus_new_handlers_p2p.h"
#include "p2p/p2p.h"
#include "../p2p_supplicant.h"
Data Structures | |
struct | group_changed_data |
Functions | |
void | wpas_dbus_signal_scan_done (struct wpa_supplicant *wpa_s, int success) |
send scan done signal More... | |
void | wpas_dbus_signal_blob_added (struct wpa_supplicant *wpa_s, const char *name) |
Send a blob added signal. More... | |
void | wpas_dbus_signal_blob_removed (struct wpa_supplicant *wpa_s, const char *name) |
Send a blob removed signal. More... | |
void | wpas_dbus_signal_network_selected (struct wpa_supplicant *wpa_s, int id) |
Send a network selected signal. More... | |
void | wpas_dbus_signal_network_request (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, enum wpa_ctrl_req_type rtype, const char *default_txt) |
Indicate that additional information (EAP password, etc.) is required to complete the association to this SSID. More... | |
void | wpas_dbus_signal_network_enabled_changed (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) |
Signals Enabled property changes. More... | |
void | wpas_dbus_signal_certification (struct wpa_supplicant *wpa_s, int depth, const char *subject, const char *altsubject[], int num_altsubject, const char *cert_hash, const struct wpabuf *cert) |
void | wpas_dbus_signal_eap_status (struct wpa_supplicant *wpa_s, const char *status, const char *parameter) |
void | wpas_dbus_signal_sta_authorized (struct wpa_supplicant *wpa_s, const u8 *sta) |
Send a STA authorized signal. More... | |
void | wpas_dbus_signal_sta_deauthorized (struct wpa_supplicant *wpa_s, const u8 *sta) |
Send a STA deauthorized signal. More... | |
void | wpas_dbus_signal_p2p_group_removed (struct wpa_supplicant *wpa_s, const char *role) |
Signals P2P group was removed. More... | |
void | wpas_dbus_signal_p2p_provision_discovery (struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request, enum p2p_prov_disc_status status, u16 config_methods, unsigned int generated_pin) |
Signals various PD events. More... | |
void | wpas_dbus_signal_p2p_go_neg_req (struct wpa_supplicant *wpa_s, const u8 *src, u16 dev_passwd_id, u8 go_intent) |
Signal P2P GO Negotiation Request RX. More... | |
void | wpas_dbus_signal_p2p_group_started (struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, int client, int network_id) |
Signals P2P group has started. Emitted when a group is successfully started irrespective of the role (client/GO) of the current device. More... | |
void | wpas_dbus_signal_p2p_go_neg_resp (struct wpa_supplicant *wpa_s, struct p2p_go_neg_results *res) |
Emit GONegotiation Success/Failure signal. More... | |
void | wpas_dbus_signal_p2p_invitation_result (struct wpa_supplicant *wpa_s, int status, const u8 *bssid) |
Emit InvitationResult signal. More... | |
void | wpas_dbus_signal_p2p_peer_joined (struct wpa_supplicant *wpa_s, const u8 *peer_addr) |
void | wpas_dbus_signal_p2p_peer_disconnected (struct wpa_supplicant *wpa_s, const u8 *peer_addr) |
void | wpas_dbus_signal_p2p_sd_request (struct wpa_supplicant *wpa_s, int freq, const u8 *sa, u8 dialog_token, u16 update_indic, const u8 *tlvs, size_t tlvs_len) |
void | wpas_dbus_signal_p2p_sd_response (struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic, const u8 *tlvs, size_t tlvs_len) |
void | wpas_dbus_signal_p2p_wps_failed (struct wpa_supplicant *wpa_s, struct wps_event_fail *fail) |
Signals WpsFailed event. More... | |
void | wpas_dbus_signal_p2p_group_formation_failure (struct wpa_supplicant *wpa_s, const char *reason) |
Signals GroupFormationFailure event. More... | |
void | wpas_dbus_signal_p2p_invitation_received (struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *dev_addr, const u8 *bssid, int id, int op_freq) |
Emit InvitationReceived signal. More... | |
void | wpas_dbus_signal_prop_changed (struct wpa_supplicant *wpa_s, enum wpas_dbus_prop property) |
Signals change of property. More... | |
void | wpas_dbus_bss_signal_prop_changed (struct wpa_supplicant *wpa_s, enum wpas_dbus_bss_prop property, unsigned int id) |
Signals change of BSS property. More... | |
void | wpas_dbus_signal_debug_level_changed (struct wpa_global *global) |
Signals change of debug param. More... | |
void | wpas_dbus_signal_debug_timestamp_changed (struct wpa_global *global) |
Signals change of debug param. More... | |
void | wpas_dbus_signal_debug_show_keys_changed (struct wpa_global *global) |
Signals change of debug param. More... | |
int | wpas_dbus_ctrl_iface_init (struct wpas_dbus_priv *priv) |
Initialize dbus control interface. More... | |
void | wpas_dbus_ctrl_iface_deinit (struct wpas_dbus_priv *iface) |
Deinitialize dbus ctrl interface for wpa_supplicant. More... | |
int | wpas_dbus_register_network (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) |
Register a configured network with dbus. More... | |
int | wpas_dbus_unregister_network (struct wpa_supplicant *wpa_s, int nid) |
Unregister a configured network from dbus. More... | |
int | wpas_dbus_unregister_bss (struct wpa_supplicant *wpa_s, u8 bssid[ETH_ALEN], unsigned int id) |
Unregister a scanned BSS from dbus. More... | |
int | wpas_dbus_register_bss (struct wpa_supplicant *wpa_s, u8 bssid[ETH_ALEN], unsigned int id) |
Register a scanned BSS with dbus. More... | |
int | wpas_dbus_register_interface (struct wpa_supplicant *wpa_s) |
Register an interface with D-Bus. More... | |
int | wpas_dbus_unregister_interface (struct wpa_supplicant *wpa_s) |
Unregister the interface from D-Bus. More... | |
void | wpas_dbus_signal_peer_device_found (struct wpa_supplicant *wpa_s, const u8 *dev_addr) |
Send a peer found signal. More... | |
void | wpas_dbus_signal_peer_device_lost (struct wpa_supplicant *wpa_s, const u8 *dev_addr) |
Send a peer lost signal. More... | |
int | wpas_dbus_register_peer (struct wpa_supplicant *wpa_s, const u8 *dev_addr) |
Register a discovered peer object with dbus. More... | |
int | wpas_dbus_unregister_peer (struct wpa_supplicant *wpa_s, const u8 *dev_addr) |
Unregister a peer object with dbus. More... | |
void | wpas_dbus_signal_p2p_find_stopped (struct wpa_supplicant *wpa_s) |
Send P2P Find stopped signal. More... | |
void | wpas_dbus_signal_peer_groups_changed (struct wpa_supplicant *wpa_s, const u8 *dev_addr) |
Send peer group change property signal. More... | |
void | wpas_dbus_register_p2p_group (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) |
Register a p2p group object with dbus. More... | |
void | wpas_dbus_unregister_p2p_group (struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid) |
Unregister a p2p group object from dbus. More... | |
int | wpas_dbus_register_persistent_group (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) |
Register a configured(saved) More... | |
int | wpas_dbus_unregister_persistent_group (struct wpa_supplicant *wpa_s, int nid) |
Unregister a persistent_group. More... | |
WPA Supplicant / dbus-based control interface Copyright (c) 2009-2010, Witold Sowa witol Copyright (c) 2009, Jouni Malinen d.so wa@gm ail. comj@w1. fi
void wpas_dbus_bss_signal_prop_changed | ( | struct wpa_supplicant * | wpa_s, |
enum wpas_dbus_bss_prop | property, | ||
unsigned int | id | ||
) |
Signals change of BSS property.
wpa_s | wpa_supplicant network interface data |
property | indicates which property has changed |
id | unique BSS identifier |
Sends PropertyChanged signals with path, interface, and arguments depending on which property has changed.
void wpas_dbus_ctrl_iface_deinit | ( | struct wpas_dbus_priv * | iface | ) |
Deinitialize dbus ctrl interface for wpa_supplicant.
iface | Pointer to dbus private data from wpas_dbus_init() |
Deinitialize the dbus control interface that was initialized with wpas_dbus_ctrl_iface_init().
int wpas_dbus_ctrl_iface_init | ( | struct wpas_dbus_priv * | priv | ) |
Initialize dbus control interface.
global | Pointer to global data from wpa_supplicant_init() |
Initialize the dbus control interface for wpa_supplicantand and start receiving commands from external programs over the bus.
int wpas_dbus_register_bss | ( | struct wpa_supplicant * | wpa_s, |
u8 | bssid[ETH_ALEN], | ||
unsigned int | id | ||
) |
Register a scanned BSS with dbus.
wpa_s | wpa_supplicant interface structure |
bssid | scanned network bssid |
id | unique BSS identifier |
Registers BSS representing object with dbus
int wpas_dbus_register_interface | ( | struct wpa_supplicant * | wpa_s | ) |
Register an interface with D-Bus.
wpa_s | wpa_supplicant interface structure |
int wpas_dbus_register_network | ( | struct wpa_supplicant * | wpa_s, |
struct wpa_ssid * | ssid | ||
) |
Register a configured network with dbus.
wpa_s | wpa_supplicant interface structure |
ssid | network configuration data |
Registers network representing object with dbus
void wpas_dbus_register_p2p_group | ( | struct wpa_supplicant * | wpa_s, |
struct wpa_ssid * | ssid | ||
) |
Register a p2p group object with dbus.
wpa_s | wpa_supplicant interface structure |
ssid | SSID struct |
Registers p2p group representing object with dbus
int wpas_dbus_register_peer | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | dev_addr | ||
) |
Register a discovered peer object with dbus.
wpa_s | wpa_supplicant interface structure |
dev_addr | P2P Device Address of the peer |
Registers network representing object with dbus
int wpas_dbus_register_persistent_group | ( | struct wpa_supplicant * | wpa_s, |
struct wpa_ssid * | ssid | ||
) |
Register a configured(saved)
persistent group with dbus
wpa_s | wpa_supplicant interface structure |
ssid | persistent group (still represented as a network within wpa) configuration data |
Registers a persistent group representing object with dbus.
void wpas_dbus_signal_blob_added | ( | struct wpa_supplicant * | wpa_s, |
const char * | name | ||
) |
Send a blob added signal.
wpa_s | wpa_supplicant network interface data |
name | blob name |
Notify listeners about adding a new blob
void wpas_dbus_signal_blob_removed | ( | struct wpa_supplicant * | wpa_s, |
const char * | name | ||
) |
Send a blob removed signal.
wpa_s | wpa_supplicant network interface data |
name | blob name |
Notify listeners about removing blob
void wpas_dbus_signal_debug_level_changed | ( | struct wpa_global * | global | ) |
Signals change of debug param.
global | wpa_global structure |
Sends PropertyChanged signals informing that debug level has changed.
void wpas_dbus_signal_debug_show_keys_changed | ( | struct wpa_global * | global | ) |
Signals change of debug param.
global | wpa_global structure |
Sends PropertyChanged signals informing that debug show_keys has changed.
void wpas_dbus_signal_debug_timestamp_changed | ( | struct wpa_global * | global | ) |
Signals change of debug param.
global | wpa_global structure |
Sends PropertyChanged signals informing that debug timestamp has changed.
void wpas_dbus_signal_network_enabled_changed | ( | struct wpa_supplicant * | wpa_s, |
struct wpa_ssid * | ssid | ||
) |
Signals Enabled property changes.
wpa_s | wpa_supplicant network interface data |
ssid | configured network which Enabled property has changed |
Sends PropertyChanged signals containing new value of Enabled property for specified network
void wpas_dbus_signal_network_request | ( | struct wpa_supplicant * | wpa_s, |
struct wpa_ssid * | ssid, | ||
enum wpa_ctrl_req_type | rtype, | ||
const char * | default_txt | ||
) |
Indicate that additional information (EAP password, etc.) is required to complete the association to this SSID.
wpa_s | wpa_supplicant network interface data |
rtype | The specific additional information required |
default_text | Optional description of required information |
Request additional information or passwords to complete an association request.
void wpas_dbus_signal_network_selected | ( | struct wpa_supplicant * | wpa_s, |
int | id | ||
) |
Send a network selected signal.
wpa_s | wpa_supplicant network interface data |
id | network id |
Notify listeners about selecting a network
void wpas_dbus_signal_p2p_find_stopped | ( | struct wpa_supplicant * | wpa_s | ) |
Send P2P Find stopped signal.
wpa_s | wpa_supplicant network interface data |
Notify listeners about P2P Find stopped
void wpas_dbus_signal_p2p_go_neg_req | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | src, | ||
u16 | dev_passwd_id, | ||
u8 | go_intent | ||
) |
Signal P2P GO Negotiation Request RX.
wpa_s | wpa_supplicant network interface data |
src | Source address of the message triggering this notification |
dev_passwd_id | WPS Device Password Id |
go_intent | Peer's GO Intent value |
Sends signal to notify that a peer P2P Device is requesting group owner negotiation with us.
void wpas_dbus_signal_p2p_go_neg_resp | ( | struct wpa_supplicant * | wpa_s, |
struct p2p_go_neg_results * | res | ||
) |
Emit GONegotiation Success/Failure signal.
wpa_s | wpa_supplicant network interface data |
res | Result of the GO Neg Request |
void wpas_dbus_signal_p2p_group_formation_failure | ( | struct wpa_supplicant * | wpa_s, |
const char * | reason | ||
) |
Signals GroupFormationFailure event.
wpa_s | wpa_supplicant network interface data |
reason | indicates the reason code for group formation failure |
Sends Event dbus signal and string reason code when available.
void wpas_dbus_signal_p2p_group_removed | ( | struct wpa_supplicant * | wpa_s, |
const char * | role | ||
) |
Signals P2P group was removed.
wpa_s | wpa_supplicant network interface data |
role | role of this device (client or GO) Sends signal with i/f name and role as string arguments |
void wpas_dbus_signal_p2p_group_started | ( | struct wpa_supplicant * | wpa_s, |
const struct wpa_ssid * | ssid, | ||
int | client, | ||
int | network_id | ||
) |
Signals P2P group has started. Emitted when a group is successfully started irrespective of the role (client/GO) of the current device.
wpa_s | wpa_supplicant network interface data |
ssid | SSID object |
client | this device is P2P client |
network_id | network id of the group started, use instead of ssid->id to account for persistent groups |
void wpas_dbus_signal_p2p_invitation_received | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | sa, | ||
const u8 * | dev_addr, | ||
const u8 * | bssid, | ||
int | id, | ||
int | op_freq | ||
) |
Emit InvitationReceived signal.
wpa_s | wpa_supplicant network interface data |
sa | Source address of the Invitation Request |
dev_add | GO Device Address |
bssid | P2P Group BSSID or NULL if not received |
id | Persistent group id or %0 if not persistent group |
op_freq | Operating frequency for the group |
void wpas_dbus_signal_p2p_invitation_result | ( | struct wpa_supplicant * | wpa_s, |
int | status, | ||
const u8 * | bssid | ||
) |
Emit InvitationResult signal.
wpa_s | wpa_supplicant network interface data |
status | Status of invitation process |
bssid | Basic Service Set Identifier |
void wpas_dbus_signal_p2p_peer_disconnected | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | peer_addr | ||
) |
Method to emit a signal for a peer disconnecting the group. The signal will carry path to the group member object constructed using the P2P Device Address of the peer.
: wpa_supplicant network interface data : P2P Device Address of the peer joining the group
void wpas_dbus_signal_p2p_peer_joined | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | peer_addr | ||
) |
Method to emit a signal for a peer joining the group. The signal will carry path to the group member object constructed using p2p i/f addr used for connecting.
: wpa_supplicant network interface data : P2P Device Address of the peer joining the group
void wpas_dbus_signal_p2p_provision_discovery | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | dev_addr, | ||
int | request, | ||
enum p2p_prov_disc_status | status, | ||
u16 | config_methods, | ||
unsigned int | generated_pin | ||
) |
Signals various PD events.
dev_addr | - who sent the request or responded to our request. |
request | - Will be 1 if request, 0 for response. |
status | - valid only in case of response |
config_methods | - wps config methods |
generated_pin | - pin to be displayed in case of WPS_CONFIG_DISPLAY method |
Sends following provision discovery related events: ProvisionDiscoveryRequestDisplayPin ProvisionDiscoveryResponseDisplayPin ProvisionDiscoveryRequestEnterPin ProvisionDiscoveryResponseEnterPin ProvisionDiscoveryPBCRequest ProvisionDiscoveryPBCResponse
TODO:: ProvisionDiscoveryFailure (timeout case)
void wpas_dbus_signal_p2p_sd_request | ( | struct wpa_supplicant * | wpa_s, |
int | freq, | ||
const u8 * | sa, | ||
u8 | dialog_token, | ||
u16 | update_indic, | ||
const u8 * | tlvs, | ||
size_t | tlvs_len | ||
) |
Method to emit a signal for a service discovery request. The signal will carry station address, frequency, dialog token, update indicator and it tlvs
: wpa_supplicant network interface data
void wpas_dbus_signal_p2p_sd_response | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | sa, | ||
u16 | update_indic, | ||
const u8 * | tlvs, | ||
size_t | tlvs_len | ||
) |
Method to emit a signal for a service discovery response. The signal will carry station address, update indicator and it tlvs
: wpa_supplicant network interface data
void wpas_dbus_signal_p2p_wps_failed | ( | struct wpa_supplicant * | wpa_s, |
struct wps_event_fail * | fail | ||
) |
Signals WpsFailed event.
wpa_s | wpa_supplicant network interface data |
fail | WPS failure information |
Sends Event dbus signal with name "fail" and dictionary containing "msg" field with fail message number (int32) as arguments
void wpas_dbus_signal_peer_device_found | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | dev_addr | ||
) |
Send a peer found signal.
wpa_s | wpa_supplicant network interface data |
dev_addr | Peer P2P Device Address |
Notify listeners about find a p2p peer device found
void wpas_dbus_signal_peer_device_lost | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | dev_addr | ||
) |
Send a peer lost signal.
wpa_s | wpa_supplicant network interface data |
dev_addr | Peer P2P Device Address |
Notify listeners about lost a p2p peer device
void wpas_dbus_signal_peer_groups_changed | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | dev_addr | ||
) |
Send peer group change property signal.
wpa_s | wpa_supplicant network interface data |
dev_addr | P2P Device Address |
Notify listeners about peer Groups property changes.
void wpas_dbus_signal_prop_changed | ( | struct wpa_supplicant * | wpa_s, |
enum wpas_dbus_prop | property | ||
) |
Signals change of property.
wpa_s | wpa_supplicant network interface data |
property | indicates which property has changed |
Sends PropertyChanged signals with path, interface and arguments depending on which property has changed.
void wpas_dbus_signal_scan_done | ( | struct wpa_supplicant * | wpa_s, |
int | success | ||
) |
send scan done signal
wpa_s | wpa_supplicant network interface data |
success | indicates if scanning succeed or failed |
Notify listeners about finishing a scan
void wpas_dbus_signal_sta_authorized | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | sta | ||
) |
Send a STA authorized signal.
wpa_s | wpa_supplicant network interface data |
sta | station mac address |
Notify listeners a new station has been authorized
void wpas_dbus_signal_sta_deauthorized | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | sta | ||
) |
Send a STA deauthorized signal.
wpa_s | wpa_supplicant network interface data |
sta | station mac address |
Notify listeners a station has been deauthorized
int wpas_dbus_unregister_bss | ( | struct wpa_supplicant * | wpa_s, |
u8 | bssid[ETH_ALEN], | ||
unsigned int | id | ||
) |
Unregister a scanned BSS from dbus.
wpa_s | wpa_supplicant interface structure |
bssid | scanned network bssid |
id | unique BSS identifier |
Unregisters BSS representing object from dbus
int wpas_dbus_unregister_interface | ( | struct wpa_supplicant * | wpa_s | ) |
Unregister the interface from D-Bus.
wpa_s | wpa_supplicant interface structure |
int wpas_dbus_unregister_network | ( | struct wpa_supplicant * | wpa_s, |
int | nid | ||
) |
Unregister a configured network from dbus.
wpa_s | wpa_supplicant interface structure |
nid | network id |
Unregisters network representing object from dbus
void wpas_dbus_unregister_p2p_group | ( | struct wpa_supplicant * | wpa_s, |
const struct wpa_ssid * | ssid | ||
) |
Unregister a p2p group object from dbus.
wpa_s | wpa_supplicant interface structure |
ssid | network name of the p2p group started |
int wpas_dbus_unregister_peer | ( | struct wpa_supplicant * | wpa_s, |
const u8 * | dev_addr | ||
) |
Unregister a peer object with dbus.
wpa_s | wpa_supplicant interface structure |
dev_addr | p2p device addr |
Registers network representing object with dbus
int wpas_dbus_unregister_persistent_group | ( | struct wpa_supplicant * | wpa_s, |
int | nid | ||
) |
Unregister a persistent_group.
from dbus
wpa_s | wpa_supplicant interface structure |
nid | network id |
Unregisters persistent group representing object from dbus
NOTE: There is a slight issue with the semantics here. While the implementation simply means the persistent group is unloaded from memory, it should not get interpreted as the group is actually being erased/removed from persistent storage as well.