All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Typedefs | Functions | Variables
state.h File Reference

Go to the source code of this file.

Typedefs

typedef struct fr_state_tree_t fr_state_tree_t
 

Functions

bool fr_request_to_state (fr_state_tree_t *state, REQUEST *request, RADIUS_PACKET *original, RADIUS_PACKET *packet)
 Transfer ownership of the state VALUE_PAIRs and ctx, back to a state entry. More...
 
void fr_state_discard (fr_state_tree_t *state, REQUEST *request, RADIUS_PACKET *original)
 Called when sending an Access-Accept/Access-Reject to discard state information. More...
 
uint64_t fr_state_entries_created (fr_state_tree_t *state)
 Return number of entries created. More...
 
uint64_t fr_state_entries_timeout (fr_state_tree_t *state)
 Return number of entries that timed out. More...
 
uint32_t fr_state_entries_tracked (fr_state_tree_t *state)
 Return number of entries we're currently tracking. More...
 
void fr_state_to_request (fr_state_tree_t *state, REQUEST *request, RADIUS_PACKET *packet)
 Copy a pointer to the head of the list of state VALUE_PAIRs (and their ctx) into the request. More...
 
fr_state_tree_tfr_state_tree_init (TALLOC_CTX *ctx, uint32_t max_sessions, uint32_t timeout)
 Initialise a new state tree. More...
 

Variables

fr_state_tree_tglobal_state
 

Typedef Documentation

Definition at line 33 of file state.h.

Function Documentation

bool fr_request_to_state ( fr_state_tree_t state,
REQUEST request,
RADIUS_PACKET original,
RADIUS_PACKET packet 
)

Transfer ownership of the state VALUE_PAIRs and ctx, back to a state entry.

Put request->state into the State attribute. Put the State attribute into the vps list. Delete the original entry, if it exists

Also creates a new state entry.

Definition at line 579 of file state.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fr_state_discard ( fr_state_tree_t state,
REQUEST request,
RADIUS_PACKET original 
)

Called when sending an Access-Accept/Access-Reject to discard state information.

Definition at line 487 of file state.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint64_t fr_state_entries_created ( fr_state_tree_t state)

Return number of entries created.

Definition at line 624 of file state.c.

+ Here is the caller graph for this function:

uint64_t fr_state_entries_timeout ( fr_state_tree_t state)

Return number of entries that timed out.

Definition at line 632 of file state.c.

+ Here is the caller graph for this function:

uint32_t fr_state_entries_tracked ( fr_state_tree_t state)

Return number of entries we're currently tracking.

Definition at line 640 of file state.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fr_state_to_request ( fr_state_tree_t state,
REQUEST request,
RADIUS_PACKET packet 
)

Copy a pointer to the head of the list of state VALUE_PAIRs (and their ctx) into the request.

Note
Does not copy the actual VALUE_PAIRs. The VALUE_PAIRs and their context are transferred between state entries as the conversation progresses.
Called with the mutex free.

Definition at line 523 of file state.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

fr_state_tree_t* fr_state_tree_init ( TALLOC_CTX *  ctx,
uint32_t  max_sessions,
uint32_t  timeout 
)

Initialise a new state tree.

Parameters
ctxto link the lifecycle of the state tree to.
max_sessionswe track state for.
timeoutHow long to wait before cleaning up entries.
Returns
a new state tree or NULL on failure.

Definition at line 156 of file state.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

fr_state_tree_t* global_state

Definition at line 87 of file state.c.