aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2012-04-19 13:32:51 +0200
committerTobias Brunner <tobias@strongswan.org>2012-05-03 13:14:07 +0200
commit94b48e071a6014390fd554f186ce2a2a1bb2464a (patch)
treeda9ba3cea1e834187e3f640f0e3583b378d92b39 /src
parent2ee11fd42d78f05140404864f3ce25b2608d2102 (diff)
downloadstrongswan-94b48e071a6014390fd554f186ce2a2a1bb2464a.tar.bz2
strongswan-94b48e071a6014390fd554f186ce2a2a1bb2464a.tar.xz
Provide plugin list from charon, not internally in libcharon.
Diffstat (limited to 'src')
-rw-r--r--src/charon/Android.mk3
-rw-r--r--src/charon/Makefile.am3
-rw-r--r--src/charon/charon.c15
-rw-r--r--src/libcharon/Android.mk3
-rwxr-xr-xsrc/libcharon/Makefile.am3
-rw-r--r--src/libcharon/daemon.c18
-rw-r--r--src/libcharon/daemon.h9
7 files changed, 28 insertions, 26 deletions
diff --git a/src/charon/Android.mk b/src/charon/Android.mk
index eb7eca9dd..1dd27d534 100644
--- a/src/charon/Android.mk
+++ b/src/charon/Android.mk
@@ -13,7 +13,8 @@ LOCAL_C_INCLUDES += \
$(strongswan_PATH)/src/libcharon \
$(strongswan_PATH)/src/libstrongswan
-LOCAL_CFLAGS := $(strongswan_CFLAGS)
+LOCAL_CFLAGS := $(strongswan_CFLAGS) \
+ -DPLUGINS='"$(strongswan_CHARON_PLUGINS)"'
LOCAL_MODULE := charon
diff --git a/src/charon/Makefile.am b/src/charon/Makefile.am
index 6481947f1..cbc533b93 100644
--- a/src/charon/Makefile.am
+++ b/src/charon/Makefile.am
@@ -10,7 +10,8 @@ INCLUDES = \
AM_CFLAGS = \
-DIPSEC_DIR=\"${ipsecdir}\" \
- -DIPSEC_PIDDIR=\"${piddir}\"
+ -DIPSEC_PIDDIR=\"${piddir}\" \
+ -DPLUGINS=\""${charon_plugins}\""
charon_LDADD = \
$(top_builddir)/src/libstrongswan/libstrongswan.la \
diff --git a/src/charon/charon.c b/src/charon/charon.c
index 48fb26245..9211a63c2 100644
--- a/src/charon/charon.c
+++ b/src/charon/charon.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006-2010 Tobias Brunner
+ * Copyright (C) 2006-2012 Tobias Brunner
* Copyright (C) 2005-2009 Martin Willi
* Copyright (C) 2006 Daniel Roethlisberger
* Copyright (C) 2005 Jan Hutter
@@ -550,8 +550,19 @@ int main(int argc, char *argv[])
initialize_loggers(!use_syslog, levels);
+ DBG1(DBG_DMN, "Starting IKEv2 charon daemon (strongSwan "VERSION")");
+ if (lib->integrity)
+ {
+ DBG1(DBG_DMN, "integrity tests enabled:");
+ DBG1(DBG_DMN, "lib 'libstrongswan': passed file and segment integrity tests");
+ DBG1(DBG_DMN, "lib 'libhydra': passed file and segment integrity tests");
+ DBG1(DBG_DMN, "lib 'libcharon': passed file and segment integrity tests");
+ DBG1(DBG_DMN, "daemon 'charon': passed file integrity test");
+ }
+
/* initialize daemon */
- if (!charon->initialize(charon))
+ if (!charon->initialize(charon,
+ lib->settings->get_str(lib->settings, "charon.load", PLUGINS)))
{
DBG1(DBG_DMN, "initialization failed - aborting charon");
goto deinit;
diff --git a/src/libcharon/Android.mk b/src/libcharon/Android.mk
index dffe519ac..a7669ab83 100644
--- a/src/libcharon/Android.mk
+++ b/src/libcharon/Android.mk
@@ -168,8 +168,7 @@ LOCAL_C_INCLUDES += \
$(strongswan_PATH)/src/libstrongswan \
$(strongswan_PATH)/src/libtncif
-LOCAL_CFLAGS := $(strongswan_CFLAGS) \
- -DPLUGINS='"$(strongswan_CHARON_PLUGINS)"'
+LOCAL_CFLAGS := $(strongswan_CFLAGS)
LOCAL_MODULE := libcharon
diff --git a/src/libcharon/Makefile.am b/src/libcharon/Makefile.am
index f97984317..8b16de187 100755
--- a/src/libcharon/Makefile.am
+++ b/src/libcharon/Makefile.am
@@ -133,8 +133,7 @@ INCLUDES = \
AM_CFLAGS = \
-DIPSEC_DIR=\"${ipsecdir}\" \
- -DIPSEC_PIDDIR=\"${piddir}\" \
- -DPLUGINS=\""${libcharon_plugins}\""
+ -DIPSEC_PIDDIR=\"${piddir}\"
libcharon_la_LIBADD = -lm $(PTHREADLIB) $(DLLIB) $(SOCKLIB)
diff --git a/src/libcharon/daemon.c b/src/libcharon/daemon.c
index ee2db3318..c6238ebab 100644
--- a/src/libcharon/daemon.c
+++ b/src/libcharon/daemon.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006-2010 Tobias Brunner
+ * Copyright (C) 2006-2012 Tobias Brunner
* Copyright (C) 2005-2009 Martin Willi
* Copyright (C) 2006 Daniel Roethlisberger
* Copyright (C) 2005 Jan Hutter
@@ -207,22 +207,10 @@ METHOD(daemon_t, start, void,
}
METHOD(daemon_t, initialize, bool,
- private_daemon_t *this)
+ private_daemon_t *this, char *plugins)
{
- DBG1(DBG_DMN, "Starting IKEv2 charon daemon (strongSwan "VERSION")");
-
- if (lib->integrity)
- {
- DBG1(DBG_DMN, "integrity tests enabled:");
- DBG1(DBG_DMN, "lib 'libstrongswan': passed file and segment integrity tests");
- DBG1(DBG_DMN, "lib 'libhydra': passed file and segment integrity tests");
- DBG1(DBG_DMN, "lib 'libcharon': passed file and segment integrity tests");
- DBG1(DBG_DMN, "daemon 'charon': passed file integrity test");
- }
-
/* load plugins, further infrastructure may need it */
- if (!lib->plugins->load(lib->plugins, NULL,
- lib->settings->get_str(lib->settings, "charon.load", PLUGINS)))
+ if (!lib->plugins->load(lib->plugins, NULL, plugins))
{
return FALSE;
}
diff --git a/src/libcharon/daemon.h b/src/libcharon/daemon.h
index bfbf774ff..ad9ab4cd2 100644
--- a/src/libcharon/daemon.h
+++ b/src/libcharon/daemon.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006-2010 Tobias Brunner
+ * Copyright (C) 2006-2012 Tobias Brunner
* Copyright (C) 2005-2009 Martin Willi
* Copyright (C) 2006 Daniel Roethlisberger
* Copyright (C) 2005 Jan Hutter
@@ -279,14 +279,17 @@ struct daemon_t {
* This should be called after the initialization of the daemon because
* some plugins require the process to keep additional capabilities.
*
- * @return TRUE if successful, FALSE otherwise
+ * @return TRUE, if successful
*/
bool (*drop_capabilities)(daemon_t *this);
/**
* Initialize the daemon.
+ *
+ * @param plugins list of plugins to load
+ * @return TRUE, if successful
*/
- bool (*initialize)(daemon_t *this);
+ bool (*initialize)(daemon_t *this, char *plugins);
/**
* Starts the daemon, i.e. spawns the threads of the thread pool.