aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/padlock/padlock_plugin.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-08-13 11:27:54 +0200
committerMartin Willi <martin@revosec.ch>2010-08-13 17:11:53 +0200
commit619f9a4ef147938e9087f0e2767a6027bf75e8a0 (patch)
tree9eed86e9cf39284e1dec17aa59f60d5eae880993 /src/libstrongswan/plugins/padlock/padlock_plugin.c
parentbfe4d08c207d5405eeef1f2531fd4c3fdeb2a205 (diff)
downloadstrongswan-619f9a4ef147938e9087f0e2767a6027bf75e8a0.tar.bz2
strongswan-619f9a4ef147938e9087f0e2767a6027bf75e8a0.tar.xz
Migrated padlock plugin to INIT/METHOD macros
Diffstat (limited to 'src/libstrongswan/plugins/padlock/padlock_plugin.c')
-rw-r--r--src/libstrongswan/plugins/padlock/padlock_plugin.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libstrongswan/plugins/padlock/padlock_plugin.c b/src/libstrongswan/plugins/padlock/padlock_plugin.c
index c9606ae15..d8461089a 100644
--- a/src/libstrongswan/plugins/padlock/padlock_plugin.c
+++ b/src/libstrongswan/plugins/padlock/padlock_plugin.c
@@ -101,10 +101,8 @@ static padlock_feature_t get_padlock_features()
return 0;
}
-/**
- * Implementation of aes_plugin_t.destroy
- */
-static void destroy(private_padlock_plugin_t *this)
+METHOD(plugin_t, destroy, void,
+ private_padlock_plugin_t *this)
{
if (this->features & PADLOCK_RNG_ENABLED)
{
@@ -133,11 +131,13 @@ static void destroy(private_padlock_plugin_t *this)
*/
plugin_t *padlock_plugin_create()
{
- private_padlock_plugin_t *this = malloc_thing(private_padlock_plugin_t);
+ private_padlock_plugin_t *this;
- this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
+ INIT(this,
+ .public.plugin.destroy = _destroy,
+ .features = get_padlock_features(),
+ );
- this->features = get_padlock_features();
if (!this->features)
{
free(this);