The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
#include <freeradius-devel/server/state.h>
#include "interpret_priv.h"
#include "subrequest_child_priv.h"
Go to the source code of this file.
Functions | |
static void | unlang_detached_max_request_time (UNUSED fr_event_list_t *el, UNUSED fr_time_t now, void *uctx) |
Event handler to free a detached child. More... | |
static unlang_action_t | unlang_subrequest_calculate_result (rlm_rcode_t *p_result, UNUSED request_t *request, unlang_stack_frame_t *frame) |
Function to run in the context of the parent on resumption. More... | |
static unlang_action_t | unlang_subrequest_child_done (rlm_rcode_t *p_result, UNUSED int *p_priority, request_t *request, void *uctx) |
When the child is done, tell the parent that we've exited. More... | |
void | unlang_subrequest_child_op_free (void) |
int | unlang_subrequest_child_op_init (void) |
int | unlang_subrequest_child_push (rlm_rcode_t *out, request_t *child, unlang_subrequest_session_t const *session, bool free_child, bool top_frame) |
Push a pre-existing child back onto the stack as a subrequest. More... | |
int | unlang_subrequest_child_push_and_detach (request_t *request) |
int | unlang_subrequest_child_push_resume (request_t *child, unlang_frame_state_subrequest_t *state) |
Push a resumption frame onto a child's stack. More... | |
unlang_action_t | unlang_subrequest_child_run (UNUSED rlm_rcode_t *p_result, UNUSED request_t *request, unlang_stack_frame_t *frame) |
Function called by the unlang interpreter to start the child running. More... | |
static void | unlang_subrequest_child_signal (request_t *request, fr_signal_t action, UNUSED void *uctx) |
Process a detach signal in the child. More... | |
int | unlang_subrequest_lifetime_set (request_t *request) |
Initialize a detached child. More... | |
Variables | |
static fr_dict_t const * | dict_freeradius |
static fr_dict_attr_t const * | request_attr_request_lifetime |
fr_dict_autoload_t | subrequest_dict [] |
fr_dict_attr_autoload_t | subrequest_dict_attr [] |
static unlang_subrequest_t * | subrequest_instruction |
Holds a synthesised instruction that we insert into the parent request. More... | |
|
static |
Event handler to free a detached child.
Definition at line 53 of file subrequest_child.c.
|
static |
Function to run in the context of the parent on resumption.
Definition at line 244 of file subrequest_child.c.
|
static |
When the child is done, tell the parent that we've exited.
This is pushed as a frame at the top of the child's stack, so when the child is done executing, it runs this to inform the parent that its done.
Definition at line 170 of file subrequest_child.c.
void unlang_subrequest_child_op_free | ( | void | ) |
Definition at line 434 of file subrequest_child.c.
int unlang_subrequest_child_op_init | ( | void | ) |
Definition at line 390 of file subrequest_child.c.
int unlang_subrequest_child_push | ( | rlm_rcode_t * | out, |
request_t * | child, | ||
unlang_subrequest_session_t const * | session, | ||
bool | free_child, | ||
bool | top_frame | ||
) |
Push a pre-existing child back onto the stack as a subrequest.
The child MUST have been allocated with unlang_io_subrequest_alloc, or something that calls it.
After the child is no longer required it MUST be freed with unlang_subrequest_detach_and_free. It's not enough to free it with talloc_free.
This function should be called before pushing any additional frames onto the child's stack for it to execute.
The parent should return UNLANG_ACTION_PUSHED_CHILD, when it's done setting up the child request. It should NOT return UNLANG_ACTION_YIELD.
[in] | out | Where to write the result of the subrequest. |
[in] | child | to push. |
[in] | session | control values. Whether we restore/store session info. |
[in] | free_child | automatically free the child when it's finished executing. This is useful if extracting the result from the child is done using the child's stack, and so the parent never needs to access it. |
[in] | top_frame | Set to UNLANG_TOP_FRAME if the interpreter should return. Set to UNLANG_SUB_FRAME if the interprer should continue. |
Definition at line 329 of file subrequest_child.c.
int unlang_subrequest_child_push_and_detach | ( | request_t * | request | ) |
Definition at line 373 of file subrequest_child.c.
int unlang_subrequest_child_push_resume | ( | request_t * | child, |
unlang_frame_state_subrequest_t * | state | ||
) |
Push a resumption frame onto a child's stack.
This is necessary so that the child informs its parent when it's done/detached and so that the child responds to detach signals.
Definition at line 224 of file subrequest_child.c.
unlang_action_t unlang_subrequest_child_run | ( | UNUSED rlm_rcode_t * | p_result, |
UNUSED request_t * | request, | ||
unlang_stack_frame_t * | frame | ||
) |
Function called by the unlang interpreter to start the child running.
The reason why we do this on the unlang stack is so that this frame is marked as resumable in the parent, not whatever frame was previously being processed by the interpreter when the parent was called.
i.e. after calling unlang_subrequest_child_push, the code in the parent can call UNLANG_ACTION_PUSHED_CHILD, which will result in this frame being executed, and this frame can yield.
Definition at line 266 of file subrequest_child.c.
|
static |
Process a detach signal in the child.
This processes any detach signals the child receives The child doesn't actually do the detaching
Definition at line 112 of file subrequest_child.c.
int unlang_subrequest_lifetime_set | ( | request_t * | request | ) |
Initialize a detached child.
Detach it from the parent, set up it's lifetime, and mark it as runnable.
Definition at line 67 of file subrequest_child.c.
|
static |
Definition at line 34 of file subrequest_child.c.
|
static |
Definition at line 42 of file subrequest_child.c.
fr_dict_autoload_t subrequest_dict |
Definition at line 37 of file subrequest_child.c.
fr_dict_attr_autoload_t subrequest_dict_attr |
Definition at line 45 of file subrequest_child.c.
|
static |
Holds a synthesised instruction that we insert into the parent request.
Definition at line 32 of file subrequest_child.c.