From 64ff7a5142dbd536f84dfdd6a2dc788ec88a57e8 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Mon, 3 Nov 2008 09:44:54 +0000 Subject: [PATCH] log loaded plugins at startup --- src/charon/daemon.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/charon/daemon.c b/src/charon/daemon.c index 3bfb32d25..ea6766627 100644 --- a/src/charon/daemon.c +++ b/src/charon/daemon.c @@ -316,6 +316,24 @@ static void lookup_uid_gid(private_daemon_t *this) #endif } +/** + * Log loaded plugins + */ +static void print_plugins() +{ + char buf[512], *plugin; + int len = 0; + enumerator_t *enumerator; + + enumerator = lib->plugins->create_plugin_enumerator(lib->plugins); + while (len < sizeof(buf) && enumerator->enumerate(enumerator, &plugin)) + { + len += snprintf(&buf[len], sizeof(buf)-len, "%s ", plugin); + } + enumerator->destroy(enumerator); + DBG1(DBG_DMN, "loaded plugins: %s", buf); +} + /** * Initialize the daemon */ @@ -368,6 +386,8 @@ static bool initialize(private_daemon_t *this, bool syslog, level_t levels[]) lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, lib->settings->get_str(lib->settings, "charon.load", PLUGINS)); + print_plugins(); + /* create the kernel interfaces */ this->public.kernel_interface->create_interfaces(this->public.kernel_interface);