The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Typedefs | Functions
session.h File Reference

EAP session management. More...

#include <freeradius-devel/server/request.h>
#include <freeradius-devel/server/request_data.h>
#include <freeradius-devel/server/module.h>
#include "compose.h"
#include "types.h"
+ Include dependency graph for session.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  eap_session_s
 Tracks the progress of a single session of any EAP method. More...
 

Macros

#define REQUEST_DATA_EAP_SESSION   (1)
 
#define REQUEST_DATA_EAP_SESSION_PROXIED   (2)
 

Typedefs

typedef struct eap_session_s eap_session_t
 

Functions

eap_session_teap_session_continue (void const *instance, eap_packet_raw_t **eap_packet, request_t *request)
 Ingest an eap_packet into a thawed or newly allocated session. More...
 
void eap_session_destroy (eap_session_t **eap_session)
 'destroy' an EAP session and disassociate it from the current request More...
 
void eap_session_freeze (eap_session_t **eap_session)
 Freeze an eap_session_t so that it can continue later. More...
 
static eap_session_teap_session_get (request_t *request)
 
eap_session_teap_session_thaw (request_t *request)
 Thaw an eap_session_t so it can be continued. More...
 

Detailed Description

EAP session management.

Id
c30e9ac80af358b2cc08239cc7e8e30aea6029ea
Id
e551cde599c5252db21bf37876eefabbb08dfeae

Definition in file session.h.


Data Structure Documentation

◆ eap_session_s

struct eap_session_s

Tracks the progress of a single session of any EAP method.

Definition at line 40 of file session.h.

+ Collaboration diagram for eap_session_s:
Data Fields
uint8_t * child_state State value returned by tunneled EAP method.
bool finished Whether we consider this session complete.
char * identity NAI (User-Name) from EAP-Identity.
void const * inst Instance of the eap module this session was created by.
eap_session_t * next Next/previous eap session in this doubly linked list.
void * opaque Opaque data used by EAP methods.
eap_session_t * prev
eap_round_t * prev_round Previous response/request pair.

this_round should contain the response to the request in prev_round.

module_method_t process Callback that should be used to process the next round.

Usually set to the process function of an EAP submodule.

request_t * request Current request.

Only used by OpenSSL callbacks to access the current request. Must be NULL if eap_session is not being processed by rlm_eap.

int rounds How many roundtrips have occurred this session.
rlm_rcode_t submodule_rcode Result of last submodule call.
request_t * subrequest Current subrequest being executed.
eap_round_t * this_round The EAP response we're processing, and the EAP request we're building.
bool tls Whether EAP method uses TLS.
eap_type_t type EAP method number.
fr_time_t updated The last time we received a packet for this EAP session.

Macro Definition Documentation

◆ REQUEST_DATA_EAP_SESSION

#define REQUEST_DATA_EAP_SESSION   (1)

Definition at line 32 of file session.h.

◆ REQUEST_DATA_EAP_SESSION_PROXIED

#define REQUEST_DATA_EAP_SESSION_PROXIED   (2)

Definition at line 33 of file session.h.

Typedef Documentation

◆ eap_session_t

typedef struct eap_session_s eap_session_t

Definition at line 1 of file session.h.

Function Documentation

◆ eap_session_continue()

eap_session_t* eap_session_continue ( void const *  instance,
eap_packet_raw_t **  eap_packet_p,
request_t request 
)

Ingest an eap_packet into a thawed or newly allocated session.

If eap_packet is an Identity-Response then allocate a new eap_session and fill the identity.

If eap_packet is not an identity response, retrieve the pre-existing eap_session_t from request data.

If no User-Name attribute is present in the request, one will be created from the Identity-Response received when the eap_session was allocated.

See also
eap_session_freeze
eap_session_thaw
eap_session_destroy
Parameters
[in]instanceof rlm_eap that created the session.
[in]eap_packet_pextracted from the RADIUS Access-Request. Consumed or freed by this function. Do not access after calling this function. Is a **so the packet pointer can be set to NULL.
[in]requestThe current request.
Returns
  • A newly allocated eap_session_t, or the one associated with the current request. MUST be freed with eap_session_destroy if being disposed of, OR MUST be re-frozen with eap_session_freeze if the authentication session will continue when a future request is received.
  • NULL on error, any existing sessions will be destroyed.

Definition at line 307 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eap_session_destroy()

void eap_session_destroy ( eap_session_t **  eap_session)

'destroy' an EAP session and disassociate it from the current request

Note
This could be done in the eap_session_t destructor (and was done previously) but this made the code too hard to follow, and too fragile.
See also
eap_session_continue
eap_session_freeze
eap_session_thaw
Parameters
eap_sessionto destroy (disassociate and free).

Definition at line 148 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eap_session_freeze()

void eap_session_freeze ( eap_session_t **  eap_session)

Freeze an eap_session_t so that it can continue later.

Sets the request and pointer to the eap_session to NULL. Primarily here to help track the lifecycle of an eap_session_t.

The actual freezing/thawing and management (ensuring it's available during multiple rounds of EAP) of the eap_session_t associated with REQUEST_DATA_EAP_SESSION, is done by the state API.

Note
must be called before mod_* functions in rlm_eap return.
See also
eap_session_continue
eap_session_thaw
eap_session_destroy
Parameters
eap_sessionto freeze.

Definition at line 173 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eap_session_get()

static eap_session_t* eap_session_get ( request_t request)
inlinestatic

Definition at line 82 of file session.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eap_session_thaw()

eap_session_t* eap_session_thaw ( request_t request)

Thaw an eap_session_t so it can be continued.

Retrieve an eap_session_t from the request data, and set relevant fields. Primarily here to help track the lifecycle of an eap_session_t.

The actual freezing/thawing and management (ensuring it's available during multiple rounds of EAP) of the eap_session_t associated with REQUEST_DATA_EAP_SESSION, is done by the state API.

Note
eap_session_continue should be used instead if ingesting an eap_packet_raw_t.
See also
eap_session_continue
eap_session_freeze
eap_session_destroy
Parameters
requestto retrieve session from.
Returns

Definition at line 205 of file session.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: