2 * Copyright (C) 2006 Martin Willi
3 * Hochschule fuer Technik Rapperswil
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>.
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
18 ENUM(eap_code_names
, EAP_REQUEST
, EAP_FAILURE
,
25 ENUM(eap_code_short_names
, EAP_REQUEST
, EAP_FAILURE
,
32 ENUM_BEGIN(eap_type_names
, EAP_IDENTITY
, EAP_GTC
,
39 ENUM_NEXT(eap_type_names
, EAP_TLS
, EAP_TLS
, EAP_GTC
,
41 ENUM_NEXT(eap_type_names
, EAP_SIM
, EAP_SIM
, EAP_TLS
,
43 ENUM_NEXT(eap_type_names
, EAP_TTLS
, EAP_TTLS
, EAP_SIM
,
45 ENUM_NEXT(eap_type_names
, EAP_AKA
, EAP_AKA
, EAP_TTLS
,
47 ENUM_NEXT(eap_type_names
, EAP_MSCHAPV2
, EAP_MSCHAPV2
, EAP_AKA
,
49 ENUM_NEXT(eap_type_names
, EAP_TNC
, EAP_TNC
, EAP_MSCHAPV2
,
51 ENUM_NEXT(eap_type_names
, EAP_RADIUS
, EAP_EXPERIMENTAL
, EAP_TNC
,
55 ENUM_END(eap_type_names
, EAP_EXPERIMENTAL
);
57 ENUM_BEGIN(eap_type_short_names
, EAP_IDENTITY
, EAP_GTC
,
64 ENUM_NEXT(eap_type_short_names
, EAP_TLS
, EAP_TLS
, EAP_GTC
,
66 ENUM_NEXT(eap_type_short_names
, EAP_SIM
, EAP_SIM
, EAP_TLS
,
68 ENUM_NEXT(eap_type_short_names
, EAP_TTLS
, EAP_TTLS
, EAP_SIM
,
70 ENUM_NEXT(eap_type_short_names
, EAP_AKA
, EAP_AKA
, EAP_TTLS
,
72 ENUM_NEXT(eap_type_short_names
, EAP_MSCHAPV2
, EAP_MSCHAPV2
, EAP_AKA
,
74 ENUM_NEXT(eap_type_short_names
, EAP_TNC
, EAP_TNC
, EAP_MSCHAPV2
,
76 ENUM_NEXT(eap_type_short_names
, EAP_RADIUS
, EAP_EXPERIMENTAL
, EAP_TNC
,
80 ENUM_END(eap_type_short_names
, EAP_EXPERIMENTAL
);
82 ENUM(auth_rule_names
, AUTH_RULE_IDENTITY
, AUTH_HELPER_SUBJECT_HASH_URL
,
91 "RULE_CRL_VALIDATION",
92 "RULE_OCSP_VALIDATION",
95 "HELPER_SUBJECT_CERT",
97 "HELPER_SUBJECT_HASH_URL",
103 eap_type_t
eap_type_from_string(char *name
)
110 {"identity", EAP_IDENTITY
},
118 {"mschapv2", EAP_MSCHAPV2
},
120 {"radius", EAP_RADIUS
},
123 for (i
= 0; i
< countof(types
); i
++)
125 if (strcaseeq(name
, types
[i
].name
))
127 return types
[i
].type
;