mirror of
https://gitee.com/Vancouver2017/luban-lite.git
synced 2025-12-28 15:08:55 +00:00
v1.2.2
This commit is contained in:
@@ -0,0 +1,372 @@
|
||||
/*
|
||||
* wpa_supplicant D-Bus control interface - common functionality
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
* Copyright (c) 2009, Witold Sowa <witold.sowa@gmail.com>
|
||||
* Copyright (c) 2009, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#include "utils/includes.h"
|
||||
#include <dbus/dbus.h>
|
||||
|
||||
#include "utils/common.h"
|
||||
#include "utils/eloop.h"
|
||||
#include "dbus_common.h"
|
||||
#include "dbus_common_i.h"
|
||||
#include "dbus_new.h"
|
||||
#include "../wpa_supplicant_i.h"
|
||||
|
||||
|
||||
#ifndef SIGPOLL
|
||||
#ifdef SIGIO
|
||||
/*
|
||||
* If we do not have SIGPOLL, try to use SIGIO instead. This is needed for
|
||||
* FreeBSD.
|
||||
*/
|
||||
#define SIGPOLL SIGIO
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
static void dispatch_data(DBusConnection *con)
|
||||
{
|
||||
while (dbus_connection_get_dispatch_status(con) ==
|
||||
DBUS_DISPATCH_DATA_REMAINS)
|
||||
dbus_connection_dispatch(con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* dispatch_initial_dbus_messages - Dispatch initial dbus messages after
|
||||
* claiming bus name
|
||||
* @eloop_ctx: the DBusConnection to dispatch on
|
||||
* @timeout_ctx: unused
|
||||
*
|
||||
* If clients are quick to notice that service claimed its bus name,
|
||||
* there may have been messages that came in before initialization was
|
||||
* all finished. Dispatch those here.
|
||||
*/
|
||||
static void dispatch_initial_dbus_messages(void *eloop_ctx, void *timeout_ctx)
|
||||
{
|
||||
DBusConnection *con = eloop_ctx;
|
||||
dispatch_data(con);
|
||||
}
|
||||
|
||||
|
||||
static void process_watch(struct wpas_dbus_priv *priv,
|
||||
DBusWatch *watch, eloop_event_type type)
|
||||
{
|
||||
dbus_connection_ref(priv->con);
|
||||
|
||||
priv->should_dispatch = 0;
|
||||
|
||||
if (type == EVENT_TYPE_READ)
|
||||
dbus_watch_handle(watch, DBUS_WATCH_READABLE);
|
||||
else if (type == EVENT_TYPE_WRITE)
|
||||
dbus_watch_handle(watch, DBUS_WATCH_WRITABLE);
|
||||
else if (type == EVENT_TYPE_EXCEPTION)
|
||||
dbus_watch_handle(watch, DBUS_WATCH_ERROR);
|
||||
|
||||
if (priv->should_dispatch) {
|
||||
dispatch_data(priv->con);
|
||||
priv->should_dispatch = 0;
|
||||
}
|
||||
|
||||
dbus_connection_unref(priv->con);
|
||||
}
|
||||
|
||||
|
||||
static void process_watch_exception(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
{
|
||||
process_watch(eloop_ctx, sock_ctx, EVENT_TYPE_EXCEPTION);
|
||||
}
|
||||
|
||||
|
||||
static void process_watch_read(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
{
|
||||
process_watch(eloop_ctx, sock_ctx, EVENT_TYPE_READ);
|
||||
}
|
||||
|
||||
|
||||
static void process_watch_write(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
{
|
||||
process_watch(eloop_ctx, sock_ctx, EVENT_TYPE_WRITE);
|
||||
}
|
||||
|
||||
|
||||
static dbus_bool_t add_watch(DBusWatch *watch, void *data)
|
||||
{
|
||||
struct wpas_dbus_priv *priv = data;
|
||||
unsigned int flags;
|
||||
int fd;
|
||||
|
||||
if (!dbus_watch_get_enabled(watch))
|
||||
return TRUE;
|
||||
|
||||
flags = dbus_watch_get_flags(watch);
|
||||
fd = dbus_watch_get_unix_fd(watch);
|
||||
|
||||
eloop_register_sock(fd, EVENT_TYPE_EXCEPTION, process_watch_exception,
|
||||
priv, watch);
|
||||
|
||||
if (flags & DBUS_WATCH_READABLE) {
|
||||
eloop_register_sock(fd, EVENT_TYPE_READ, process_watch_read,
|
||||
priv, watch);
|
||||
}
|
||||
if (flags & DBUS_WATCH_WRITABLE) {
|
||||
eloop_register_sock(fd, EVENT_TYPE_WRITE, process_watch_write,
|
||||
priv, watch);
|
||||
}
|
||||
|
||||
dbus_watch_set_data(watch, priv, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void remove_watch(DBusWatch *watch, void *data)
|
||||
{
|
||||
unsigned int flags;
|
||||
int fd;
|
||||
|
||||
flags = dbus_watch_get_flags(watch);
|
||||
fd = dbus_watch_get_unix_fd(watch);
|
||||
|
||||
eloop_unregister_sock(fd, EVENT_TYPE_EXCEPTION);
|
||||
|
||||
if (flags & DBUS_WATCH_READABLE)
|
||||
eloop_unregister_sock(fd, EVENT_TYPE_READ);
|
||||
if (flags & DBUS_WATCH_WRITABLE)
|
||||
eloop_unregister_sock(fd, EVENT_TYPE_WRITE);
|
||||
|
||||
dbus_watch_set_data(watch, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
static void watch_toggled(DBusWatch *watch, void *data)
|
||||
{
|
||||
if (dbus_watch_get_enabled(watch))
|
||||
add_watch(watch, data);
|
||||
else
|
||||
remove_watch(watch, data);
|
||||
}
|
||||
|
||||
|
||||
static void process_timeout(void *eloop_ctx, void *sock_ctx)
|
||||
{
|
||||
DBusTimeout *timeout = sock_ctx;
|
||||
dbus_timeout_handle(timeout);
|
||||
}
|
||||
|
||||
|
||||
static dbus_bool_t add_timeout(DBusTimeout *timeout, void *data)
|
||||
{
|
||||
struct wpas_dbus_priv *priv = data;
|
||||
|
||||
if (!dbus_timeout_get_enabled(timeout))
|
||||
return TRUE;
|
||||
|
||||
eloop_register_timeout(0, dbus_timeout_get_interval(timeout) * 1000,
|
||||
process_timeout, priv, timeout);
|
||||
|
||||
dbus_timeout_set_data(timeout, priv, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void remove_timeout(DBusTimeout *timeout, void *data)
|
||||
{
|
||||
struct wpas_dbus_priv *priv = data;
|
||||
|
||||
eloop_cancel_timeout(process_timeout, priv, timeout);
|
||||
dbus_timeout_set_data(timeout, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
static void timeout_toggled(DBusTimeout *timeout, void *data)
|
||||
{
|
||||
if (dbus_timeout_get_enabled(timeout))
|
||||
add_timeout(timeout, data);
|
||||
else
|
||||
remove_timeout(timeout, data);
|
||||
}
|
||||
|
||||
|
||||
static void process_wakeup_main(int sig, void *signal_ctx)
|
||||
{
|
||||
struct wpas_dbus_priv *priv = signal_ctx;
|
||||
|
||||
if (sig != SIGPOLL || !priv->con)
|
||||
return;
|
||||
|
||||
if (dbus_connection_get_dispatch_status(priv->con) !=
|
||||
DBUS_DISPATCH_DATA_REMAINS)
|
||||
return;
|
||||
|
||||
/* Only dispatch once - we do not want to starve other events */
|
||||
dbus_connection_ref(priv->con);
|
||||
dbus_connection_dispatch(priv->con);
|
||||
dbus_connection_unref(priv->con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wakeup_main - Attempt to wake our mainloop up
|
||||
* @data: dbus control interface private data
|
||||
*
|
||||
* Try to wake up the main eloop so it will process
|
||||
* dbus events that may have happened.
|
||||
*/
|
||||
static void wakeup_main(void *data)
|
||||
{
|
||||
struct wpas_dbus_priv *priv = data;
|
||||
|
||||
/* Use SIGPOLL to break out of the eloop select() */
|
||||
raise(SIGPOLL);
|
||||
priv->should_dispatch = 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* integrate_with_eloop - Register our mainloop integration with dbus
|
||||
* @connection: connection to the system message bus
|
||||
* @priv: a dbus control interface data structure
|
||||
* Returns: 0 on success, -1 on failure
|
||||
*/
|
||||
static int integrate_with_eloop(struct wpas_dbus_priv *priv)
|
||||
{
|
||||
if (!dbus_connection_set_watch_functions(priv->con, add_watch,
|
||||
remove_watch, watch_toggled,
|
||||
priv, NULL) ||
|
||||
!dbus_connection_set_timeout_functions(priv->con, add_timeout,
|
||||
remove_timeout,
|
||||
timeout_toggled, priv,
|
||||
NULL)) {
|
||||
wpa_printf(MSG_ERROR, "dbus: Failed to set callback functions");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (eloop_register_signal(SIGPOLL, process_wakeup_main, priv))
|
||||
return -1;
|
||||
dbus_connection_set_wakeup_main_function(priv->con, wakeup_main,
|
||||
priv, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static DBusHandlerResult disconnect_filter(DBusConnection *conn,
|
||||
DBusMessage *message, void *data)
|
||||
{
|
||||
struct wpas_dbus_priv *priv = data;
|
||||
|
||||
if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL,
|
||||
"Disconnected")) {
|
||||
wpa_printf(MSG_DEBUG, "dbus: bus disconnected, terminating");
|
||||
dbus_connection_set_exit_on_disconnect(conn, FALSE);
|
||||
wpa_supplicant_terminate_proc(priv->global);
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
} else
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
|
||||
|
||||
static int wpas_dbus_init_common(struct wpas_dbus_priv *priv)
|
||||
{
|
||||
DBusError error;
|
||||
int ret = 0;
|
||||
|
||||
/* Get a reference to the system bus */
|
||||
dbus_error_init(&error);
|
||||
priv->con = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
|
||||
if (priv->con) {
|
||||
dbus_connection_add_filter(priv->con, disconnect_filter, priv,
|
||||
NULL);
|
||||
} else {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"dbus: Could not acquire the system bus: %s - %s",
|
||||
error.name, error.message);
|
||||
ret = -1;
|
||||
}
|
||||
dbus_error_free(&error);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int wpas_dbus_init_common_finish(struct wpas_dbus_priv *priv)
|
||||
{
|
||||
/* Tell dbus about our mainloop integration functions */
|
||||
integrate_with_eloop(priv);
|
||||
|
||||
/*
|
||||
* Dispatch initial DBus messages that may have come in since the bus
|
||||
* name was claimed above. Happens when clients are quick to notice the
|
||||
* service.
|
||||
*
|
||||
* FIXME: is there a better solution to this problem?
|
||||
*/
|
||||
eloop_register_timeout(0, 50, dispatch_initial_dbus_messages,
|
||||
priv->con, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void wpas_dbus_deinit_common(struct wpas_dbus_priv *priv)
|
||||
{
|
||||
if (priv->con) {
|
||||
eloop_cancel_timeout(dispatch_initial_dbus_messages,
|
||||
priv->con, NULL);
|
||||
eloop_cancel_timeout(process_timeout, priv, ELOOP_ALL_CTX);
|
||||
|
||||
dbus_connection_set_watch_functions(priv->con, NULL, NULL,
|
||||
NULL, NULL, NULL);
|
||||
dbus_connection_set_timeout_functions(priv->con, NULL, NULL,
|
||||
NULL, NULL, NULL);
|
||||
dbus_connection_remove_filter(priv->con, disconnect_filter,
|
||||
priv);
|
||||
|
||||
dbus_connection_unref(priv->con);
|
||||
}
|
||||
|
||||
os_free(priv);
|
||||
}
|
||||
|
||||
|
||||
struct wpas_dbus_priv * wpas_dbus_init(struct wpa_global *global)
|
||||
{
|
||||
struct wpas_dbus_priv *priv;
|
||||
|
||||
priv = os_zalloc(sizeof(*priv));
|
||||
if (priv == NULL)
|
||||
return NULL;
|
||||
priv->global = global;
|
||||
|
||||
if (wpas_dbus_init_common(priv) < 0 ||
|
||||
#ifdef CONFIG_CTRL_IFACE_DBUS_NEW
|
||||
wpas_dbus_ctrl_iface_init(priv) < 0 ||
|
||||
#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
|
||||
wpas_dbus_init_common_finish(priv) < 0) {
|
||||
wpas_dbus_deinit(priv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return priv;
|
||||
}
|
||||
|
||||
|
||||
void wpas_dbus_deinit(struct wpas_dbus_priv *priv)
|
||||
{
|
||||
if (priv == NULL)
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE_DBUS_NEW
|
||||
wpas_dbus_ctrl_iface_deinit(priv);
|
||||
#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
|
||||
|
||||
wpas_dbus_deinit_common(priv);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* wpa_supplicant D-Bus control interface - common definitions
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
* Copyright (c) 2009, Witold Sowa <witold.sowa@gmail.com>
|
||||
* Copyright (c) 2009, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef DBUS_COMMON_H
|
||||
#define DBUS_COMMON_H
|
||||
|
||||
struct wpas_dbus_priv;
|
||||
struct wpa_global;
|
||||
|
||||
struct wpas_dbus_priv * wpas_dbus_init(struct wpa_global *global);
|
||||
void wpas_dbus_deinit(struct wpas_dbus_priv *priv);
|
||||
|
||||
#endif /* DBUS_COMMON_H */
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* wpa_supplicant D-Bus control interface - internal definitions
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
* Copyright (c) 2009, Witold Sowa <witold.sowa@gmail.com>
|
||||
* Copyright (c) 2009, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef DBUS_COMMON_I_H
|
||||
#define DBUS_COMMON_I_H
|
||||
|
||||
#include <dbus/dbus.h>
|
||||
|
||||
struct wpa_dbus_property_desc;
|
||||
|
||||
struct wpas_dbus_priv {
|
||||
DBusConnection *con;
|
||||
int should_dispatch;
|
||||
struct wpa_global *global;
|
||||
u32 next_objid;
|
||||
int dbus_new_initialized;
|
||||
|
||||
#if defined(CONFIG_CTRL_IFACE_DBUS_NEW)
|
||||
struct wpa_dbus_property_desc *all_interface_properties;
|
||||
int globals_start;
|
||||
#if defined(CONFIG_AP)
|
||||
int dbus_noc_refcnt;
|
||||
#endif /* CONFIG_AP */
|
||||
#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
|
||||
};
|
||||
|
||||
#endif /* DBUS_COMMON_I_H */
|
||||
4954
bsp/peripheral/wireless/aic8800/wpas/wpa_supplicant/dbus/dbus_new.c
Normal file
4954
bsp/peripheral/wireless/aic8800/wpas/wpa_supplicant/dbus/dbus_new.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,621 @@
|
||||
/*
|
||||
* WPA Supplicant / dbus-based control interface
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
* Copyright (c) 2009-2010, Witold Sowa <witold.sowa@gmail.com>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef CTRL_IFACE_DBUS_NEW_H
|
||||
#define CTRL_IFACE_DBUS_NEW_H
|
||||
|
||||
#include "common/defs.h"
|
||||
#include "p2p/p2p.h"
|
||||
|
||||
struct wpa_global;
|
||||
struct wpa_supplicant;
|
||||
struct wpa_ssid;
|
||||
struct wps_event_m2d;
|
||||
struct wps_event_fail;
|
||||
struct wps_credential;
|
||||
|
||||
enum wpas_dbus_prop {
|
||||
WPAS_DBUS_PROP_AP_SCAN,
|
||||
WPAS_DBUS_PROP_SCANNING,
|
||||
WPAS_DBUS_PROP_STATE,
|
||||
WPAS_DBUS_PROP_CURRENT_BSS,
|
||||
WPAS_DBUS_PROP_CURRENT_NETWORK,
|
||||
WPAS_DBUS_PROP_CURRENT_AUTH_MODE,
|
||||
WPAS_DBUS_PROP_BSSS,
|
||||
WPAS_DBUS_PROP_STATIONS,
|
||||
WPAS_DBUS_PROP_DISCONNECT_REASON,
|
||||
WPAS_DBUS_PROP_AUTH_STATUS_CODE,
|
||||
WPAS_DBUS_PROP_ASSOC_STATUS_CODE,
|
||||
WPAS_DBUS_PROP_ROAM_TIME,
|
||||
WPAS_DBUS_PROP_ROAM_COMPLETE,
|
||||
WPAS_DBUS_PROP_SESSION_LENGTH,
|
||||
WPAS_DBUS_PROP_BSS_TM_STATUS,
|
||||
};
|
||||
|
||||
enum wpas_dbus_bss_prop {
|
||||
WPAS_DBUS_BSS_PROP_SIGNAL,
|
||||
WPAS_DBUS_BSS_PROP_FREQ,
|
||||
WPAS_DBUS_BSS_PROP_MODE,
|
||||
WPAS_DBUS_BSS_PROP_PRIVACY,
|
||||
WPAS_DBUS_BSS_PROP_RATES,
|
||||
WPAS_DBUS_BSS_PROP_WPA,
|
||||
WPAS_DBUS_BSS_PROP_RSN,
|
||||
WPAS_DBUS_BSS_PROP_WPS,
|
||||
WPAS_DBUS_BSS_PROP_IES,
|
||||
WPAS_DBUS_BSS_PROP_AGE,
|
||||
};
|
||||
|
||||
enum wpas_dbus_sta_prop {
|
||||
WPAS_DBUS_STA_PROP_ADDRESS,
|
||||
};
|
||||
|
||||
#define WPAS_DBUS_OBJECT_PATH_MAX 150
|
||||
|
||||
#define WPAS_DBUS_NEW_SERVICE "fi.w1.wpa_supplicant1"
|
||||
#define WPAS_DBUS_NEW_PATH "/fi/w1/wpa_supplicant1"
|
||||
#define WPAS_DBUS_NEW_INTERFACE "fi.w1.wpa_supplicant1"
|
||||
|
||||
#define WPAS_DBUS_NEW_PATH_INTERFACES WPAS_DBUS_NEW_PATH "/Interfaces"
|
||||
#define WPAS_DBUS_NEW_IFACE_INTERFACE WPAS_DBUS_NEW_INTERFACE ".Interface"
|
||||
#define WPAS_DBUS_NEW_IFACE_WPS WPAS_DBUS_NEW_IFACE_INTERFACE ".WPS"
|
||||
|
||||
#define WPAS_DBUS_NEW_NETWORKS_PART "Networks"
|
||||
#define WPAS_DBUS_NEW_IFACE_NETWORK WPAS_DBUS_NEW_INTERFACE ".Network"
|
||||
|
||||
#define WPAS_DBUS_NEW_BSSIDS_PART "BSSs"
|
||||
#define WPAS_DBUS_NEW_IFACE_BSS WPAS_DBUS_NEW_INTERFACE ".BSS"
|
||||
|
||||
#define WPAS_DBUS_NEW_STAS_PART "Stations"
|
||||
#define WPAS_DBUS_NEW_IFACE_STA WPAS_DBUS_NEW_INTERFACE ".Station"
|
||||
|
||||
#define WPAS_DBUS_NEW_IFACE_P2PDEVICE \
|
||||
WPAS_DBUS_NEW_IFACE_INTERFACE ".P2PDevice"
|
||||
|
||||
#define WPAS_DBUS_NEW_IFACE_MESH WPAS_DBUS_NEW_IFACE_INTERFACE ".Mesh"
|
||||
|
||||
/*
|
||||
* Groups correspond to P2P groups where this device is a GO (owner)
|
||||
*/
|
||||
#define WPAS_DBUS_NEW_P2P_GROUPS_PART "Groups"
|
||||
#define WPAS_DBUS_NEW_IFACE_P2P_GROUP WPAS_DBUS_NEW_INTERFACE ".Group"
|
||||
|
||||
/*
|
||||
* Different dbus object for persistent groups so they do not get confused
|
||||
* with regular (configured) network objects.
|
||||
*/
|
||||
#define WPAS_DBUS_NEW_PERSISTENT_GROUPS_PART "PersistentGroups"
|
||||
#define WPAS_DBUS_NEW_IFACE_PERSISTENT_GROUP \
|
||||
WPAS_DBUS_NEW_INTERFACE ".PersistentGroup"
|
||||
|
||||
#define WPAS_DBUS_NEW_P2P_PEERS_PART "Peers"
|
||||
#define WPAS_DBUS_NEW_IFACE_P2P_PEER WPAS_DBUS_NEW_INTERFACE ".Peer"
|
||||
|
||||
/* Top-level Errors */
|
||||
#define WPAS_DBUS_ERROR_UNKNOWN_ERROR \
|
||||
WPAS_DBUS_NEW_INTERFACE ".UnknownError"
|
||||
#define WPAS_DBUS_ERROR_INVALID_ARGS \
|
||||
WPAS_DBUS_NEW_INTERFACE ".InvalidArgs"
|
||||
|
||||
#define WPAS_DBUS_ERROR_IFACE_EXISTS \
|
||||
WPAS_DBUS_NEW_INTERFACE ".InterfaceExists"
|
||||
#define WPAS_DBUS_ERROR_IFACE_DISABLED \
|
||||
WPAS_DBUS_NEW_INTERFACE ".InterfaceDisabled"
|
||||
#define WPAS_DBUS_ERROR_IFACE_UNKNOWN \
|
||||
WPAS_DBUS_NEW_INTERFACE ".InterfaceUnknown"
|
||||
|
||||
#define WPAS_DBUS_ERROR_NOT_CONNECTED \
|
||||
WPAS_DBUS_NEW_INTERFACE ".NotConnected"
|
||||
#define WPAS_DBUS_ERROR_NETWORK_UNKNOWN \
|
||||
WPAS_DBUS_NEW_INTERFACE ".NetworkUnknown"
|
||||
|
||||
#define WPAS_DBUS_ERROR_CONNECT_CHANNEL_UNAVAILABLE \
|
||||
WPAS_DBUS_NEW_INTERFACE ".ConnectChannelUnavailable"
|
||||
#define WPAS_DBUS_ERROR_CONNECT_CHANNEL_UNSUPPORTED \
|
||||
WPAS_DBUS_NEW_INTERFACE ".ConnectChannelUnsupported"
|
||||
#define WPAS_DBUS_ERROR_CONNECT_UNSPECIFIED_ERROR \
|
||||
WPAS_DBUS_NEW_INTERFACE ".ConnectUnspecifiedError"
|
||||
|
||||
#define WPAS_DBUS_ERROR_BLOB_EXISTS \
|
||||
WPAS_DBUS_NEW_INTERFACE ".BlobExists"
|
||||
#define WPAS_DBUS_ERROR_BLOB_UNKNOWN \
|
||||
WPAS_DBUS_NEW_INTERFACE ".BlobUnknown"
|
||||
|
||||
#define WPAS_DBUS_ERROR_SUBSCRIPTION_IN_USE \
|
||||
WPAS_DBUS_NEW_INTERFACE ".SubscriptionInUse"
|
||||
#define WPAS_DBUS_ERROR_NO_SUBSCRIPTION \
|
||||
WPAS_DBUS_NEW_INTERFACE ".NoSubscription"
|
||||
#define WPAS_DBUS_ERROR_SUBSCRIPTION_EPERM \
|
||||
WPAS_DBUS_NEW_INTERFACE ".SubscriptionNotYou"
|
||||
|
||||
/* Interface-level errors */
|
||||
#define WPAS_DBUS_ERROR_IFACE_SCAN_ERROR \
|
||||
WPAS_DBUS_NEW_IFACE_INTERFACE ".ScanError"
|
||||
|
||||
void wpas_dbus_subscribe_noc(struct wpas_dbus_priv *priv);
|
||||
void wpas_dbus_unsubscribe_noc(struct wpas_dbus_priv *priv);
|
||||
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE_DBUS_NEW
|
||||
|
||||
int wpas_dbus_ctrl_iface_init(struct wpas_dbus_priv *priv);
|
||||
void wpas_dbus_ctrl_iface_deinit(struct wpas_dbus_priv *iface);
|
||||
|
||||
int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s);
|
||||
int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s);
|
||||
void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
|
||||
enum wpas_dbus_prop property);
|
||||
void wpas_dbus_bss_signal_prop_changed(struct wpa_supplicant *wpa_s,
|
||||
enum wpas_dbus_bss_prop property,
|
||||
unsigned int id);
|
||||
void wpas_dbus_signal_network_enabled_changed(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid);
|
||||
void wpas_dbus_signal_network_selected(struct wpa_supplicant *wpa_s, int id);
|
||||
void wpas_dbus_signal_network_request(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid,
|
||||
enum wpa_ctrl_req_type rtype,
|
||||
const char *default_text);
|
||||
void wpas_dbus_signal_scan_done(struct wpa_supplicant *wpa_s, int success);
|
||||
void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
|
||||
const struct wps_credential *cred);
|
||||
void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
|
||||
struct wps_event_m2d *m2d);
|
||||
void wpas_dbus_signal_wps_event_fail(struct wpa_supplicant *wpa_s,
|
||||
struct wps_event_fail *fail);
|
||||
void wpas_dbus_signal_wps_event_success(struct wpa_supplicant *wpa_s);
|
||||
void wpas_dbus_signal_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s);
|
||||
int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid);
|
||||
int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid);
|
||||
int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
|
||||
u8 bssid[ETH_ALEN], unsigned int id);
|
||||
int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
|
||||
u8 bssid[ETH_ALEN], unsigned int id);
|
||||
int wpas_dbus_unregister_sta(struct wpa_supplicant *wpa_s, const u8 *sta);
|
||||
int wpas_dbus_register_sta(struct wpa_supplicant *wpa_s, const u8 *sta);
|
||||
void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
|
||||
const char *name);
|
||||
void wpas_dbus_signal_blob_removed(struct wpa_supplicant *wpa_s,
|
||||
const char *name);
|
||||
void wpas_dbus_signal_debug_level_changed(struct wpa_global *global);
|
||||
void wpas_dbus_signal_debug_timestamp_changed(struct wpa_global *global);
|
||||
void wpas_dbus_signal_debug_show_keys_changed(struct wpa_global *global);
|
||||
|
||||
int wpas_dbus_register_peer(struct wpa_supplicant *wpa_s, const u8 *dev_addr);
|
||||
void wpas_dbus_signal_p2p_find_stopped(struct wpa_supplicant *wpa_s);
|
||||
void wpas_dbus_signal_peer_device_found(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr);
|
||||
int wpas_dbus_unregister_peer(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr);
|
||||
void wpas_dbus_signal_peer_device_lost(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr);
|
||||
void wpas_dbus_signal_peer_groups_changed(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr);
|
||||
void wpas_dbus_signal_p2p_group_removed(struct wpa_supplicant *wpa_s,
|
||||
const char *role);
|
||||
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);
|
||||
void wpas_dbus_signal_p2p_go_neg_req(struct wpa_supplicant *wpa_s,
|
||||
const u8 *src, u16 dev_passwd_id,
|
||||
u8 go_intent);
|
||||
void wpas_dbus_signal_p2p_group_started(struct wpa_supplicant *wpa_s,
|
||||
int client, int persistent,
|
||||
const u8 *ip);
|
||||
void wpas_dbus_signal_p2p_group_formation_failure(struct wpa_supplicant *wpa_s,
|
||||
const char *reason);
|
||||
void wpas_dbus_register_p2p_group(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid);
|
||||
void wpas_dbus_signal_p2p_go_neg_resp(struct wpa_supplicant *wpa_s,
|
||||
struct p2p_go_neg_results *res);
|
||||
void wpas_dbus_unregister_p2p_group(struct wpa_supplicant *wpa_s,
|
||||
const struct wpa_ssid *ssid);
|
||||
int wpas_dbus_register_persistent_group(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid);
|
||||
int wpas_dbus_unregister_persistent_group(struct wpa_supplicant *wpa_s,
|
||||
int nid);
|
||||
void wpas_dbus_signal_p2p_invitation_result(struct wpa_supplicant *wpa_s,
|
||||
int status, const u8 *bssid);
|
||||
void wpas_dbus_signal_p2p_peer_disconnected(struct wpa_supplicant *wpa_s,
|
||||
const u8 *member);
|
||||
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_peer_joined(struct wpa_supplicant *wpa_s,
|
||||
const u8 *member);
|
||||
void wpas_dbus_signal_p2p_wps_failed(struct wpa_supplicant *wpa_s,
|
||||
struct wps_event_fail *fail);
|
||||
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_preq(struct wpa_supplicant *wpa_s,
|
||||
const u8 *addr, const u8 *dst, const u8 *bssid,
|
||||
const u8 *ie, size_t ie_len, u32 ssi_signal);
|
||||
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);
|
||||
void wpas_dbus_signal_sta_deauthorized(struct wpa_supplicant *wpa_s,
|
||||
const u8 *sta);
|
||||
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);
|
||||
void wpas_dbus_signal_mesh_group_started(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid);
|
||||
void wpas_dbus_signal_mesh_group_removed(struct wpa_supplicant *wpa_s,
|
||||
const u8 *meshid, u8 meshid_len,
|
||||
int reason);
|
||||
void wpas_dbus_signal_mesh_peer_connected(struct wpa_supplicant *wpa_s,
|
||||
const u8 *peer_addr);
|
||||
void wpas_dbus_signal_mesh_peer_disconnected(struct wpa_supplicant *wpa_s,
|
||||
const u8 *peer_addr, int reason);
|
||||
|
||||
#else /* CONFIG_CTRL_IFACE_DBUS_NEW */
|
||||
|
||||
static inline int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define wpas_dbus_signal_state_changed(w, n, o) do { } while (0)
|
||||
|
||||
static inline void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
|
||||
enum wpas_dbus_prop property)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_bss_signal_prop_changed(
|
||||
struct wpa_supplicant *wpa_s, enum wpas_dbus_bss_prop property,
|
||||
unsigned int id)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_network_enabled_changed(
|
||||
struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_network_selected(
|
||||
struct wpa_supplicant *wpa_s, int id)
|
||||
{
|
||||
}
|
||||
|
||||
static inline 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)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_scan_done(struct wpa_supplicant *wpa_s,
|
||||
int success)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
|
||||
const struct wps_credential *cred)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
|
||||
struct wps_event_m2d *m2d)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_wps_event_fail(
|
||||
struct wpa_supplicant *wpa_s, struct wps_event_fail *fail)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_wps_event_success(
|
||||
struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_wps_event_pbc_overlap(
|
||||
struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s,
|
||||
int nid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
|
||||
u8 bssid[ETH_ALEN], unsigned int id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
|
||||
u8 bssid[ETH_ALEN], unsigned int id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_unregister_sta(struct wpa_supplicant *wpa_s,
|
||||
const u8 *sta)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_register_sta(struct wpa_supplicant *wpa_s,
|
||||
const u8 *sta)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
|
||||
const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_blob_removed(struct wpa_supplicant *wpa_s,
|
||||
const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_debug_level_changed(
|
||||
struct wpa_global *global)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_debug_timestamp_changed(
|
||||
struct wpa_global *global)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_debug_show_keys_changed(
|
||||
struct wpa_global *global)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_register_peer(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_unregister_peer(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_peer_groups_changed(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_group_removed(struct wpa_supplicant *wpa_s,
|
||||
const char *role)
|
||||
{
|
||||
}
|
||||
|
||||
static inline 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)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_p2p_go_neg_req(struct wpa_supplicant *wpa_s,
|
||||
const u8 *src,
|
||||
u16 dev_passwd_id,
|
||||
u8 go_intent)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_group_started(struct wpa_supplicant *wpa_s,
|
||||
int client, int persistent,
|
||||
const u8 *ip)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_group_formation_failure(struct wpa_supplicant *wpa_s,
|
||||
const char *reason)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_register_p2p_group(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_register_persistent_group(
|
||||
struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_unregister_persistent_group(
|
||||
struct wpa_supplicant *wpa_s, int nid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_go_neg_resp(struct wpa_supplicant *wpa_s,
|
||||
struct p2p_go_neg_results *res)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_unregister_p2p_group(struct wpa_supplicant *wpa_s,
|
||||
const struct wpa_ssid *ssid)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_p2p_invitation_result(
|
||||
struct wpa_supplicant *wpa_s, int status,
|
||||
const u8 *bssid)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_register_p2p_groupmember(struct wpa_supplicant *wpa_s,
|
||||
const u8 *p2p_if_addr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline 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)
|
||||
{
|
||||
}
|
||||
|
||||
static inline 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)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_unregister_p2p_groupmember(struct wpa_supplicant *wpa_s,
|
||||
const u8 *p2p_if_addr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_peer_joined(struct wpa_supplicant *wpa_s,
|
||||
const u8 *member)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_find_stopped(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_peer_device_found(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_peer_device_lost(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_peer_disconnected(struct wpa_supplicant *wpa_s,
|
||||
const u8 *member)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_wps_failed(struct wpa_supplicant *wpa_s,
|
||||
struct wps_event_fail *fail)
|
||||
{
|
||||
}
|
||||
|
||||
static inline 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)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_preq(struct wpa_supplicant *wpa_s,
|
||||
const u8 *addr, const u8 *dst,
|
||||
const u8 *bssid,
|
||||
const u8 *ie, size_t ie_len,
|
||||
u32 ssi_signal)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_eap_status(struct wpa_supplicant *wpa_s,
|
||||
const char *status,
|
||||
const char *parameter)
|
||||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
void wpas_dbus_signal_sta_authorized(struct wpa_supplicant *wpa_s,
|
||||
const u8 *sta)
|
||||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
void wpas_dbus_signal_sta_deauthorized(struct wpa_supplicant *wpa_s,
|
||||
const u8 *sta)
|
||||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
void wpas_dbus_signal_mesh_group_started(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid)
|
||||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
void wpas_dbus_signal_mesh_group_removed(struct wpa_supplicant *wpa_s,
|
||||
const u8 *meshid, u8 meshid_len,
|
||||
int reason)
|
||||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
void wpas_dbus_signal_mesh_peer_connected(struct wpa_supplicant *wpa_s,
|
||||
const u8 *peer_addr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
void wpas_dbus_signal_mesh_peer_disconnected(struct wpa_supplicant *wpa_s,
|
||||
const u8 *peer_addr, int reason)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
|
||||
|
||||
#endif /* CTRL_IFACE_DBUS_H_NEW */
|
||||
Reference in New Issue
Block a user