]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Plugin enumerator enumerates over loaded features, too
authorMartin Willi <martin@revosec.ch>
Wed, 29 Jun 2011 12:49:32 +0000 (14:49 +0200)
committerMartin Willi <martin@revosec.ch>
Fri, 14 Oct 2011 08:05:44 +0000 (10:05 +0200)
src/libcharon/daemon.c
src/libcharon/plugins/stroke/stroke_list.c
src/libstrongswan/plugins/plugin_loader.c
src/libstrongswan/plugins/plugin_loader.h
src/pluto/log.c
src/pluto/plutomain.c
src/scepclient/scepclient.c

index a108cd4efeea556a5ec7dee80f23c093d99ea82f..9412fee7c88aa0b33e228503f9a5b4ff5dd66bd8 100644 (file)
@@ -214,7 +214,7 @@ static void print_plugins()
 
        buf[0] = '\0';
        enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
-       while (len < sizeof(buf) && enumerator->enumerate(enumerator, &plugin))
+       while (len < sizeof(buf) && enumerator->enumerate(enumerator, &plugin, NULL))
        {
                len += snprintf(&buf[len], sizeof(buf)-len, "%s ",
                                                plugin->get_name(plugin));
index 485c7b31374bb41491e68311dc522f87f78eaa1c..8ceb8b4ca898150f15cb5f510a8c158db10f4e34 100644 (file)
@@ -451,7 +451,7 @@ METHOD(stroke_list_t, status, void,
                                lib->scheduler->get_job_load(lib->scheduler));
                fprintf(out, "  loaded plugins: ");
                enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
-               while (enumerator->enumerate(enumerator, &plugin))
+               while (enumerator->enumerate(enumerator, &plugin, NULL))
                {
                        fprintf(out, "%s ", plugin->get_name(plugin));
                }
index 26af529d407d878146a5f746b406be9a5258c328..cd942a7e0a4c3032480a991191f1cb7fc76706ca 100644 (file)
@@ -177,9 +177,14 @@ static bool load_plugin(private_plugin_loader_t *this, char *name, char *file)
 /**
  * Convert enumerated entries to plugin_t
  */
-static bool plugin_filter(void *null, plugin_entry_t **entry, plugin_t **plugin)
+static bool plugin_filter(void *null, plugin_entry_t **entry, plugin_t **plugin,
+                                                 void *in, linked_list_t **list)
 {
        *plugin = (*entry)->plugin;
+       if (list)
+       {
+               *list = (*entry)->loaded;
+       }
        return TRUE;
 }
 
index e03da4543f5792dc68080a4f62d62baf1c1d22fa..ea36bb147b66c7cca4e70f2d22b307c394dd239b 100644 (file)
@@ -59,7 +59,11 @@ struct plugin_loader_t {
        /**
         * Create an enumerator over all loaded plugins.
         *
-        * @return                              enumerator over plugin_t*
+        * In addition to the plugin, a to read-only list is enumerated (if it is
+        * not NULL). This list contains pointer to plugin features currently
+        * loaded.
+        *
+        * @return                              enumerator over plugin_t*, linked_list_t*
         */
        enumerator_t* (*create_plugin_enumerator)(plugin_loader_t *this);
 
index c5f1776ec8d97c16f29b1083b817d717de2c9388..1f5eafd9af8c1f9f26e3deae1d271cc99b7e604c 100644 (file)
@@ -841,7 +841,7 @@ static void show_loaded_plugins()
 
        buf[0] = '\0';
        enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
-       while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin))
+       while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin, NULL))
        {
                len += snprintf(&buf[len], BUF_LEN-len, "%s ", plugin->get_name(plugin));
        }
index b1ec7cb5635f9082c3b3b14034bb9d6dd093d47e..8aead3e3c4780a262e4ba62591443015adb69cb8 100644 (file)
@@ -271,7 +271,7 @@ static void print_plugins()
 
        buf[0] = '\0';
        enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
-       while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin))
+       while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin, NULL))
        {
                len += snprintf(&buf[len], BUF_LEN-len, "%s ", plugin->get_name(plugin));
        }
index 6e7125b74a9a80f231ee9f10c3ac8d6fd739cb61..6d5bf38ae09e5babdcd5297ff9e17685a8e6f877 100644 (file)
@@ -286,7 +286,7 @@ static void print_plugins()
        enumerator_t *enumerator;
 
        enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
-       while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin))
+       while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin, NULL))
        {
                len += snprintf(&buf[len], BUF_LEN-len, "%s ", plugin->get_name(plugin));
        }