summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-05-25 17:49:12 +0200
committerThomas Haller <thaller@redhat.com>2015-07-29 22:34:35 +0200
commitd2d40cc75b13f03c986dc284d4f244c3640c1776 (patch)
tree836c9a8e2bdedde610a82743f504790d49168a8c
parenteafa6c3584421d14e09a18f76bad7b1b5ebc2288 (diff)
downloadNetworkManager-d2d40cc75b13f03c986dc284d4f244c3640c1776.tar.gz
vpn: refactor vpn-manager to use NMVpnPluginInfo
Use NMVpnPluginInfo to load the plugins in NMVpnManager. This has the advantage of reusing the code from libnm to use the same approach to read the plugin config files. Another advantage is that we now check the file permissions of the config file.
-rw-r--r--src/vpn-manager/nm-vpn-manager.c227
-rw-r--r--src/vpn-manager/nm-vpn-service.c99
-rw-r--r--src/vpn-manager/nm-vpn-service.h6
3 files changed, 155 insertions, 177 deletions
diff --git a/src/vpn-manager/nm-vpn-manager.c b/src/vpn-manager/nm-vpn-manager.c
index 2a6f48b79c..8dc46c41bf 100644
--- a/src/vpn-manager/nm-vpn-manager.c
+++ b/src/vpn-manager/nm-vpn-manager.c
@@ -29,44 +29,38 @@
#include "nm-vpn-connection.h"
#include "nm-setting-vpn.h"
#include "nm-vpn-dbus-interface.h"
+#include "nm-core-internal.h"
#include "nm-enum-types.h"
#include "nm-logging.h"
-
-#define VPN_NAME_FILES_DIR NMCONFDIR "/VPN"
+#include "gsystem-local-alloc.h"
G_DEFINE_TYPE (NMVpnManager, nm_vpn_manager, G_TYPE_OBJECT)
#define NM_VPN_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_VPN_MANAGER, NMVpnManagerPrivate))
typedef struct {
- GHashTable *services;
- GFileMonitor *monitor;
- guint monitor_id;
+ GSList *services;
+ GFileMonitor *monitor_etc;
+ GFileMonitor *monitor_lib;
+ guint monitor_id_etc;
+ guint monitor_id_lib;
} NMVpnManagerPrivate;
-
static NMVpnService *
-get_service_by_namefile (NMVpnManager *self, const char *namefile)
+_plugin_info_get_service (NMVpnPluginInfo *plugin_info)
{
- NMVpnManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self);
- GHashTableIter iter;
- gpointer data;
-
- g_return_val_if_fail (namefile, NULL);
- g_return_val_if_fail (g_path_is_absolute (namefile), NULL);
-
- g_hash_table_iter_init (&iter, priv->services);
- while (g_hash_table_iter_next (&iter, NULL, &data)) {
- NMVpnService *candidate = NM_VPN_SERVICE (data);
- const char *service_namefile;
-
- service_namefile = nm_vpn_service_get_name_file (candidate);
- if (!strcmp (namefile, service_namefile))
- return candidate;
- }
+ if (plugin_info)
+ return NM_VPN_SERVICE (g_object_get_data (G_OBJECT (plugin_info), "service-instance"));
return NULL;
}
+static void
+_plugin_info_set_service (NMVpnPluginInfo *plugin_info, NMVpnService *service)
+{
+ g_object_set_data_full (G_OBJECT (plugin_info), "service-instance", service,
+ (GDestroyNotify) g_object_unref);
+}
+
gboolean
nm_vpn_manager_activate_connection (NMVpnManager *manager,
NMVpnConnection *vpn,
@@ -75,6 +69,7 @@ nm_vpn_manager_activate_connection (NMVpnManager *manager,
NMConnection *connection;
NMSettingVpn *s_vpn;
NMVpnService *service;
+ NMVpnPluginInfo *plugin_info;
const char *service_name;
NMDevice *device;
@@ -98,8 +93,8 @@ nm_vpn_manager_activate_connection (NMVpnManager *manager,
g_assert (s_vpn);
service_name = nm_setting_vpn_get_service_type (s_vpn);
- g_assert (service_name);
- service = g_hash_table_lookup (NM_VPN_MANAGER_GET_PRIVATE (manager)->services, service_name);
+ plugin_info = nm_vpn_plugin_info_list_find_by_service (NM_VPN_MANAGER_GET_PRIVATE (manager)->services, service_name);
+ service = _plugin_info_get_service (plugin_info);
if (!service) {
g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_CONNECTION_NOT_AVAILABLE,
"The VPN service '%s' was not installed.",
@@ -119,33 +114,31 @@ nm_vpn_manager_deactivate_connection (NMVpnManager *self,
}
static void
-try_add_service (NMVpnManager *self, const char *namefile)
+try_add_service (NMVpnManager *self, NMVpnPluginInfo *plugin_info)
{
NMVpnManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self);
NMVpnService *service = NULL;
- GHashTableIter iter;
GError *error = NULL;
- const char *service_name;
-
- g_return_if_fail (g_path_is_absolute (namefile));
- /* Make sure we don't add dupes */
- g_hash_table_iter_init (&iter, priv->services);
- while (g_hash_table_iter_next (&iter, NULL, (gpointer) &service)) {
- if (g_strcmp0 (namefile, nm_vpn_service_get_name_file (service)) == 0)
- return;
- }
+ /* Make sure we don't add dupes.
+ * We don't really allow reload of the same file. What we do allow is however to
+ * delete a file and re-add it. */
+ if (nm_vpn_plugin_info_list_find_by_filename (priv->services,
+ nm_vpn_plugin_info_get_filename (plugin_info)))
+ return;
+ if (!nm_vpn_plugin_info_list_add (&priv->services, plugin_info, NULL))
+ return;
/* New service */
- service = nm_vpn_service_new (namefile, &error);
+ service = nm_vpn_service_new (plugin_info, &error);
if (service) {
- service_name = nm_vpn_service_get_dbus_service (service);
- g_hash_table_insert (priv->services, (char *) service_name, service);
- nm_log_info (LOGD_VPN, "VPN: loaded %s", service_name);
+ _plugin_info_set_service (plugin_info, service);
+ nm_log_info (LOGD_VPN, "VPN: loaded %s - %s",
+ nm_vpn_plugin_info_get_name (plugin_info),
+ nm_vpn_service_get_dbus_service (service));
} else {
- nm_log_warn (LOGD_VPN, "failed to load VPN service file %s: (%d) %s",
- namefile,
- error ? error->code : -1,
+ nm_log_warn (LOGD_VPN, "failed to load VPN service file %s: %s",
+ nm_vpn_plugin_info_get_filename (plugin_info),
error && error->message ? error->message : "(unknown)");
g_clear_error (&error);
}
@@ -160,41 +153,65 @@ vpn_dir_changed (GFileMonitor *monitor,
{
NMVpnManager *self = NM_VPN_MANAGER (user_data);
NMVpnManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self);
+ NMVpnPluginInfo *plugin_info;
NMVpnService *service;
- char *path;
+ gs_free char *path = NULL;
+ GError *error = NULL;
path = g_file_get_path (file);
- if (!g_str_has_suffix (path, ".name")) {
- g_free (path);
+ if (!nm_vpn_plugin_info_validate_filename (path))
return;
- }
switch (event_type) {
case G_FILE_MONITOR_EVENT_DELETED:
- nm_log_dbg (LOGD_VPN, "service file %s deleted", path);
+ plugin_info = nm_vpn_plugin_info_list_find_by_filename (priv->services, path);
+ if (!plugin_info)
+ break;
- service = get_service_by_namefile (self, path);
+ nm_log_dbg (LOGD_VPN, "vpn: service file %s deleted", path);
+ service = _plugin_info_get_service (plugin_info);
if (service) {
- const char *service_name = nm_vpn_service_get_dbus_service (service);
-
/* Stop active VPN connections and destroy the service */
nm_vpn_service_stop_connections (service, FALSE,
NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED);
- nm_log_info (LOGD_VPN, "VPN: unloaded %s", service_name);
- g_hash_table_remove (priv->services, service_name);
+ nm_log_info (LOGD_VPN, "VPN: unloaded %s", nm_vpn_service_get_dbus_service (service));
+
+ _plugin_info_set_service (plugin_info, NULL);
}
+ nm_vpn_plugin_info_list_remove (&priv->services, plugin_info);
break;
case G_FILE_MONITOR_EVENT_CREATED:
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
- nm_log_dbg (LOGD_VPN, "service file %s created or modified", path);
- try_add_service (self, path);
+ plugin_info = nm_vpn_plugin_info_list_find_by_filename (priv->services, path);
+ if (plugin_info) {
+ /* we don't support reloading an existing plugin. You can only remove the file
+ * and re-add it. By reloading we want to support the use case of installing
+ * a VPN plugin after NM started. No need to burden ourself with a complete
+ * reload. */
+ break;
+ }
+
+ if (!_nm_vpn_plugin_info_check_file (path, TRUE, TRUE, 0,
+ NULL, NULL, &error)) {
+ nm_log_dbg (LOGD_VPN, "vpn: ignore changed service file %s (%s)", path, error->message);
+ g_clear_error (&error);
+ break;
+ }
+ plugin_info = nm_vpn_plugin_info_new_from_file (path, &error);
+ if (!plugin_info) {
+ nm_log_dbg (LOGD_VPN, "vpn: ignore changed service file %s due to invalid content (%s)", path, error->message);
+ g_clear_error (&error);
+ break;
+ }
+
+ nm_log_dbg (LOGD_VPN, "vpn: service file %s created or modified", path);
+ try_add_service (self, plugin_info);
+ g_object_unref (plugin_info);
break;
default:
- nm_log_dbg (LOGD_VPN, "service file %s change event %d", path, event_type);
+ nm_log_dbg (LOGD_VPN, "vpn: service file %s change event %d", path, event_type);
break;
}
-
- g_free (path);
}
/******************************************************************************/
@@ -206,50 +223,40 @@ nm_vpn_manager_init (NMVpnManager *self)
{
NMVpnManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self);
GFile *file;
- GDir *dir;
- const char *fn;
- char *path;
-
- priv->services = g_hash_table_new_full (g_str_hash, g_str_equal,
- NULL, g_object_unref);
+ GSList *infos, *info;
+ const char *conf_dir_etc = _nm_vpn_plugin_info_get_default_dir_etc ();
+ const char *conf_dir_lib = _nm_vpn_plugin_info_get_default_dir_lib ();
/* Watch the VPN directory for changes */
- file = g_file_new_for_path (VPN_NAME_FILES_DIR "/");
- priv->monitor = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, NULL, NULL);
+ file = g_file_new_for_path (conf_dir_lib);
+ priv->monitor_lib = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, NULL, NULL);
g_object_unref (file);
- if (priv->monitor) {
- priv->monitor_id = g_signal_connect (priv->monitor, "changed",
- G_CALLBACK (vpn_dir_changed), self);
+ if (priv->monitor_lib) {
+ priv->monitor_id_lib = g_signal_connect (priv->monitor_lib, "changed",
+ G_CALLBACK (vpn_dir_changed), self);
}
- /* Load VPN service files */
- dir = g_dir_open (VPN_NAME_FILES_DIR, 0, NULL);
- if (dir) {
- while ((fn = g_dir_read_name (dir))) {
- /* only parse filenames that end with .name */
- if (g_str_has_suffix (fn, ".name")) {
- path = g_build_filename (VPN_NAME_FILES_DIR, fn, NULL);
- try_add_service (self, path);
- g_free (path);
- }
- }
- g_dir_close (dir);
+ file = g_file_new_for_path (conf_dir_etc);
+ priv->monitor_etc = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, NULL, NULL);
+ g_object_unref (file);
+ if (priv->monitor_etc) {
+ priv->monitor_id_etc = g_signal_connect (priv->monitor_etc, "changed",
+ G_CALLBACK (vpn_dir_changed), self);
}
-}
-
-static void
-stop_all_services (NMVpnManager *self)
-{
- NMVpnManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (self);
- GHashTableIter iter;
- NMVpnService *service;
- g_hash_table_iter_init (&iter, priv->services);
- while (g_hash_table_iter_next (&iter, NULL, (gpointer) &service)) {
- nm_vpn_service_stop_connections (service,
- TRUE,
- NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED);
- }
+ /* first read conf_dir_lib. The name files are not really user configuration, but
+ * plugin configuration. Hence we expect ~newer~ plugins to install their files
+ * in /usr/lib/NetworkManager. We want to prefer those files.
+ * In case of no-conflict, the order doesn't matter. */
+ infos = _nm_vpn_plugin_info_list_load_dir (conf_dir_lib, TRUE, 0, NULL, NULL);
+ for (info = infos; info; info = info->next)
+ try_add_service (self, info->data);
+ g_slist_free_full (infos, g_object_unref);
+
+ infos = _nm_vpn_plugin_info_list_load_dir (conf_dir_etc, TRUE, 0, NULL, NULL);
+ for (info = infos; info; info = info->next)
+ try_add_service (self, info->data);
+ g_slist_free_full (infos, g_object_unref);
}
static void
@@ -257,17 +264,29 @@ dispose (GObject *object)
{
NMVpnManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (object);
- if (priv->monitor) {
- if (priv->monitor_id)
- g_signal_handler_disconnect (priv->monitor, priv->monitor_id);
- g_file_monitor_cancel (priv->monitor);
- g_clear_object (&priv->monitor);
+ if (priv->monitor_etc) {
+ if (priv->monitor_id_etc)
+ g_signal_handler_disconnect (priv->monitor_etc, priv->monitor_id_etc);
+ g_file_monitor_cancel (priv->monitor_etc);
+ g_clear_object (&priv->monitor_etc);
}
- if (priv->services) {
- stop_all_services (NM_VPN_MANAGER (object));
- g_hash_table_destroy (priv->services);
- priv->services = NULL;
+ if (priv->monitor_lib) {
+ if (priv->monitor_id_lib)
+ g_signal_handler_disconnect (priv->monitor_lib, priv->monitor_id_lib);
+ g_file_monitor_cancel (priv->monitor_lib);
+ g_clear_object (&priv->monitor_lib);
+ }
+
+ while (priv->services) {
+ NMVpnPluginInfo *plugin_info = priv->services->data;
+ NMVpnService *service = _plugin_info_get_service (plugin_info);
+
+ if (service) {
+ nm_vpn_service_stop_connections (service, TRUE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED);
+ _plugin_info_set_service (plugin_info, NULL);
+ }
+ nm_vpn_plugin_info_list_remove (&priv->services, plugin_info);
}
G_OBJECT_CLASS (nm_vpn_manager_parent_class)->dispose (object);
diff --git a/src/vpn-manager/nm-vpn-service.c b/src/vpn-manager/nm-vpn-service.c
index 56cb6abe74..4661ab4223 100644
--- a/src/vpn-manager/nm-vpn-service.c
+++ b/src/vpn-manager/nm-vpn-service.c
@@ -35,10 +35,7 @@
G_DEFINE_TYPE (NMVpnService, nm_vpn_service, G_TYPE_OBJECT)
typedef struct {
- char *name;
- char *dbus_service;
- char *program;
- char *namefile;
+ NMVpnPluginInfo *plugin_info;
NMVpnConnection *active;
GSList *pending;
@@ -50,67 +47,50 @@ typedef struct {
#define NM_VPN_SERVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_VPN_SERVICE, NMVpnServicePrivate))
-#define VPN_CONNECTION_GROUP "VPN Connection"
-
static gboolean start_pending_vpn (NMVpnService *self, GError **error);
static void _name_owner_changed (GObject *object, GParamSpec *pspec, gpointer user_data);
NMVpnService *
-nm_vpn_service_new (const char *namefile, GError **error)
+nm_vpn_service_new (NMVpnPluginInfo *plugin_info, GError **error)
{
NMVpnService *self;
NMVpnServicePrivate *priv;
- GKeyFile *kf;
- g_return_val_if_fail (namefile != NULL, NULL);
- g_return_val_if_fail (g_path_is_absolute (namefile), NULL);
+ g_return_val_if_fail (NM_IS_VPN_PLUGIN_INFO (plugin_info), NULL);
+ g_return_val_if_fail (nm_vpn_plugin_info_get_filename (plugin_info), NULL);
- kf = g_key_file_new ();
- if (!g_key_file_load_from_file (kf, namefile, G_KEY_FILE_NONE, error)) {
- g_key_file_free (kf);
+ if (!nm_vpn_plugin_info_get_program (plugin_info)) {
+ g_set_error (error,
+ NM_VPN_PLUGIN_ERROR,
+ NM_VPN_PLUGIN_ERROR_FAILED,
+ "missing \"program\" entry");
return NULL;
}
self = (NMVpnService *) g_object_new (NM_TYPE_VPN_SERVICE, NULL);
priv = NM_VPN_SERVICE_GET_PRIVATE (self);
- priv->namefile = g_strdup (namefile);
-
- priv->dbus_service = g_key_file_get_string (kf, VPN_CONNECTION_GROUP, "service", error);
- if (!priv->dbus_service)
- goto error;
-
- priv->program = g_key_file_get_string (kf, VPN_CONNECTION_GROUP, "program", error);
- if (!priv->program)
- goto error;
-
- priv->name = g_key_file_get_string (kf, VPN_CONNECTION_GROUP, "name", error);
- if (!priv->name)
- goto error;
+ priv->plugin_info = g_object_ref (plugin_info);
priv->proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS |
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
NULL,
- priv->dbus_service,
+ nm_vpn_plugin_info_get_service (plugin_info),
NM_VPN_DBUS_PLUGIN_PATH,
NM_VPN_DBUS_PLUGIN_INTERFACE,
NULL, error);
- if (!priv->proxy)
- goto error;
+ if (!priv->proxy) {
+ g_object_unref (self);
+ return NULL;
+ }
g_signal_connect (priv->proxy, "notify::g-name-owner",
G_CALLBACK (_name_owner_changed), self);
_name_owner_changed (G_OBJECT (priv->proxy), NULL, self);
- g_key_file_free (kf);
return self;
-
-error:
- g_object_unref (self);
- g_key_file_free (kf);
- return NULL;
}
const char *
@@ -118,15 +98,7 @@ nm_vpn_service_get_dbus_service (NMVpnService *service)
{
g_return_val_if_fail (NM_IS_VPN_SERVICE (service), NULL);
- return NM_VPN_SERVICE_GET_PRIVATE (service)->dbus_service;
-}
-
-const char *
-nm_vpn_service_get_name_file (NMVpnService *service)
-{
- g_return_val_if_fail (NM_IS_VPN_SERVICE (service), NULL);
-
- return NM_VPN_SERVICE_GET_PRIVATE (service)->namefile;
+ return nm_vpn_plugin_info_get_service (NM_VPN_SERVICE_GET_PRIVATE (service)->plugin_info);
}
static void
@@ -187,7 +159,7 @@ _daemon_exec_timeout (gpointer data)
NMVpnService *self = NM_VPN_SERVICE (data);
NMVpnServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (self);
- nm_log_warn (LOGD_VPN, "VPN service '%s' start timed out", priv->name);
+ nm_log_warn (LOGD_VPN, "VPN service '%s' start timed out", nm_vpn_plugin_info_get_name (priv->plugin_info));
priv->start_timeout = 0;
nm_vpn_service_stop_connections (self, FALSE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT);
return G_SOURCE_REMOVE;
@@ -204,17 +176,21 @@ nm_vpn_service_daemon_exec (NMVpnService *service, GError **error)
g_return_val_if_fail (NM_IS_VPN_SERVICE (service), FALSE);
- vpn_argv[0] = priv->program;
+ vpn_argv[0] = (char *) nm_vpn_plugin_info_get_program (priv->plugin_info);
vpn_argv[1] = NULL;
+ g_assert (vpn_argv[0]);
+
success = g_spawn_async (NULL, vpn_argv, NULL, 0, nm_utils_setpgid, NULL, &pid, &spawn_error);
if (success) {
nm_log_info (LOGD_VPN, "VPN service '%s' started (%s), PID %ld",
- priv->name, priv->dbus_service, (long int) pid);
+ nm_vpn_plugin_info_get_name (priv->plugin_info),
+ nm_vpn_service_get_dbus_service (service),
+ (long int) pid);
priv->start_timeout = g_timeout_add_seconds (5, _daemon_exec_timeout, service);
} else {
nm_log_warn (LOGD_VPN, "VPN service '%s': could not launch the VPN service. error: (%d) %s.",
- priv->name,
+ nm_vpn_plugin_info_get_name (priv->plugin_info),
spawn_error ? spawn_error->code : -1,
spawn_error && spawn_error->message ? spawn_error->message : "(unknown)");
@@ -244,7 +220,7 @@ start_active_vpn (NMVpnService *self, GError **error)
return TRUE;
} else if (priv->start_timeout == 0) {
/* VPN service not running, start it */
- nm_log_info (LOGD_VPN, "Starting VPN service '%s'...", priv->name);
+ nm_log_info (LOGD_VPN, "Starting VPN service '%s'...", nm_vpn_plugin_info_get_name (priv->plugin_info));
return nm_vpn_service_daemon_exec (self, error);
}
@@ -324,14 +300,14 @@ _name_owner_changed (GObject *object,
if (owner && !priv->service_running) {
/* service appeared */
priv->service_running = TRUE;
- nm_log_info (LOGD_VPN, "VPN service '%s' appeared; activating connections", priv->name);
+ nm_log_info (LOGD_VPN, "VPN service '%s' appeared; activating connections", nm_vpn_plugin_info_get_name (priv->plugin_info));
/* Expect success because the VPN service has already appeared */
success = start_active_vpn (service, NULL);
g_warn_if_fail (success);
} else if (!owner && priv->service_running) {
/* service went away */
priv->service_running = FALSE;
- nm_log_info (LOGD_VPN, "VPN service '%s' disappeared", priv->name);
+ nm_log_info (LOGD_VPN, "VPN service '%s' disappeared", nm_vpn_plugin_info_get_name (priv->plugin_info));
nm_vpn_service_stop_connections (service, FALSE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED);
}
@@ -351,10 +327,9 @@ dispose (GObject *object)
NMVpnService *self = NM_VPN_SERVICE (object);
NMVpnServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (self);
- if (priv->start_timeout) {
- g_source_remove (priv->start_timeout);
- priv->start_timeout = 0;
- }
+ nm_clear_g_source (&priv->start_timeout);
+
+ g_clear_object (&priv->plugin_info);
/* VPNService owner is required to stop connections before releasing */
g_assert (priv->active == NULL);
@@ -371,19 +346,6 @@ dispose (GObject *object)
}
static void
-finalize (GObject *object)
-{
- NMVpnServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (object);
-
- g_free (priv->name);
- g_free (priv->dbus_service);
- g_free (priv->program);
- g_free (priv->namefile);
-
- G_OBJECT_CLASS (nm_vpn_service_parent_class)->finalize (object);
-}
-
-static void
nm_vpn_service_class_init (NMVpnServiceClass *service_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (service_class);
@@ -392,5 +354,4 @@ nm_vpn_service_class_init (NMVpnServiceClass *service_class)
/* virtual methods */
object_class->dispose = dispose;
- object_class->finalize = finalize;
}
diff --git a/src/vpn-manager/nm-vpn-service.h b/src/vpn-manager/nm-vpn-service.h
index 6e935950e2..a748d32f39 100644
--- a/src/vpn-manager/nm-vpn-service.h
+++ b/src/vpn-manager/nm-vpn-service.h
@@ -25,6 +25,7 @@
#include "nm-glib.h"
#include "nm-device.h"
#include "nm-vpn-connection.h"
+#include "nm-vpn-plugin-info.h"
#define NM_TYPE_VPN_SERVICE (nm_vpn_service_get_type ())
#define NM_VPN_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_SERVICE, NMVpnService))
@@ -43,14 +44,11 @@ typedef struct {
GType nm_vpn_service_get_type (void);
-NMVpnService * nm_vpn_service_new (const char *namefile, GError **error);
+NMVpnService * nm_vpn_service_new (NMVpnPluginInfo *plugin_info, GError **error);
/* Returns the VPN service's D-Bus service name */
const char *nm_vpn_service_get_dbus_service (NMVpnService *service);
-/* Returns the path of the VPN service's .name file */
-const char *nm_vpn_service_get_name_file (NMVpnService *service);
-
gboolean nm_vpn_service_activate (NMVpnService *service,
NMVpnConnection *vpn,
GError **error);