Don't use union members directly in plugin_feature_t.
[strongswan.git] / src / libcharon / sa / authenticators / eap / eap_method.c
1 /*
2 * Copyright (C) 2006 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_method.h"
17
18 #include <daemon.h>
19
20 ENUM(eap_role_names, EAP_SERVER, EAP_PEER,
21 "EAP_SERVER",
22 "EAP_PEER",
23 );
24
25 /**
26 * See header
27 */
28 bool eap_method_register(plugin_t *plugin, plugin_feature_t *feature,
29 bool reg, void *data)
30 {
31 if (reg)
32 {
33 charon->eap->add_method(charon->eap, feature->arg.eap, 0,
34 feature->type == FEATURE_EAP_SERVER ? EAP_SERVER : EAP_PEER,
35 (eap_constructor_t)data);
36 }
37 else
38 {
39 charon->eap->remove_method(charon->eap, (eap_constructor_t)data);
40 }
41 return TRUE;
42 }