Commit dfb77e3b authored by Dan Winship's avatar Dan Winship

settings: trivial: rename NMSystemConfigInterface to NMSettingsPlugin

Since there have not been separate system and user settings services
since 0.8, the "system" in NMSystemConfigInterface is kind of
meaningless. Rename it to NMSettingsPlugin, which describes what it
does better.

This is just:

    git mv src/settings/nm-system-config-interface.h src/settings/nm-settings-plugin.h
    git mv src/settings/nm-system-config-interface.c src/settings/nm-settings-plugin.c
    perl -pi -e 's/SystemConfigInterface/SettingsPlugin/g;' \
             -e 's/system_config_interface/settings_plugin/g;' \
             -e 's/system-config-interface/settings-plugin/g;' \
             -e 's/SYSTEM_CONFIG_INTERFACE/SETTINGS_PLUGIN/g;' \
             -e 's/sc_plugin/settings_plugin/g;' \
             -e 's/SC_PLUGIN/SETTINGS_PLUGIN/g;' \
             -e 's/SC_IS_PLUGIN/SETTINGS_IS_PLUGIN/g;' \
             -e 's/SC_TYPE_PLUGIN/SETTINGS_TYPE_PLUGIN/g;' \
             -e 's/SCPlugin/SettingsPlugin/g;' \
             -e 's/nm_system_config_factory/nm_settings_plugin_factory/g;' \
         $(find src/settings -type f)

