Migrated eap_md5 plugin to INIT/METHOD macros
[strongswan.git] / src / libcharon / plugins / eap_md5 / eap_md5_plugin.c
1 /*
2 * Copyright (C) 2008 Martin Willi
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 #include "eap_md5_plugin.h"
17 #include "eap_md5.h"
18
19 #include <daemon.h>
20
21 METHOD(plugin_t, destroy, void,
22 eap_md5_plugin_t *this)
23 {
24 charon->eap->remove_method(charon->eap,
25 (eap_constructor_t)eap_md5_create_server);
26 charon->eap->remove_method(charon->eap,
27 (eap_constructor_t)eap_md5_create_peer);
28 free(this);
29 }
30
31 /*
32 * see header file
33 */
34 plugin_t *eap_md5_plugin_create()
35 {
36 eap_md5_plugin_t *this;
37
38 INIT(this,
39 .plugin = {
40 .destroy = _destroy,
41 },
42 );
43
44 charon->eap->add_method(charon->eap, EAP_MD5, 0, EAP_SERVER,
45 (eap_constructor_t)eap_md5_create_server);
46 charon->eap->add_method(charon->eap, EAP_MD5, 0, EAP_PEER,
47 (eap_constructor_t)eap_md5_create_peer);
48
49 return &this->plugin;
50 }
51