All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rlm_eap.h
Go to the documentation of this file.
1 /*
2  * rlm_eap.h Local Header file.
3  *
4  * Version: $Id: 8c6014caec33d4447da55702ba524244f75423bf $
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  *
20  * Copyright 2001 hereUare Communications, Inc. <raghud@hereuare.com>
21  * Copyright 2003 Alan DeKok <aland@freeradius.org>
22  * Copyright 2006 The FreeRADIUS server project
23  */
24 #ifndef _RLM_EAP_H
25 #define _RLM_EAP_H
26 
27 RCSIDH(rlm_eap_h, "$Id: 8c6014caec33d4447da55702ba524244f75423bf $")
28 
29 #include <freeradius-devel/modpriv.h>
30 #include <freeradius-devel/state.h>
31 #include "eap.h"
32 #include "eap_types.h"
33 
34 /*
35  * Keep track of which sub modules we've loaded.
36  */
37 typedef struct eap_module {
38  char const *name;
42  void *instance;
43 } eap_module_t;
44 
45 /*
46  * This structure contains eap's persistent data.
47  * sessions = remembered sessions, in a tree for speed.
48  * types = All supported EAP-Types
49  * mutex = ensure only one thread is updating the sessions[] struct
50  */
51 typedef struct rlm_eap {
53 
54  char const *default_method_name;
56 
59 
60 #ifdef HAVE_PTHREAD_H
61  pthread_mutex_t session_mutex;
62 #endif
63 
64  char const *xlat_name; /* no xlat's yet */
66 } rlm_eap_t;
67 
68 /*
69  * For simplicity in the rest of the code.
70  */
71 #ifndef HAVE_PTHREAD_H
72 /*
73  * This is easier than ifdef's throughout the code.
74  */
75 #define pthread_mutex_init(_x, _y)
76 #define pthread_mutex_destroy(_x)
77 #define pthread_mutex_lock(_x)
78 #define pthread_mutex_unlock(_x)
79 #endif
80 
81 /* function definitions */
82 /* EAP-Type */
85 
86 /* EAP */
87 int eap_start(rlm_eap_t *inst, REQUEST *request) CC_HINT(nonnull);
88 void eap_fail(eap_session_t *eap_session) CC_HINT(nonnull);
89 void eap_success(eap_session_t *eap_session) CC_HINT(nonnull);
90 rlm_rcode_t eap_compose(eap_session_t *eap_session) CC_HINT(nonnull);
92 
93 /* Memory Management */
96 
97 #endif /*_RLM_EAP_H*/
#define RCSIDH(h, id)
Definition: build.h:136
rlm_rcode_t eap_compose(eap_session_t *eap_session) CC_HINT(nonnull)
Definition: eap.c:445
eap_session_t * eap_session_alloc(rlm_eap_t *inst, REQUEST *request)
Allocate a new eap_session_t.
Definition: mem.c:107
#define CC_HINT(_x)
Definition: build.h:71
void eap_fail(eap_session_t *eap_session) CC_HINT(nonnull)
Definition: eap.c:850
struct eap_module eap_module_t
#define inst
eap_round_t * eap_round_alloc(eap_session_t *eap_session)
Definition: mem.c:32
enum eap_method eap_type_t
enum eap_rcode eap_rcode_t
bool mod_accounting_username_bug
Definition: rlm_eap.h:58
rlm_eap_module_t * type
Definition: rlm_eap.h:39
Structure to represent packet format of eap on wire
Definition: eap_types.h:143
char const * name
Definition: rlm_eap.h:38
void eap_success(eap_session_t *eap_session) CC_HINT(nonnull)
Definition: eap.c:868
char const * default_method_name
Definition: rlm_eap.h:54
Tracks the progress of a single session of any EAP method.
Definition: eap.h:60
void * instance
Definition: rlm_eap.h:42
enum rlm_rcodes rlm_rcode_t
Return codes indicating the result of the module call.
Contains a pair of request and response packets.
Definition: eap.h:43
eap_session_t * eap_session_get(rlm_eap_t *inst, eap_packet_raw_t **eap_msg, REQUEST *request) CC_HINT(nonnull)
Definition: eap.c:1069
CONF_SECTION * cs
Definition: rlm_eap.h:41
void * lt_dlhandle
Definition: modpriv.h:42
bool ignore_unknown_types
Definition: rlm_eap.h:57
Interface to call EAP sub mdoules.
Definition: eap.h:95
int eap_start(rlm_eap_t *inst, REQUEST *request) CC_HINT(nonnull)
Definition: eap.c:608
eap_rcode_t eap_method_select(rlm_eap_t *inst, eap_session_t *eap_session)
Select the correct callback based on a response.
Definition: eap.c:317
char const * xlat_name
Definition: rlm_eap.h:64
fr_randctx rand_pool
Definition: rlm_eap.h:65
int eap_module_instantiate(rlm_eap_t *inst, eap_module_t **method, eap_type_t num, CONF_SECTION *cs)
Load required EAP sub-modules (methods)
Definition: eap.c:96
eap_module_t * methods[PW_EAP_MAX_TYPES]
Definition: rlm_eap.h:52
struct rlm_eap rlm_eap_t
eap_type_t default_method
Definition: rlm_eap.h:55
lt_dlhandle handle
Definition: rlm_eap.h:40