plugin-loader: Removed unused path argument of load() method
authorTobias Brunner <tobias@strongswan.org>
Fri, 28 Jun 2013 08:44:15 +0000 (10:44 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 28 Jun 2013 08:44:15 +0000 (10:44 +0200)
Multiple additional search paths can be added with the add_path()
method.

25 files changed:
scripts/crypt_burn.c
scripts/dh_speed.c
scripts/dnssec.c
scripts/fetch.c
scripts/hash_burn.c
scripts/key2keyid.c
scripts/keyid2sql.c
scripts/pubkey_speed.c
scripts/tls_test.c
src/conftest/conftest.c
src/libcharon/daemon.c
src/libhydra/plugins/attr_sql/pool.c
src/libimcv/imcv.c
src/libimcv/imv/imv_policy_manager.c
src/libimcv/plugins/imv_os/pacman.c
src/libpts/plugins/imv_attestation/attest.c
src/libstrongswan/plugins/plugin_loader.c
src/libstrongswan/plugins/plugin_loader.h
src/libstrongswan/tests/test_runner.c
src/manager/main.c
src/medsrv/main.c
src/openac/openac.c
src/pki/pki.c
src/scepclient/scepclient.c
src/starter/netkey.c

index 9633568..8101f9c 100644 (file)
@@ -27,7 +27,7 @@ int main(int argc, char *argv[])
 
 
        library_init(NULL);
-       lib->plugins->load(lib->plugins, NULL, PLUGINS);
+       lib->plugins->load(lib->plugins, PLUGINS);
        atexit(library_deinit);
 
        printf("loaded: %s\n", PLUGINS);
index 5888075..dc0a287 100644 (file)
@@ -119,7 +119,7 @@ int main(int argc, char *argv[])
        }
 
        library_init(NULL);
-       lib->plugins->load(lib->plugins, NULL, argv[1]);
+       lib->plugins->load(lib->plugins, argv[1]);
        atexit(library_deinit);
 
        rounds = atoi(argv[2]);
index 315a146..0cddfc4 100644 (file)
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
 
        dbg = dbg_dnssec;
 
-       if (!lib->plugins->load(lib->plugins, NULL, PLUGINS))
+       if (!lib->plugins->load(lib->plugins, PLUGINS))
        {
                return 1;
        }
index 23f8572..f58b37f 100644 (file)
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
 
        library_init(NULL);
        atexit(library_deinit);
-       lib->plugins->load(lib->plugins, NULL, PLUGINS);
+       lib->plugins->load(lib->plugins, PLUGINS);
 
        if (argc != 3 || (!streq(argv[1], "a") && !streq(argv[1], "s")))
        {
index e616d6d..20e5642 100644 (file)
@@ -26,7 +26,7 @@ int main(int argc, char *argv[])
        int limit = 0, i = 0;
 
        library_init(NULL);
-       lib->plugins->load(lib->plugins, NULL, PLUGINS);
+       lib->plugins->load(lib->plugins, PLUGINS);
        atexit(library_deinit);
 
        printf("loaded: %s\n", PLUGINS);
index aba96a8..31f3bee 100644 (file)
@@ -31,7 +31,7 @@ int main(int argc, char *argv[])
        int read;
 
        library_init(NULL);
-       lib->plugins->load(lib->plugins, NULL, PLUGINS);
+       lib->plugins->load(lib->plugins, PLUGINS);
        atexit(library_deinit);
 
        read = fread(buf, 1, sizeof(buf), stdin);
index 26427ab..6e9a133 100644 (file)
@@ -31,7 +31,7 @@ int main(int argc, char *argv[])
        int read, n;
 
        library_init(NULL);
-       lib->plugins->load(lib->plugins, NULL, PLUGINS);
+       lib->plugins->load(lib->plugins, PLUGINS);
        atexit(library_deinit);
 
        read = fread(buf, 1, sizeof(buf), stdin);
index 32c6e8f..ba3ad1f 100644 (file)
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
        }
 
        library_init(NULL);
-       lib->plugins->load(lib->plugins, NULL, argv[1]);
+       lib->plugins->load(lib->plugins, argv[1]);
        atexit(library_deinit);
 
        keydata = chunk_create(buf, 0);
index 332f13d..e1e8ca8 100644 (file)
@@ -255,7 +255,7 @@ static void init()
 
        dbg = dbg_tls;
 
-       lib->plugins->load(lib->plugins, NULL, PLUGINS);
+       lib->plugins->load(lib->plugins, PLUGINS);
 
        creds = mem_cred_create();
        lib->credmgr->add_set(lib->credmgr, &creds->set);
