Track overarching 'state' of the authentication session over multiple packets.
More...
#include <freeradius-devel/util/dict.h>
#include <freeradius-devel/server/request.h>
#include <freeradius-devel/server/cf_parse.h>
#include <freeradius-devel/server/tmpl.h>
Go to the source code of this file.
|
| void | fr_state_discard (fr_state_tree_t *state, request_t *request) |
| | Called when sending an Access-Accept/Access-Reject to discard state information.
|
| |
| void | fr_state_discard_by_state (fr_state_tree_t *state, request_t *request) |
| | Called to discard a state which is synthesized.
|
| |
| void | fr_state_discard_child (request_t *parent, void const *unique_ptr, int unique_int) |
| | Remove state from a child.
|
| |
| int | fr_state_restore (fr_state_tree_t *state, request_t *request) |
| | Copy a pointer to the head of the list of state fr_pair_ts (and their ctx) into the request.
|
| |
| void | fr_state_restore_from_parent (request_t *child, void const *unique_ptr, int unique_int) |
| | Restore subrequest data from a parent request.
|
| |
| int | fr_state_store (fr_state_tree_t *state, request_t *request) |
| | Transfer ownership of the state fr_pair_ts and ctx, back to a state entry.
|
| |
| void | fr_state_store_in_parent (request_t *request, void const *unique_ptr, int unique_int) |
| | Store subrequest's session-state list and persistable request data in its parent.
|
| |
| fr_state_tree_t * | fr_state_tree_init (TALLOC_CTX *ctx, fr_dict_attr_t const *da, fr_state_config_t const *config) |
| | Initialise a new state tree.
|
| |
Track overarching 'state' of the authentication session over multiple packets.
- Id
- 3fea08be12119aa7dd0dd7bb872f9dc1e9d8775b
- Copyright
- 2014 The FreeRADIUS server project
-
2014 Alan DeKok (aland.nosp@m.@dep.nosp@m.loyin.nosp@m.grad.nosp@m.ius.c.nosp@m.om)
Definition in file state.h.
◆ fr_state_config_t
Definition at line 40 of file state.h.
| Data Fields |
|
uint32_t |
context_id |
internal number to help keep state trees separate |
|
tmpl_t * |
dedup_key |
for tracking misbehaving supplicants |
|
uint32_t |
max_rounds |
maximum number of rounds before we give up |
|
uint32_t |
max_sessions |
maximum number of sessions |
|
uint8_t |
server_id |
for mangling State |
|
bool |
thread_safe |
|
|
fr_time_delta_t |
timeout |
idle timeout |
◆ fr_state_tree_t
◆ fr_state_discard()
Called when sending an Access-Accept/Access-Reject to discard state information.
- Parameters
-
| [in] | state | tree to lookup state in. |
| [in] | request | to discard state for. |
Definition at line 685 of file state.c.
◆ fr_state_discard_by_state()
Called to discard a state which is synthesized.
Some protocols synthesize a state, which means that there is the possibility for conflict. i.e. an old state exists which needs to be discarded. The current request can't restore the old state, it instead needs to discard it.
- Parameters
-
| [in] | state | tree to lookup state in. |
| [in] | request | to discard state for. |
Definition at line 734 of file state.c.
◆ fr_state_discard_child()
| void fr_state_discard_child |
( |
request_t * |
parent, |
|
|
void const * |
unique_ptr, |
|
|
int |
unique_int |
|
) |
| |
Remove state from a child.
This is useful for modules like EAP, where we keep a persistent eap_session but may call multiple EAP method modules during negotiation, and need to discard the state between each module call.
- Parameters
-
| [in] | parent | Holding the child's state. |
| [in] | unique_ptr | A parent may have multiple subrequests spawned by different modules. This identifies the module or other facility that spawned the subrequest. |
| [in] | unique_int | Further identification. |
Definition at line 1037 of file state.c.
◆ fr_state_restore()
Copy a pointer to the head of the list of state fr_pair_ts (and their ctx) into the request.
- Note
- Does not copy the actual fr_pair_ts. The fr_pair_ts and their context are transferred between state entries as the conversation progresses.
-
Called with the mutex free.
- Parameters
-
| [in] | state | tree to lookup state in. |
| [in] | request | to restore state for. |
- Returns
- 2 if the state attribute didn't match any known states.
- 1 if no state attribute existed.
- 0 on success (state restored)
- -1 if a state entry has already been thawed by a another request.
Definition at line 764 of file state.c.
◆ fr_state_restore_from_parent()
| void fr_state_restore_from_parent |
( |
request_t * |
child, |
|
|
void const * |
unique_ptr, |
|
|
int |
unique_int |
|
) |
| |
Restore subrequest data from a parent request.
- Parameters
-
| [in] | child | The child request to restore state to. |
| [in] | unique_ptr | A parent may have multiple subrequests spawned by different modules. This identifies the module or other facility that spawned the subrequest. |
| [in] | unique_int | Further identification. |
Definition at line 987 of file state.c.
◆ fr_state_store()
Transfer ownership of the state fr_pair_ts and ctx, back to a state entry.
Put request->session_state_pairs 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 840 of file state.c.
◆ fr_state_store_in_parent()
| void fr_state_store_in_parent |
( |
request_t * |
child, |
|
|
void const * |
unique_ptr, |
|
|
int |
unique_int |
|
) |
| |
Store subrequest's session-state list and persistable request data in its parent.
- Parameters
-
| [in] | child | The child request to retrieve state from. |
| [in] | unique_ptr | A parent may have multiple subrequests spawned by different modules. This identifies the module or other facility that spawned the subrequest. |
| [in] | unique_int | Further identification. |
Definition at line 941 of file state.c.
◆ fr_state_tree_init()
Initialise a new state tree.
- Parameters
-
| [in] | ctx | to link the lifecycle of the state tree to. |
| [in] | da | Attribute used to store and retrieve state from. |
| [in] | config | the configuration data |
- Returns
- A new state tree.
- NULL on failure.
Definition at line 232 of file state.c.
◆ state_session_config