aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/eap_identity/eap_identity_plugin.c
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2010-08-13 16:57:01 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2010-08-13 16:57:01 +0200
commit71efe40077a160e5d60dc4fe3f19b5670e6ced93 (patch)
treee3df4949968a0a98b667b0eea588567c730696f4 /src/libcharon/plugins/eap_identity/eap_identity_plugin.c
parenta568897011607468d26f26ae386c5f6da8c83aca (diff)
downloadstrongswan-71efe40077a160e5d60dc4fe3f19b5670e6ced93.tar.bz2
strongswan-71efe40077a160e5d60dc4fe3f19b5670e6ced93.tar.xz
Migrated eap_identity plugin to INIT/METHOD macros
Diffstat (limited to 'src/libcharon/plugins/eap_identity/eap_identity_plugin.c')
-rw-r--r--src/libcharon/plugins/eap_identity/eap_identity_plugin.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/libcharon/plugins/eap_identity/eap_identity_plugin.c b/src/libcharon/plugins/eap_identity/eap_identity_plugin.c
index 082997154..079c27909 100644
--- a/src/libcharon/plugins/eap_identity/eap_identity_plugin.c
+++ b/src/libcharon/plugins/eap_identity/eap_identity_plugin.c
@@ -14,15 +14,12 @@
*/
#include "eap_identity_plugin.h"
-
#include "eap_identity.h"
#include <daemon.h>
-/**
- * Implementation of plugin_t.destroy
- */
-static void destroy(eap_identity_plugin_t *this)
+METHOD(plugin_t, destroy, void,
+ eap_identity_plugin_t *this)
{
charon->eap->remove_method(charon->eap,
(eap_constructor_t)eap_identity_create_server);
@@ -36,9 +33,13 @@ static void destroy(eap_identity_plugin_t *this)
*/
plugin_t *eap_identity_plugin_create()
{
- eap_identity_plugin_t *this = malloc_thing(eap_identity_plugin_t);
+ eap_identity_plugin_t *this;
- this->plugin.destroy = (void(*)(plugin_t*))destroy;
+ INIT(this,
+ .plugin = {
+ .destroy = _destroy,
+ },
+ );
charon->eap->add_method(charon->eap, EAP_IDENTITY, 0, EAP_SERVER,
(eap_constructor_t)eap_identity_create_server);