diff options
author | Martin Willi <martin@revosec.ch> | 2011-04-11 18:54:18 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2011-04-15 10:07:12 +0200 |
commit | 787b5884aaf873fb9fda2b0d8b7c3d54e38ae7a5 (patch) | |
tree | f8c05bcf7572117763fd50eaf315a13c2e6261d2 /src/libhydra | |
parent | 6e2791715b7534b601ff5d5163d63d88ad7a8a5e (diff) | |
download | strongswan-787b5884aaf873fb9fda2b0d8b7c3d54e38ae7a5.tar.bz2 strongswan-787b5884aaf873fb9fda2b0d8b7c3d54e38ae7a5.tar.xz |
Added a get_name() function to plugin_t, create_plugin_enumerator enumerates over plugin_t
Diffstat (limited to 'src/libhydra')
7 files changed, 49 insertions, 1 deletions
diff --git a/src/libhydra/plugins/attr/attr_plugin.c b/src/libhydra/plugins/attr/attr_plugin.c index 0f66b680a..762dc88b2 100644 --- a/src/libhydra/plugins/attr/attr_plugin.c +++ b/src/libhydra/plugins/attr/attr_plugin.c @@ -36,6 +36,12 @@ struct private_attr_plugin_t { attr_provider_t *provider; }; +METHOD(plugin_t, get_name, char*, + private_attr_plugin_t *this) +{ + return "attr"; +} + METHOD(plugin_t, destroy, void, private_attr_plugin_t *this) { @@ -54,6 +60,7 @@ plugin_t *attr_plugin_create() INIT(this, .public = { .plugin = { + .get_name = _get_name, .destroy = _destroy, }, }, diff --git a/src/libhydra/plugins/attr_sql/attr_sql_plugin.c b/src/libhydra/plugins/attr_sql/attr_sql_plugin.c index ca9de023e..f9be3d245 100644 --- a/src/libhydra/plugins/attr_sql/attr_sql_plugin.c +++ b/src/libhydra/plugins/attr_sql/attr_sql_plugin.c @@ -40,9 +40,14 @@ struct private_attr_sql_plugin_t { * configuration attributes */ sql_attribute_t *attribute; - }; +METHOD(plugin_t, get_name, char*, + private_attr_sql_plugin_t *this) +{ + return "attr-sql"; +} + METHOD(plugin_t, destroy, void, private_attr_sql_plugin_t *this) { @@ -71,6 +76,7 @@ plugin_t *attr_sql_plugin_create() INIT(this, .public = { .plugin = { + .get_name = _get_name, .destroy = _destroy, }, }, diff --git a/src/libhydra/plugins/kernel_klips/kernel_klips_plugin.c b/src/libhydra/plugins/kernel_klips/kernel_klips_plugin.c index 3c312ca2b..c5b9fa692 100644 --- a/src/libhydra/plugins/kernel_klips/kernel_klips_plugin.c +++ b/src/libhydra/plugins/kernel_klips/kernel_klips_plugin.c @@ -32,6 +32,12 @@ struct private_kernel_klips_plugin_t { kernel_klips_plugin_t public; }; +METHOD(plugin_t, get_name, char*, + private_kernel_klips_plugin_t *this) +{ + return "kernel-klips"; +} + METHOD(plugin_t, destroy, void, private_kernel_klips_plugin_t *this) { @@ -50,6 +56,7 @@ plugin_t *kernel_klips_plugin_create() INIT(this, .public = { .plugin = { + .get_name = _get_name, .destroy = _destroy, }, }, diff --git a/src/libhydra/plugins/kernel_netlink/kernel_netlink_plugin.c b/src/libhydra/plugins/kernel_netlink/kernel_netlink_plugin.c index 9fc1a03f5..78823c968 100644 --- a/src/libhydra/plugins/kernel_netlink/kernel_netlink_plugin.c +++ b/src/libhydra/plugins/kernel_netlink/kernel_netlink_plugin.c @@ -33,6 +33,12 @@ struct private_kernel_netlink_plugin_t { kernel_netlink_plugin_t public; }; +METHOD(plugin_t, get_name, char*, + private_kernel_netlink_plugin_t *this) +{ + return "kernel-netlink"; +} + METHOD(plugin_t, destroy, void, private_kernel_netlink_plugin_t *this) { @@ -53,6 +59,7 @@ plugin_t *kernel_netlink_plugin_create() INIT(this, .public = { .plugin = { + .get_name = _get_name, .destroy = _destroy, }, }, diff --git a/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_plugin.c b/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_plugin.c index 9e7a7904d..fa3d38665 100644 --- a/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_plugin.c +++ b/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_plugin.c @@ -32,6 +32,12 @@ struct private_kernel_pfkey_plugin_t { kernel_pfkey_plugin_t public; }; +METHOD(plugin_t, get_name, char*, + private_kernel_pfkey_plugin_t *this) +{ + return "kernel-pfkey"; +} + METHOD(plugin_t, destroy, void, private_kernel_pfkey_plugin_t *this) { @@ -50,6 +56,7 @@ plugin_t *kernel_pfkey_plugin_create() INIT(this, .public = { .plugin = { + .get_name = _get_name, .destroy = _destroy, }, }, diff --git a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_plugin.c b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_plugin.c index a4cb53edd..1749a89d2 100644 --- a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_plugin.c +++ b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_plugin.c @@ -32,6 +32,12 @@ struct private_kernel_pfroute_plugin_t { kernel_pfroute_plugin_t public; }; +METHOD(plugin_t, get_name, char*, + private_kernel_pfroute_plugin_t *this) +{ + return "kernel-pfroute"; +} + METHOD(plugin_t, destroy, void, private_kernel_pfroute_plugin_t *this) { @@ -50,6 +56,7 @@ plugin_t *kernel_pfroute_plugin_create() INIT(this, .public = { .plugin = { + .get_name = _get_name, .destroy = _destroy, }, }, diff --git a/src/libhydra/plugins/resolve/resolve_plugin.c b/src/libhydra/plugins/resolve/resolve_plugin.c index ad18c7060..070596b75 100644 --- a/src/libhydra/plugins/resolve/resolve_plugin.c +++ b/src/libhydra/plugins/resolve/resolve_plugin.c @@ -36,6 +36,12 @@ struct private_resolve_plugin_t { resolve_handler_t *handler; }; +METHOD(plugin_t, get_name, char*, + private_resolve_plugin_t *this) +{ + return "resolve"; +} + METHOD(plugin_t, destroy, void, private_resolve_plugin_t *this) { @@ -54,6 +60,7 @@ plugin_t *resolve_plugin_create() INIT(this, .public = { .plugin = { + .get_name = _get_name, .destroy = _destroy, }, }, |