31 #include <freeradius-devel/server/cf_util.h>
32 #include <freeradius-devel/server/request.h>
33 #include <freeradius-devel/unlang/action.h>
35 #define UNLANG_TOP_FRAME (true)
36 #define UNLANG_SUB_FRAME (false)
38 #define UNLANG_STACK_MAX (64)
39 #define UNLANG_FRAME_PRE_ALLOC (128)
124 CC_HINT(warn_unused_result);
128 CC_HINT(warn_unused_result);
A section grouping multiple CONF_PAIR.
fr_dcursor_eval_t void const * uctx
unlang_request_stop_t stop
function called when a request is signalled to stop.
rlm_rcode_t unlang_interpret(request_t *request)
Run the interpreter for a current request.
fr_event_list_t * unlang_interpret_event_list(request_t *request)
Get the event list for the current interpreter.
bool unlang_request_is_done(request_t const *request)
Return whether a request has been marked done.
void unlang_interpet_frame_discard(request_t *request)
Discard the bottom most frame on the request's stack.
int unlang_interpret_push_instruction(request_t *request, void *instruction, rlm_rcode_t default_rcode, bool top_frame)
Push an instruction onto the request stack for later interpretation.
void unlang_interpret_request_done(request_t *request)
Indicate to the caller of the interpreter that this request is complete.
unlang_interpret_t * unlang_interpret_get(request_t *request)
Get the interpreter set for a request.
void unlang_interpret_set(request_t *request, unlang_interpret_t *intp)
Set a specific interpreter for a request.
rlm_rcode_t unlang_interpret_stack_result(request_t *request)
Get the current rcode for the frame.
unlang_request_done_t done_internal
Function called when an internal request completes.
int unlang_interpret_stack_depth(request_t *request)
Return the depth of the request's stack.
void unlang_interpret_mark_runnable(request_t *request)
Mark a request as resumable.
bool unlang_request_is_scheduled(request_t const *request)
Return whether a request is currently scheduled.
int unlang_interpret_init_global(TALLOC_CTX *ctx)
unlang_request_resume_t resume
Function called when a request is resumed.
bool(* unlang_request_scheduled_t)(request_t const *request, void *uctx)
Signal the owner of the interpreter that a request is now runnable.
unlang_request_done_t done_external
Function called when a external request completes.
void unlang_interpret_set_thread_default(unlang_interpret_t *intp)
Set the default interpreter for this thread.
unlang_request_init_t detach
Function called when a request is detached.
unlang_request_runnable_t mark_runnable
Function called when a request needs to be added back to the runnable queue.
bool unlang_request_is_cancelled(request_t const *request)
Return whether a request has been cancelled.
unlang_request_yield_t yield
Function called when a request yields.
void unlang_interpret_signal(request_t *request, fr_signal_t action)
Send a signal (usually stop) to a request.
void(* unlang_request_done_t)(request_t *request, rlm_rcode_t rcode, void *uctx)
Signal the owner of the interpreter that this request completed processing.
void(* unlang_request_resume_t)(request_t *request, void *uctx)
Signal the owner of the interpreter that a request is ready to be resumed.
unlang_interpret_t * unlang_interpret_init(TALLOC_CTX *ctx, fr_event_list_t *el, unlang_request_func_t *func, void *uctx)
Initialize a unlang compiler / interpret.
int unlang_interpret_push_section(request_t *request, CONF_SECTION *cs, rlm_rcode_t default_action, bool top_frame)
Push a configuration section onto the request stack for later interpretation.
unlang_request_done_t done_detached
Function called when a detached request completes.
void(* unlang_request_yield_t)(request_t *request, void *uctx)
Signal the owner of the interpreter that a request has yielded.
bool unlang_interpret_is_resumable(request_t *request)
Check if a request as resumable.
rlm_rcode_t unlang_interpret_synchronous(fr_event_list_t *el, request_t *request)
Execute an unlang section synchronously.
void(* unlang_request_init_t)(request_t *request, void *uctx)
Signal the owner of the interpreter that this request should be initialised and executed.
void unlang_interpret_stack_result_set(request_t *request, rlm_rcode_t code)
Overwrite the current stack rcode.
TALLOC_CTX * unlang_interpret_frame_talloc_ctx(request_t *request)
Get a talloc_ctx which is valid only for this frame.
unlang_request_scheduled_t scheduled
Function to check if a request is already scheduled.
void(* unlang_request_stop_t)(request_t *request, void *uctx)
Stop a request from running.
void(* unlang_request_runnable_t)(request_t *request, void *uctx)
Signal the owner of the interpreter that a request is now runnable.
void * unlang_interpret_stack_alloc(TALLOC_CTX *ctx)
Allocate a new unlang stack.
unlang_request_init_t init_internal
Function called to initialise an internal request.
unlang_interpret_t * unlang_interpret_get_thread_default(void)
Get the default interpreter for this thread.
External functions provided by the owner of the interpret.
Stores all information relating to an event list.
rlm_rcode_t
Return codes indicating the result of the module call.
static fr_event_list_t * el