Provide plugin list from charon, not internally in libcharon.

This commit is contained in:
Tobias Brunner 2012-04-19 13:32:51 +02:00
parent 2ee11fd42d
commit 94b48e071a
8 changed files with 125 additions and 123 deletions

View File

@ -787,7 +787,7 @@ dnl ==============================================
m4_include(m4/macros/add-plugin.m4)
# plugin lists for all components
libcharon_plugins=
charon_plugins=
pluto_plugins=
starter_plugins=
pool_plugins=
@ -806,105 +806,105 @@ p_plugins=
h_plugins=
s_plugins=
ADD_PLUGIN([test-vectors], [s libcharon pluto openac scepclient pki])
ADD_PLUGIN([curl], [s libcharon pluto scepclient scripts])
ADD_PLUGIN([soup], [s libcharon pluto scripts])
ADD_PLUGIN([ldap], [s libcharon pluto scepclient scripts])
ADD_PLUGIN([mysql], [s libcharon pluto pool manager medsrv attest])
ADD_PLUGIN([sqlite], [s libcharon pluto pool manager medsrv attest])
ADD_PLUGIN([pkcs11], [s libcharon pki])
ADD_PLUGIN([aes], [s libcharon pluto openac scepclient pki scripts])
ADD_PLUGIN([des], [s libcharon pluto openac scepclient pki scripts])
ADD_PLUGIN([blowfish], [s libcharon pluto openac scepclient pki scripts])
ADD_PLUGIN([sha1], [s libcharon pluto openac scepclient pki scripts medsrv attest])
ADD_PLUGIN([sha2], [s libcharon pluto openac scepclient pki scripts medsrv attest])
ADD_PLUGIN([md4], [s libcharon openac manager scepclient pki])
ADD_PLUGIN([md5], [s libcharon pluto openac scepclient pki scripts attest])
ADD_PLUGIN([random], [s libcharon pluto openac scepclient pki scripts medsrv attest])
ADD_PLUGIN([x509], [s libcharon pluto openac scepclient pki scripts attest])
ADD_PLUGIN([revocation], [s libcharon])
ADD_PLUGIN([constraints], [s libcharon])
ADD_PLUGIN([pubkey], [s libcharon])
ADD_PLUGIN([pkcs1], [s libcharon pluto openac scepclient pki scripts manager medsrv attest])
ADD_PLUGIN([pkcs8], [s libcharon pluto openac scepclient pki scripts manager medsrv attest])
ADD_PLUGIN([pgp], [s libcharon pluto])
ADD_PLUGIN([test-vectors], [s charon pluto openac scepclient pki])
ADD_PLUGIN([curl], [s charon pluto scepclient scripts])
ADD_PLUGIN([soup], [s charon pluto scripts])
ADD_PLUGIN([ldap], [s charon pluto scepclient scripts])
ADD_PLUGIN([mysql], [s charon pluto pool manager medsrv attest])
ADD_PLUGIN([sqlite], [s charon pluto pool manager medsrv attest])
ADD_PLUGIN([pkcs11], [s charon pki])
ADD_PLUGIN([aes], [s charon pluto openac scepclient pki scripts])
ADD_PLUGIN([des], [s charon pluto openac scepclient pki scripts])
ADD_PLUGIN([blowfish], [s charon pluto openac scepclient pki scripts])
ADD_PLUGIN([sha1], [s charon pluto openac scepclient pki scripts medsrv attest])
ADD_PLUGIN([sha2], [s charon pluto openac scepclient pki scripts medsrv attest])
ADD_PLUGIN([md4], [s charon openac manager scepclient pki])
ADD_PLUGIN([md5], [s charon pluto openac scepclient pki scripts attest])
ADD_PLUGIN([random], [s charon pluto openac scepclient pki scripts medsrv attest])
ADD_PLUGIN([x509], [s charon pluto openac scepclient pki scripts attest])
ADD_PLUGIN([revocation], [s charon])
ADD_PLUGIN([constraints], [s charon])
ADD_PLUGIN([pubkey], [s charon])
ADD_PLUGIN([pkcs1], [s charon pluto openac scepclient pki scripts manager medsrv attest])
ADD_PLUGIN([pkcs8], [s charon pluto openac scepclient pki scripts manager medsrv attest])
ADD_PLUGIN([pgp], [s charon pluto])
ADD_PLUGIN([dnskey], [s pluto])
ADD_PLUGIN([pem], [s libcharon pluto openac scepclient pki scripts manager medsrv attest])
ADD_PLUGIN([padlock], [s libcharon])
ADD_PLUGIN([openssl], [s libcharon pluto openac scepclient pki scripts manager medsrv attest])
ADD_PLUGIN([gcrypt], [s libcharon pluto openac scepclient pki scripts manager medsrv attest])
ADD_PLUGIN([af-alg], [s libcharon pluto openac scepclient pki scripts medsrv attest])
ADD_PLUGIN([fips-prf], [s libcharon])
ADD_PLUGIN([gmp], [s libcharon pluto openac scepclient pki scripts manager medsrv attest])
ADD_PLUGIN([agent], [s libcharon])
ADD_PLUGIN([xcbc], [s libcharon])
ADD_PLUGIN([cmac], [s libcharon])
ADD_PLUGIN([hmac], [s libcharon pluto scripts])
ADD_PLUGIN([ctr], [s libcharon scripts])
ADD_PLUGIN([ccm], [s libcharon scripts])
ADD_PLUGIN([gcm], [s libcharon scripts])
ADD_PLUGIN([pem], [s charon pluto openac scepclient pki scripts manager medsrv attest])
ADD_PLUGIN([padlock], [s charon])
ADD_PLUGIN([openssl], [s charon pluto openac scepclient pki scripts manager medsrv attest])
ADD_PLUGIN([gcrypt], [s charon pluto openac scepclient pki scripts manager medsrv attest])
ADD_PLUGIN([af-alg], [s charon pluto openac scepclient pki scripts medsrv attest])
ADD_PLUGIN([fips-prf], [s charon])
ADD_PLUGIN([gmp], [s charon pluto openac scepclient pki scripts manager medsrv attest])
ADD_PLUGIN([agent], [s charon])
ADD_PLUGIN([xcbc], [s charon])
ADD_PLUGIN([cmac], [s charon])
ADD_PLUGIN([hmac], [s charon pluto scripts])
ADD_PLUGIN([ctr], [s charon scripts])
ADD_PLUGIN([ccm], [s charon scripts])
ADD_PLUGIN([gcm], [s charon scripts])
ADD_PLUGIN([xauth], [p pluto])
ADD_PLUGIN([attr], [h libcharon pluto])
ADD_PLUGIN([attr-sql], [h libcharon pluto])
ADD_PLUGIN([load-tester], [c libcharon])
ADD_PLUGIN([kernel-pfkey], [h libcharon pluto starter])
ADD_PLUGIN([kernel-pfroute], [h libcharon pluto starter])
ADD_PLUGIN([kernel-klips], [h libcharon pluto starter])
ADD_PLUGIN([kernel-netlink], [h libcharon pluto starter])
ADD_PLUGIN([resolve], [h libcharon pluto])
ADD_PLUGIN([socket-default], [c libcharon])
ADD_PLUGIN([socket-raw], [c libcharon])
ADD_PLUGIN([socket-dynamic], [c libcharon])
ADD_PLUGIN([farp], [c libcharon])
ADD_PLUGIN([stroke], [c libcharon])
ADD_PLUGIN([smp], [c libcharon])
ADD_PLUGIN([sql], [c libcharon])
ADD_PLUGIN([updown], [c libcharon])
ADD_PLUGIN([eap-identity], [c libcharon])
ADD_PLUGIN([eap-sim], [c libcharon])
ADD_PLUGIN([eap-sim-file], [c libcharon])
ADD_PLUGIN([eap-sim-pcsc], [c libcharon])
ADD_PLUGIN([eap-aka], [c libcharon])
ADD_PLUGIN([eap-aka-3gpp2], [c libcharon])
ADD_PLUGIN([eap-simaka-sql], [c libcharon])
ADD_PLUGIN([eap-simaka-pseudonym], [c libcharon])
ADD_PLUGIN([eap-simaka-reauth], [c libcharon])
ADD_PLUGIN([eap-md5], [c libcharon])
ADD_PLUGIN([eap-gtc], [c libcharon])
ADD_PLUGIN([eap-mschapv2], [c libcharon])
ADD_PLUGIN([eap-radius], [c libcharon])
ADD_PLUGIN([eap-tls], [c libcharon])
ADD_PLUGIN([eap-ttls], [c libcharon])
ADD_PLUGIN([eap-peap], [c libcharon])
ADD_PLUGIN([eap-tnc], [c libcharon])
ADD_PLUGIN([xauth-generic], [c libcharon])
ADD_PLUGIN([xauth-eap], [c libcharon])
ADD_PLUGIN([tnc-ifmap], [c libcharon])
ADD_PLUGIN([tnc-pdp], [c libcharon])
ADD_PLUGIN([tnc-imc], [c libcharon])
ADD_PLUGIN([tnc-imv], [c libcharon])
ADD_PLUGIN([tnc-tnccs], [c libcharon])
ADD_PLUGIN([tnccs-20], [c libcharon])
ADD_PLUGIN([tnccs-11], [c libcharon])
ADD_PLUGIN([tnccs-dynamic], [c libcharon])
ADD_PLUGIN([medsrv], [c libcharon])
ADD_PLUGIN([medcli], [c libcharon])
ADD_PLUGIN([nm], [c libcharon])
ADD_PLUGIN([dhcp], [c libcharon])
ADD_PLUGIN([android], [c libcharon])
ADD_PLUGIN([ha], [c libcharon])
ADD_PLUGIN([whitelist], [c libcharon])
ADD_PLUGIN([certexpire], [c libcharon])
ADD_PLUGIN([led], [c libcharon])
ADD_PLUGIN([duplicheck], [c libcharon])
ADD_PLUGIN([coupling], [c libcharon])
ADD_PLUGIN([radattr], [c libcharon])
ADD_PLUGIN([maemo], [c libcharon])
ADD_PLUGIN([uci], [c libcharon])
ADD_PLUGIN([addrblock], [c libcharon])
ADD_PLUGIN([unit-tester], [c libcharon])
ADD_PLUGIN([attr], [h charon pluto])
ADD_PLUGIN([attr-sql], [h charon pluto])
ADD_PLUGIN([load-tester], [c charon])
ADD_PLUGIN([kernel-pfkey], [h charon pluto starter])
ADD_PLUGIN([kernel-pfroute], [h charon pluto starter])
ADD_PLUGIN([kernel-klips], [h charon pluto starter])
ADD_PLUGIN([kernel-netlink], [h charon pluto starter])
ADD_PLUGIN([resolve], [h charon pluto])
ADD_PLUGIN([socket-default], [c charon])
ADD_PLUGIN([socket-raw], [c charon])
ADD_PLUGIN([socket-dynamic], [c charon])
ADD_PLUGIN([farp], [c charon])
ADD_PLUGIN([stroke], [c charon])
ADD_PLUGIN([smp], [c charon])
ADD_PLUGIN([sql], [c charon])
ADD_PLUGIN([updown], [c charon])
ADD_PLUGIN([eap-identity], [c charon])
ADD_PLUGIN([eap-sim], [c charon])
ADD_PLUGIN([eap-sim-file], [c charon])
ADD_PLUGIN([eap-sim-pcsc], [c charon])
ADD_PLUGIN([eap-aka], [c charon])
ADD_PLUGIN([eap-aka-3gpp2], [c charon])
ADD_PLUGIN([eap-simaka-sql], [c charon])
ADD_PLUGIN([eap-simaka-pseudonym], [c charon])
ADD_PLUGIN([eap-simaka-reauth], [c charon])
ADD_PLUGIN([eap-md5], [c charon])
ADD_PLUGIN([eap-gtc], [c charon])
ADD_PLUGIN([eap-mschapv2], [c charon])
ADD_PLUGIN([eap-radius], [c charon])
ADD_PLUGIN([eap-tls], [c charon])
ADD_PLUGIN([eap-ttls], [c charon])
ADD_PLUGIN([eap-peap], [c charon])
ADD_PLUGIN([eap-tnc], [c charon])
ADD_PLUGIN([xauth-generic], [c charon])
ADD_PLUGIN([xauth-eap], [c charon])
ADD_PLUGIN([tnc-ifmap], [c charon])
ADD_PLUGIN([tnc-pdp], [c charon])
ADD_PLUGIN([tnc-imc], [c charon])
ADD_PLUGIN([tnc-imv], [c charon])
ADD_PLUGIN([tnc-tnccs], [c charon])
ADD_PLUGIN([tnccs-20], [c charon])
ADD_PLUGIN([tnccs-11], [c charon])
ADD_PLUGIN([tnccs-dynamic], [c charon])
ADD_PLUGIN([medsrv], [c charon])
ADD_PLUGIN([medcli], [c charon])
ADD_PLUGIN([nm], [c charon])
ADD_PLUGIN([dhcp], [c charon])
ADD_PLUGIN([android], [c charon])
ADD_PLUGIN([ha], [c charon])
ADD_PLUGIN([whitelist], [c charon])
ADD_PLUGIN([certexpire], [c charon])
ADD_PLUGIN([led], [c charon])
ADD_PLUGIN([duplicheck], [c charon])
ADD_PLUGIN([coupling], [c charon])
ADD_PLUGIN([radattr], [c charon])
ADD_PLUGIN([maemo], [c charon])
ADD_PLUGIN([uci], [c charon])
ADD_PLUGIN([addrblock], [c charon])
ADD_PLUGIN([unit-tester], [c charon])
AC_SUBST(libcharon_plugins)
AC_SUBST(charon_plugins)
AC_SUBST(pluto_plugins)
AC_SUBST(starter_plugins)
AC_SUBST(pool_plugins)

View File

@ -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

View File

@ -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 \

View File

@ -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;

View File

@ -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

View File

@ -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)

View File

@ -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;
}

View File

@ -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.