2
2
* rlm_eap.h Local Header file.
4
* Version: $Id: rlm_eap.h,v 1.13 2004/03/02 23:57:40 mgriego Exp $
4
* Version: $Id: rlm_eap.h,v 1.13.4.1 2006/02/06 16:23:53 nbk Exp $
6
6
* This program is free software; you can redistribute it and/or modify
7
7
* it under the terms of the GNU General Public License as published by
42
42
* This structure contains eap's persistent data.
43
* sessions[] = EAP_HANDLERS, keyed by the first octet of the State
44
* attribute, and composed of a linked list, ordered from
43
* sessions = remembered sessions, in a tree for speed.
46
44
* types = All supported EAP-Types
47
45
* mutex = ensure only one thread is updating the sessions[] struct
49
47
typedef struct rlm_eap_t {
50
EAP_HANDLER *sessions[256];
48
rbtree_t *session_tree;
49
EAP_HANDLER *session_head, *session_tail;
51
50
EAP_TYPES *types[PW_EAP_MAX_TYPES + 1];
54
53
* Configuration items.
56
56
char *default_eap_type_name;
58
57
int default_eap_type;
59
58
int ignore_unknown_eap_types;
60
59
int cisco_accounting_username_bug;
62
61
#ifdef HAVE_PTHREAD_H
63
62
pthread_mutex_t session_mutex;
64
pthread_mutex_t module_mutex;
67
* For simplicity in the rest of the code.
69
#ifndef HAVE_PTHREAD_H
71
* This is easier than ifdef's throughout the code.
73
#define pthread_mutex_init(_x, _y)
74
#define pthread_mutex_destroy(_x)
75
#define pthread_mutex_lock(_x)
76
#define pthread_mutex_unlock(_x)
68
79
/* function definitions */
70
81
int eaptype_load(EAP_TYPES **type, int eap_type, CONF_SECTION *cs);
84
95
EAP_HANDLER *eap_handler_alloc(void);
85
96
void eap_packet_free(EAP_PACKET **eap_packet);
86
97
void eap_ds_free(EAP_DS **eap_ds);
87
void eap_handler_free(EAP_HANDLER **handler);
98
void eap_handler_free(EAP_HANDLER *handler);
89
100
int eaplist_add(rlm_eap_t *inst, EAP_HANDLER *handler);
90
void eaplist_free(rlm_eap_t *inst);
91
101
EAP_HANDLER *eaplist_find(rlm_eap_t *inst, REQUEST *request,
92
102
eap_packet_t *eap_packet);
103
void eaplist_free(rlm_eap_t *inst);
95
106
void generate_key(void);