Migrated eap_md5 plugin to INIT/METHOD macros
[strongswan.git] / src / libcharon / plugins / eap_md5 / eap_md5_plugin.c
index e716dc6..39a6f57 100644 (file)
  */
 
 #include "eap_md5_plugin.h"
-
 #include "eap_md5.h"
 
 #include <daemon.h>
 
-/**
- * Implementation of plugin_t.destroy
- */
-static void destroy(eap_md5_plugin_t *this)
+METHOD(plugin_t, destroy, void,
+       eap_md5_plugin_t *this)
 {
        charon->eap->remove_method(charon->eap,
                                                           (eap_constructor_t)eap_md5_create_server);
@@ -36,9 +33,13 @@ static void destroy(eap_md5_plugin_t *this)
  */
 plugin_t *eap_md5_plugin_create()
 {
-       eap_md5_plugin_t *this = malloc_thing(eap_md5_plugin_t);
+       eap_md5_plugin_t *this;
 
-       this->plugin.destroy = (void(*)(plugin_t*))destroy;
+       INIT(this,
+               .plugin = {
+                       .destroy = _destroy,
+               },
+       );
 
        charon->eap->add_method(charon->eap, EAP_MD5, 0, EAP_SERVER,
                                                        (eap_constructor_t)eap_md5_create_server);