Commit 198591a6 authored by Thomas Haller's avatar Thomas Haller

libnm: merge branch 'th/libnm-no-dbus-codegen-1'

!299
parents 90487ef5 558dacce
Pipeline #70991 failed with stages
in 116 minutes and 9 seconds
......@@ -1296,8 +1296,7 @@ nmc_do_cmd (NmCli *nmc, const NMCCommand cmds[], const char *cmd, int argc, char
const NMCCommand *c;
gs_unref_object GTask *task = NULL;
task = g_task_new (NULL, NULL, command_done, nmc);
g_task_set_source_tag (task, nmc_do_cmd);
task = nm_g_task_new (NULL, NULL, nmc_do_cmd, command_done, nmc);
g_task_set_task_data (task, nmc, NULL);
if (argc == 0 && nmc->complete) {
......
......@@ -102,6 +102,7 @@
LoadConnections:
@filenames: Array of paths to on-disk connection profiles in directories monitored by NetworkManager.
@status: Success or failure of the operation as a whole. True if NetworkManager at least tried to load the indicated connections, even if it did not succeed. False if an error occurred before trying to load the connections (eg, permission denied).
Note that before 1.20, NetworkManager had a bug and this @status value was wrong. It is better to assume success if the method does not return with a D-Bus error. On top of that, you can look at @failures to know whether any of the requested files failed.
@failures: Paths of connection files that could not be loaded.
Loads or reloads the indicated connections from disk. You should call this
......@@ -119,7 +120,7 @@
<!--
ReloadConnections:
@status: Success or failure.
@status: This always returns %TRUE.
Tells NetworkManager to reload all connection files from disk, including
noticing any added or deleted connection files. By default, connections
......
This diff is collapsed.
......@@ -277,10 +277,13 @@ void nm_client_connectivity_check_set_enabled (NMClient *client,
NM_AVAILABLE_IN_1_20
const char *nm_client_connectivity_check_get_uri (NMClient *client);
_NM_DEPRECATED_SYNC_METHOD
gboolean nm_client_get_logging (NMClient *client,
char **level,
char **domains,
GError **error);
_NM_DEPRECATED_SYNC_METHOD
gboolean nm_client_set_logging (NMClient *client,
const char *level,
const char *domains,
......
......@@ -12,6 +12,8 @@
#include "nm-std-aux/nm-dbus-compat.h"
#define NM_DBUS_DEFAULT_TIMEOUT_MSEC 25000
GBusType _nm_dbus_bus_type (void);
void _nm_dbus_proxy_replace_match (GDBusProxy *proxy);
......
......@@ -7,6 +7,7 @@
#include "nm-device-wifi-p2p.h"
#include "nm-glib-aux/nm-dbus-aux.h"
#include "nm-setting-connection.h"
#include "nm-setting-wifi-p2p.h"
#include "nm-utils.h"
......@@ -19,11 +20,6 @@
/*****************************************************************************/
typedef struct {
NMDeviceWifiP2P *device;
GSimpleAsyncResult *simple;
} RequestScanInfo;
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
PROP_HW_ADDRESS,
PROP_PEERS,
......@@ -142,23 +138,6 @@ nm_device_wifi_p2p_get_peer_by_path (NMDeviceWifiP2P *device,
return peer;
}
static void
start_find_finished_cb (GObject *obj,
GAsyncResult *res,
gpointer user_data)
{
NMDBusDeviceWifiP2P *proxy = (NMDBusDeviceWifiP2P*) obj;
gs_unref_object GTask *task = G_TASK (user_data);
GError *error = NULL;
gboolean success;
success = nmdbus_device_wifi_p2p_call_start_find_finish (proxy, res, &error);
if (!success)
g_task_return_error (task, error);
else
g_task_return_boolean (task, TRUE);
}
/**
* nm_device_wifi_p2p_start_find:
* @device: a #NMDeviceWifiP2P
......@@ -177,26 +156,32 @@ start_find_finished_cb (GObject *obj,
* Since: 1.16
**/
void
nm_device_wifi_p2p_start_find (NMDeviceWifiP2P *device,
GVariant *options,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
nm_device_wifi_p2p_start_find (NMDeviceWifiP2P *device,
GVariant *options,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE (device);
GTask *task;
g_return_if_fail (NM_IS_DEVICE_WIFI_P2P (device));
task = g_task_new (device, cancellable, callback, user_data);
g_return_if_fail (!options || g_variant_is_of_type (options, G_VARIANT_TYPE_VARDICT));
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
if (!options)
options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0);
nmdbus_device_wifi_p2p_call_start_find (priv->proxy,
options,
cancellable,
start_find_finished_cb,
task);
_nm_object_dbus_call (device,
nm_device_wifi_p2p_start_find,
cancellable,
callback,
user_data,
NM_DBUS_PATH,
NM_DBUS_INTERFACE,
"StartFind",
g_variant_new ("(@a{sv})", options),
G_VARIANT_TYPE ("()"),
G_DBUS_CALL_FLAGS_NONE,
NM_DBUS_DEFAULT_TIMEOUT_MSEC,
nm_dbus_connection_call_finish_void_cb);
}
/**
......@@ -216,24 +201,10 @@ nm_device_wifi_p2p_start_find_finish (NMDeviceWifiP2P *device,
GAsyncResult *result,
GError **error)
{
return g_task_propagate_boolean (G_TASK (result), error);
}
g_return_val_if_fail (NM_IS_DEVICE_WIFI_P2P (device), FALSE);
g_return_val_if_fail (nm_g_task_is_valid (result, device, nm_device_wifi_p2p_start_find), FALSE);
static void
stop_find_finished_cb (GObject *obj,
GAsyncResult *res,
gpointer user_data)
{
NMDBusDeviceWifiP2P *proxy = (NMDBusDeviceWifiP2P*) obj;
gs_unref_object GTask *task = G_TASK (user_data);
GError *error = NULL;
gboolean success;
success = nmdbus_device_wifi_p2p_call_stop_find_finish (proxy, res, &error);
if (!success)
g_task_return_error (task, error);
else
g_task_return_boolean (task, TRUE);
return g_task_propagate_boolean (G_TASK (result), error);
}
/**
......@@ -253,17 +224,22 @@ nm_device_wifi_p2p_stop_find (NMDeviceWifiP2P *device,
GAsyncReadyCallback callback,
gpointer user_data)
{
NMDeviceWifiP2PPrivate *priv = NM_DEVICE_WIFI_P2P_GET_PRIVATE (device);
GTask *task;
g_return_if_fail (NM_IS_DEVICE_WIFI_P2P (device));
task = g_task_new (device, cancellable, callback, user_data);
nmdbus_device_wifi_p2p_call_stop_find (priv->proxy,
cancellable,
stop_find_finished_cb,
task);
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
_nm_object_dbus_call (device,
nm_device_wifi_p2p_stop_find,
cancellable,
callback,
user_data,
NM_DBUS_PATH,
NM_DBUS_INTERFACE,
"StopFind",
g_variant_new ("()"),
G_VARIANT_TYPE ("()"),
G_DBUS_CALL_FLAGS_NONE,
NM_DBUS_DEFAULT_TIMEOUT_MSEC,
nm_dbus_connection_call_finish_void_cb);
}
/**
......@@ -283,6 +259,9 @@ nm_device_wifi_p2p_stop_find_finish (NMDeviceWifiP2P *device,
GAsyncResult *result,
GError **error)
{
g_return_val_if_fail (NM_IS_DEVICE_WIFI_P2P (device), FALSE);
g_return_val_if_fail (nm_g_task_is_valid (result, device, nm_device_wifi_p2p_stop_find), FALSE);
return g_task_propagate_boolean (G_TASK (result), error);
}
......
......@@ -8,6 +8,7 @@
#include "nm-device-wifi.h"
#include "nm-glib-aux/nm-dbus-aux.h"
#include "nm-setting-connection.h"
#include "nm-setting-wireless.h"
#include "nm-setting-wireless-security.h"
......@@ -26,11 +27,6 @@ G_DEFINE_TYPE (NMDeviceWifi, nm_device_wifi, NM_TYPE_DEVICE)
void _nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device, gboolean enabled);
static void state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data);
typedef struct {
NMDeviceWifi *device;
GSimpleAsyncResult *simple;
} RequestScanInfo;
typedef struct {
NMDBusDeviceWifi *proxy;
......@@ -42,8 +38,6 @@ typedef struct {
NMDeviceWifiCapabilities wireless_caps;
GPtrArray *aps;
gint64 last_scan;
RequestScanInfo *scan_info;
} NMDeviceWifiPrivate;
enum {
......@@ -273,52 +267,6 @@ nm_device_wifi_get_last_scan (NMDeviceWifi *device)
return NM_DEVICE_WIFI_GET_PRIVATE (device)->last_scan;
}
static GVariant *
prepare_scan_options (GVariant *options)
{
GVariant *variant;
GVariantIter iter;
GVariantBuilder builder;
char *key;
GVariant *value;
if (!options)
variant = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0);
else {
g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
g_variant_iter_init (&iter, options);
while (g_variant_iter_loop (&iter, "{sv}", &key, &value))
{
// FIXME: verify options here?
g_variant_builder_add (&builder, "{sv}", key, value);
}
variant = g_variant_builder_end (&builder);
}
return variant;
}
static gboolean
_device_wifi_request_scan (NMDeviceWifi *device,
GVariant *options,
GCancellable *cancellable,
GError **error)
{
gboolean ret;
GVariant *variant;
g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), FALSE);
variant = prepare_scan_options (options);
ret = nmdbus_device_wifi_call_request_scan_sync (NM_DEVICE_WIFI_GET_PRIVATE (device)->proxy,
variant,
cancellable, error);
if (error && *error)
g_dbus_error_strip_remote_error (*error);
return ret;
}
/**
* nm_device_wifi_request_scan:
* @device: a #NMDeviceWifi
......@@ -339,7 +287,7 @@ nm_device_wifi_request_scan (NMDeviceWifi *device,
GCancellable *cancellable,
GError **error)
{
return _device_wifi_request_scan (device, NULL, cancellable, error);
return nm_device_wifi_request_scan_options (device, NULL, cancellable, error);
}
/**
......@@ -370,76 +318,30 @@ nm_device_wifi_request_scan_options (NMDeviceWifi *device,
GCancellable *cancellable,
GError **error)
{
return _device_wifi_request_scan (device, options, cancellable, error);
g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), FALSE);
g_return_val_if_fail (!options || g_variant_is_of_type (options, G_VARIANT_TYPE_VARDICT), FALSE);
g_return_val_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable), FALSE);
g_return_val_if_fail (!error || !*error, FALSE);
if (!options)
options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0);
return _nm_object_dbus_call_sync_void (device,
cancellable,
g_dbus_proxy_get_object_path (G_DBUS_PROXY (NM_DEVICE_WIFI_GET_PRIVATE (device)->proxy)),
NM_DBUS_INTERFACE_DEVICE_WIRELESS,
"RequestScan",
g_variant_new ("(@a{sv})", options),
G_DBUS_CALL_FLAGS_NONE,
NM_DBUS_DEFAULT_TIMEOUT_MSEC,
TRUE,
error);
}
NM_BACKPORT_SYMBOL (libnm_1_0_6, gboolean, nm_device_wifi_request_scan_options,
(NMDeviceWifi *device, GVariant *options, GCancellable *cancellable, GError **error),
(device, options, cancellable, error));
static void
request_scan_cb (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
RequestScanInfo *info = user_data;
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (info->device);
GError *error = NULL;
priv->scan_info = NULL;
if (nmdbus_device_wifi_call_request_scan_finish (NMDBUS_DEVICE_WIFI (source),
result, &error))
g_simple_async_result_set_op_res_gboolean (info->simple, TRUE);
else {
g_dbus_error_strip_remote_error (error);
g_simple_async_result_take_error (info->simple, error);
}
g_simple_async_result_complete (info->simple);
g_object_unref (info->simple);
g_slice_free (RequestScanInfo, info);
}
static void
_device_wifi_request_scan_async (NMDeviceWifi *device,
GVariant *options,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device);
RequestScanInfo *info;
GSimpleAsyncResult *simple;
GVariant *variant;
g_return_if_fail (NM_IS_DEVICE_WIFI (device));
simple = g_simple_async_result_new (G_OBJECT (device), callback, user_data,
nm_device_wifi_request_scan_async);
if (cancellable)
g_simple_async_result_set_check_cancellable (simple, cancellable);
/* If a scan is in progress, just return */
if (priv->scan_info) {
g_simple_async_result_set_op_res_gboolean (simple, TRUE);
g_simple_async_result_complete_in_idle (simple);
g_object_unref (simple);
return;
}
info = g_slice_new0 (RequestScanInfo);
info->device = device;
info->simple = simple;
variant = prepare_scan_options (options);
priv->scan_info = info;
nmdbus_device_wifi_call_request_scan (NM_DEVICE_WIFI_GET_PRIVATE (device)->proxy,
variant,
cancellable, request_scan_cb, info);
}
/**
* nm_device_wifi_request_scan_async:
* @device: a #NMDeviceWifi
......@@ -457,7 +359,7 @@ nm_device_wifi_request_scan_async (NMDeviceWifi *device,
GAsyncReadyCallback callback,
gpointer user_data)
{
_device_wifi_request_scan_async (device, NULL, cancellable, callback, user_data);
nm_device_wifi_request_scan_options_async (device, NULL, cancellable, callback, user_data);
}
/**
......@@ -476,6 +378,8 @@ nm_device_wifi_request_scan_async (NMDeviceWifi *device,
* D-Bus call. Valid options inside the dictionary are:
* 'ssids' => array of SSIDs (saay)
*
* To complete the request call nm_device_wifi_request_scan_finish().
*
* Since: 1.2
**/
void
......@@ -485,7 +389,26 @@ nm_device_wifi_request_scan_options_async (NMDeviceWifi *device,
GAsyncReadyCallback callback,
gpointer user_data)
{
_device_wifi_request_scan_async (device, options, cancellable, callback, user_data);
g_return_if_fail (NM_IS_DEVICE_WIFI (device));
g_return_if_fail (!options || g_variant_is_of_type (options, G_VARIANT_TYPE_VARDICT));
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
if (!options)
options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0);
_nm_object_dbus_call (device,
nm_device_wifi_request_scan_async,
cancellable,
callback,
user_data,
g_dbus_proxy_get_object_path (G_DBUS_PROXY (NM_DEVICE_WIFI_GET_PRIVATE (device)->proxy)),
NM_DBUS_INTERFACE_DEVICE_WIRELESS,
"RequestScan",
g_variant_new ("(@a{sv})", options),
G_VARIANT_TYPE ("()"),
G_DBUS_CALL_FLAGS_NONE,
NM_DBUS_DEFAULT_TIMEOUT_MSEC,
nm_dbus_connection_call_finish_void_strip_dbus_error_cb);
}
NM_BACKPORT_SYMBOL (libnm_1_0_6, void, nm_device_wifi_request_scan_options_async,
......@@ -498,7 +421,8 @@ NM_BACKPORT_SYMBOL (libnm_1_0_6, void, nm_device_wifi_request_scan_options_async
* @result: the result passed to the #GAsyncReadyCallback
* @error: location for a #GError, or %NULL
*
* Gets the result of a call to nm_device_wifi_request_scan_async().
* Gets the result of a call to nm_device_wifi_request_scan_async() and
* nm_device_wifi_request_scan_options_async().
*
* Returns: %TRUE on success, %FALSE on error, in which case @error will be
* set.
......@@ -508,15 +432,10 @@ nm_device_wifi_request_scan_finish (NMDeviceWifi *device,
GAsyncResult *result,
GError **error)
{
GSimpleAsyncResult *simple;
g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (device), nm_device_wifi_request_scan_async), FALSE);
g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), FALSE);
g_return_val_if_fail (nm_g_task_is_valid (result, device, nm_device_wifi_request_scan_async), FALSE);
simple = G_SIMPLE_ASYNC_RESULT (result);
if (g_simple_async_result_propagate_error (simple, error))
return FALSE;
else
return g_simple_async_result_get_op_res_gboolean (simple);
return g_task_propagate_boolean (G_TASK (result), error);
}
static void
......
This diff is collapsed.
This diff is collapsed.
......@@ -84,8 +84,9 @@ gboolean nm_manager_get_startup (NMManager *manager);
gboolean nm_manager_networking_get_enabled (NMManager *manager);
_NM_DEPRECATED_SYNC_METHOD_INTERNAL
gboolean nm_manager_networking_set_enabled (NMManager *manager,
gboolean enabled,
gboolean _nm_manager_networking_set_enabled (GDBusConnection *dbus_connection,
const char *name_owner,
gboolean enable,
GError **error);
gboolean nm_manager_wireless_get_enabled (NMManager *manager);
......@@ -112,31 +113,13 @@ void nm_manager_connectivity_check_set_enabled (NMManager *manager,
const char *nm_manager_connectivity_check_get_uri (NMManager *manager);
gboolean nm_manager_get_logging (NMManager *manager,
char **level,
char **domains,
GError **error);
gboolean nm_manager_set_logging (NMManager *manager,
const char *level,
const char *domains,
GError **error);
NMClientPermissionResult nm_manager_get_permission_result (NMManager *manager,
NMClientPermission permission);
NMConnectivityState nm_manager_get_connectivity (NMManager *manager);
_NM_DEPRECATED_SYNC_METHOD_INTERNAL
NMConnectivityState nm_manager_check_connectivity (NMManager *manager,
GCancellable *cancellable,
GError **error);
void nm_manager_check_connectivity_async (NMManager *manager,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
NMConnectivityState nm_manager_check_connectivity_finish (NMManager *manager,
GAsyncResult *result,
GError **error);
void _nm_manager_set_connectivity_hack (NMManager *manager,
guint32 connectivity);
/* Devices */
......@@ -152,81 +135,17 @@ const GPtrArray *nm_manager_get_active_connections (NMManager *manager);
NMActiveConnection *nm_manager_get_primary_connection (NMManager *manager);
NMActiveConnection *nm_manager_get_activating_connection (NMManager *manager);
void nm_manager_activate_connection_async (NMManager *manager,
NMConnection *connection,
NMDevice *device,
const char *specific_object,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
NMActiveConnection *nm_manager_activate_connection_finish (NMManager *manager,
GAsyncResult *result,
GError **error);
void nm_manager_add_and_activate_connection_async (NMManager *manager,
NMConnection *partial,
NMDevice *device,
const char *specific_object,
GVariant *options,
gboolean force_v2,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
NMActiveConnection *nm_manager_add_and_activate_connection_finish (NMManager *manager,
GAsyncResult *result,
GVariant **out_result,
GError **error);
_NM_DEPRECATED_SYNC_METHOD_INTERNAL
gboolean nm_manager_deactivate_connection (NMManager *manager,
NMActiveConnection *active,
GCancellable *cancellable,
GError **error);
void nm_manager_deactivate_connection_async (NMManager *manager,
NMActiveConnection *active,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean nm_manager_deactivate_connection_finish (NMManager *manager,
GAsyncResult *result,
GError **error);
void nm_manager_wait_for_active_connection (NMManager *self,
const char *active_path,
const char *connection_path,
GVariant *add_and_activate_output_take,
GTask *task_take);
const GPtrArray *nm_manager_get_checkpoints (NMManager *manager);
void nm_manager_checkpoint_create (NMManager *manager,
const GPtrArray *devices,
guint32 rollback_timeout,
NMCheckpointCreateFlags flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
NMCheckpoint *nm_manager_checkpoint_create_finish (NMManager *manager,
GAsyncResult *result,
GError **error);
void nm_manager_checkpoint_destroy (NMManager *manager,
const char *checkpoint_path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean nm_manager_checkpoint_destroy_finish (NMManager *manager,
GAsyncResult *result,
GError **error);
void nm_manager_checkpoint_rollback (NMManager *manager,
void nm_manager_wait_for_checkpoint (NMManager *self,
const char *checkpoint_path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GHashTable *nm_manager_checkpoint_rollback_finish (NMManager *manager,
GAsyncResult *result,
GError **error);
void nm_manager_checkpoint_adjust_rollback_timeout (NMManager *manager,
const char *checkpoint_path,
guint32 add_timeout,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean nm_manager_checkpoint_adjust_rollback_timeout_finish (NMManager *manager,
GAsyncResult *result,
GError **error);
GTask *task_take);
/*****************************************************************************/
......@@ -240,15 +159,9 @@ _NMActivateResult *_nm_activate_result_new (NMActiveConnection *active,
void _nm_activate_result_free (_NMActivateResult *result);
/*****************************************************************************/
NM_AUTO_DEFINE_FCN0 (_NMActivateResult *, _nm_auto_free_activate_result, _nm_activate_result_free)
#define nm_auto_free_activate_result nm_auto(_nm_auto_free_activate_result)
void nm_manager_reload (NMManager *manager,
NMManagerReloadFlags flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean nm_manager_reload_finish (NMManager *manager,
GAsyncResult *result,
GError **error);
/*****************************************************************************/
#endif /* __NM_MANAGER_H__ */
......@@ -34,7 +34,50 @@ GDBusObjectManager *_nm_object_get_dbus_object_manager (NMObject *object);
GQuark _nm_object_obj_nm_quark (void);
/* DBus property accessors */
GDBusConnection *_nm_object_get_dbus_connection (gpointer self);
const char *_nm_object_get_dbus_name_owner (gpointer self);
GDBusConnection *_nm_client_get_dbus_connection (NMClient *client);
const char *_nm_client_get_dbus_name_owner (NMClient *client);
void _nm_object_dbus_call (gpointer self,
gpointer source_tag,
GCancellable *cancellable,
GAsyncReadyCallback user_callback,
gpointer user_callback_data,
const char *object_path,
const char *interface_name,
const char *method_name,
GVariant *parameters,
const GVariantType *reply_type,
GDBusCallFlags flags,
int timeout_msec,
GAsyncReadyCallback internal_callback);
GVariant *_nm_object_dbus_call_sync (gpointer self,
GCancellable *cancellable,
const char *object_path,
const char *interface_name,
const char *method_name,
GVariant *parameters,
const GVariantType *reply_type,
GDBusCallFlags flags,
int timeout_msec,
gboolean strip_dbus_error,
GError **error);
gboolean _nm_object_dbus_call_sync_void (gpointer self,
GCancellable *cancellable,
const char *object_path,
const char *interface_name,
const char *method_name,
GVariant *parameters,
GDBusCallFlags flags,
int timeout_msec,
gboolean strip_dbus_error,
GError **error);
void _nm_object_set_property (NMObject *object,
const char *interface,
......@@ -45,6 +88,9 @@ void _nm_object_set_property (NMObject *object,
GDBusProxy *_nm_object_get_proxy (NMObject *object,
const char *interface);
GError *_nm_object_new_error_nm_not_running (void);
void _nm_object_set_error_nm_not_running (GError **error);
struct udev;
void _nm_device_set_udev (NMDevice *device, struct udev *udev);
......
......@@ -69,6 +69,8 @@ typedef struct {
CList pending; /* ordered list of pending property updates. */
GPtrArray *proxies;
char *name_owner_cached;
} NMObjectPrivate;
enum {
......@@ -127,6 +129,211 @@ _nm_object_get_proxy (NMObject *object,
return G_DBUS_PROXY (proxy);
}
/*****************************************************************************/
GDBusConnection *
_nm_object_get_dbus_connection (gpointer self)
{
NMObjectPrivate *priv;
nm_assert (NM_IS_OBJECT (self));
priv = NM_OBJECT_GET_PRIVATE (self);
return g_dbus_object_manager_client_get_connection (G_DBUS_OBJECT_MANAGER_CLIENT (priv->object_manager));
}
const char *
_nm_object_get_dbus_name_owner (gpointer self)
{