Migrated kernel_netlink_plugin_t to INIT/METHOD macros

This commit is contained in:
Andreas Steffen
2010-11-25 23:12:12 +01:00
parent ea6dc84f09
commit 52c037997c
@@ -33,10 +33,8 @@ struct private_kernel_netlink_plugin_t {
kernel_netlink_plugin_t public;
};
/**
* Implementation of plugin_t.destroy
*/
static void destroy(private_kernel_netlink_plugin_t *this)
METHOD(plugin_t, destroy, void,
private_kernel_netlink_plugin_t *this)
{
hydra->kernel_interface->remove_ipsec_interface(hydra->kernel_interface,
(kernel_ipsec_constructor_t)kernel_netlink_ipsec_create);
@@ -50,10 +48,15 @@ static void destroy(private_kernel_netlink_plugin_t *this)
*/
plugin_t *kernel_netlink_plugin_create()
{
private_kernel_netlink_plugin_t *this = malloc_thing(private_kernel_netlink_plugin_t);
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
private_kernel_netlink_plugin_t *this;
INIT(this,
.public = {
.plugin = {
.destroy = _destroy,
},
},
);
hydra->kernel_interface->add_ipsec_interface(hydra->kernel_interface,
(kernel_ipsec_constructor_t)kernel_netlink_ipsec_create);
hydra->kernel_interface->add_net_interface(hydra->kernel_interface,