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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * Copyright 2001 hereUare Communications, Inc. <raghud@hereuare.com>
23 * Copyright 2003 Alan DeKok <aland@freeradius.org>
29 #include <sys/types.h>
33 #include <netinet/in.h>
42 #define PW_EAP_REQUEST 1
43 #define PW_EAP_RESPONSE 2
44 #define PW_EAP_SUCCESS 3
45 #define PW_EAP_FAILURE 4
46 #define PW_EAP_MAX_CODES 4
48 /* base for dictionary values */
49 #define ATTRIBUTE_EAP_ID 1020
50 #define ATTRIBUTE_EAP_CODE 1021
51 #define ATTRIBUTE_EAP_MD5_PASSWORD 1022
52 #define ATTRIBUTE_EAP_BASE (5*256)
54 #define PW_EAP_IDENTITY 1
55 #define PW_EAP_NOTIFICATION 2
61 #define PW_EAP_LEAP 17
63 #define PW_EAP_TTLS 21
64 #define PW_EAP_PEAP 25
65 #define PW_EAP_MSCHAPV2 26
66 #define PW_EAP_CISCO_MSCHAPV2 29
67 #define PW_EAP_MAX_TYPES 29
69 #define EAP_HEADER_LEN 4
75 EAP_NOTFOUND, /* not found */
76 EAP_FOUND, /* found, continue */
77 EAP_OK, /* ok, continue */
78 EAP_FAIL, /* failed, don't reply */
79 EAP_NOOP, /* succeeded without doing anything */
80 EAP_INVALID, /* invalid, don't reply */
81 EAP_VALID /* valid, continue */
85 * EAP-Type specific data.
87 typedef struct eaptype_t {
94 * Structure to hold EAP data.
96 * length = code + id + length + type + type.data
99 typedef struct eap_packet {
105 unsigned char *packet;
109 * Structure to represent packet format of eap *on wire*
111 typedef struct eap_packet_t {
114 unsigned char length[2];
115 unsigned char data[1];
123 * interfaces in eapcommon.c
125 extern int eaptype_name2type(const char *name);
126 extern const char *eaptype_type2name(unsigned int type, char *buffer, size_t buflen);
127 extern int eap_basic_compose(RADIUS_PACKET *packet, EAP_PACKET *reply);
128 extern void map_eap_types(RADIUS_PACKET *req);
129 extern eap_packet_t *eap_attribute(VALUE_PAIR *vps);
130 extern void unmap_eap_types(RADIUS_PACKET *rep);
132 #endif /* _EAP_TYPES_H */