Commit 7f8dc06d authored by Daniel Gnoutcheff's avatar Daniel Gnoutcheff

remove nm-settings-connection-interface

NMSettingsConnectionInterface was created to allow the daemon and NM
clients to have common code that handled both system and user
connections. It's no longer needed now that user settings services are
gone.

This concludes the flattening of libnm-glib.
parent bbd4c232
......@@ -45,7 +45,6 @@
#include <nm-device-bt.h>
//#include <nm-device-olpc-mesh.h>
#include <nm-remote-settings.h>
#include <nm-settings-connection-interface.h>
#include <nm-vpn-connection.h>
#include "utils.h"
......
......@@ -35,7 +35,6 @@
#include <nm-client.h>
#include <nm-setting-connection.h>
#include <nm-remote-settings.h>
#include <nm-settings-connection-interface.h>
#include "nmcli.h"
#include "utils.h"
......
......@@ -31,8 +31,6 @@
<xi:include href="xml/nm-object.xml"/>
<xi:include href="xml/nm-remote-connection.xml"/>
<xi:include href="xml/nm-remote-settings.xml"/>
<xi:include href="xml/nm-settings-connection-interface.xml"/>
<xi:include href="xml/nm-settings-service.xml"/>
<xi:include href="xml/nm-types.xml"/>
<xi:include href="xml/nm-vpn-connection.xml"/>
<xi:include href="xml/nm-vpn-plugin.xml"/>
......
......@@ -76,8 +76,7 @@ libnminclude_HEADERS = \
nm-ip6-config.h \
nm-dhcp6-config.h \
nm-remote-connection.h \
nm-remote-settings.h \
nm-settings-connection-interface.h
nm-remote-settings.h
libnm_glib_la_SOURCES = \
nm-object.c \
......@@ -106,8 +105,7 @@ libnm_glib_la_SOURCES = \
nm-dhcp6-config.c \
nm-remote-connection.c \
nm-remote-connection-private.h \
nm-remote-settings.c \
nm-settings-connection-interface.c
nm-remote-settings.c
libnm_glib_la_LIBADD = \
$(top_builddir)/libnm-util/libnm-util.la \
......
......@@ -116,6 +116,9 @@ global:
nm_object_get_connection;
nm_object_get_path;
nm_object_get_type;
nm_remote_connection_delete;
nm_remote_connection_get_secrets;
nm_remote_connection_commit_changes;
nm_remote_connection_get_type;
nm_remote_connection_new;
nm_remote_settings_add_connection;
......@@ -128,11 +131,6 @@ global:
nm_serial_device_get_bytes_received;
nm_serial_device_get_bytes_sent;
nm_serial_device_get_type;
nm_settings_connection_interface_delete;
nm_settings_connection_interface_emit_updated;
nm_settings_connection_interface_get_secrets;
nm_settings_connection_interface_get_type;
nm_settings_connection_interface_update;
nm_settings_error_quark;
nm_settings_get_type;
nm_settings_list_connections;
......
......@@ -30,14 +30,10 @@
#include "nm-remote-connection-private.h"
#include "nm-dbus-glib-types.h"
#include "nm-sysconfig-connection-bindings.h"
#include "nm-settings-connection-interface.h"
#define NM_REMOTE_CONNECTION_BUS "bus"
static void settings_connection_interface_init (NMSettingsConnectionInterface *klass);
G_DEFINE_TYPE_EXTENDED (NMRemoteConnection, nm_remote_connection, NM_TYPE_CONNECTION, 0,
G_IMPLEMENT_INTERFACE (NM_TYPE_SETTINGS_CONNECTION_INTERFACE, settings_connection_interface_init))
G_DEFINE_TYPE (NMRemoteConnection, nm_remote_connection, NM_TYPE_CONNECTION)
enum {
PROP_0,
......@@ -47,6 +43,14 @@ enum {
LAST_PROP
};
enum {
UPDATED,
REMOVED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = { 0 };
typedef struct {
NMRemoteConnection *self;
......@@ -88,22 +92,36 @@ static void
update_cb (DBusGProxy *proxy, GError *error, gpointer user_data)
{
RemoteCall *call = user_data;
NMSettingsConnectionInterfaceUpdateFunc func = (NMSettingsConnectionInterfaceUpdateFunc) call->callback;
NMRemoteConnectionCommitFunc func = (NMRemoteConnectionCommitFunc) call->callback;
(*func)(NM_SETTINGS_CONNECTION_INTERFACE (call->self), error, call->user_data);
(*func)(call->self, error, call->user_data);
remote_call_complete (call->self, call);
}
static gboolean
update (NMSettingsConnectionInterface *connection,
NMSettingsConnectionInterfaceUpdateFunc callback,
gpointer user_data)
/**
* nm_remote_connection_commit_changes:
* @connection: the #NMRemoteConnection
* @callback: a function to be called when the commit completes
* @user_data: caller-specific data to be passed to @callback
*
* Save any local changes to the settings and properties of this connection and
* save them in the settings service.
**/
void
nm_remote_connection_commit_changes (NMRemoteConnection *self,
NMRemoteConnectionCommitFunc callback,
gpointer user_data)
{
NMRemoteConnection *self = NM_REMOTE_CONNECTION (connection);
NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self);
NMRemoteConnectionPrivate *priv;
GHashTable *settings = NULL;
RemoteCall *call;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_REMOTE_CONNECTION (self));
g_return_if_fail (callback != NULL);
priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self);
call = g_malloc0 (sizeof (RemoteCall));
call->self = self;
call->callback = (GFunc) callback;
......@@ -120,29 +138,40 @@ update (NMSettingsConnectionInterface *connection,
priv->calls = g_slist_append (priv->calls, call);
g_hash_table_destroy (settings);
return TRUE;
}
static void
delete_cb (DBusGProxy *proxy, GError *error, gpointer user_data)
{
RemoteCall *call = user_data;
NMSettingsConnectionInterfaceDeleteFunc func = (NMSettingsConnectionInterfaceDeleteFunc) call->callback;
NMRemoteConnectionDeleteFunc func = (NMRemoteConnectionDeleteFunc) call->callback;
(*func)(NM_SETTINGS_CONNECTION_INTERFACE (call->self), error, call->user_data);
(*func)(call->self, error, call->user_data);
remote_call_complete (call->self, call);
}
static gboolean
do_delete (NMSettingsConnectionInterface *connection,
NMSettingsConnectionInterfaceDeleteFunc callback,
gpointer user_data)
/**
* nm_remote_connection_delete:
* @connection: the #NMRemoteConnection
* @callback: a function to be called when the delete completes
* @user_data: caller-specific data to be passed to @callback
*
* Delete the connection.
**/
void
nm_remote_connection_delete (NMRemoteConnection *self,
NMRemoteConnectionDeleteFunc callback,
gpointer user_data)
{
NMRemoteConnection *self = NM_REMOTE_CONNECTION (connection);
NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self);
NMRemoteConnectionPrivate *priv;
RemoteCall *call;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_REMOTE_CONNECTION (self));
g_return_if_fail (callback != NULL);
priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self);
call = g_malloc0 (sizeof (RemoteCall));
call->self = self;
call->callback = (GFunc) callback;
......@@ -154,32 +183,47 @@ do_delete (NMSettingsConnectionInterface *connection,
call);
g_assert (call->call);
priv->calls = g_slist_append (priv->calls, call);
return TRUE;
}
static void
get_secrets_cb (DBusGProxy *proxy, GHashTable *secrets, GError *error, gpointer user_data)
{
RemoteCall *call = user_data;
NMSettingsConnectionInterfaceGetSecretsFunc func = (NMSettingsConnectionInterfaceGetSecretsFunc) call->callback;
NMRemoteConnectionGetSecretsFunc func = (NMRemoteConnectionGetSecretsFunc) call->callback;
(*func)(NM_SETTINGS_CONNECTION_INTERFACE (call->self), error ? NULL : secrets, error, call->user_data);
(*func)(call->self, error ? NULL : secrets, error, call->user_data);
remote_call_complete (call->self, call);
}
static gboolean
get_secrets (NMSettingsConnectionInterface *connection,
const char *setting_name,
const char **hints,
gboolean request_new,
NMSettingsConnectionInterfaceGetSecretsFunc callback,
gpointer user_data)
/**
* nm_remote_connection_get_secrets:
* @connection: the #NMRemoteConnection
* @setting_name: the #NMSetting object name to get secrets for
* @hints: #NMSetting key names to get secrets for (optional)
* @request_new: hint that new secrets (instead of cached or stored secrets)
* should be returned
* @callback: a function to be called when the update completes
* @user_data: caller-specific data to be passed to @callback
*
* Request the connection's secrets.
**/
void
nm_remote_connection_get_secrets (NMRemoteConnection *self,
const char *setting_name,
const char **hints,
gboolean request_new,
NMRemoteConnectionGetSecretsFunc callback,
gpointer user_data)
{
NMRemoteConnection *self = NM_REMOTE_CONNECTION (connection);
NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self);
NMRemoteConnectionPrivate *priv;
RemoteCall *call;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_REMOTE_CONNECTION (self));
g_return_if_fail (callback != NULL);
priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self);
call = g_malloc0 (sizeof (RemoteCall));
call->self = self;
call->callback = (GFunc) callback;
......@@ -194,8 +238,6 @@ get_secrets (NMSettingsConnectionInterface *connection,
call);
g_assert (call->call);
priv->calls = g_slist_append (priv->calls, call);
return TRUE;
}
/****************************************************************/
......@@ -218,7 +260,7 @@ replace_settings (NMRemoteConnection *self, GHashTable *new_settings)
/* Emit update irregardless to let listeners figure out what to do with
* the connection; whether to delete / ignore it or not.
*/
nm_settings_connection_interface_emit_updated (NM_SETTINGS_CONNECTION_INTERFACE (self));
g_signal_emit (self, signals[UPDATED], 0, new_settings);
return TRUE;
}
......@@ -257,20 +299,11 @@ updated_cb (DBusGProxy *proxy, GHashTable *settings, gpointer user_data)
static void
removed_cb (DBusGProxy *proxy, gpointer user_data)
{
g_signal_emit_by_name (G_OBJECT (user_data), "removed");
g_signal_emit (G_OBJECT (user_data), signals[REMOVED], 0);
}
/****************************************************************/
static void
settings_connection_interface_init (NMSettingsConnectionInterface *klass)
{
/* interface implementation */
klass->update = update;
klass->delete = do_delete;
klass->get_secrets = get_secrets;
}
/**
* nm_remote_connection_new:
* @bus: a valid and connected D-Bus connection
......@@ -425,5 +458,24 @@ nm_remote_connection_class_init (NMRemoteConnectionClass *remote_class)
NM_REMOTE_CONNECTION_INIT_RESULT_ERROR,
NM_REMOTE_CONNECTION_INIT_RESULT_UNKNOWN,
G_PARAM_READABLE));
}
/* Signals */
signals[UPDATED] =
g_signal_new (NM_REMOTE_CONNECTION_UPDATED,
G_TYPE_FROM_CLASS (remote_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMRemoteConnectionClass, updated),
NULL, NULL,
g_cclosure_marshal_VOID__BOXED,
G_TYPE_NONE, 1, DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT);
signals[REMOVED] =
g_signal_new (NM_REMOTE_CONNECTION_REMOVED,
G_TYPE_FROM_CLASS (remote_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMRemoteConnectionClass, removed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
......@@ -38,6 +38,9 @@ G_BEGIN_DECLS
#define NM_IS_REMOTE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_REMOTE_CONNECTION))
#define NM_REMOTE_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_REMOTE_CONNECTION, NMRemoteConnectionClass))
#define NM_REMOTE_CONNECTION_UPDATED "updated"
#define NM_REMOTE_CONNECTION_REMOVED "removed"
typedef struct {
NMConnection parent;
} NMRemoteConnection;
......@@ -45,6 +48,12 @@ typedef struct {
typedef struct {
NMConnectionClass parent_class;
/* Signals */
void (*updated) (NMRemoteConnection *connection,
GHashTable *new_settings);
void (*removed) (NMRemoteConnection *connection);
/* Padding for future expansion */
void (*_reserved1) (void);
void (*_reserved2) (void);
......@@ -54,10 +63,38 @@ typedef struct {
void (*_reserved6) (void);
} NMRemoteConnectionClass;
typedef void (*NMRemoteConnectionCommitFunc) (NMRemoteConnection *connection,
GError *error,
gpointer user_data);
typedef void (*NMRemoteConnectionDeleteFunc) (NMRemoteConnection *connection,
GError *error,
gpointer user_data);
typedef void (*NMRemoteConnectionGetSecretsFunc) (NMRemoteConnection *connection,
GHashTable *secrets,
GError *error,
gpointer user_data);
GType nm_remote_connection_get_type (void);
NMRemoteConnection *nm_remote_connection_new (DBusGConnection *bus,
const char *path);
void nm_remote_connection_commit_changes (NMRemoteConnection *connection,
NMRemoteConnectionCommitFunc callback,
gpointer user_data);
void nm_remote_connection_delete (NMRemoteConnection *connection,
NMRemoteConnectionDeleteFunc callback,
gpointer user_data);
void nm_remote_connection_get_secrets (NMRemoteConnection *connection,
const char *setting_name,
const char **hints,
gboolean request_new,
NMRemoteConnectionGetSecretsFunc callback,
gpointer user_data);
G_END_DECLS
#endif /* __NM_REMOTE_CONNECTION__ */
......
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager -- Network link manager
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* Copyright (C) 2007 - 2008 Novell, Inc.
* Copyright (C) 2007 - 2009 Red Hat, Inc.
*/
#include "nm-settings-connection-interface.h"
#include "nm-dbus-glib-types.h"
/**
* nm_settings_connection_interface_update:
* @connection: an object implementing #NMSettingsConnectionInterface
* @callback: a function to be called when the update completes
* @user_data: caller-specific data to be passed to @callback
*
* Update the connection with current settings and properties.
*
* Returns: TRUE on success, FALSE on failure
**/
gboolean
nm_settings_connection_interface_update (NMSettingsConnectionInterface *connection,
NMSettingsConnectionInterfaceUpdateFunc callback,
gpointer user_data)
{
g_return_val_if_fail (connection != NULL, FALSE);
g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION_INTERFACE (connection), FALSE);
g_return_val_if_fail (callback != NULL, FALSE);
if (NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->update) {
return NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->update (connection,
callback,
user_data);
}
return FALSE;
}
/**
* nm_settings_connection_interface_delete:
* @connection: a objecting implementing #NMSettingsConnectionInterface
* @callback: a function to be called when the delete completes
* @user_data: caller-specific data to be passed to @callback
*
* Delete the connection.
*
* Returns: TRUE on success, FALSE on failure
**/
gboolean
nm_settings_connection_interface_delete (NMSettingsConnectionInterface *connection,
NMSettingsConnectionInterfaceDeleteFunc callback,
gpointer user_data)
{
g_return_val_if_fail (connection != NULL, FALSE);
g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION_INTERFACE (connection), FALSE);
g_return_val_if_fail (callback != NULL, FALSE);
if (NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->delete) {
return NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->delete (connection,
callback,
user_data);
}
return FALSE;
}
/**
* nm_settings_connection_interface_get_secrets:
* @connection: a object implementing #NMSettingsConnectionInterface
* @setting_name: the #NMSetting object name to get secrets for
* @hints: #NMSetting key names to get secrets for (optional)
* @request_new: hint that new secrets (instead of cached or stored secrets)
* should be returned
* @callback: a function to be called when the update completes
* @user_data: caller-specific data to be passed to @callback
*
* Request the connection's secrets.
*
* Returns: TRUE on success, FALSE on failure
**/
gboolean
nm_settings_connection_interface_get_secrets (NMSettingsConnectionInterface *connection,
const char *setting_name,
const char **hints,
gboolean request_new,
NMSettingsConnectionInterfaceGetSecretsFunc callback,
gpointer user_data)
{
g_return_val_if_fail (connection != NULL, FALSE);
g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION_INTERFACE (connection), FALSE);
g_return_val_if_fail (callback != NULL, FALSE);
if (NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->get_secrets) {
return NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->get_secrets (connection,
setting_name,
hints,
request_new,
callback,
user_data);
}
return FALSE;
}
void
nm_settings_connection_interface_emit_updated (NMSettingsConnectionInterface *connection)
{
if (NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->emit_updated)
NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->emit_updated (connection);
else {
NMConnection *tmp;
GHashTable *settings;
tmp = nm_connection_duplicate (NM_CONNECTION (connection));
nm_connection_clear_secrets (tmp);
settings = nm_connection_to_hash (tmp);
g_object_unref (tmp);
g_signal_emit_by_name (connection, NM_SETTINGS_CONNECTION_INTERFACE_UPDATED, settings);
g_hash_table_destroy (settings);
}
}
static void
nm_settings_connection_interface_init (gpointer g_iface)
{
GType iface_type = G_TYPE_FROM_INTERFACE (g_iface);
static gboolean initialized = FALSE;
if (initialized)
return;
/* Signals */
g_signal_new (NM_SETTINGS_CONNECTION_INTERFACE_UPDATED,
iface_type,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMSettingsConnectionInterface, updated),
NULL, NULL,
g_cclosure_marshal_VOID__BOXED,
G_TYPE_NONE, 1, DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT);
g_signal_new (NM_SETTINGS_CONNECTION_INTERFACE_REMOVED,
iface_type,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMSettingsConnectionInterface, removed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
initialized = TRUE;
}
GType
nm_settings_connection_interface_get_type (void)
{
static GType itype = 0;
if (!itype) {
const GTypeInfo iinfo = {
sizeof (NMSettingsConnectionInterface), /* class_size */
nm_settings_connection_interface_init, /* base_init */
NULL, /* base_finalize */
NULL,
NULL, /* class_finalize */
NULL, /* class_data */
0,
0, /* n_preallocs */
NULL
};
itype = g_type_register_static (G_TYPE_INTERFACE,
"NMSettingsConnectionInterface",
&iinfo, 0);
g_type_interface_add_prerequisite (itype, NM_TYPE_CONNECTION);
}
return itype;
}
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/*
* libnm_glib -- Access network status & information from glib applications
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* Copyright (C) 2007 - 2008 Novell, Inc.
* Copyright (C) 2007 - 2009 Red Hat, Inc.
*/
#ifndef __NM_SETTINGS_CONNECTION_INTERFACE_H__
#define __NM_SETTINGS_CONNECTION_INTERFACE_H__
#include <glib-object.h>
#include <dbus/dbus-glib.h>
#include <nm-connection.h>
G_BEGIN_DECLS
#define NM_TYPE_SETTINGS_CONNECTION_INTERFACE (nm_settings_connection_interface_get_type ())
#define NM_SETTINGS_CONNECTION_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTINGS_CONNECTION_INTERFACE, NMSettingsConnectionInterface))
#define NM_IS_SETTINGS_CONNECTION_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTINGS_CONNECTION_INTERFACE))
#define NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_SETTINGS_CONNECTION_INTERFACE, NMSettingsConnectionInterface))
#define NM_SETTINGS_CONNECTION_INTERFACE_UPDATED "updated"
#define NM_SETTINGS_CONNECTION_INTERFACE_REMOVED "removed"
typedef struct _NMSettingsConnectionInterface NMSettingsConnectionInterface;
typedef void (*NMSettingsConnectionInterfaceUpdateFunc) (NMSettingsConnectionInterface *connection,
GError *error,
gpointer user_data);
typedef void (*NMSettingsConnectionInterfaceDeleteFunc) (NMSettingsConnectionInterface *connection,
GError *error,
gpointer user_data);
typedef void (*NMSettingsConnectionInterfaceGetSecretsFunc) (NMSettingsConnectionInterface *connection,
GHashTable *secrets,
GError *error,
gpointer user_data);
struct _NMSettingsConnectionInterface {
GTypeInterface g_iface;
/* Methods */
gboolean (*update) (NMSettingsConnectionInterface *connection,
NMSettingsConnectionInterfaceUpdateFunc callback,
gpointer user_data);
gboolean (*delete) (NMSettingsConnectionInterface *connection,
NMSettingsConnectionInterfaceDeleteFunc callback,
gpointer user_data);
gboolean (*get_secrets) (NMSettingsConnectionInterface *connection,
const char *setting_name,
const char **hints,
gboolean request_new,
NMSettingsConnectionInterfaceGetSecretsFunc callback,
gpointer user_data);
void (*emit_updated) (NMSettingsConnectionInterface *connection);
/* Signals */
/* 'new_settings' hash should *not* contain secrets */
void (*updated) (NMSettingsConnectionInterface *connection,
GHashTable *new_settings);
void (*removed) (NMSettingsConnectionInterface *connection);
/* Padding for future expansion */
void (*_reserved1) (void);
void (*_reserved2) (void);
void (*_reserved3) (void);
void (*_reserved4) (void);
void (*_reserved5) (void);
void (*_reserved6) (void);
};
GType nm_settings_connection_interface_get_type (void);
gboolean nm_settings_connection_interface_update (NMSettingsConnectionInterface *connection,
NMSettingsConnectionInterfaceUpdateFunc callback,
gpointer user_data);
gboolean nm_settings_connection_interface_delete (NMSettingsConnectionInterface *connection,
NMSettingsConnectionInterfaceDeleteFunc callback,
gpointer user_data);
gboolean nm_settings_connection_interface_get_secrets (NMSettingsConnectionInterface *connection,
const char *setting_name,
const char **hints,
gboolean request_new,
NMSettingsConnectionInterfaceGetSecretsFunc callback,
gpointer user_data);
void nm_settings_connection_interface_emit_updated (NMSettingsConnectionInterface *connection);
G_END_DECLS
#endif /* __NM_SETTINGS_CONNECTION_INTERFACE_H__ */
......@@ -757,13 +757,13 @@ remove_connection (NMManager *manager,
/*******************************************************************/
static void
system_connection_updated_cb (NMSettingsConnectionInterface *connection,
system_connection_updated_cb (NMSysconfigConnection *connection,
gpointer unused,
NMManager *manager)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
const char *path;
NMSettingsConnectionInterface *existing;
NMSysconfigConnection *existing;
GError *error = NULL;
path = nm_connection_get_path (NM_CONNECTION (connection));
......@@ -792,7 +792,7 @@ system_connection_updated_cb (NMSettingsConnectionInterface *connection,
}
static void
system_connection_removed_cb (NMSettingsConnectionInterface *connection,
system_connection_removed_cb (NMSysconfigConnection *connection,
NMManager *manager)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
......@@ -807,16 +807,16 @@ system_connection_removed_cb (NMSettingsConnectionInterface *connection,
static void
system_internal_new_connection (NMManager *manager,
NMSettingsConnectionInterface *connection)
NMSysconfigConnection *connection)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
const char *path;
g_return_if_fail (connection != NULL);
g_signal_connect (connection, NM_SETTINGS_CONNECTION_INTERFACE_UPDATED,