plugin load configuration in strongswan.conf

some components accept a "component.load" option with a space separated list of plugins to load
  libcharon- plugins are now handled the same way as libstrongswan- plugins
This commit is contained in:
Martin Willi
2008-05-15 14:01:26 +00:00
parent 84770ded1e
commit a3d92a3745
21 changed files with 169 additions and 118 deletions
+18 -17
View File
@@ -175,7 +175,8 @@ static void destroy(private_daemon_t *this)
{
this->public.ike_sa_manager->flush(this->public.ike_sa_manager);
}
DESTROY_IF(this->public.plugins);
/* unload plugins to release threads */
lib->plugins->unload(lib->plugins);
DESTROY_IF(this->public.ike_sa_manager);
DESTROY_IF(this->public.kernel_interface);
DESTROY_IF(this->public.scheduler);
@@ -367,24 +368,28 @@ static bool initialize(private_daemon_t *this, bool syslog, level_t levels[])
return FALSE;
}
#endif /* INTEGRITY_TEST */
/* load secrets, ca certificates and crls */
this->public.processor = processor_create();
this->public.scheduler = scheduler_create();
this->public.credentials = credential_manager_create();
this->public.controller = controller_create();
this->public.eap = eap_manager_create();
this->public.backends = backend_manager_create();
this->public.attributes = attribute_manager_create();
this->public.kernel_interface = kernel_interface_create();
this->public.socket = socket_create();
/* load plugins, further infrastructure may need it */
lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
lib->settings->get_str(lib->settings, "charon.load",
"aes des gmp hmac md5 random sha1 sha2 pubkey x509 xcbc stroke"));
this->public.ike_sa_manager = ike_sa_manager_create();
if (this->public.ike_sa_manager == NULL)
{
return FALSE;
}
this->public.processor = processor_create();
this->public.scheduler = scheduler_create();
/* load secrets, ca certificates and crls */
this->public.credentials = credential_manager_create();
this->public.controller = controller_create();
this->public.eap = eap_manager_create();
this->public.backends = backend_manager_create();
this->public.attributes = attribute_manager_create();
this->public.plugins = plugin_loader_create();
this->public.kernel_interface = kernel_interface_create();
this->public.socket = socket_create();
this->public.sender = sender_create();
this->public.receiver = receiver_create();
if (this->public.receiver == NULL)
@@ -400,8 +405,6 @@ static bool initialize(private_daemon_t *this, bool syslog, level_t levels[])
}
this->public.mediation_manager = mediation_manager_create();
#endif /* ME */
this->public.plugins->load(this->public.plugins, IPSEC_PLUGINDIR, "libcharon-");
return TRUE;
}
@@ -460,7 +463,6 @@ private_daemon_t *daemon_create(void)
this->public.processor = NULL;
this->public.controller = NULL;
this->public.eap = NULL;
this->public.plugins = NULL;
this->public.bus = NULL;
this->public.outlog = NULL;
this->public.syslog = NULL;
@@ -529,7 +531,6 @@ int main(int argc, char *argv[])
/* initialize library */
library_init(STRONGSWAN_CONF);
lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, "libstrongswan-");
lib->printf_hook->add_handler(lib->printf_hook, 'R',
traffic_selector_get_printf_hooks());
private_charon = daemon_create();
-6
View File
@@ -163,7 +163,6 @@ typedef struct daemon_t daemon_t;
#include <config/attributes/attribute_manager.h>
#include <credentials/credential_manager.h>
#include <sa/authenticators/eap/eap_manager.h>
#include <plugins/plugin_loader.h>
#ifdef ME
#include <sa/connect_manager.h>
@@ -251,11 +250,6 @@ struct daemon_t {
*/
bus_t *bus;
/**
* plugin loader
*/
plugin_loader_t *plugins;
/**
* A bus listener logging to stdout
*/
+4 -4
View File
@@ -3,9 +3,9 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon ${dbus_C
AM_CFLAGS = -rdynamic
plugin_LTLIBRARIES = libcharon-dbus.la
plugin_LTLIBRARIES = libstrongswan-dbus.la
libcharon_dbus_la_SOURCES = dbus.h dbus.c
libcharon_dbus_la_LDFLAGS = -module
libcharon_dbus_la_LIBADD = ${dbus_LIBS}
libstrongswan_dbus_la_SOURCES = dbus.h dbus.c
libstrongswan_dbus_la_LDFLAGS = -module
libstrongswan_dbus_la_LIBADD = ${dbus_LIBS}
+4 -4
View File
@@ -3,9 +3,9 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon
AM_CFLAGS = -rdynamic
plugin_LTLIBRARIES = libcharon-eapaka.la
plugin_LTLIBRARIES = libstrongswan-eapaka.la
libcharon_eapaka_la_SOURCES = eap_aka_plugin.h eap_aka_plugin.c eap_aka.h eap_aka.c
libcharon_eapaka_la_LDFLAGS = -module
libcharon_eapaka_la_LIBADD = -lgmp
libstrongswan_eapaka_la_SOURCES = eap_aka_plugin.h eap_aka_plugin.c eap_aka.h eap_aka.c
libstrongswan_eapaka_la_LDFLAGS = -module
libstrongswan_eapaka_la_LIBADD = -lgmp
+3 -3
View File
@@ -3,8 +3,8 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon
AM_CFLAGS = -rdynamic
plugin_LTLIBRARIES = libcharon-eapidentity.la
libcharon_eapidentity_la_SOURCES = \
plugin_LTLIBRARIES = libstrongswan-eapidentity.la
libstrongswan_eapidentity_la_SOURCES = \
eap_identity_plugin.h eap_identity_plugin.c eap_identity.h eap_identity.c
libcharon_eapidentity_la_LDFLAGS = -module
libstrongswan_eapidentity_la_LDFLAGS = -module
+3 -3
View File
@@ -3,8 +3,8 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon
AM_CFLAGS = -rdynamic
plugin_LTLIBRARIES = libcharon-eapmd5.la
plugin_LTLIBRARIES = libstrongswan-eapmd5.la
libcharon_eapmd5_la_SOURCES = eap_md5_plugin.h eap_md5_plugin.c eap_md5.h eap_md5.c
libcharon_eapmd5_la_LDFLAGS = -module
libstrongswan_eapmd5_la_SOURCES = eap_md5_plugin.h eap_md5_plugin.c eap_md5.h eap_md5.c
libstrongswan_eapmd5_la_LDFLAGS = -module
+3 -3
View File
@@ -3,10 +3,10 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon
AM_CFLAGS = -rdynamic -DIPSEC_CONFDIR=\"${confdir}\" -DSIM_READER_LIB=\"${simreader}\"
plugin_LTLIBRARIES = libcharon-eapsim.la libeapsim-file.la
plugin_LTLIBRARIES = libstrongswan-eapsim.la libeapsim-file.la
libcharon_eapsim_la_SOURCES = eap_sim_plugin.h eap_sim_plugin.c eap_sim.h eap_sim.c
libcharon_eapsim_la_LDFLAGS = -module
libstrongswan_eapsim_la_SOURCES = eap_sim_plugin.h eap_sim_plugin.c eap_sim.h eap_sim.c
libstrongswan_eapsim_la_LDFLAGS = -module
libeapsim_file_la_SOURCES = eap_sim_file.c
libeapsim_file_la_LDFLAGS = -module
+3 -3
View File
@@ -3,9 +3,9 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon
AM_CFLAGS = -rdynamic
plugin_LTLIBRARIES = libcharon-medcli.la
libcharon_medcli_la_SOURCES = medcli_plugin.h medcli_plugin.c \
plugin_LTLIBRARIES = libstrongswan-medcli.la
libstrongswan_medcli_la_SOURCES = medcli_plugin.h medcli_plugin.c \
medcli_creds.h medcli_creds.c \
medcli_config.h medcli_config.c
libcharon_medcli_la_LDFLAGS = -module
libstrongswan_medcli_la_LDFLAGS = -module
+3 -3
View File
@@ -3,9 +3,9 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon
AM_CFLAGS = -rdynamic
plugin_LTLIBRARIES = libcharon-medsrv.la
libcharon_medsrv_la_SOURCES = medsrv_plugin.h medsrv_plugin.c \
plugin_LTLIBRARIES = libstrongswan-medsrv.la
libstrongswan_medsrv_la_SOURCES = medsrv_plugin.h medsrv_plugin.c \
medsrv_creds.h medsrv_creds.c \
medsrv_config.h medsrv_config.c
libcharon_medsrv_la_LDFLAGS = -module
libstrongswan_medsrv_la_LDFLAGS = -module
+4 -4
View File
@@ -3,8 +3,8 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon ${xml_CF
AM_CFLAGS = -rdynamic -DIPSEC_PIDDIR=\"${piddir}\"
plugin_LTLIBRARIES = libcharon-smp.la
libcharon_smp_la_SOURCES = smp.h smp.c
libcharon_smp_la_LDFLAGS = -module
libcharon_smp_la_LIBADD = ${xml_LIBS}
plugin_LTLIBRARIES = libstrongswan-smp.la
libstrongswan_smp_la_SOURCES = smp.h smp.c
libstrongswan_smp_la_LDFLAGS = -module
libstrongswan_smp_la_LIBADD = ${xml_LIBS}
+3 -3
View File
@@ -3,11 +3,11 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon
AM_CFLAGS = -rdynamic -DIPSEC_PLUGINDIR=\"${plugindir}\"
plugin_LTLIBRARIES = libcharon-sql.la
libcharon_sql_la_SOURCES = sql_plugin.h sql_plugin.c \
plugin_LTLIBRARIES = libstrongswan-sql.la
libstrongswan_sql_la_SOURCES = sql_plugin.h sql_plugin.c \
sql_config.h sql_config.c sql_cred.h sql_cred.c \
sql_attribute.h sql_attribute.c sql_logger.h sql_logger.c
libcharon_sql_la_LDFLAGS = -module
libstrongswan_sql_la_LDFLAGS = -module
ipsec_PROGRAMS = pool
pool_SOURCES = pool.c
+3 -2
View File
@@ -358,8 +358,9 @@ int main(int argc, char *argv[])
dbg = dbg_stderr;
library_init(STRONGSWAN_CONF);
atexit(library_deinit);
lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, "libstrongswan-");
lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
lib->settings->get_str(lib->settings, "pool.load",
"sqlite mysql"));
uri = lib->settings->get_str(lib->settings, "charon.plugins.sql.database", NULL);
if (!uri)
+3 -3
View File
@@ -3,9 +3,9 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon -I$(top_
AM_CFLAGS = -rdynamic -DIPSEC_CONFDIR=\"${confdir}\" -DIPSEC_PIDDIR=\"${piddir}\"
plugin_LTLIBRARIES = libcharon-stroke.la
plugin_LTLIBRARIES = libstrongswan-stroke.la
libcharon_stroke_la_SOURCES = stroke_plugin.h stroke_plugin.c \
libstrongswan_stroke_la_SOURCES = stroke_plugin.h stroke_plugin.c \
stroke_socket.h stroke_socket.c \
stroke_config.h stroke_config.c \
stroke_control.h stroke_control.c \
@@ -15,5 +15,5 @@ libcharon_stroke_la_SOURCES = stroke_plugin.h stroke_plugin.c \
stroke_list.h stroke_list.c \
stroke_shared_key.h stroke_shared_key.c
libcharon_stroke_la_LDFLAGS = -module
libstrongswan_stroke_la_LDFLAGS = -module
+3 -3
View File
@@ -3,9 +3,9 @@ INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon
AM_CFLAGS = -rdynamic
plugin_LTLIBRARIES = libcharon-unit-tester.la
plugin_LTLIBRARIES = libstrongswan-unit-tester.la
libcharon_unit_tester_la_SOURCES = unit_tester.c unit_tester.h \
libstrongswan_unit_tester_la_SOURCES = unit_tester.c unit_tester.h \
tests/test_enumerator.c \
tests/test_auth_info.c \
tests/test_fips_prf.c \
@@ -17,5 +17,5 @@ libcharon_unit_tester_la_SOURCES = unit_tester.c unit_tester.h \
tests/test_med_db.c \
tests/test_aes.c \
tests/test_chunk.c
libcharon_unit_tester_la_LDFLAGS = -module
libstrongswan_unit_tester_la_LDFLAGS = -module