diff options
author | Tobias Brunner <tobias@strongswan.org> | 2012-01-19 12:27:56 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2012-01-19 12:37:42 +0100 |
commit | f1ba06c1c6eff3e7c6a5666bcb68d3f3e2e8a373 (patch) | |
tree | cf82f97e848a47f9d45ca1db048ca81c082d2c95 /src/libcharon | |
parent | fdf1f239ef33d9bb69a49138956c6fd52c74a053 (diff) | |
download | strongswan-f1ba06c1c6eff3e7c6a5666bcb68d3f3e2e8a373.tar.bz2 strongswan-f1ba06c1c6eff3e7c6a5666bcb68d3f3e2e8a373.tar.xz |
Cache list of plugin names to further simplify its usage.
Also helpful for ipsec statusall to avoid having to enumerate plugins.
Diffstat (limited to 'src/libcharon')
-rw-r--r-- | src/libcharon/daemon.c | 16 | ||||
-rw-r--r-- | src/libcharon/plugins/stroke/stroke_list.c | 8 |
2 files changed, 5 insertions, 19 deletions
diff --git a/src/libcharon/daemon.c b/src/libcharon/daemon.c index f175826d5..3fb49d475 100644 --- a/src/libcharon/daemon.c +++ b/src/libcharon/daemon.c @@ -201,18 +201,6 @@ METHOD(daemon_t, start, void, DEFAULT_THREADS)); } -/** - * Log loaded plugins - */ -static void print_plugins() -{ - char *plugins; - - plugins = lib->plugins->loaded_plugins(lib->plugins); - DBG1(DBG_DMN, "loaded plugins: %s", plugins); - free(plugins); -} - METHOD(daemon_t, initialize, bool, private_daemon_t *this) { @@ -233,8 +221,8 @@ METHOD(daemon_t, initialize, bool, { return FALSE; } - - print_plugins(); + DBG1(DBG_DMN, "loaded plugins: %s", + lib->plugins->loaded_plugins(lib->plugins)); this->public.ike_sa_manager = ike_sa_manager_create(); if (this->public.ike_sa_manager == NULL) diff --git a/src/libcharon/plugins/stroke/stroke_list.c b/src/libcharon/plugins/stroke/stroke_list.c index 8125d37bf..c056dce23 100644 --- a/src/libcharon/plugins/stroke/stroke_list.c +++ b/src/libcharon/plugins/stroke/stroke_list.c @@ -414,8 +414,7 @@ METHOD(stroke_list_t, status, void, if (all) { peer_cfg_t *peer_cfg; - plugin_t *plugin; - char *pool, *plugins; + char *pool; host_t *host; u_int32_t dpd; time_t since, now; @@ -449,9 +448,8 @@ METHOD(stroke_list_t, status, void, } fprintf(out, ", scheduled: %d\n", lib->scheduler->get_job_load(lib->scheduler)); - plugins = lib->plugins->loaded_plugins(lib->plugins); - fprintf(out, " loaded plugins: %s\n", plugins); - free(plugins); + fprintf(out, " loaded plugins: %s\n", + lib->plugins->loaded_plugins(lib->plugins)); first = TRUE; enumerator = this->attribute->create_pool_enumerator(this->attribute); |