summaryrefslogtreecommitdiff
path: root/src/charon-svc/charon-svc.c
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/charon-svc.c
parentf42f239a632306ed082f6fde878977248eea85cf (diff)
downloadvyos-strongswan-518dd33c94e041db0444c7d1f33da363bb8e3faf.tar.gz
vyos-strongswan-518dd33c94e041db0444c7d1f33da363bb8e3faf.zip
Imported Upstream version 5.4.0
Diffstat (limited to 'src/charon-svc/charon-svc.c')
-rw-r--r--src/charon-svc/charon-svc.c32
1 files changed, 17 insertions, 15 deletions
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();