(followed by some whitespace fixups in nm-settings-plugin.c, and a
Makefile.am fix for the rename)
parent 04c41283
......@@ -266,10 +266,10 @@ libNetworkManager_la_SOURCES = \
settings/nm-secret-agent.h \
settings/nm-settings-connection.c \
settings/nm-settings-connection.h \
settings/nm-settings-plugin.c \
settings/nm-settings-plugin.h \
settings/nm-settings.c \
settings/nm-settings.h \
settings/nm-system-config-interface.c \
settings/nm-system-config-interface.h \
\
settings/plugins/keyfile/common.h \
settings/plugins/keyfile/nm-keyfile-connection.c \
......
......@@ -21,7 +21,7 @@
#include "config.h"
#include "nm-system-config-interface.h"
#include "nm-settings-plugin.h"
#include "nm-settings-connection.h"
static void
......@@ -36,49 +36,49 @@ interface_init (gpointer g_iface)
/* Properties */
g_object_interface_install_property
(g_iface,
g_param_spec_string (NM_SYSTEM_CONFIG_INTERFACE_NAME, "", "",
g_param_spec_string (NM_SETTINGS_PLUGIN_NAME, "", "",
NULL,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_object_interface_install_property
(g_iface,
g_param_spec_string (NM_SYSTEM_CONFIG_INTERFACE_INFO, "", "",
g_param_spec_string (NM_SETTINGS_PLUGIN_INFO, "", "",
NULL,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_object_interface_install_property
(g_iface,
g_param_spec_uint (NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES, "", "",
NM_SYSTEM_CONFIG_INTERFACE_CAP_NONE,
NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_CONNECTIONS,
NM_SYSTEM_CONFIG_INTERFACE_CAP_NONE,
g_param_spec_uint (NM_SETTINGS_PLUGIN_CAPABILITIES, "", "",
NM_SETTINGS_PLUGIN_CAP_NONE,
NM_SETTINGS_PLUGIN_CAP_MODIFY_CONNECTIONS,
NM_SETTINGS_PLUGIN_CAP_NONE,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
/* Signals */
g_signal_new (NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED,
iface_type,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMSystemConfigInterface, connection_added),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
NM_TYPE_SETTINGS_CONNECTION);
g_signal_new (NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED,
iface_type,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMSystemConfigInterface, unmanaged_specs_changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
g_signal_new (NM_SYSTEM_CONFIG_INTERFACE_UNRECOGNIZED_SPECS_CHANGED,
g_signal_new (NM_SETTINGS_PLUGIN_CONNECTION_ADDED,
iface_type,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMSystemConfigInterface, unrecognized_specs_changed),
G_STRUCT_OFFSET (NMSettingsPlugin, connection_added),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
NM_TYPE_SETTINGS_CONNECTION);
g_signal_new (NM_SETTINGS_PLUGIN_UNMANAGED_SPECS_CHANGED,
iface_type,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMSettingsPlugin, unmanaged_specs_changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
g_signal_new (NM_SETTINGS_PLUGIN_UNRECOGNIZED_SPECS_CHANGED,
iface_type,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMSettingsPlugin, unrecognized_specs_changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
......@@ -88,13 +88,13 @@ interface_init (gpointer g_iface)
GType
nm_system_config_interface_get_type (void)
nm_settings_plugin_get_type (void)
{
static GType system_config_interface_type = 0;
static GType settings_plugin_type = 0;
if (!system_config_interface_type) {
const GTypeInfo system_config_interface_info = {
sizeof (NMSystemConfigInterface), /* class_size */
if (!settings_plugin_type) {
const GTypeInfo settings_plugin_info = {
sizeof (NMSettingsPlugin), /* class_size */
interface_init, /* base_init */
NULL, /* base_finalize */
NULL,
......@@ -105,80 +105,80 @@ nm_system_config_interface_get_type (void)
NULL
};
system_config_interface_type = g_type_register_static (G_TYPE_INTERFACE,
"NMSystemConfigInterface",
&system_config_interface_info,
0);
settings_plugin_type = g_type_register_static (G_TYPE_INTERFACE,
"NMSettingsPlugin",
&settings_plugin_info,
0);
g_type_interface_add_prerequisite (system_config_interface_type, G_TYPE_OBJECT);
g_type_interface_add_prerequisite (settings_plugin_type, G_TYPE_OBJECT);
}
return system_config_interface_type;
return settings_plugin_type;
}
void
nm_system_config_interface_init (NMSystemConfigInterface *config,
gpointer unused)
nm_settings_plugin_init (NMSettingsPlugin *config,
gpointer unused)
{
g_return_if_fail (config != NULL);
if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->init)
NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->init (config);
if (NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->init)
NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->init (config);
}
GSList *
nm_system_config_interface_get_connections (NMSystemConfigInterface *config)
nm_settings_plugin_get_connections (NMSettingsPlugin *config)
{
g_return_val_if_fail (config != NULL, NULL);
if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_connections)
return NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_connections (config);
if (NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->get_connections)
return NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->get_connections (config);
return NULL;
}
gboolean
nm_system_config_interface_load_connection (NMSystemConfigInterface *config,
const char *filename)
nm_settings_plugin_load_connection (NMSettingsPlugin *config,
const char *filename)
{
g_return_val_if_fail (config != NULL, FALSE);
if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->load_connection)
return NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->load_connection (config, filename);
if (NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->load_connection)
return NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->load_connection (config, filename);
return FALSE;
}
void
nm_system_config_interface_reload_connections (NMSystemConfigInterface *config)
nm_settings_plugin_reload_connections (NMSettingsPlugin *config)
{
g_return_if_fail (config != NULL);
if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->reload_connections)
NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->reload_connections (config);
if (NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->reload_connections)
NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->reload_connections (config);
}
GSList *
nm_system_config_interface_get_unmanaged_specs (NMSystemConfigInterface *config)
nm_settings_plugin_get_unmanaged_specs (NMSettingsPlugin *config)
{
g_return_val_if_fail (config != NULL, NULL);
if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_unmanaged_specs)
return NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_unmanaged_specs (config);
if (NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->get_unmanaged_specs)
return NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->get_unmanaged_specs (config);
return NULL;
}
GSList *
nm_system_config_interface_get_unrecognized_specs (NMSystemConfigInterface *config)
nm_settings_plugin_get_unrecognized_specs (NMSettingsPlugin *config)
{
g_return_val_if_fail (config != NULL, NULL);
if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_unrecognized_specs)
return NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_unrecognized_specs (config);
if (NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->get_unrecognized_specs)
return NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->get_unrecognized_specs (config);
return NULL;
}
/**
* nm_system_config_interface_add_connection:
* @config: the #NMSystemConfigInterface
* nm_settings_plugin_add_connection:
* @config: the #NMSettingsPlugin
* @connection: the source connection to create a plugin-specific
* #NMSettingsConnection from
* @save_to_disk: %TRUE to save the connection to disk immediately, %FALSE to
......@@ -193,16 +193,16 @@ nm_system_config_interface_get_unrecognized_specs (NMSystemConfigInterface *conf
* Returns: the new #NMSettingsConnection or %NULL
*/
NMSettingsConnection *
nm_system_config_interface_add_connection (NMSystemConfigInterface *config,
NMConnection *connection,
gboolean save_to_disk,
GError **error)
nm_settings_plugin_add_connection (NMSettingsPlugin *config,
NMConnection *connection,
gboolean save_to_disk,
GError **error)
{
g_return_val_if_fail (config != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->add_connection)
return NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->add_connection (config, connection, save_to_disk, error);
if (NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->add_connection)
return NM_SETTINGS_PLUGIN_GET_INTERFACE (config)->add_connection (config, connection, save_to_disk, error);
return NULL;
}
......@@ -19,8 +19,8 @@
* Copyright (C) 2008 Novell, Inc.
*/
#ifndef __NETWORKMANAGER_SYSTEM_CONFIG_INTERFACE_H__
#define __NETWORKMANAGER_SYSTEM_CONFIG_INTERFACE_H__
#ifndef __NETWORKMANAGER_SETTINGS_PLUGIN_H__
#define __NETWORKMANAGER_SETTINGS_PLUGIN_H__
#include <nm-connection.h>
......@@ -29,66 +29,66 @@
G_BEGIN_DECLS
/* Plugin's factory function that returns a GObject that implements
* NMSystemConfigInterface.
* NMSettingsPlugin.
*/
GObject * nm_system_config_factory (void);
GObject * nm_settings_plugin_factory (void);
#define NM_TYPE_SYSTEM_CONFIG_INTERFACE (nm_system_config_interface_get_type ())
#define NM_SYSTEM_CONFIG_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SYSTEM_CONFIG_INTERFACE, NMSystemConfigInterface))
#define NM_IS_SYSTEM_CONFIG_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SYSTEM_CONFIG_INTERFACE))
#define NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_SYSTEM_CONFIG_INTERFACE, NMSystemConfigInterface))
#define NM_TYPE_SETTINGS_PLUGIN (nm_settings_plugin_get_type ())
#define NM_SETTINGS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTINGS_PLUGIN, NMSettingsPlugin))
#define NM_IS_SETTINGS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTINGS_PLUGIN))
#define NM_SETTINGS_PLUGIN_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_SETTINGS_PLUGIN, NMSettingsPlugin))
#define NM_SYSTEM_CONFIG_INTERFACE_NAME "name"
#define NM_SYSTEM_CONFIG_INTERFACE_INFO "info"
#define NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES "capabilities"
#define NM_SETTINGS_PLUGIN_NAME "name"
#define NM_SETTINGS_PLUGIN_INFO "info"
#define NM_SETTINGS_PLUGIN_CAPABILITIES "capabilities"
#define NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED "unmanaged-specs-changed"
#define NM_SYSTEM_CONFIG_INTERFACE_UNRECOGNIZED_SPECS_CHANGED "unrecognized-specs-changed"
#define NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED "connection-added"
#define NM_SETTINGS_PLUGIN_UNMANAGED_SPECS_CHANGED "unmanaged-specs-changed"
#define NM_SETTINGS_PLUGIN_UNRECOGNIZED_SPECS_CHANGED "unrecognized-specs-changed"
#define NM_SETTINGS_PLUGIN_CONNECTION_ADDED "connection-added"
typedef enum {
NM_SYSTEM_CONFIG_INTERFACE_CAP_NONE = 0x00000000,
NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_CONNECTIONS = 0x00000001,
NM_SETTINGS_PLUGIN_CAP_NONE = 0x00000000,
NM_SETTINGS_PLUGIN_CAP_MODIFY_CONNECTIONS = 0x00000001,
/* When adding more capabilities, be sure to update the "Capabilities"
* property max value in nm-system-config-interface.c.
* property max value in nm-settings-plugin.c.
*/
} NMSystemConfigInterfaceCapabilities;
} NMSettingsPluginCapabilities;
typedef enum {
NM_SYSTEM_CONFIG_INTERFACE_PROP_FIRST = 0x1000,
NM_SETTINGS_PLUGIN_PROP_FIRST = 0x1000,
NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME = NM_SYSTEM_CONFIG_INTERFACE_PROP_FIRST,
NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO,
NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES,
} NMSystemConfigInterfaceProp;
NM_SETTINGS_PLUGIN_PROP_NAME = NM_SETTINGS_PLUGIN_PROP_FIRST,
NM_SETTINGS_PLUGIN_PROP_INFO,
NM_SETTINGS_PLUGIN_PROP_CAPABILITIES,
} NMSettingsPluginProp;
typedef struct _NMSystemConfigInterface NMSystemConfigInterface;
typedef struct _NMSettingsPlugin NMSettingsPlugin;
struct _NMSystemConfigInterface {
struct _NMSettingsPlugin {
GTypeInterface g_iface;
/* Called when the plugin is loaded to initialize it */
void (*init) (NMSystemConfigInterface *config);
void (*init) (NMSettingsPlugin *config);
/* Returns a GSList of NMSettingsConnection objects that represent
* connections the plugin knows about. The returned list is freed by the
* system settings service.
*/
GSList * (*get_connections) (NMSystemConfigInterface *config);
GSList * (*get_connections) (NMSettingsPlugin *config);
/* Requests that the plugin load/reload a single connection, if it
* recognizes the filename. Returns success or failure.
*/
gboolean (*load_connection) (NMSystemConfigInterface *config,
gboolean (*load_connection) (NMSettingsPlugin *config,
const char *filename);
/* Requests that the plugin reload all connection files from disk,
* and emit signals reflecting new, changed, and removed connections.
*/
void (*reload_connections) (NMSystemConfigInterface *config);
void (*reload_connections) (NMSettingsPlugin *config);
/*
* Return a string list of specifications of devices which NetworkManager
......@@ -99,7 +99,7 @@ struct _NMSystemConfigInterface {
* Each string in the list must be in one of the formats recognized by
* nm_device_spec_match_list().
*/
GSList * (*get_unmanaged_specs) (NMSystemConfigInterface *config);
GSList * (*get_unmanaged_specs) (NMSettingsPlugin *config);
/*
* Return a string list of specifications of devices for which at least
......@@ -111,7 +111,7 @@ struct _NMSystemConfigInterface {
* Each string in the list must be in one of the formats recognized by
* nm_device_spec_match_list().
*/
GSList * (*get_unrecognized_specs) (NMSystemConfigInterface *config);
GSList * (*get_unrecognized_specs) (NMSettingsPlugin *config);
/*
* Initialize the plugin-specific connection and return a new
......@@ -120,7 +120,7 @@ struct _NMSystemConfigInterface {
* storage if @save_to_disk is TRUE. The returned object is owned by the
* plugin and must be referenced by the owner if necessary.
*/
NMSettingsConnection * (*add_connection) (NMSystemConfigInterface *config,
NMSettingsConnection * (*add_connection) (NMSettingsPlugin *config,
NMConnection *connection,
gboolean save_to_disk,
GError **error);
......@@ -128,35 +128,35 @@ struct _NMSystemConfigInterface {
/* Signals */
/* Emitted when a new connection has been found by the plugin */
void (*connection_added) (NMSystemConfigInterface *config,
void (*connection_added) (NMSettingsPlugin *config,
NMSettingsConnection *connection);
/* Emitted when the list of unmanaged device specifications changes */
void (*unmanaged_specs_changed) (NMSystemConfigInterface *config);
void (*unmanaged_specs_changed) (NMSettingsPlugin *config);
/* Emitted when the list of devices with unrecognized connections changes */
void (*unrecognized_specs_changed) (NMSystemConfigInterface *config);
void (*unrecognized_specs_changed) (NMSettingsPlugin *config);
};
GType nm_system_config_interface_get_type (void);
GType nm_settings_plugin_get_type (void);
void nm_system_config_interface_init (NMSystemConfigInterface *config,
gpointer unused);
void nm_settings_plugin_init (NMSettingsPlugin *config,
gpointer unused);
GSList *nm_system_config_interface_get_connections (NMSystemConfigInterface *config);
GSList *nm_settings_plugin_get_connections (NMSettingsPlugin *config);
gboolean nm_system_config_interface_load_connection (NMSystemConfigInterface *config,
const char *filename);
void nm_system_config_interface_reload_connections (NMSystemConfigInterface *config);
gboolean nm_settings_plugin_load_connection (NMSettingsPlugin *config,
const char *filename);
void nm_settings_plugin_reload_connections (NMSettingsPlugin *config);
GSList *nm_system_config_interface_get_unmanaged_specs (NMSystemConfigInterface *config);
GSList *nm_system_config_interface_get_unrecognized_specs (NMSystemConfigInterface *config);
GSList *nm_settings_plugin_get_unmanaged_specs (NMSettingsPlugin *config);
GSList *nm_settings_plugin_get_unrecognized_specs (NMSettingsPlugin *config);
NMSettingsConnection *nm_system_config_interface_add_connection (NMSystemConfigInterface *config,
NMConnection *connection,
gboolean save_to_disk,
GError **error);
NMSettingsConnection *nm_settings_plugin_add_connection (NMSettingsPlugin *config,
NMConnection *connection,
gboolean save_to_disk,
GError **error);
G_END_DECLS
#endif /* NM_SYSTEM_CONFIG_INTERFACE_H */
#endif /* NM_SETTINGS_PLUGIN_H */
This diff is collapsed.
......@@ -4,7 +4,7 @@ Plugins generally have three components:
just objects wrapped around on-disk config data. The plugin handles requests
to add new connections via the NM D-Bus API, and also watches config
directories for changes to configuration data. Plugins implement the
NMSystemConfigInterface interface. See plugin.c.
NMSettingsPlugin interface. See plugin.c.
2) "connections": subclasses of NMSettingsConnection. They handle updates to
configuration data, deletion, etc. See NMKeyfileConnection.
......@@ -16,16 +16,16 @@ Plugins generally have three components:
out appropriate configuration data to disk.
NM will first call the "factory" function that every module must provide, which
is nm_system_config_factory(). That function creates and returns a singleton
instance of the plugin's main object, which implements NMSystemConfigInterface.
is nm_settings_plugin_factory(). That function creates and returns a singleton
instance of the plugin's main object, which implements NMSettingsPlugin.
That interface is implemented via the object definition in G_DEFINE_TYPE_EXTENDED
in plugin.c, which registers the interface setup function
system_config_interface_init(), which when called actually sets up the vtables
for the functions defined by NMSystemConfigInterface. Thus there are two
entry points into the plugin: nm_system_config_factory() and
the NMSystemConfigInterface methods.
settings_plugin_init(), which when called actually sets up the vtables
for the functions defined by NMSettingsPlugin. Thus there are two
entry points into the plugin: nm_settings_plugin_factory() and
the NMSettingsPlugin methods.
The plugin also emits various signals (defined by NMSystemConfigInterface)
The plugin also emits various signals (defined by NMSettingsPlugin)
which NetworkManager listens for. These include notifications of new
connections if they were created via changes to the on-disk files. The
"connection" objects can also emit signals (defined by the NMSettingsConnection
......
......@@ -29,34 +29,34 @@
#include <nm-setting-connection.h>
#include "nm-default.h"
#include "nm-system-config-interface.h"
#include "nm-settings-plugin.h"
#include "NetworkManagerUtils.h"
#include "plugin.h"
#include "reader.h"
#include "nm-ibft-connection.h"
static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class);
static void settings_plugin_init (NMSettingsPlugin *settings_plugin_class);
G_DEFINE_TYPE_EXTENDED (SCPluginIbft, sc_plugin_ibft, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (NM_TYPE_SYSTEM_CONFIG_INTERFACE,
system_config_interface_init))
G_DEFINE_TYPE_EXTENDED (SettingsPluginIbft, settings_plugin_ibft, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (NM_TYPE_SETTINGS_PLUGIN,
settings_plugin_init))
#define SC_PLUGIN_IBFT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SC_TYPE_PLUGIN_IBFT, SCPluginIbftPrivate))
#define SETTINGS_PLUGIN_IBFT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SETTINGS_TYPE_PLUGIN_IBFT, SettingsPluginIbftPrivate))
typedef struct {
GHashTable *connections; /* uuid::connection */
gboolean initialized;
} SCPluginIbftPrivate;
} SettingsPluginIbftPrivate;
static SCPluginIbft *sc_plugin_ibft_get (void);
NM_DEFINE_SINGLETON_GETTER (SCPluginIbft, sc_plugin_ibft_get, SC_TYPE_PLUGIN_IBFT);
static SettingsPluginIbft *settings_plugin_ibft_get (void);
NM_DEFINE_SINGLETON_GETTER (SettingsPluginIbft, settings_plugin_ibft_get, SETTINGS_TYPE_PLUGIN_IBFT);
static void
read_connections (SCPluginIbft *self)
read_connections (SettingsPluginIbft *self)
{
SCPluginIbftPrivate *priv = SC_PLUGIN_IBFT_GET_PRIVATE (self);
SettingsPluginIbftPrivate *priv = SETTINGS_PLUGIN_IBFT_GET_PRIVATE (self);
GSList *blocks = NULL, *iter;
GError *error = NULL;
NMIbftConnection *connection;
......@@ -85,10 +85,10 @@ read_connections (SCPluginIbft *self)
}
static GSList *
get_connections (NMSystemConfigInterface *config)
get_connections (NMSettingsPlugin *config)
{
SCPluginIbft *self = SC_PLUGIN_IBFT (config);
SCPluginIbftPrivate *priv = SC_PLUGIN_IBFT_GET_PRIVATE (self);
SettingsPluginIbft *self = SETTINGS_PLUGIN_IBFT (config);
SettingsPluginIbftPrivate *priv = SETTINGS_PLUGIN_IBFT_GET_PRIVATE (self);
GSList *list = NULL;
GHashTableIter iter;
NMIbftConnection *connection;
......@@ -106,14 +106,14 @@ get_connections (NMSystemConfigInterface *config)
}
static void
init (NMSystemConfigInterface *config)
init (NMSettingsPlugin *config)
{
}
static void
sc_plugin_ibft_init (SCPluginIbft *self)
settings_plugin_ibft_init (SettingsPluginIbft *self)
{
SCPluginIbftPrivate *priv = SC_PLUGIN_IBFT_GET_PRIVATE (self);
SettingsPluginIbftPrivate *priv = SETTINGS_PLUGIN_IBFT_GET_PRIVATE (self);
priv->connections = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
}
......@@ -121,15 +121,15 @@ sc_plugin_ibft_init (SCPluginIbft *self)
static void
dispose (GObject *object)
{
SCPluginIbft *self = SC_PLUGIN_IBFT (object);
SCPluginIbftPrivate *priv = SC_PLUGIN_IBFT_GET_PRIVATE (self);
SettingsPluginIbft *self = SETTINGS_PLUGIN_IBFT (object);
SettingsPluginIbftPrivate *priv = SETTINGS_PLUGIN_IBFT_GET_PRIVATE (self);
if (priv->connections) {
g_hash_table_destroy (priv->connections);
priv->connections = NULL;
}
G_OBJECT_CLASS (sc_plugin_ibft_parent_class)->dispose (object);
G_OBJECT_CLASS (settings_plugin_ibft_parent_class)->dispose (object);
}
static void
......@@ -137,14 +137,14 @@ get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
switch (prop_id) {
case NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME:
case NM_SETTINGS_PLUGIN_PROP_NAME:
g_value_set_string (value, "iBFT");
break;
case NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO:
case NM_SETTINGS_PLUGIN_PROP_INFO:
g_value_set_string (value, "(c) 2014 Red Hat, Inc. To report bugs please use the NetworkManager mailing list.");
break;
case NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES:
g_value_set_uint (value, NM_SYSTEM_CONFIG_INTERFACE_CAP_NONE);
case NM_SETTINGS_PLUGIN_PROP_CAPABILITIES:
g_value_set_uint (value, NM_SETTINGS_PLUGIN_CAP_NONE);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -160,39 +160,39 @@ set_property (GObject *object, guint prop_id,
}
static void
sc_plugin_ibft_class_init (SCPluginIbftClass *req_class)
settings_plugin_ibft_class_init (SettingsPluginIbftClass *req_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (req_class);
g_type_class_add_private (req_class, sizeof (SCPluginIbftPrivate));
g_type_class_add_private (req_class, sizeof (SettingsPluginIbftPrivate));
object_class->dispose = dispose;
object_class->get_property = get_property;
object_class->set_property = set_property;
g_object_class_override_property (object_class,
NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME,
NM_SYSTEM_CONFIG_INTERFACE_NAME);
NM_SETTINGS_PLUGIN_PROP_NAME,
NM_SETTINGS_PLUGIN_NAME);
g_object_class_override_property (object_class,
NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO,
NM_SYSTEM_CONFIG_INTERFACE_INFO);
NM_SETTINGS_PLUGIN_PROP_INFO,
NM_SETTINGS_PLUGIN_INFO);
g_object_class_override_property (object_class,
NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES,
NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES);
NM_SETTINGS_PLUGIN_PROP_CAPABILITIES,
NM_SETTINGS_PLUGIN_CAPABILITIES);
}
static void
system_config_interface_init (NMSystemConfigInterface *system_config_interface_class)
settings_plugin_init (NMSettingsPlugin *settings_plugin_class)
{
/* interface implementation */
system_config_interface_class->get_connections = get_connections;
system_config_interface_class->init = init;
settings_plugin_class->get_connections = get_connections;
settings_plugin_class->init = init;
}
G_MODULE_EXPORT GObject *
nm_system_config_factory (void)
nm_settings_plugin_factory (void)
{
return g_object_ref (sc_plugin_ibft_get ());
return g_object_ref (settings_plugin_ibft_get ());
}
......@@ -23,25 +23,25 @@
#include "nm-default.h"
#define SC_TYPE_PLUGIN_IBFT (sc_plugin_ibft_get_type ())
#define SC_PLUGIN_IBFT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SC_TYPE_PLUGIN_IBFT, SCPluginIbft))
#define SC_PLUGIN_IBFT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SC_TYPE_PLUGIN_IBFT, SCPluginIbftClass))
#define SC_IS_PLUGIN_IBFT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SC_TYPE_PLUGIN_IBFT))
#define SC_IS_PLUGIN_IBFT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SC_TYPE_PLUGIN_IBFT))
#define SC_PLUGIN_IBFT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SC_TYPE_PLUGIN_IBFT, SCPluginIbftClass))
#define SETTINGS_TYPE_PLUGIN_IBFT (settings_plugin_ibft_get_type ())
#define SETTINGS_PLUGIN_IBFT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SETTINGS_TYPE_PLUGIN_IBFT, SettingsPluginIbft))
#define SETTINGS_PLUGIN_IBFT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SETTINGS_TYPE_PLUGIN_IBFT, SettingsPluginIbftClass))
#define SETTINGS_IS_PLUGIN_IBFT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SETTINGS_TYPE_PLUGIN_IBFT))
#define SETTINGS_IS_PLUGIN_IBFT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SETTINGS_TYPE_PLUGIN_IBFT))
#define SETTINGS_PLUGIN_IBFT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SETTINGS_TYPE_PLUGIN_IBFT, SettingsPluginIbftClass))
typedef struct _SCPluginIbft SCPluginIbft;
typedef struct _SCPluginIbftClass SCPluginIbftClass;
typedef struct _SettingsPluginIbft SettingsPluginIbft;
typedef struct _SettingsPluginIbftClass SettingsPluginIbftClass;
struct _SCPluginIbft {
struct _SettingsPluginIbft {
GObject parent;
};
struct _SCPluginIbftClass {
struct _SettingsPluginIbftClass {
GObjectClass parent;
};
GType sc_plugin_ibft_get_type (void);
GType settings_plugin_ibft_get_type (void);
#endif /* _PLUGIN_H_ */
This diff is collapsed.
......@@ -26,25 +26,25 @@
#include "nm-exported-object.h"
#define SC_TYPE_PLUGIN_IFCFG (sc_plugin_ifcfg_get_type ())
#define SC_PLUGIN_IFCFG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfg))
#define SC_PLUGIN_IFCFG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfgClass))
#define SC_IS_PLUGIN_IFCFG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SC_TYPE_PLUGIN_IFCFG))
#define SC_IS_PLUGIN_IFCFG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SC_TYPE_PLUGIN_IFCFG))
#define SC_PLUGIN_IFCFG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfgClass))
#define SETTINGS_TYPE_PLUGIN_IFCFG (settings_plugin_ifcfg_get_type ())
#define SETTINGS_PLUGIN_IFCFG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SETTINGS_TYPE_PLUGIN_IFCFG, SettingsPluginIfcfg))
#define SETTINGS_PLUGIN_IFCFG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SETTINGS_TYPE_PLUGIN_IFCFG, SettingsPluginIfcfgClass))
#define SETTINGS_IS_PLUGIN_IFCFG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SETTINGS_TYPE_PLUGIN_IFCFG))
#define SETTINGS_IS_PLUGIN_IFCFG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SETTINGS_TYPE_PLUGIN_IFCFG))
#define SETTINGS_PLUGIN_IFCFG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SETTINGS_TYPE_PLUGIN_IFCFG, SettingsPluginIfcfgClass))
typedef struct _SCPluginIfcfg SCPluginIfcfg;
typedef struct _SCPluginIfcfgClass SCPluginIfcfgClass;
typedef struct _SettingsPluginIfcfg SettingsPluginIfcfg;
typedef struct _SettingsPluginIfcfgClass SettingsPluginIfcfgClass;
struct _SCPluginIfcfg {
struct _SettingsPluginIfcfg {
NMExportedObject parent;
};
struct _SCPluginIfcfgClass {
struct _SettingsPluginIfcfgClass {
NMExportedObjectClass parent;
};
GType sc_plugin_ifcfg_get_type (void);
GType settings_plugin_ifcfg_get_type (void);
#endif /* _PLUGIN_H_ */
......@@ -26,7 +26,7 @@
#include <stdlib.h>
#include <errno.h>
#include "nm-system-config-interface.h"
#include "nm-settings-plugin.h"
#include "nm-default.h"
#include "nm-core-internal.h"
#include "NetworkManagerUtils.h"
......