Added a get_name() function to plugin_t, create_plugin_enumerator enumerates over plugin_t

This commit is contained in:
Martin Willi
2011-04-15 10:07:12 +02:00
parent 6e2791715b
commit 787b5884aa
107 changed files with 828 additions and 245 deletions
+7
View File
@@ -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,
},
},
@@ -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,
},
},
@@ -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,
},
},
@@ -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,
},
},
@@ -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,
},
},
@@ -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,
},
},
@@ -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,
},
},