[network-manager-openswan/dcbw/libreswan: 8/8] core: build libreswan and openswan services from the same sources



commit 0a1de45457184138173b13153100a18aec387137
Author: Dan Williams <dcbw redhat com>
Date:   Tue Nov 18 11:58:24 2014 -0600

    core: build libreswan and openswan services from the same sources
    
    Due to the different VPN service name, we do need to build different
    binaries for the plugin, helper, and properties.  The auth dialog
    doesn't actually care, so it now has a generic name.

 .gitignore                                         |   10 +++-
 Makefile.am                                        |   41 +++++++++------
 auth-dialog/Makefile.am                            |   10 ++--
 auth-dialog/main.c                                 |   11 +++-
 ...top.in.in => nm-swan-auth-dialog.desktop.in.in} |    2 +-
 configure.ac                                       |   10 +++-
 nm-libreswan-service.conf                          |   14 +++++
 nm-libreswan-service.name.in                       |   10 ++++
 nm-libreswan.desktop.in                            |   11 ++++
 nm-openswan-service.name.in                        |    2 +-
 po/POTFILES.in                                     |    3 +-
 po/POTFILES.skip                                   |    2 +-
 properties/Makefile.am                             |   35 +++++++++----
 properties/nm-openswan.c                           |   16 +++---
 src/Makefile.am                                    |   52 ++++++++++++++------
 src/nm-openswan-service-helper.c                   |    8 ++-
 src/nm-openswan-service.c                          |    6 ++-
 src/nm-openswan-service.h                          |    4 --
 18 files changed, 171 insertions(+), 76 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index cd7ad78..df64ca6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,11 +28,15 @@ m4/intltool.m4
 m4/libtool.m4
 m4/lt*.m4
 
-auth-dialog/nm-openswan-auth-dialog
-auth-dialog/nm-openswan-auth-dialog.desktop
-auth-dialog/nm-openswan-auth-dialog.desktop.in
+auth-dialog/nm-swan-auth-dialog
+auth-dialog/nm-swan-auth-dialog.desktop
+auth-dialog/nm-swan-auth-dialog.desktop.in
 nm-openswan-service.name
+nm-libreswan-service.name
 nm-openswan.desktop
+nm-libreswan.desktop
+src/nm-libreswan-service
+src/nm-libreswan-service-helper
 src/nm-openswan-service
 src/nm-openswan-service-helper
 src/show-xfrm
diff --git a/Makefile.am b/Makefile.am
index 1cec43d..d27b3f8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,36 +7,43 @@ SUBDIRS += auth-dialog properties po
 endif
 
 dbusservicedir = $(sysconfdir)/dbus-1/system.d
-dbusservice_DATA = nm-openswan-service.conf
+dbusservice_DATA = $(NULL)
 
 nmvpnservicedir = $(sysconfdir)/NetworkManager/VPN
-nmvpnservice_DATA = nm-openswan-service.name
+nmvpnservice_DATA = $(NULL)
 
-desktopfile = nm-openswan.desktop.in
-#iconfile = gnome-mime-application-x-openswan-ipsec-vpn-settings.png
+desktopfiles = $(NULL)
+namefiles = $(NULL)
 
-if WITH_GNOME
-# FIXME: uncomment when nmce gets --import support
-#desktopdir = $(datadir)/applications
-#desktop_in_files = $(desktopfile)
-#desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
-# INTLTOOL_DESKTOP_RULE@
-
-icondir = $(datadir)/icons/hicolor/48x48/apps
-#icon_DATA = $(iconfile)
-endif
+if ENABLE_OPENSWAN
+dbusservice_DATA += nm-openswan-service.conf
+nmvpnservice_DATA += nm-openswan-service.name
+desktopfiles += nm-openswan.desktop.in
+namefiles += nm-openswan-service.name.in
 
 nm-openswan-service.name: $(srcdir)/nm-openswan-service.name.in
        sed -e 's|[ ]LIBEXECDIR[@]|$(libexecdir)|g' \
            -e 's|[ ]PLUGINDIR[@]|$(libdir)/NetworkManager|g' \
            $< >$@
