Generate an event when a network is added or removed
Generate an event on the control socket interface when a network is added or removed. The event name CTRL-EVENT-NETWORK-<ADDED|REMOVED> is followed by the network entry identifier. The event matches the corresponding Network<Added|Removed> signal on the d-bus interface. Signed-off-by: Andrew Beltrano <anbeltra@microsoft.com>
This commit is contained in:
parent
f238610616
commit
0030590fb3
2 changed files with 12 additions and 2 deletions
|
@ -126,6 +126,10 @@ extern "C" {
|
|||
#define WPA_EVENT_FREQ_CONFLICT "CTRL-EVENT-FREQ-CONFLICT "
|
||||
/** Frequency ranges that the driver recommends to avoid */
|
||||
#define WPA_EVENT_AVOID_FREQ "CTRL-EVENT-AVOID-FREQ "
|
||||
/** A new network profile was added (followed by network entry id) */
|
||||
#define WPA_EVENT_NETWORK_ADDED "CTRL-EVENT-NETWORK-ADDED "
|
||||
/** A network profile was removed (followed by prior network entry id) */
|
||||
#define WPA_EVENT_NETWORK_REMOVED "CTRL-EVENT-NETWORK-REMOVED "
|
||||
/** Result of MSCS setup */
|
||||
#define WPA_EVENT_MSCS_RESULT "CTRL-EVENT-MSCS-RESULT "
|
||||
/** WPS overlap detected in PBC mode */
|
||||
|
|
|
@ -350,8 +350,11 @@ void wpas_notify_network_added(struct wpa_supplicant *wpa_s,
|
|||
* applications since these network objects won't behave like
|
||||
* regular ones.
|
||||
*/
|
||||
if (!ssid->p2p_group && wpa_s->global->p2p_group_formation != wpa_s)
|
||||
if (!ssid->p2p_group && wpa_s->global->p2p_group_formation != wpa_s) {
|
||||
wpas_dbus_register_network(wpa_s, ssid);
|
||||
wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_NETWORK_ADDED "%d",
|
||||
ssid->id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -381,8 +384,11 @@ void wpas_notify_network_removed(struct wpa_supplicant *wpa_s,
|
|||
if (wpa_s->wpa)
|
||||
wpa_sm_pmksa_cache_flush(wpa_s->wpa, ssid);
|
||||
if (!ssid->p2p_group && wpa_s->global->p2p_group_formation != wpa_s &&
|
||||
!wpa_s->p2p_mgmt)
|
||||
!wpa_s->p2p_mgmt) {
|
||||
wpas_dbus_unregister_network(wpa_s, ssid->id);
|
||||
wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_NETWORK_REMOVED "%d",
|
||||
ssid->id);
|
||||
}
|
||||
if (network_is_persistent_group(ssid))
|
||||
wpas_notify_persistent_group_removed(wpa_s, ssid);
|
||||
|
||||
|
|
Loading…
Reference in a new issue