27 RCSIDH(state_h,
"$Id: 367b70ec104f22fa472d67f4d1e2fd1affcd64fb $")
33 #include <freeradius-devel/util/dict.h>
34 #include <freeradius-devel/server/request.h>
static fr_time_delta_t timeout
uint32_t max_sessions
Maximum number of sessions we track.
uint8_t server_id
ID to use for load balancing.
fr_dict_attr_t const * da
State attribute used.
bool thread_safe
Whether we lock the tree whilst modifying it.
uint32_t context_id
ID binding state values to a context such as a virtual server.
void fr_state_discard_child(request_t *parent, void const *unique_ptr, int unique_int)
Remove state from a child.
fr_state_tree_t * fr_state_tree_init(TALLOC_CTX *ctx, fr_dict_attr_t const *da, bool thread_safe, uint32_t max_sessions, fr_time_delta_t timeout, uint8_t server_id, uint32_t context_id)
Initialise a new state tree.
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_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.
int fr_request_to_state(fr_state_tree_t *state, request_t *request)
Transfer ownership of the state fr_pair_ts and ctx, back to a state entry.
int fr_state_to_request(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.
uint64_t fr_state_entries_tracked(fr_state_tree_t *state)
Return number of entries we're currently tracking.
uint64_t fr_state_entries_created(fr_state_tree_t *state)
Return number of entries created.
uint64_t fr_state_entries_timeout(fr_state_tree_t *state)
Return number of entries that timed out.
void fr_state_restore_to_child(request_t *child, void const *unique_ptr, int unique_int)
Restore subrequest data from a parent request.
A time delta, a difference in time measured in nanoseconds.