+endif
+
+if ENABLE_LIBRESWAN
+dbusservice_DATA += nm-libreswan-service.conf
+nmvpnservice_DATA += nm-libreswan-service.name
+desktopfiles += nm-libreswan.desktop.in
+namefiles += nm-libreswan-service.name.in
+
+nm-libreswan-service.name: $(srcdir)/nm-libreswan-service.name.in
+       sed -e 's|[ ]LIBEXECDIR[@]|$(libexecdir)|g' \
+           -e 's|[ ]PLUGINDIR[@]|$(libdir)/NetworkManager|g' \
+           $< >$@
+endif
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-more-warnings=yes
 
-EXTRA_DIST = nm-openswan-service.name.in \
+EXTRA_DIST = $(namefiles) \
              $(dbusservice_DATA)  \
-             $(desktopfile)  \
-             #$(iconfile)         \
+             $(desktopfiles)  \
              intltool-extract.in  \
              intltool-merge.in    \
              intltool-update.in \
diff --git a/auth-dialog/Makefile.am b/auth-dialog/Makefile.am
index b910693..4518660 100644
--- a/auth-dialog/Makefile.am
+++ b/auth-dialog/Makefile.am
@@ -11,11 +11,11 @@ AM_CPPFLAGS = \
        -DVERSION=\"$(VERSION)\" \
        -I${top_srcdir}
 
-libexec_PROGRAMS = nm-openswan-auth-dialog
+libexec_PROGRAMS = nm-swan-auth-dialog
 
-nm_openswan_auth_dialog_SOURCES = main.c
+nm_swan_auth_dialog_SOURCES = main.c
 
-nm_openswan_auth_dialog_LDADD = \
+nm_swan_auth_dialog_LDADD = \
        $(NM_LIBS) \
        $(GTK_LIBS) \
        $(NMGTK_LIBS) \
@@ -23,8 +23,8 @@ nm_openswan_auth_dialog_LDADD = \
 
 @INTLTOOL_DESKTOP_RULE@
 desktopdir = $(datadir)/applications
-desktop_in_in_files = nm-openswan-auth-dialog.desktop.in.in
-desktop_in_files = nm-openswan-auth-dialog.desktop.in
+desktop_in_in_files = nm-swan-auth-dialog.desktop.in.in
+desktop_in_files = nm-swan-auth-dialog.desktop.in
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 
 EXTRA_DIST = \
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 5c879dd..b2695a0 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -40,6 +40,9 @@
 
 #include "src/nm-openswan-service.h"
 
+#define NM_DBUS_SERVICE_OPENSWAN    "org.freedesktop.NetworkManager.openswan"
+#define NM_DBUS_SERVICE_LIBRESWAN   "org.freedesktop.NetworkManager.libreswan"
+
 #define KEYRING_UUID_TAG "connection-uuid"
 #define KEYRING_SN_TAG "setting-name"
 #define KEYRING_SK_TAG "setting-key"
@@ -452,7 +455,7 @@ main (int argc, char *argv[])
        gtk_init (&argc, &argv);
        textdomain (GETTEXT_PACKAGE);
 
-       context = g_option_context_new ("- openswan auth dialog");
+       context = g_option_context_new ("- IPSec auth dialog");
        g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
 
        if (!g_option_context_parse (context, &argc, &argv, &error)) {
@@ -468,8 +471,10 @@ main (int argc, char *argv[])
                return 1;
        }
 
-       if (strcmp (vpn_service, NM_DBUS_SERVICE_OPENSWAN) != 0) {
-               fprintf (stderr, "This dialog only works with the '%s' service\n", NM_DBUS_SERVICE_OPENSWAN);
+       if (   strcmp (vpn_service, NM_DBUS_SERVICE_OPENSWAN) != 0
+           && strcmp (vpn_service, NM_DBUS_SERVICE_LIBRESWAN) != 0) {
+               fprintf (stderr, "This dialog only works with the '%s' and '%s' services\n",
+                        NM_DBUS_SERVICE_OPENSWAN, NM_DBUS_SERVICE_LIBRESWAN);
                return 1;
        }
 
diff --git a/auth-dialog/nm-openswan-auth-dialog.desktop.in.in b/auth-dialog/nm-swan-auth-dialog.desktop.in.in
similarity index 72%
rename from auth-dialog/nm-openswan-auth-dialog.desktop.in.in
rename to auth-dialog/nm-swan-auth-dialog.desktop.in.in
index 9c91b6b..4fec5dd 100644
--- a/auth-dialog/nm-openswan-auth-dialog.desktop.in.in
+++ b/auth-dialog/nm-swan-auth-dialog.desktop.in.in
@@ -1,7 +1,7 @@
 [Desktop Entry]
 _Name=Network
 _Comment=Request VPN authentication
-Exec= LIBEXECDIR@/nm-openswan-auth-dialog
+Exec= LIBEXECDIR@/nm-swan-auth-dialog
 Terminal=false
 Type=Application
 NoDisplay=true
diff --git a/configure.ac b/configure.ac
index aac837b..aa5d250 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,6 +96,14 @@ if test x"$with_gnome" != xno; then
        AC_SUBST(LIBSECRET_LIBS)
 fi
 
+AC_ARG_ENABLE(openswan, AS_HELP_STRING([--enable-openswan], [enable OpenSWAN support]),
+                     [enable_openswan=${enableval}], [enable_openswan=yes])
+AM_CONDITIONAL(ENABLE_OPENSWAN, test "${enable_openswan}" = "yes")
+
+AC_ARG_ENABLE(libreswan, AS_HELP_STRING([--enable-libreswan], [enable LibreSWAN support]),
+                     [enable_libreswan=${enableval}], [enable_libreswan=yes])
+AM_CONDITIONAL(ENABLE_LIBRESWAN, test "${enable_libreswan}" = "yes")
+
 dnl
 dnl Distribution version string
 dnl
@@ -110,7 +118,7 @@ AC_CONFIG_FILES([
 Makefile
 src/Makefile
 auth-dialog/Makefile
-auth-dialog/nm-openswan-auth-dialog.desktop.in
+auth-dialog/nm-swan-auth-dialog.desktop.in
 properties/Makefile
 po/Makefile.in
 ])
diff --git a/nm-libreswan-service.conf b/nm-libreswan-service.conf
new file mode 100644
index 0000000..b5cecc6
--- /dev/null
+++ b/nm-libreswan-service.conf
@@ -0,0 +1,14 @@
+<!DOCTYPE busconfig PUBLIC
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd";>
+<busconfig>
+       <policy user="root">
+               <allow own="org.freedesktop.NetworkManager.libreswan"/>
+               <allow send_destination="org.freedesktop.NetworkManager.libreswan"/>
+       </policy>
+       <policy context="default">
+               <deny own="org.freedesktop.NetworkManager.libreswan"/>
+               <deny send_destination="org.freedesktop.NetworkManager.libreswan"/>
+       </policy>
+</busconfig>
+
diff --git a/nm-libreswan-service.name.in b/nm-libreswan-service.name.in
new file mode 100644
index 0000000..ce9c126
--- /dev/null
+++ b/nm-libreswan-service.name.in
@@ -0,0 +1,10 @@
+[VPN Connection]
+name=libreswan
+service=org.freedesktop.NetworkManager.libreswan
+program= LIBEXECDIR@/nm-libreswan-service
+
+[GNOME]
+auth-dialog= LIBEXECDIR@/nm-swan-auth-dialog
+properties= PLUGINDIR@/libnm-libreswan-properties
+supports-external-ui-mode=true
+supports-hints=true
diff --git a/nm-libreswan.desktop.in b/nm-libreswan.desktop.in
new file mode 100644
index 0000000..4802fa5
--- /dev/null
+++ b/nm-libreswan.desktop.in
@@ -0,0 +1,11 @@
+[Desktop Entry]
+_Name=IPsec Based VPN Connection Manager (libreswan)
+_GenericName=IPsec Based VPN Connection Manager (libreswan)
+_Comment=Add, Remove, and Edit VPN Connections
+Exec=nm-vpn-properties --import-service org.freedesktop.NetworkManager.libreswan --import-file %f
+Icon=gnome-mime-application-x-openswan-ipsec-vpn-settings
+Terminal=false
+Type=Application
+Categories=GNOME;Network;
+MimeType=application/x-openswan-ipsec-vpn-settings
+NoDisplay=true
diff --git a/nm-openswan-service.name.in b/nm-openswan-service.name.in
index 6607c12..5cc28ce 100644
--- a/nm-openswan-service.name.in
+++ b/nm-openswan-service.name.in
@@ -4,7 +4,7 @@ service=org.freedesktop.NetworkManager.openswan
 program= LIBEXECDIR@/nm-openswan-service
 
 [GNOME]
-auth-dialog= LIBEXECDIR@/nm-openswan-auth-dialog
+auth-dialog= LIBEXECDIR@/nm-swan-auth-dialog
 properties= PLUGINDIR@/libnm-openswan-properties
 supports-external-ui-mode=true
 supports-hints=true
diff --git a/po/POTFILES.in b/po/POTFILES.in
index da3f3ca..c9b167b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,7 +1,8 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
 auth-dialog/main.c
-auth-dialog/nm-openswan-auth-dialog.desktop.in.in
+auth-dialog/nm-swan-auth-dialog.desktop.in.in
+nm-libreswan.desktop.in
 nm-openswan.desktop.in
 properties/nm-openswan.c
 [type: gettext/glade]properties/nm-openswan-dialog.ui
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index de5662d..8991cf4 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -1,2 +1,2 @@
-auth-dialog/nm-openswan-auth-dialog.desktop.in
+auth-dialog/nm-swan-auth-dialog.desktop.in
 
diff --git a/properties/Makefile.am b/properties/Makefile.am
index 214f478..c722f82 100644
--- a/properties/Makefile.am
+++ b/properties/Makefile.am
@@ -1,6 +1,3 @@
-plugindir = $(libdir)/NetworkManager
-plugin_LTLIBRARIES = libnm-openswan-properties.la
-
 AM_CPPFLAGS = \
        $(GLIB_CFLAGS) \
        $(GTK_CFLAGS) \
@@ -13,16 +10,32 @@ AM_CPPFLAGS = \
        -DVERSION=\"$(VERSION)\" \
        -I${top_srcdir}
 
-libnm_openswan_properties_la_SOURCES = \
-       nm-openswan.c \
-       nm-openswan.h
+plugindir = $(libdir)/NetworkManager
+plugin_LTLIBRARIES = $(NULL)
+
+sources = nm-openswan.c nm-openswan.h
+libs = $(GTK_LIBS) $(NM_LIBS)
+ldflags = -avoid-version
 
-libnm_openswan_properties_la_LIBADD = \
-       $(GTK_LIBS) \
-       $(NM_LIBS)
+if ENABLE_OPENSWAN
+plugin_LTLIBRARIES += libnm-openswan-properties.la
+libnm_openswan_properties_la_SOURCES = $(sources)
+libnm_openswan_properties_la_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       -DDBUS_SERVICE=\"openswan\"
+libnm_openswan_properties_la_LIBADD = $(libs)
+libnm_openswan_properties_la_LDFLAGS = $(ldflags)
+endif
 
-libnm_openswan_properties_la_LDFLAGS = \
-        -avoid-version
+if ENABLE_LIBRESWAN
+plugin_LTLIBRARIES += libnm-libreswan-properties.la
+libnm_libreswan_properties_la_SOURCES = $(sources)
+libnm_libreswan_properties_la_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       -DDBUS_SERVICE=\"libreswan\"
+libnm_libreswan_properties_la_LIBADD = $(libs)
+libnm_libreswan_properties_la_LDFLAGS = $(ldflags)
+endif
 
 uidir = $(datadir)/gnome-vpn-properties/openswan
 ui_DATA = nm-openswan-dialog.ui
diff --git a/properties/nm-openswan.c b/properties/nm-openswan.c
index f9687ed..40d445c 100644
--- a/properties/nm-openswan.c
+++ b/properties/nm-openswan.c
@@ -44,9 +44,9 @@
 #include "src/nm-openswan-service.h"
 #include "nm-openswan.h"
 
-#define OPENSWAN_PLUGIN_NAME    _("IPsec based VPN")
-#define OPENSWAN_PLUGIN_DESC    _("IPsec, IKEv1, IKEv2 based VPN")
-#define OPENSWAN_PLUGIN_SERVICE NM_DBUS_SERVICE_OPENSWAN 
+#define PLUGIN_NAME    _("IPsec based VPN")
+#define PLUGIN_DESC    _("IPsec, IKEv1, IKEv2 based VPN")
+#define PLUGIN_SERVICE "org.freedesktop.NetworkManager." DBUS_SERVICE
 
 #define ENC_TYPE_SECURE 0
 #define ENC_TYPE_WEAK   1
@@ -507,7 +507,7 @@ update_connection (NMVpnPluginUiWidgetInterface *iface,
                return FALSE;
 
        s_vpn = NM_SETTING_VPN (nm_setting_vpn_new ());
-       g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, NM_DBUS_SERVICE_OPENSWAN, NULL);
+       g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, PLUGIN_SERVICE, NULL);
 
        /* Gateway */
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "gateway_entry"));
@@ -585,7 +585,7 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
 
        object = NM_VPN_PLUGIN_UI_WIDGET_INTERFACE (g_object_new (OPENSWAN_TYPE_PLUGIN_UI_WIDGET, NULL));
        if (!object) {
-               g_set_error (error, OPENSWAN_PLUGIN_UI_ERROR, 0, "could not create openswan object");
+               g_set_error (error, OPENSWAN_PLUGIN_UI_ERROR, 0, "could not create UI object");
                return NULL;
        }
 
@@ -688,13 +688,13 @@ get_property (GObject *object, guint prop_id,
 {
        switch (prop_id) {
        case NM_VPN_PLUGIN_UI_INTERFACE_PROP_NAME:
-               g_value_set_string (value, OPENSWAN_PLUGIN_NAME);
+               g_value_set_string (value, PLUGIN_NAME);
                break;
        case NM_VPN_PLUGIN_UI_INTERFACE_PROP_DESC:
-               g_value_set_string (value, OPENSWAN_PLUGIN_DESC);
+               g_value_set_string (value, PLUGIN_DESC);
                break;
        case NM_VPN_PLUGIN_UI_INTERFACE_PROP_SERVICE:
-               g_value_set_string (value, OPENSWAN_PLUGIN_SERVICE);
+               g_value_set_string (value, PLUGIN_SERVICE);
                break;
        default:
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
diff --git a/src/Makefile.am b/src/Makefile.am
index 46f6288..57d6f81 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,30 +15,52 @@ AM_CPPFLAGS = \
        -DNM_OPENSWAN_LOCALEDIR=\"$(datadir)/locale\" \
        -I${top_srcdir}
 
-libexec_PROGRAMS = nm-openswan-service nm-openswan-service-helper
+libexec_PROGRAMS = $(NULL)
 
-nm_openswan_service_SOURCES = \
+service_sources = \
        nm-openswan-service.c \
        nm-openswan-service.h
+service_ldadd = $(DBUS_LIBS) $(GLIB_LIBS) $(NM_LIBS) -lutil
 
-nm_openswan_service_LDADD = \
-       $(DBUS_LIBS) \
-       $(GLIB_LIBS) \
-       $(NM_LIBS) \
-       -lutil
+helper_sources = \
+       nm-openswan-service-helper.c \
+       nm-openswan-service.h
+helper_ldadd = $(DBUS_LIBS) $(NM_LIBS) $(LIBNL_LIBS)
 
-nm_openswan_service_helper_SOURCES = \
-       nm-openswan-service-helper.c
+if ENABLE_OPENSWAN
+libexec_PROGRAMS += nm-openswan-service
+nm_openswan_service_SOURCES = $(service_sources)
+nm_openswan_service_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       -DDBUS_SERVICE=\"openswan\"
+nm_openswan_service_LDADD = $(service_ldadd)
 
-nm_openswan_service_helper_LDADD = \
-       $(DBUS_LIBS) \
-       $(NM_LIBS) \
-       $(LIBNL_LIBS)
+libexec_PROGRAMS += nm-openswan-service-helper
+nm_openswan_service_helper_SOURCES = $(helper_sources)
+nm_openswan_service_helper_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       -DDBUS_SERVICE=\"openswan\"
+nm_openswan_service_helper_LDADD = $(helper_ldadd)
+endif
 
-noinst_PROGRAMS = show-xfrm
+if ENABLE_LIBRESWAN
+libexec_PROGRAMS += nm-libreswan-service
+nm_libreswan_service_SOURCES = $(service_sources)
+nm_libreswan_service_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       -DDBUS_SERVICE=\"libreswan\"
+nm_libreswan_service_LDADD = $(service_ldadd)
 
-show_xfrm_SOURCES = show-xfrm.c
+libexec_PROGRAMS += nm-libreswan-service-helper
+nm_libreswan_service_helper_SOURCES = $(helper_sources)
+nm_libreswan_service_helper_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       -DDBUS_SERVICE=\"libreswan\"
+nm_libreswan_service_helper_LDADD = $(helper_ldadd)
+endif
 
+noinst_PROGRAMS = show-xfrm
+show_xfrm_SOURCES = show-xfrm.c
 show_xfrm_LDADD = $(LIBNL_LIBS) $(GLIB_LIBS)
 
 CLEANFILES = *~
diff --git a/src/nm-openswan-service-helper.c b/src/nm-openswan-service-helper.c
index 3f1fa5a..79ad326 100644
--- a/src/nm-openswan-service-helper.c
+++ b/src/nm-openswan-service-helper.c
@@ -45,6 +45,8 @@
 #include "nm-openswan-service.h"
 #include "nm-utils.h"
 
+#define DBUS_SERVICE_NAME "org.freedesktop.NetworkManager." DBUS_SERVICE
+
 /* These are here because nm-dbus-glib-types.h isn't exported */
 #define DBUS_TYPE_G_ARRAY_OF_UINT          (dbus_g_type_get_collection ("GArray", G_TYPE_UINT))
 #define DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT (dbus_g_type_get_collection ("GPtrArray", 
DBUS_TYPE_G_ARRAY_OF_UINT))
@@ -55,10 +57,10 @@ helper_failed (DBusGConnection *connection, const char *reason)
        DBusGProxy *proxy;
        GError *err = NULL;
 
-       g_warning ("nm-openswan-service-helper did not receive a valid %s from openswan", reason);
+       g_warning ("helper did not receive a valid %s from openswan", reason);
 
        proxy = dbus_g_proxy_new_for_name (connection,
-                                                               NM_DBUS_SERVICE_OPENSWAN,
+                                                               DBUS_SERVICE_NAME,
                                                                NM_VPN_DBUS_PLUGIN_PATH,
                                                                NM_VPN_DBUS_PLUGIN_INTERFACE);
 
@@ -84,7 +86,7 @@ send_ip4_config (DBusGConnection *connection, GHashTable *config)
        GError *err = NULL;
 
        proxy = dbus_g_proxy_new_for_name (connection,
-                                                               NM_DBUS_SERVICE_OPENSWAN,
+                                                               DBUS_SERVICE_NAME,
                                                                NM_VPN_DBUS_PLUGIN_PATH,
                                                                NM_VPN_DBUS_PLUGIN_INTERFACE);
 
diff --git a/src/nm-openswan-service.c b/src/nm-openswan-service.c
index 09d9fdb..19c3146 100644
--- a/src/nm-openswan-service.c
+++ b/src/nm-openswan-service.c
@@ -44,6 +44,8 @@
 # define DIST_VERSION VERSION
 #endif
 
+#define DBUS_SERVICE_NAME "org.freedesktop.NetworkManager." DBUS_SERVICE
+
 #define NM_TYPE_OPENSWAN_PLUGIN (nm_openswan_plugin_get_type ())
 #define NM_OPENSWAN_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_OPENSWAN_PLUGIN, 
NMOpenSwanPlugin))
 
@@ -1299,7 +1301,7 @@ main (int argc, char *argv[])
        g_option_context_add_main_entries (opt_ctx, options, NULL);
 
        g_option_context_set_summary (opt_ctx,
-               _("nm-openswan-service provides integrated IPsec VPN capability to NetworkManager."));
+               _("This service provides integrated IPsec VPN capability to NetworkManager."));
 
        g_option_context_parse (opt_ctx, &argc, &argv, NULL);
        g_option_context_free (opt_ctx);
@@ -1311,7 +1313,7 @@ main (int argc, char *argv[])
                g_message ("%s (version " DIST_VERSION ") starting...", argv[0]);
 
        plugin = g_object_new (NM_TYPE_OPENSWAN_PLUGIN,
-                              NM_VPN_PLUGIN_DBUS_SERVICE_NAME, NM_DBUS_SERVICE_OPENSWAN,
+                              NM_VPN_PLUGIN_DBUS_SERVICE_NAME, DBUS_SERVICE_NAME,
                               NULL);
        if (!plugin)
                exit (1);
diff --git a/src/nm-openswan-service.h b/src/nm-openswan-service.h
index fed9b7c..44dd331 100644
--- a/src/nm-openswan-service.h
+++ b/src/nm-openswan-service.h
@@ -24,10 +24,6 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#define NM_DBUS_SERVICE_OPENSWAN    "org.freedesktop.NetworkManager.openswan"
-#define NM_DBUS_INTERFACE_OPENSWAN  "org.freedesktop.NetworkManager.openswan"
-#define NM_DBUS_PATH_OPENSWAN       "/org/freedesktop/NetworkManager/openswan"
-
 #define NM_OPENSWAN_RIGHT  "right"
 #define NM_OPENSWAN_LEFTID "leftid"
 #define NM_OPENSWAN_PSK_VALUE "pskvalue"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]