Add features support to kernel-pfkey plugin
This commit is contained in:
@@ -38,11 +38,20 @@ METHOD(plugin_t, get_name, char*,
|
|||||||
return "kernel-pfkey";
|
return "kernel-pfkey";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
METHOD(plugin_t, get_features, int,
|
||||||
|
private_kernel_pfkey_plugin_t *this, plugin_feature_t *features[])
|
||||||
|
{
|
||||||
|
static plugin_feature_t f[] = {
|
||||||
|
PLUGIN_CALLBACK(kernel_ipsec_register, kernel_pfkey_ipsec_create),
|
||||||
|
PLUGIN_PROVIDE(CUSTOM, "kernel-ipsec"),
|
||||||
|
};
|
||||||
|
*features = f;
|
||||||
|
return countof(f);
|
||||||
|
}
|
||||||
|
|
||||||
METHOD(plugin_t, destroy, void,
|
METHOD(plugin_t, destroy, void,
|
||||||
private_kernel_pfkey_plugin_t *this)
|
private_kernel_pfkey_plugin_t *this)
|
||||||
{
|
{
|
||||||
hydra->kernel_interface->remove_ipsec_interface(hydra->kernel_interface,
|
|
||||||
(kernel_ipsec_constructor_t)kernel_pfkey_ipsec_create);
|
|
||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,13 +66,11 @@ plugin_t *kernel_pfkey_plugin_create()
|
|||||||
.public = {
|
.public = {
|
||||||
.plugin = {
|
.plugin = {
|
||||||
.get_name = _get_name,
|
.get_name = _get_name,
|
||||||
.reload = (void*)return_false,
|
.get_features = _get_features,
|
||||||
.destroy = _destroy,
|
.destroy = _destroy,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
hydra->kernel_interface->add_ipsec_interface(hydra->kernel_interface,
|
|
||||||
(kernel_ipsec_constructor_t)kernel_pfkey_ipsec_create);
|
|
||||||
|
|
||||||
return &this->public.plugin;
|
return &this->public.plugin;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user