Commit 898c29cc authored by Tambet Ingo's avatar Tambet Ingo

2008-05-05 Tambet Ingo <tambet@gmail.com>

	* system-settings/plugins/keyfile/nm-keyfile-connection.[ch]: Implement.

	* system-settings/plugins/keyfile/plugin.c: Work with
	NMKeyfileConnections.

	* system-settings/src/dbus-settings.c: Remove NMSysconfigExportedConnection.
	Plugins are supposed to return NMExportedConnections now and handle the
	updated(), removed(), and GetSecrets().
	Store the internal list of connections in hash table to make it easier
	to find duplicates.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3640 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent 97668fc7
2008-05-05 Tambet Ingo <tambet@gmail.com>
* system-settings/plugins/keyfile/nm-keyfile-connection.[ch]: Implement.
* system-settings/plugins/keyfile/plugin.c: Work with
NMKeyfileConnections.
* system-settings/src/dbus-settings.c: Remove NMSysconfigExportedConnection.
Plugins are supposed to return NMExportedConnections now and handle the
updated(), removed(), and GetSecrets().
Store the internal list of connections in hash table to make it easier
to find duplicates.
2008-05-07 Tambet Ingo <tambet@gmail.com>
* src/backends/NetworkManagerSuSE.c (nm_system_set_hostname): Update
......
......@@ -17,6 +17,7 @@ libnm_settings_plugin_ifcfg_suse_la_CPPFLAGS = \
-I${top_srcdir}/system-settings/src \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-util \
-I${top_srcdir}/libnm-glib \
-DSYSCONFDIR=\"$(sysconfdir)\"
libnm_settings_plugin_ifcfg_suse_la_LDFLAGS = -module -avoid-version
......@@ -24,5 +25,6 @@ libnm_settings_plugin_ifcfg_suse_la_LIBADD = \
$(GLIB_LIBS) \
$(GMODULE_LIBS) \
$(GIO_LIBS) \
$(top_builddir)/libnm-util/libnm-util.la
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/libnm-glib/libnm_glib.la
......@@ -2,6 +2,8 @@
pkglib_LTLIBRARIES = libnm-settings-plugin-keyfile.la
libnm_settings_plugin_keyfile_la_SOURCES = \
nm-keyfile-connection.c \
nm-keyfile-connection.h \
plugin.c \
plugin.h \
reader.c \
......@@ -17,6 +19,7 @@ libnm_settings_plugin_keyfile_la_CPPFLAGS = \
-I${top_srcdir}/system-settings/src \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-util \
-I${top_srcdir}/libnm-glib \
-DKEYFILE_DIR=\""$(sysconfdir)/NetworkManager/system_config"\"
libnm_settings_plugin_keyfile_la_LDFLAGS = -module -avoid-version
......@@ -25,5 +28,6 @@ libnm_settings_plugin_keyfile_la_LIBADD = \
$(GMODULE_LIBS) \
$(DBUS_LIBS) \
$(GIO_LIBS) \
$(top_builddir)/libnm-util/libnm-util.la
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/libnm-glib/libnm_glib.la
/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
#include <string.h>
#include <glib/gstdio.h>
#include <NetworkManager.h>
#include "nm-keyfile-connection.h"
#include "reader.h"
#include "writer.h"
G_DEFINE_TYPE (NMKeyfileConnection, nm_keyfile_connection, NM_TYPE_EXPORTED_CONNECTION)
#define NM_KEYFILE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_KEYFILE_CONNECTION, NMKeyfileConnectionPrivate))
typedef struct {
char *filename;
} NMKeyfileConnectionPrivate;
enum {
PROP_0,
PROP_FILENAME,
LAST_PROP
};
NMKeyfileConnection *
nm_keyfile_connection_new (const char *filename)
{
g_return_val_if_fail (filename != NULL, NULL);
return (NMKeyfileConnection *) g_object_new (NM_TYPE_KEYFILE_CONNECTION,
NM_KEYFILE_CONNECTION_FILENAME, filename,
NULL);
}
const char *
nm_keyfile_connection_get_filename (NMKeyfileConnection *self)
{
g_return_val_if_fail (NM_IS_KEYFILE_CONNECTION (self), NULL);
return NM_KEYFILE_CONNECTION_GET_PRIVATE (self)->filename;
}
static GHashTable *
get_settings (NMExportedConnection *exported)
{
return nm_connection_to_hash (nm_exported_connection_get_connection (exported));
}
static const char *
get_id (NMExportedConnection *exported)
{
return NM_KEYFILE_CONNECTION_GET_PRIVATE (exported)->filename;
}
static void
update (NMExportedConnection *exported, GHashTable *new_settings)
{
write_connection (nm_exported_connection_get_connection (exported));
}
static void
delete (NMExportedConnection *exported)
{
NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (exported);
g_unlink (priv->filename);
}
/* GObject */
static void
nm_keyfile_connection_init (NMKeyfileConnection *connection)
{
}
static GObject *
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
{
GObject *object;
NMKeyfileConnectionPrivate *priv;
NMConnection *wrapped;
object = G_OBJECT_CLASS (nm_keyfile_connection_parent_class)->constructor (type, n_construct_params, construct_params);
if (!object)
return NULL;
priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (object);
if (!priv->filename) {
g_warning ("Keyfile file name not provided.");
goto err;
}
wrapped = connection_from_file (priv->filename);
if (!wrapped)
goto err;
g_object_set (object, NM_EXPORTED_CONNECTION_CONNECTION, wrapped, NULL);
g_object_unref (wrapped);
return object;
err:
g_object_unref (object);
return NULL;
}
static void
finalize (GObject *object)
{
NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (object);
g_free (priv->filename);
G_OBJECT_CLASS (nm_keyfile_connection_parent_class)->finalize (object);
}
static void
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (object);
switch (prop_id) {
case PROP_FILENAME:
/* Construct only */
priv->filename = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (object);
switch (prop_id) {
case PROP_FILENAME:
g_value_set_string (value, priv->filename);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
nm_keyfile_connection_class_init (NMKeyfileConnectionClass *keyfile_connection_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (keyfile_connection_class);
NMExportedConnectionClass *connection_class = NM_EXPORTED_CONNECTION_CLASS (keyfile_connection_class);
g_type_class_add_private (keyfile_connection_class, sizeof (NMKeyfileConnectionPrivate));
/* Virtual methods */
object_class->constructor = constructor;
object_class->set_property = set_property;
object_class->get_property = get_property;
object_class->finalize = finalize;
connection_class->get_settings = get_settings;
connection_class->get_id = get_id;
connection_class->update = update;
connection_class->delete = delete;
/* Properties */
g_object_class_install_property
(object_class, PROP_FILENAME,
g_param_spec_string (NM_KEYFILE_CONNECTION_FILENAME,
"FileName",
"File name",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
}
/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
#ifndef NM_KEYFILE_CONNECTION_H
#define NM_KEYFILE_CONNECTION_H
#include <nm-settings.h>
G_BEGIN_DECLS
#define NM_TYPE_KEYFILE_CONNECTION (nm_keyfile_connection_get_type ())
#define NM_KEYFILE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_KEYFILE_CONNECTION, NMKeyfileConnection))
#define NM_KEYFILE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_KEYFILE_CONNECTION, NMKeyfileConnectionClass))
#define NM_IS_KEYFILE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_KEYFILE_CONNECTION))
#define NM_IS_KEYFILE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_KEYFILE_CONNECTION))
#define NM_KEYFILE_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_KEYFILE_CONNECTION, NMKeyfileConnectionClass))
#define NM_KEYFILE_CONNECTION_FILENAME "filename"
typedef struct {
NMExportedConnection parent;
} NMKeyfileConnection;
typedef struct {
NMExportedConnectionClass parent;
} NMKeyfileConnectionClass;
GType nm_keyfile_connection_get_type (void);
NMKeyfileConnection *nm_keyfile_connection_new (const char *filename);
const char *nm_keyfile_connection_get_filename (NMKeyfileConnection *self);
G_END_DECLS
#endif /* NM_KEYFILE_CONNECTION_H */
......@@ -13,7 +13,7 @@
#include "plugin.h"
#include "nm-system-config-interface.h"
#include "reader.h"
#include "nm-keyfile-connection.h"
#include "writer.h"
#define KEYFILE_PLUGIN_NAME "keyfile"
......@@ -36,19 +36,17 @@ typedef struct {
gboolean disposed;
} SCPluginKeyfilePrivate;
static NMConnection *
static NMKeyfileConnection *
read_one_connection (NMSystemConfigInterface *config, const char *filename)
{
SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (config);
char *full_path;
NMConnection *connection = NULL;
NMKeyfileConnection *connection;
full_path = g_build_filename (KEYFILE_DIR, filename, NULL);
connection = connection_from_file (full_path);
connection = nm_keyfile_connection_new (filename);
if (connection)
g_hash_table_insert (priv->hash, g_strdup (filename), connection);
g_free (full_path);
g_hash_table_insert (priv->hash,
(gpointer) nm_keyfile_connection_get_filename (connection),
g_object_ref (connection));
return connection;
}
......@@ -63,8 +61,13 @@ read_connections (NMSystemConfigInterface *config)
if (dir) {
const char *item;
while ((item = g_dir_read_name (dir)))
read_one_connection (config, item);
while ((item = g_dir_read_name (dir))) {
char *full_path;
full_path = g_build_filename (KEYFILE_DIR, item, NULL);
read_one_connection (config, full_path);
g_free (full_path);
}
g_dir_close (dir);
} else {
......@@ -73,30 +76,6 @@ read_connections (NMSystemConfigInterface *config)
}
}
static void
delete_connection (NMSystemConfigInterface *config, NMConnection *connection)
{
SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (config);
NMSettingConnection *s_con;
char *filename;
s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
if (!s_con)
return;
filename = g_build_filename (KEYFILE_DIR, s_con->id, NULL);
if (g_hash_table_lookup (priv->hash, s_con->id)) {
if (g_file_test (filename, G_FILE_TEST_IS_REGULAR))
/* Monitoring takes care of the rest */
g_unlink (filename);
else
g_warning ("File '%s' does not exist", filename);
}
g_free (filename);
}
/* Monitoring */
static void
......@@ -109,37 +88,29 @@ dir_changed (GFileMonitor *monitor,
NMSystemConfigInterface *config = NM_SYSTEM_CONFIG_INTERFACE (user_data);
SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (config);
char *name;
NMConnection *connection;
NMKeyfileConnection *connection;
name = g_file_get_basename (file);
name = g_file_get_path (file);
connection = g_hash_table_lookup (priv->hash, name);
switch (event_type) {
case G_FILE_MONITOR_EVENT_DELETED:
if (connection) {
g_hash_table_remove (priv->hash, name);
g_signal_emit_by_name (config, "connection-removed", connection);
nm_exported_connection_signal_removed (NM_EXPORTED_CONNECTION (connection));
}
break;
case G_FILE_MONITOR_EVENT_CREATED:
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
if (connection) {
/* Update */
char *full_path;
NMConnection *tmp;
full_path = g_file_get_path (file);
tmp = connection_from_file (full_path);
g_free (full_path);
NMExportedConnection *tmp;
tmp = (NMExportedConnection *) nm_keyfile_connection_new (name);
if (tmp) {
GHashTable *settings;
settings = nm_connection_to_hash (tmp);
if (nm_connection_replace_settings (connection, settings))
g_signal_emit_by_name (config, "connection-updated", connection);
settings = nm_connection_to_hash (nm_exported_connection_get_connection (tmp));
nm_exported_connection_update (NM_EXPORTED_CONNECTION (connection), settings);
g_hash_table_destroy (settings);
g_object_unref (tmp);
}
......@@ -164,7 +135,7 @@ setup_monitoring (NMSystemConfigInterface *config)
GFile *file;
GFileMonitor *monitor;
priv->hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
priv->hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref);
file = g_file_new_for_path (KEYFILE_DIR);
monitor = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, NULL, NULL);
......@@ -208,18 +179,6 @@ add_connection (NMSystemConfigInterface *config, NMConnection *connection)
write_connection (connection);
}
static void
update_connection (NMSystemConfigInterface *config, NMConnection *connection)
{
write_connection (connection);
}
static void
remove_connection (NMSystemConfigInterface *config, NMConnection *connection)
{
delete_connection (config, connection);
}
/* GObject */
static void
......@@ -292,8 +251,6 @@ system_config_interface_init (NMSystemConfigInterface *system_config_interface_c
/* interface implementation */
system_config_interface_class->get_connections = get_connections;
system_config_interface_class->add_connection = add_connection;
system_config_interface_class->update_connection = update_connection;
system_config_interface_class->remove_connection = remove_connection;
}
G_MODULE_EXPORT GObject *
......
This diff is collapsed.
......@@ -28,37 +28,6 @@
#include "nm-system-config-interface.h"
#include "nm-system-config-hal-manager.h"
typedef struct _NMSysconfigExportedConnection NMSysconfigExportedConnection;
typedef struct _NMSysconfigExportedConnectionClass NMSysconfigExportedConnectionClass;
/*
* NMSysconfigExportedConnection
*/
#define NM_TYPE_SYSCONFIG_EXPORTED_CONNECTION (nm_sysconfig_exported_connection_get_type ())
#define NM_SYSCONFIG_EXPORTED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SYSCONFIG_EXPORTED_CONNECTION, NMSysconfigExportedConnection))
#define NM_SYSCONFIG_EXPORTED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SYSCONFIG_EXPORTED_CONNECTION, NMSysconfigExportedConnectionClass))
#define NM_IS_SYSCONFIG_EXPORTED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SYSCONFIG_EXPORTED_CONNECTION))
#define NM_IS_SYSCONFIG_EXPORTED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SYSCONFIG_EXPORTED_CONNECTION))
#define NM_SYSCONFIG_EXPORTED_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SYSCONFIG_EXPORTED_CONNECTION, NMSysconfigExportedConnectionClass))
struct _NMSysconfigExportedConnection
{
NMExportedConnection parent_instance;
};
struct _NMSysconfigExportedConnectionClass
{
NMExportedConnectionClass parent_class;
};
GType nm_sysconfig_exported_connection_get_type (void);
NMSysconfigExportedConnection *nm_sysconfig_exported_connection_new (NMConnection *connection,
DBusGConnection *g_conn);
/*
* NMSysconfigSettings
*/
typedef struct _NMSysconfigSettings NMSysconfigSettings;
typedef struct _NMSysconfigSettingsClass NMSysconfigSettingsClass;
......@@ -93,16 +62,10 @@ void nm_sysconfig_settings_add_plugin (NMSysconfigSettings *settings,
NMSystemConfigInterface *plugin);
void nm_sysconfig_settings_add_connection (NMSysconfigSettings *settings,
NMSystemConfigInterface *plugin,
NMConnection *connection);
NMExportedConnection *connection);
void nm_sysconfig_settings_remove_connection (NMSysconfigSettings *settings,
NMConnection *connection);
void nm_sysconfig_settings_update_connection (NMSysconfigSettings *settings,
NMConnection *connection);
GSList *nm_sysconfig_settings_get_connections (NMSysconfigSettings *settings);
NMExportedConnection *connection);
void nm_sysconfig_settings_update_unamanged_devices (NMSysconfigSettings *settings,
GSList *new_list);
......
......@@ -190,7 +190,7 @@ load_stuff (gpointer user_data)
typedef struct {
Application *app;
NMConnection *connection;
NMExportedConnection *connection;
guint add_id;
char *udi;
GByteArray *mac;
......@@ -281,7 +281,7 @@ have_connection_for_device (Application *app, GByteArray *mac)
/* If the device doesn't have a connection advertised by any of the
* plugins, create a new default DHCP-enabled connection for it.
*/
list = nm_sysconfig_settings_get_connections (app->settings);
list = nm_settings_list_connections (NM_SETTINGS (app->settings));
for (iter = list; iter; iter = g_slist_next (iter)) {
NMExportedConnection *exported = NM_EXPORTED_CONNECTION (iter->data);
NMConnection *connection;
......@@ -319,6 +319,7 @@ add_default_dhcp_connection (gpointer user_data)
WiredDeviceInfo *info = (WiredDeviceInfo *) user_data;
NMSettingConnection *s_con;
NMSettingWired *s_wired;
NMConnection *wrapped;
if (info->add_id)
info->add_id = 0;
......@@ -340,13 +341,15 @@ add_default_dhcp_connection (gpointer user_data)
if (have_connection_for_device (info->app, info->mac))
goto ignore;
info->connection = nm_connection_new ();
wrapped = nm_connection_new ();
info->connection = nm_exported_connection_new (wrapped);
g_object_unref (wrapped);
s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ());
s_con->id = g_strdup_printf (_("Auto %s"), info->iface);
s_con->type = g_strdup (NM_SETTING_WIRED_SETTING_NAME);
s_con->autoconnect = TRUE;
nm_connection_add_setting (info->connection, NM_SETTING (s_con));
nm_connection_add_setting (wrapped, NM_SETTING (s_con));
g_message ("Adding default connection '%s' for %s", s_con->id, info->udi);
......@@ -354,9 +357,9 @@ add_default_dhcp_connection (gpointer user_data)
s_wired = NM_SETTING_WIRED (nm_setting_wired_new ());
s_wired->mac_address = g_byte_array_sized_new (ETH_ALEN);
g_byte_array_append (s_wired->mac_address, info->mac->data, ETH_ALEN);
nm_connection_add_setting (info->connection, NM_SETTING (s_wired));
nm_connection_add_setting (wrapped, NM_SETTING (s_wired));
nm_sysconfig_settings_add_connection (info->app->settings, NULL, info->connection);
nm_sysconfig_settings_add_connection (info->app->settings, info->connection);
return FALSE;
......
......@@ -56,25 +56,7 @@ interface_init (gpointer g_iface)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
g_signal_new ("connection-removed",
iface_type,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMSystemConfigInterface, connection_removed),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
g_signal_new ("connection-updated",
iface_type,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMSystemConfigInterface, connection_updated),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
NM_TYPE_EXPORTED_CONNECTION);
g_signal_new ("unmanaged-devices-changed",
iface_type,
......@@ -137,20 +119,6 @@ nm_system_config_interface_get_connections (NMSystemConfigInterface *config)
return NULL;
}
GHashTable *
nm_system_config_interface_get_secrets (NMSystemConfigInterface *config,
NMConnection *connection,
NMSetting *setting)
{
g_return_val_if_fail (config != NULL, NULL);
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (setting != NULL, NULL);
if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_secrets)
return NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_secrets (config, connection, setting);
return NULL;
}
GSList *
nm_system_config_interface_get_unmanaged_devices (NMSystemConfigInterface *config)
{
......@@ -171,25 +139,3 @@ nm_system_config_interface_add_connection (NMSystemConfigInterface *config,
if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->add_connection)
NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->add_connection (config, connection);
}
void
nm_system_config_interface_update_connection (NMSystemConfigInterface *config,
NMConnection *connection)
{
g_return_if_fail (config != NULL);
g_return_if_fail (NM_IS_CONNECTION (connection));
if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->update_connection)
NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->update_connection (config, connection);
}
void
nm_system_config_interface_remove_connection (NMSystemConfigInterface *config,
NMConnection *connection)
{
g_return_if_fail (config != NULL);
g_return_if_fail (NM_IS_CONNECTION (connection));
if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->remove_connection)
NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->remove_connection (config, connection);
}
......@@ -25,6 +25,7 @@
#include <glib.h>
#include <glib-object.h>
#include <nm-connection.h>
#include <nm-settings.h>
#include "nm-system-config-hal-manager.h"
......@@ -81,17 +82,6 @@ struct _NMSystemConfigInterface {
*/
GSList * (*get_connections) (NMSystemConfigInterface *config);
/* Return the secrets associated with settings of a specific
* connection. The returned hash table is unreffed by the system settings
* service. Returned hash table should itself contain string::hashtable
* mappings, each value being a hash table of secrets for a single setting.
*
* string :: (string :: GValue)
*
* The returned hash table will be freed by the system settings service.
*/
GHashTable * (*get_secrets) (NMSystemConfigInterface *config, NMConnection *connection, NMSetting *setting);
/*
* Return a list of HAL UDIs of devices which NetworkManager should not
* manage. Returned list will be freed by the system settings service, and
......@@ -104,27 +94,10 @@ struct _NMSystemConfigInterface {
*/
void (*add_connection) (NMSystemConfigInterface *config, NMConnection *connection);
/*
* Update the connection.
*/
void (*update_connection) (NMSystemConfigInterface *config, NMConnection *connection);
/*
* Remove the connection.
*/
void (*remove_connection) (NMSystemConfigInterface *config, NMConnection *connection);
/* Signals */
/* Emitted when a new connection has been found by the plugin */
void (*connection_added) (NMSystemConfigInterface *config, NMConnection *connection);
/* Emitted when a connection has been removed by the plugin */
void (*connection_removed) (NMSystemConfigInterface *config, NMConnection *connection);
/* Emitted when any non-secret settings of the connection change */
void (*connection_updated) (NMSystemConfigInterface *config, NMConnection *connection);
void (*connection_added) (NMSystemConfigInterface *config, NMExportedConnection *connection);
/* Emitted when the list of unmanaged devices changes */
void (*unmanaged_devices_changed) (NMSystemConfigInterface *config);
......@@ -137,21 +110,11 @@ void nm_system_config_interface_init (NMSystemConfigInterface *config,
GSList * nm_system_config_interface_get_connections (NMSystemConfigInterface *config);
GHashTable *nm_system_config_interface_get_secrets (NMSystemConfigInterface *config,
NMConnection *connection,
NMSetting *setting);
GSList *nm_system_config_interface_get_unmanaged_devices (NMSystemConfigInterface *config);
void nm_system_config_interface_add_connection (NMSystemConfigInterface *config,
NMConnection *connection);
void nm_system_config_interface_update_connection (NMSystemConfigInterface *config,
NMConnection *connection);
void nm_system_config_interface_remove_connection (NMSystemConfigInterface *config,
NMConnection *connection);
G_END_DECLS
#endif /* NM_SYSTEM_CONFIG_INTERFACE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment