log loaded plugins at startup
authorMartin Willi <martin@strongswan.org>
Mon, 3 Nov 2008 09:44:54 +0000 (09:44 -0000)
committerMartin Willi <martin@strongswan.org>
Mon, 3 Nov 2008 09:44:54 +0000 (09:44 -0000)
src/charon/daemon.c

index 3bfb32d..ea67666 100644 (file)
@@ -317,6 +317,24 @@ static void lookup_uid_gid(private_daemon_t *this)
 }
 
 /**
+ * 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
  */
 static bool initialize(private_daemon_t *this, bool syslog, level_t levels[])
@@ -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);