The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Functions for allocating requests and storing internal data in them. More...
#include <freeradius-devel/server/request.h>
#include <freeradius-devel/server/request_data.h>
#include <freeradius-devel/unlang/interpret.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/atexit.h>
Go to the source code of this file.
Macros | |
#define | list_init(_ctx, _list) |
Functions | |
request_t * | _request_alloc (char const *file, int line, TALLOC_CTX *ctx, request_type_t type, request_init_args_t const *args) |
Create a new request_t data structure. | |
static int | _request_free (request_t *request) |
Callback for freeing a request struct. | |
static int | _request_free_list_free_on_exit (void *arg) |
Free any free requests when the thread is joined. | |
static int | _request_global_free (UNUSED void *uctx) |
static int | _request_global_init (UNUSED void *uctx) |
request_t * | _request_local_alloc (char const *file, int line, TALLOC_CTX *ctx, request_type_t type, request_init_args_t const *args) |
Allocate a request that's not in the free list. | |
static int | _request_local_free (request_t *request) |
static int | _state_ctx_free (fr_pair_t *state) |
static request_t * | request_alloc_pool (TALLOC_CTX *ctx) |
static int | request_child_init (request_t *child, request_t *parent) |
int | request_detach (request_t *child) |
Unlink a subrequest from its parent. | |
static int | request_detachable_init (request_t *child, request_t *parent) |
int | request_global_init (void) |
static int | request_init (char const *file, int line, request_t *request, request_type_t type, request_init_args_t const *args) |
Setup logging and other fields for a request. | |
static void | request_log_init_child (request_t *child, request_t const *parent) |
static void | request_log_init_detachable (request_t *child, request_t const *parent) |
static void | request_log_init_orphan (request_t *request) |
void | request_log_prepend (request_t *request, fr_log_t *log_dst, fr_log_lvl_t lvl) |
Prepend another logging destination to the list. | |
fr_pair_t * | request_state_replace (request_t *request, fr_pair_t *new_state) |
Replace the session_state_ctx with a new one. | |
Variables | |
static request_init_args_t | default_args |
static fr_dict_t const * | dict_freeradius |
fr_dict_attr_t const * | request_attr_control |
fr_dict_attr_t const * | request_attr_local |
fr_dict_attr_t const * | request_attr_reply |
fr_dict_attr_t const * | request_attr_request |
fr_dict_attr_t const * | request_attr_root |
fr_dict_attr_t const * | request_attr_state |
fr_dict_autoload_t | request_dict [] |
fr_dict_attr_autoload_t | request_dict_attr [] |
static _Thread_local fr_dlist_head_t * | request_free_list |
The thread local free list. | |
Functions for allocating requests and storing internal data in them.
Definition in file request.c.
#define list_init | ( | _ctx, | |
_list | |||
) |
request_t * _request_alloc | ( | char const * | file, |
int | line, | ||
TALLOC_CTX * | ctx, | ||
request_type_t | type, | ||
request_init_args_t const * | args | ||
) |
Create a new request_t data structure.
[in] | file | where the request was allocated. |
[in] | line | where the request was allocated. |
[in] | ctx | to bind the request to. |
[in] | type | what type of request to alloc. |
[in] | args | Optional arguments. |
Definition at line 501 of file request.c.
|
static |
Callback for freeing a request struct.
[in] | request | to free or return to the free list. |
Definition at line 362 of file request.c.
|
static |
|
static |
|
static |
request_t * _request_local_alloc | ( | char const * | file, |
int | line, | ||
TALLOC_CTX * | ctx, | ||
request_type_t | type, | ||
request_init_args_t const * | args | ||
) |
Allocate a request that's not in the free list.
This can be useful if modules need a persistent request for their own purposes which needs to be outside of the normal free list, so that it can be freed when the module requires, not when the thread destructor runs.
Definition at line 608 of file request.c.
|
static |
|
static |
|
inlinestatic |
int request_detach | ( | request_t * | child | ) |
Unlink a subrequest from its parent.
[in] | child | request to unlink. |
Definition at line 668 of file request.c.
int request_global_init | ( | void | ) |
|
inlinestatic |
Setup logging and other fields for a request.
[in] | file | the request was allocated in. |
[in] | line | the request was allocated on. |
[in] | request | to (re)-initialise. |
[in] | type | of request to initialise. |
[in] | args | Other optional arguments. |
Definition at line 242 of file request.c.
|
inlinestatic |
void request_log_prepend | ( | request_t * | request, |
fr_log_t * | log_dst, | ||
fr_log_lvl_t | lvl | ||
) |
Replace the session_state_ctx with a new one.
NOTHING should rewrite request->session_state_ctx.
It's now a pair, and is stored in request->pair_root. So it's wrong for anyone other than this function to play games with it.
[in] | request | to replace the state of. |
[in] | new_state | state to assign to the request. May be NULL in which case a new_state state will be alloced and assigned. |
Definition at line 637 of file request.c.
|
static |
fr_dict_attr_t const* request_attr_control |
fr_dict_attr_t const* request_attr_local |
fr_dict_attr_t const* request_attr_reply |
fr_dict_attr_t const* request_attr_request |
fr_dict_attr_t const* request_attr_root |
fr_dict_attr_t const* request_attr_state |
fr_dict_autoload_t request_dict |
fr_dict_attr_autoload_t request_dict_attr |
|
static |