index 56d98bb..8d2060c 100644 (file)
@@ -509,7 +509,7 @@ int main(int argc, char *argv[])
        }
        load_loggers(logger);
 
-       if (!lib->plugins->load(lib->plugins, NULL,
+       if (!lib->plugins->load(lib->plugins,
                        conftest->test->get_str(conftest->test, "preload", "")))
        {
                return 1;
index 1ad8069..5e3ae72 100644 (file)
@@ -529,7 +529,7 @@ METHOD(daemon_t, initialize, bool,
                                                                          countof(features), TRUE);
 
        /* load plugins, further infrastructure may need it */
-       if (!lib->plugins->load(lib->plugins, NULL, plugins))
+       if (!lib->plugins->load(lib->plugins, plugins))
        {
                return FALSE;
        }
index 880af61..4e7c48e 100644 (file)
@@ -1260,7 +1260,7 @@ int main(int argc, char *argv[])
                fprintf(stderr, "integrity check of pool failed\n");
                exit(SS_RC_DAEMON_INTEGRITY);
        }
-       if (!lib->plugins->load(lib->plugins, NULL,
+       if (!lib->plugins->load(lib->plugins,
                        lib->settings->get_str(lib->settings, "pool.load", PLUGINS)))
        {
                exit(SS_RC_INITIALIZATION_FAILED);
index de85901..b52b81c 100644 (file)
@@ -124,7 +124,7 @@ bool libimcv_init(bool is_imv)
                dbg = imcv_dbg;
                openlog("imcv", 0, LOG_DAEMON);
 
-               if (!lib->plugins->load(lib->plugins, NULL,
+               if (!lib->plugins->load(lib->plugins,
                                lib->settings->get_str(lib->settings, "libimcv.load",
                                        "random nonce gmp pubkey x509")))
                {
index 7dc4c5c..f363964 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "imv_policy_manager_usage.h"
 #include "imv_workitem.h"
+
 #include <library.h>
 #include <utils/debug.h>
 
@@ -251,7 +251,7 @@ int main(int argc, char *argv[])
        {
                exit(SS_RC_LIBSTRONGSWAN_INTEGRITY);
        }
-       if (!lib->plugins->load(lib->plugins, NULL, 
+       if (!lib->plugins->load(lib->plugins,
                        lib->settings->get_str(lib->settings, "imv_policy_manager.load",
                                 "sqlite")))
        {
@@ -285,7 +285,7 @@ int main(int argc, char *argv[])
                exit(SS_RC_INITIALIZATION_FAILED);
        }
        session_id = atoi(tnc_session_id);
-       
+
        /* attach IMV database */
        uri = lib->settings->get_str(lib->settings, "libimcv.database", NULL);
        if (!uri)
index 6e4bc11..57cc62a 100644 (file)
@@ -470,7 +470,7 @@ int main(int argc, char *argv[])
        {
                exit(SS_RC_LIBSTRONGSWAN_INTEGRITY);
        }
-       if (!lib->plugins->load(lib->plugins, NULL,
+       if (!lib->plugins->load(lib->plugins,
                        lib->settings->get_str(lib->settings, "attest.load", "sqlite")))
        {
                exit(SS_RC_INITIALIZATION_FAILED);
index 6cefb21..4d25df3 100644 (file)
@@ -443,7 +443,7 @@ int main(int argc, char *argv[])
        {
                exit(SS_RC_LIBSTRONGSWAN_INTEGRITY);
        }
-       if (!lib->plugins->load(lib->plugins, NULL,
+       if (!lib->plugins->load(lib->plugins,
                        lib->settings->get_str(lib->settings, "attest.load", PLUGINS)))
        {
                exit(SS_RC_INITIALIZATION_FAILED);
index 025e97a..5ed0a9b 100644 (file)
@@ -937,17 +937,14 @@ static bool find_plugin(char *path, char *name, char *buf, char **file)
 }
 
 METHOD(plugin_loader_t, load_plugins, bool,
-       private_plugin_loader_t *this, char *default_path, char *list)
+       private_plugin_loader_t *this, char *list)
 {
        enumerator_t *enumerator;
-       char *token;
+       char *default_path = NULL, *token;
        bool critical_failed = FALSE;
 
 #ifdef PLUGINDIR
-       if (default_path == NULL)
-       {
-               default_path = PLUGINDIR;
-       }
+       default_path = PLUGINDIR;
 #endif /* PLUGINDIR */
 
        enumerator = enumerator_create_token(list, " ", " ");
index 15496f4..285b339 100644 (file)
@@ -57,25 +57,24 @@ struct plugin_loader_t {
                                                                 bool critical);
 
        /**
-        * Load a list of plugins from a directory.
+        * Load a list of plugins.
         *
-        * Each plugin in list may have a ending exclamation mark (!) to mark it
+        * Each plugin in list may have an ending exclamation mark (!) to mark it
         * as a critical plugin. If loading a critical plugin fails, plugin loading
         * is aborted and FALSE is returned.
         *
         * Additional paths can be added with add_path(), these will be searched
-        * for the plugins first, in the order they were added, then the given path
-        * or the default follow.
+        * for the plugins first, in the order they were added, then the default
+        * path follows.
         *
         * @note Even though this method could be called multiple times this is
         * currently not really supported in regards to plugin features and their
         * dependencies (in particular soft dependencies).
         *
-        * @param path                  path containing loadable plugins, NULL for default
         * @param list                  space separated list of plugins to load
         * @return                              TRUE if all critical plugins loaded successfully
         */
-       bool (*load)(plugin_loader_t *this, char *path, char *list);
+       bool (*load)(plugin_loader_t *this, char *list);
 
        /**
         * Add an additional search path for plugins.
index 85c6b20..2f9e4dc 100644 (file)
@@ -40,7 +40,7 @@ static bool load_plugins()
        }
        enumerator->destroy(enumerator);
 
-       return lib->plugins->load(lib->plugins, NULL, PLUGINS);
+       return lib->plugins->load(lib->plugins, PLUGINS);
 }
 
 int main()
index 15ed381..66a4384 100644 (file)
@@ -35,7 +35,7 @@ int main (int arc, char *argv[])
        int threads, timeout;
 
        library_init(NULL);
-       if (!lib->plugins->load(lib->plugins, NULL,
+       if (!lib->plugins->load(lib->plugins,
                        lib->settings->get_str(lib->settings, "manager.load", PLUGINS)))
        {
                return 1;
index 03b1352..cbba728 100644 (file)
@@ -34,7 +34,7 @@ int main(int arc, char *argv[])
        int timeout, threads;
 
        library_init(NULL);
-       if (!lib->plugins->load(lib->plugins, NULL,
+       if (!lib->plugins->load(lib->plugins,
                        lib->settings->get_str(lib->settings, "medsrv.load", PLUGINS)))
        {
                return 1;
index 7b81d6c..7074d44 100644 (file)
@@ -238,7 +238,7 @@ int main(int argc, char **argv)
                fprintf(stderr, "integrity check of openac failed\n");
                exit(SS_RC_DAEMON_INTEGRITY);
        }
-       if (!lib->plugins->load(lib->plugins, NULL,
+       if (!lib->plugins->load(lib->plugins,
                        lib->settings->get_str(lib->settings, "openac.load", PLUGINS)))
        {
                exit(SS_RC_INITIALIZATION_FAILED);
index 429517b..c3039a6 100644 (file)
@@ -167,7 +167,7 @@ int main(int argc, char *argv[])
                fprintf(stderr, "integrity check of pki failed\n");
                exit(SS_RC_DAEMON_INTEGRITY);
        }
-       if (!lib->plugins->load(lib->plugins, NULL,
+       if (!lib->plugins->load(lib->plugins,
                        lib->settings->get_str(lib->settings, "pki.load", PLUGINS)))
        {
                exit(SS_RC_INITIALIZATION_FAILED);
index 11174c9..1267370 100644 (file)
@@ -924,7 +924,7 @@ int main(int argc, char **argv)
        init_log("scepclient");
 
        /* load plugins, further infrastructure may need it */
-       if (!lib->plugins->load(lib->plugins, NULL,
+       if (!lib->plugins->load(lib->plugins,
                        lib->settings->get_str(lib->settings, "scepclient.load", PLUGINS)))
        {
                exit_scepclient("plugin loading failed");
index 921a220..2b500ba 100644 (file)
@@ -58,7 +58,7 @@ bool starter_netkey_init(void)
 
 void starter_netkey_cleanup(void)
 {
-       if (!lib->plugins->load(lib->plugins, NULL,
+       if (!lib->plugins->load(lib->plugins,
                        lib->settings->get_str(lib->settings, "starter.load", PLUGINS)))
        {
                DBG1(DBG_APP, "unable to load kernel plugins");