2 * eap_types.h Header file containing the interfaces for all EAP types.
4 * most contents moved from modules/rlm_eap/eap.h
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 * Copyright 2001 hereUare Communications, Inc. <raghud@hereuare.com>
23 * Copyright 2003 Alan DeKok <aland@freeradius.org>
24 * Copyright 2006 The FreeRADIUS server project
29 RCSIDH(eap_methods_h, "$Id$")
31 #include <freeradius-devel/radiusd.h>
32 #include <freeradius-devel/modules.h>
34 /* Field length and other arbitrary things */
35 #define EAP_HEADER_LEN 4
37 typedef enum eap_code {
45 typedef enum eap_method {
46 PW_EAP_INVALID = 0, /* 0 */
47 PW_EAP_IDENTITY, /* 1 */
48 PW_EAP_NOTIFICATION, /* 2 */
53 PW_EAP_7, /* 7 - unused */
54 PW_EAP_8, /* 8 - unused */
55 PW_EAP_RSA_PUBLIC_KEY, /* 9 */
56 PW_EAP_DSS_UNILATERAL, /* 10 */
58 PW_EAP_KEA_VALIDATE, /* 12 */
60 PW_EAP_DEFENDER_TOKEN, /* 14 */
61 PW_EAP_RSA_SECURID, /* 15 */
62 PW_EAP_ARCOT_SYSTEMS, /* 16 */
65 PW_EAP_SRP_SHA1, /* 19 */
66 PW_EAP_20, /* 20 - unassigned */
68 PW_EAP_REMOTE_ACCESS_SERVICE, /* 22 */
70 PW_EAP_3COM, /* 24 - should this be EAP-HP now? */
72 PW_EAP_MSCHAPV2, /* 26 */
74 PW_EAP_CRYPTOCARD, /* 28 */
75 PW_EAP_CISCO_MSCHAPV2, /* 29 */
76 PW_EAP_DYNAMID, /* 30 */
79 PW_EAP_MS_ATLV, /* 33 */
80 PW_EAP_SENTRINET, /* 34 */
81 PW_EAP_ACTIONTEC, /* 35 */
82 PW_EAP_COGENT_BIOMETRIC, /* 36 */
83 PW_EAP_AIRFORTRESS, /* 37 */
84 PW_EAP_TNC, /* 38 - fixme conflicts with HTTP DIGEST */
85 // PW_EAP_HTTP_DIGEST, /* 38 */
86 PW_EAP_SECURISUITE, /* 39 */
87 PW_EAP_DEVICECONNECT, /* 40 */
88 PW_EAP_SPEKE, /* 41 */
89 PW_EAP_MOBAC, /* 42 */
91 PW_EAP_ZONELABS, /* 44 */
96 PW_EAP_IKEV2, /* 49 */
101 PW_EAP_MAX_TYPES /* 54 - for validation */
104 typedef enum eap_rcode {
105 EAP_NOTFOUND, //!< EAP handler data not found.
106 EAP_FOUND, //!< EAP handler data found, continue.
107 EAP_OK, //!< Ok, continue.
108 EAP_FAIL, //!< Failed, don't reply.
109 EAP_NOOP, //!< Succeeded without doing anything.
110 EAP_INVALID, //!< Invalid, don't reply.
111 EAP_VALID, //!< Valid, continue.
115 extern const FR_NAME_NUMBER eap_rcode_table[];
118 * EAP-Type specific data.
120 typedef struct eap_type_data {
127 * Structure to hold EAP data.
129 * length = code + id + length + type + type.data
130 * = 1 + 1 + 2 + 1 + X
132 typedef struct eap_packet {
136 eap_type_data_t type;
142 * Structure to represent packet format of eap *on wire*
144 typedef struct eap_packet_raw {
152 * Structure to represent eap channel binding packet format *on wire*
154 typedef struct eap_chbind_packet_t {
157 } eap_chbind_packet_t;
161 * interfaces in eapcommon.c
163 extern eap_type_t eap_name2type(char const *name);
164 extern char const *eap_type2name(eap_type_t method);
165 extern int eap_wireformat(eap_packet_t *reply);
166 extern int eap_basic_compose(RADIUS_PACKET *packet, eap_packet_t *reply);
167 extern VALUE_PAIR *eap_packet2vp(RADIUS_PACKET *packet, eap_packet_raw_t const *reply);
168 extern eap_packet_raw_t *eap_vp2packet(TALLOC_CTX *ctx, VALUE_PAIR *vps);
169 void eap_add_reply(REQUEST *request,
170 char const *name, uint8_t const *value, int len);
172 #endif /* _EAP_TYPES_H */