The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Request data management functions. More...
#include <freeradius-devel/server/request.h>
Go to the source code of this file.
Macros | |
#define | request_data_add(_request, _unique_ptr, _unique_int, _opaque, _free_on_replace, _free_on_parent, _persist) |
Add opaque data to a request_t. More... | |
#define | request_data_talloc_add(_request, _unique_ptr, _unique_int, _type, _opaque, _free_on_replace, _free_on_parent, _persist) |
Add opaque data to a request_t. More... | |
Typedefs | |
typedef struct request_data_s | request_data_t |
Functions | |
int | _request_data_add (request_t *request, void const *unique_ptr, int unique_int, char const *type, void *opaque, bool free_on_replace, bool free_on_parent, bool persist, char const *file, int line) |
Add opaque data to a request_t. More... | |
int | request_data_by_persistance (fr_dlist_head_t *out, request_t *request, bool persist) |
Loop over all the request data, pulling out ones matching persist state. More... | |
int | request_data_by_persistance_count (request_t *request, bool persist) |
Return how many request data entries exist of a given persistence. More... | |
int | request_data_by_persistance_reparent (TALLOC_CTX *ctx, fr_dlist_head_t *out, request_t *request, bool persist) |
Loop over all the request data, copying, then freeing ones matching persist state. More... | |
void | request_data_dump (request_t *request) |
void * | request_data_get (request_t *request, void const *unique_ptr, int unique_int) |
Get opaque data from a request. More... | |
void | request_data_list_dump (request_t *request, fr_dlist_head_t *head) |
void | request_data_list_init (fr_dlist_head_t *data) |
void | request_data_persistable_free (request_t *request) |
Used for removing data from subrequests that are about to be freed. More... | |
void * | request_data_reference (request_t *request, void const *unique_ptr, int unique_int) |
Get opaque data from a request without removing it. More... | |
void | request_data_restore (request_t *request, fr_dlist_head_t *in) |
Add request data back to a request. More... | |
Request data management functions.
Definition in file request_data.h.
#define request_data_add | ( | _request, | |
_unique_ptr, | |||
_unique_int, | |||
_opaque, | |||
_free_on_replace, | |||
_free_on_parent, | |||
_persist | |||
) |
Add opaque data to a request_t.
The unique ptr is meant to be a module configuration, and the unique integer allows the caller to have multiple opaque data associated with a request_t.
[in] | _request | to associate data with. |
[in] | _unique_ptr | Identifier for the data. |
[in] | _unique_int | Qualifier for the identifier. |
[in] | _opaque | Data to associate with the request. May be NULL. |
[in] | _free_on_replace | Free opaque data if this request_data is replaced. |
[in] | _free_on_parent | Free opaque data if the request is freed. Must not be set if the opaque data is also parented by the request or state (double free). |
[in] | _persist | Transfer request data to an fr_state_entry_t, and add it back to the next request we receive for the session. |
Definition at line 59 of file request_data.h.
#define request_data_talloc_add | ( | _request, | |
_unique_ptr, | |||
_unique_int, | |||
_type, | |||
_opaque, | |||
_free_on_replace, | |||
_free_on_parent, | |||
_persist | |||
) |
Add opaque data to a request_t.
The unique ptr is meant to be a module configuration, and the unique integer allows the caller to have multiple opaque data associated with a request_t.
[in] | _request | to associate data with. |
[in] | _unique_ptr | Identifier for the data. |
[in] | _unique_int | Qualifier for the identifier. |
[in] | _type | Type of data i.e. fr_pair_t. |
[in] | _opaque | Data to associate with the request. May be NULL. |
[in] | _free_on_replace | Free opaque data if this request_data is replaced. |
[in] | _free_on_parent | Free opaque data if the request is freed. Must not be set if the opaque data is also parented by the request or state (double free). |
[in] | _persist | Transfer request data to an fr_state_entry_t, and add it back to the next request we receive for the session. |
Definition at line 86 of file request_data.h.
typedef struct request_data_s request_data_t |
Definition at line 1 of file request_data.h.
int _request_data_add | ( | request_t * | request, |
void const * | unique_ptr, | ||
int | unique_int, | ||
char const * | type, | ||
void * | opaque, | ||
bool | free_on_replace, | ||
bool | free_on_parent, | ||
bool | persist, | ||
char const * | file, | ||
int | line | ||
) |
Add opaque data to a request_t.
The unique ptr is meant to be a module configuration, and the unique integer allows the caller to have multiple opaque data associated with a request_t.
[in] | request | to associate data with. |
[in] | unique_ptr | Identifier for the data. |
[in] | unique_int | Qualifier for the identifier. |
[in] | type | Type of data (if talloced) |
[in] | opaque | Data to associate with the request. May be NULL. |
[in] | free_on_replace | Free opaque data if this request_data is replaced. |
[in] | free_on_parent | Free opaque data if the request or session is freed. Must not be set if the opaque data is also parented by the request or state (double free). |
[in] | persist | Transfer request data to an fr_state_entry_t, and add it back to the next request we receive for the session. |
[in] | file | request data was added in. |
[in] | line | request data was added on. |
Definition at line 183 of file request_data.c.
int request_data_by_persistance | ( | fr_dlist_head_t * | out, |
request_t * | request, | ||
bool | persist | ||
) |
Loop over all the request data, pulling out ones matching persist state.
[out] | out | Head of result list. |
[in] | request | to search for request_data_t in. |
[in] | persist | Whether to pull persistable or non-persistable data. |
Definition at line 372 of file request_data.c.
Return how many request data entries exist of a given persistence.
[in] | request | to check in. |
[in] | persist | Whether to count persistable or non-persistable data. |
Definition at line 439 of file request_data.c.
int request_data_by_persistance_reparent | ( | TALLOC_CTX * | ctx, |
fr_dlist_head_t * | out, | ||
request_t * | request, | ||
bool | persist | ||
) |
Loop over all the request data, copying, then freeing ones matching persist state.
[in] | ctx | To allocate new request_data_t. |
[out] | out | Head of result list. If NULL, data will be reparented in place. |
[in] | request | to search for request_data_t in. |
[in] | persist | Whether to pull persistable or non-persistable data. |
Definition at line 397 of file request_data.c.
void request_data_dump | ( | request_t * | request | ) |
void* request_data_get | ( | request_t * | request, |
void const * | unique_ptr, | ||
int | unique_int | ||
) |
Get opaque data from a request.
[in] | request | to retrieve data from. |
[in] | unique_ptr | Identifier for the data. |
[in] | unique_int | Qualifier for the identifier. |
Definition at line 292 of file request_data.c.
void request_data_list_dump | ( | request_t * | request, |
fr_dlist_head_t * | head | ||
) |
Definition at line 482 of file request_data.c.
void request_data_list_init | ( | fr_dlist_head_t * | data | ) |
void request_data_persistable_free | ( | request_t * | request | ) |
Used for removing data from subrequests that are about to be freed.
[in] | request | to remove persistable data from. |
Definition at line 470 of file request_data.c.
void* request_data_reference | ( | request_t * | request, |
void const * | unique_ptr, | ||
int | unique_int | ||
) |
Get opaque data from a request without removing it.
request | to retrieve data from. |
unique_ptr | Identifier for the data. |
unique_int | Qualifier for the identifier. |
Definition at line 339 of file request_data.c.
void request_data_restore | ( | request_t * | request, |
fr_dlist_head_t * | in | ||
) |
Add request data back to a request.
request | to add data to. |
in | Data to add. |
Definition at line 461 of file request_data.c.