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_DYNAMIC
, EAP_EXPERIMENTAL
, EAP_TNC
,
56 ENUM_END(eap_type_names
, EAP_EXPERIMENTAL
);
58 ENUM_BEGIN(eap_type_short_names
, EAP_IDENTITY
, EAP_GTC
,
65 ENUM_NEXT(eap_type_short_names
, EAP_TLS
, EAP_TLS
, EAP_GTC
,
67 ENUM_NEXT(eap_type_short_names
, EAP_SIM
, EAP_SIM
, EAP_TLS
,
69 ENUM_NEXT(eap_type_short_names
, EAP_TTLS
, EAP_TTLS
, EAP_SIM
,
71 ENUM_NEXT(eap_type_short_names
, EAP_AKA
, EAP_AKA
, EAP_TTLS
,
73 ENUM_NEXT(eap_type_short_names
, EAP_MSCHAPV2
, EAP_MSCHAPV2
, EAP_AKA
,
75 ENUM_NEXT(eap_type_short_names
, EAP_TNC
, EAP_TNC
, EAP_MSCHAPV2
,
77 ENUM_NEXT(eap_type_short_names
, EAP_DYNAMIC
, EAP_EXPERIMENTAL
, EAP_TNC
,
82 ENUM_END(eap_type_short_names
, EAP_EXPERIMENTAL
);
84 ENUM(auth_rule_names
, AUTH_RULE_IDENTITY
, AUTH_HELPER_SUBJECT_HASH_URL
,
93 "RULE_CRL_VALIDATION",
94 "RULE_OCSP_VALIDATION",
97 "HELPER_SUBJECT_CERT",
99 "HELPER_SUBJECT_HASH_URL",
105 eap_type_t
eap_type_from_string(char *name
)
112 {"identity", EAP_IDENTITY
},
120 {"mschapv2", EAP_MSCHAPV2
},
122 {"radius", EAP_RADIUS
},
125 for (i
= 0; i
< countof(types
); i
++)
127 if (strcaseeq(name
, types
[i
].name
))
129 return types
[i
].type
;