The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
session.c File Reference
#include <freeradius-devel/server/pair.h>
#include <freeradius-devel/radius/radius.h>
#include <freeradius-devel/util/nbo.h>
#include "attrs.h"
#include "compose.h"
+ Include dependency graph for session.c:

Go to the source code of this file.

Functions

static int _eap_session_free (eap_session_t *eap_session)
 
static char * eap_identity (request_t *request, eap_session_t *eap_session, eap_packet_raw_t *eap_packet)
 Extract the EAP identity from EAP-Identity-Response packets. More...
 
static eap_session_teap_session_alloc (request_t *request)
 Allocate a new eap_session_t. More...
 
eap_session_teap_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. 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...
 
eap_session_teap_session_thaw (request_t *request)
 Thaw an eap_session_t so it can be continued. More...
 

Function Documentation

◆ _eap_session_free()

static int _eap_session_free ( eap_session_t eap_session)
static

Definition at line 31 of file session.c.

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

◆ eap_identity()

static char* eap_identity ( request_t request,
eap_session_t eap_session,
eap_packet_raw_t eap_packet 
)
static

Extract the EAP identity from EAP-Identity-Response packets.

Parameters
[in]requestThe current request.
[in]eap_sessionEAP-Session to associate identity with.
[in]eap_packetTo extract the identity from.
Returns
  • The user's EAP-Identity.
  • or NULL on error.

Definition at line 230 of file session.c.

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

◆ eap_session_alloc()

static eap_session_t* eap_session_alloc ( request_t request)
static

Allocate a new eap_session_t.

Allocates a new eap_session_t, and inserts it into the REQUEST_DATA_EAP_SESSION index of the request.

Note
The eap_session_t will remove itself from the REQUEST_DATA_EAP_SESSION index if it is freed. This is to simplify management of the request data entry.
Parameters
[in]requestThat generated this eap_session_t.
Returns

Definition at line 104 of file session.c.

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

◆ 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_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: