summaryrefslogtreecommitdiff
path: root/src/charon-svc
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2016-03-24 11:59:32 +0100
committerYves-Alexis Perez <corsac@debian.org>2016-03-24 11:59:32 +0100
commit518dd33c94e041db0444c7d1f33da363bb8e3faf (patch)
treee8d1665ffadff7ec40228dda47e81f8f4691cd07 /src/charon-svc
parentf42f239a632306ed082f6fde878977248eea85cf (diff)
downloadvyos-strongswan-518dd33c94e041db0444c7d1f33da363bb8e3faf.tar.gz
vyos-strongswan-518dd33c94e041db0444c7d1f33da363bb8e3faf.zip
Imported Upstream version 5.4.0
Diffstat (limited to 'src/charon-svc')
-rw-r--r--src/charon-svc/Makefile.am2
-rw-r--r--src/charon-svc/Makefile.in5
-rw-r--r--src/charon-svc/charon-svc.c32
3 files changed, 19 insertions, 20 deletions
diff --git a/src/charon-svc/Makefile.am b/src/charon-svc/Makefile.am
index ecccf02f5..c91ad08f8 100644
--- a/src/charon-svc/Makefile.am
+++ b/src/charon-svc/Makefile.am
@@ -6,11 +6,9 @@ charon-svc.o : $(top_builddir)/config.status
AM_CPPFLAGS = \
-I$(top_srcdir)/src/libstrongswan \
- -I$(top_srcdir)/src/libhydra \
-I$(top_srcdir)/src/libcharon \
-DPLUGINS=\""${charon_plugins}\""
charon_svc_LDADD = \
$(top_builddir)/src/libstrongswan/libstrongswan.la \
- $(top_builddir)/src/libhydra/libhydra.la \
$(top_builddir)/src/libcharon/libcharon.la
diff --git a/src/charon-svc/Makefile.in b/src/charon-svc/Makefile.in
index 1c0a4058d..4f9143d9b 100644
--- a/src/charon-svc/Makefile.in
+++ b/src/charon-svc/Makefile.in
@@ -105,7 +105,6 @@ am_charon_svc_OBJECTS = charon-svc.$(OBJEXT)
charon_svc_OBJECTS = $(am_charon_svc_OBJECTS)
charon_svc_DEPENDENCIES = \
$(top_builddir)/src/libstrongswan/libstrongswan.la \
- $(top_builddir)/src/libhydra/libhydra.la \
$(top_builddir)/src/libcharon/libcharon.la
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -384,6 +383,8 @@ strongswan_conf = @strongswan_conf@
strongswan_options = @strongswan_options@
swanctldir = @swanctldir@
sysconfdir = @sysconfdir@
+systemd_CFLAGS = @systemd_CFLAGS@
+systemd_LIBS = @systemd_LIBS@
systemd_daemon_CFLAGS = @systemd_daemon_CFLAGS@
systemd_daemon_LIBS = @systemd_daemon_LIBS@
systemd_journal_CFLAGS = @systemd_journal_CFLAGS@
@@ -400,13 +401,11 @@ xml_LIBS = @xml_LIBS@
charon_svc_SOURCES = charon-svc.c
AM_CPPFLAGS = \
-I$(top_srcdir)/src/libstrongswan \
- -I$(top_srcdir)/src/libhydra \
-I$(top_srcdir)/src/libcharon \
-DPLUGINS=\""${charon_plugins}\""
charon_svc_LDADD = \
$(top_builddir)/src/libstrongswan/libstrongswan.la \
- $(top_builddir)/src/libhydra/libhydra.la \
$(top_builddir)/src/libcharon/libcharon.la
all: all-am
diff --git a/src/charon-svc/charon-svc.c b/src/charon-svc/charon-svc.c
index 03cbdb871..823b366c0 100644
--- a/src/charon-svc/charon-svc.c
+++ b/src/charon-svc/charon-svc.c
@@ -14,7 +14,6 @@
*/
#include <library.h>
-#include <hydra.h>
#include <daemon.h>
#include <utils/backtrace.h>
@@ -190,6 +189,15 @@ static int service_wait()
}
/**
+ * Add namespace alias
+ */
+static void __attribute__ ((constructor))register_namespace()
+{
+ /* inherit settings from charon */
+ library_add_namespace("charon");
+}
+
+/**
* Initialize and run charon using a wait function
*/
static void init_and_run(DWORD dwArgc, LPTSTR *lpszArgv, int (*wait)())
@@ -210,28 +218,22 @@ static void init_and_run(DWORD dwArgc, LPTSTR *lpszArgv, int (*wait)())
if (library_init(NULL, SERVICE_NAME))
{
update_status(SERVICE_START_PENDING);
- if (libhydra_init())
+ if (libcharon_init())
{
+ charon->load_loggers(charon, levels, TRUE);
+ print_version();
update_status(SERVICE_START_PENDING);
- if (libcharon_init())
+ if (charon->initialize(charon, PLUGINS))
{
- charon->load_loggers(charon, levels, TRUE);
- print_version();
update_status(SERVICE_START_PENDING);
- if (charon->initialize(charon, PLUGINS))
- {
- update_status(SERVICE_START_PENDING);
- lib->plugins->status(lib->plugins, LEVEL_CTRL);
+ lib->plugins->status(lib->plugins, LEVEL_CTRL);
- charon->start(charon);
+ charon->start(charon);
- status.dwWin32ExitCode = wait();
- }
- update_status(SERVICE_STOP_PENDING);
- libcharon_deinit();
+ status.dwWin32ExitCode = wait();
}
update_status(SERVICE_STOP_PENDING);
- libhydra_deinit();
+ libcharon_deinit();
}
update_status(SERVICE_STOP_PENDING);
library_deinit();