*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Copyright 2001 hereUare Communications, Inc. <raghud@hereuare.com>
* Copyright 2003 Alan DeKok <aland@freeradius.org>
+ * Copyright 2006 The FreeRADIUS server project
*/
#ifndef _EAP_TYPES_H
#define _EAP_TYPES_H
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#include <string.h>
-#include <stdlib.h>
+#include <freeradius-devel/ident.h>
+RCSIDH(eap_types_h, "$Id$")
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
-#include <freeradius-devel/rad_assert.h>
-
#define PW_EAP_REQUEST 1
#define PW_EAP_RESPONSE 2
#define PW_EAP_SUCCESS 3
/* base for dictionary values */
#define ATTRIBUTE_EAP_ID 1020
#define ATTRIBUTE_EAP_CODE 1021
-#define ATTRIBUTE_EAP_MD5_PASSWORD 1022
-#define ATTRIBUTE_EAP_BASE (5*256)
+#define ATTRIBUTE_EAP_BASE 1280
#define PW_EAP_IDENTITY 1
#define PW_EAP_NOTIFICATION 2
#define PW_EAP_PEAP 25
#define PW_EAP_MSCHAPV2 26
#define PW_EAP_CISCO_MSCHAPV2 29
-#define PW_EAP_MAX_TYPES 29
+#define PW_EAP_TNC 38
+#define PW_EAP_IKEV2 49
+ /* same number as last type */
+#define PW_EAP_MAX_TYPES 49
#define EAP_HEADER_LEN 4
* EAP-Type specific data.
*/
typedef struct eaptype_t {
- unsigned char type;
- unsigned int length;
- unsigned char *data;
+ uint8_t type;
+ size_t length;
+ uint8_t *data;
} eaptype_t;
/*
* Structure to represent packet format of eap *on wire*
*/
typedef struct eap_packet_t {
- unsigned char code;
- unsigned char id;
- unsigned char length[2];
- unsigned char data[1];
+ uint8_t code;
+ uint8_t id;
+ uint8_t length[2];
+ uint8_t data[1];
} eap_packet_t;
-
-
+/*
+ * Structure to represent eap channel binding packet format *on wire*
+ */
+typedef struct eap_chbind_packet_t {
+ uint8_t code;
+ uint8_t data[1];
+} eap_chbind_packet_t;
/*
*/
extern int eaptype_name2type(const char *name);
extern const char *eaptype_type2name(unsigned int type, char *buffer, size_t buflen);
+extern int eap_wireformat(EAP_PACKET *reply);
extern int eap_basic_compose(RADIUS_PACKET *packet, EAP_PACKET *reply);
-extern void map_eap_types(RADIUS_PACKET *req);
-extern eap_packet_t *eap_attribute(VALUE_PAIR *vps);
-extern void unmap_eap_types(RADIUS_PACKET *rep);
+extern VALUE_PAIR *eap_packet2vp(const eap_packet_t *reply);
+extern eap_packet_t *eap_vp2packet(VALUE_PAIR *vps);
+extern VALUE_PAIR *eap_chbind_packet2vp(const eap_chbind_packet_t *packet, size_t len);
+extern size_t eap_chbind_vp2packet(VALUE_PAIR *vps, eap_chbind_packet_t **packet);
#endif /* _EAP_TYPES_H */