mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-04 02:28:02 +02:00
Implement GKeyFile system settings plugin. Implement writing system settings (currently supported only by GKeyFile plugin). * system-settings/src/main.c: * system-settings/src/dbus-settings.c: Move the communication with plugins from main.c to dbus-settings.c. Makes it possible to talk to all registered plugins for adding/updating/removing connections. * system-settings/src/nm-system-config-interface.c (nm_system_config_interface_add_connection): Implement (nm_system_config_interface_update_connection): Implement. (nm_system_config_interface_remove_connection): Implement. * system-settings/plugins/keyfile/Makefile.am: * system-settings/plugins/keyfile/plugin.[ch]: * system-settings/plugins/keyfile/writer.[ch]: * system-settings/plugins/keyfile/reader.[ch]: Implement. * system-settings/plugins/Makefile.am: Add GKeyFile plugin. * configure.in: Generate GKeyFile Makefile. * libnm-glib/nm-settings.c (impl_exported_connection_get_id): Fix a memory corruption, need to duplicate the returned string. (impl_exported_connection_update): Implement. (impl_exported_connection_delete): Implement. * introspection/nm-settings-system.xml: Add "AddConnection" method. * introspection/nm-exported-connection.xml: Add "Update" and "Delete" methods. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3587 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
92 lines
3.4 KiB
C
92 lines
3.4 KiB
C
|
|
#ifndef __NM_SETTINGS_H__
|
|
#define __NM_SETTINGS_H__
|
|
|
|
#include <glib-object.h>
|
|
#include <dbus/dbus-glib.h>
|
|
|
|
#include <nm-connection.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
#define NM_SETTINGS_ERROR nm_settings_error_quark ()
|
|
GQuark nm_settings_error_quark (void);
|
|
|
|
#define NM_TYPE_EXPORTED_CONNECTION (nm_exported_connection_get_type ())
|
|
#define NM_EXPORTED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_EXPORTED_CONNECTION, NMExportedConnection))
|
|
#define NM_EXPORTED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_EXPORTED_CONNECTION, NMExportedConnectionClass))
|
|
#define NM_IS_EXPORTED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_EXPORTED_CONNECTION))
|
|
#define NM_IS_EXPORTED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_EXPORTED_CONNECTION))
|
|
#define NM_EXPORTED_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_EXPORTED_CONNECTION, NMExportedConnectionClass))
|
|
|
|
#define NM_EXPORTED_CONNECTION_CONNECTION "connection"
|
|
|
|
typedef struct {
|
|
GObject parent;
|
|
} NMExportedConnection;
|
|
|
|
typedef struct {
|
|
GObjectClass parent_class;
|
|
|
|
/* virtual methods */
|
|
const gchar *(* get_id) (NMExportedConnection *connection);
|
|
GHashTable * (* get_settings) (NMExportedConnection *connection);
|
|
void (* get_secrets) (NMExportedConnection *connection,
|
|
const gchar *setting_name,
|
|
const gchar **hints,
|
|
gboolean request_new,
|
|
DBusGMethodInvocation *context);
|
|
|
|
void (*update) (NMExportedConnection *connection,
|
|
GHashTable *new_settings);
|
|
|
|
void (*delete) (NMExportedConnection *connection);
|
|
|
|
/* signals */
|
|
void (* updated) (NMExportedConnection *connection, GHashTable *settings);
|
|
void (* removed) (NMExportedConnection *connection);
|
|
} NMExportedConnectionClass;
|
|
|
|
GType nm_exported_connection_get_type (void);
|
|
|
|
void nm_exported_connection_register_object (NMExportedConnection *connection,
|
|
NMConnectionScope scope,
|
|
DBusGConnection *dbus_connection);
|
|
|
|
NMConnection *nm_exported_connection_get_connection (NMExportedConnection *connection);
|
|
|
|
const char *nm_exported_connection_get_id (NMExportedConnection *connection);
|
|
|
|
void nm_exported_connection_signal_updated (NMExportedConnection *connection, GHashTable *settings);
|
|
void nm_exported_connection_signal_removed (NMExportedConnection *connection);
|
|
|
|
|
|
|
|
#define NM_TYPE_SETTINGS (nm_settings_get_type ())
|
|
#define NM_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTINGS, NMSettings))
|
|
#define NM_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTINGS, NMSettingsClass))
|
|
#define NM_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTINGS))
|
|
#define NM_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTINGS))
|
|
#define NM_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTINGS, NMSettingsClass))
|
|
|
|
typedef struct {
|
|
GObject parent;
|
|
} NMSettings;
|
|
|
|
typedef struct {
|
|
GObjectClass parent_class;
|
|
|
|
/* virtual methods */
|
|
GPtrArray * (* list_connections) (NMSettings *settings);
|
|
|
|
/* signals */
|
|
void (* new_connection) (NMSettings *settings, NMExportedConnection *connection);
|
|
} NMSettingsClass;
|
|
|
|
GType nm_settings_get_type (void);
|
|
|
|
void nm_settings_signal_new_connection (NMSettings *settings, NMExportedConnection *connection);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif
|