26RCSID(
"$Id: 1307234c2c59bfd78e52ae68c614c2302bec11d9 $")
28#include <freeradius-devel/server/state.h>
29#include <freeradius-devel/server/signal.h>
30#include <freeradius-devel/server/pair.h>
31#include <freeradius-devel/unlang/unlang_priv.h>
32#include <freeradius-devel/unlang/action.h>
33#include <freeradius-devel/unlang/finally.h>
34#include <freeradius-devel/unlang/interpret.h>
35#include <freeradius-devel/util/timer.h>
48 RDEBUG(
"Timeout reached, exiting finally section");
106 static unlang_t finally_instruction = {
109 .debug_name =
"finally",
167 .frame_state_type =
"unlang_frame_state_finally_t",
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
@ UNLANG_ACTION_PUSHED_CHILD
unlang_t pushed a new child onto the stack, execute it instead of continuing.
@ UNLANG_ACTION_FAIL
Encountered an unexpected error.
void unlang_finally_init(void)
static void unlang_timeout_handler(UNUSED fr_timer_list_t *tl, UNUSED fr_time_t now, void *ctx)
fr_time_delta_t min_time
minimum time to run the finally instruction.
unlang_t * instruction
to run on timeout
int unlang_finally_push_instruction(request_t *request, void *instruction, fr_time_delta_t min_time, bool top_frame)
Push a finally instructtion on the stack, to be evaluated as the stack is unwound.
static unlang_action_t unlang_finally(UNUSED rlm_rcode_t *p_result, request_t *request, UNUSED unlang_stack_frame_t *frame)
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.
TALLOC_CTX * unlang_interpret_frame_talloc_ctx(request_t *request)
Get a talloc_ctx which is valid only for this frame.
int unlang_interpret_push(request_t *request, unlang_t const *instruction, rlm_rcode_t default_rcode, bool do_next_sibling, bool top_frame)
Push a new frame onto the stack.
void unlang_interpret_signal(request_t *request, fr_signal_t action)
Send a signal (usually stop) to a request.
fr_event_list_t * unlang_interpret_event_list(request_t *request)
Get the event list for the current interpreter.
void unlang_register(int type, unlang_op_t *op)
Register an operation with the interpreter.
static char * stack[MAX_STACK]
rlm_rcode_t
Return codes indicating the result of the module call.
@ RLM_MODULE_INVALID
The module considers the request invalid.
@ RLM_MODULE_OK
The module is OK, continue.
@ RLM_MODULE_FAIL
Module failed, don't reply.
@ RLM_MODULE_DISALLOW
Reject the request (user is locked out).
@ RLM_MODULE_REJECT
Immediately reject the request.
@ RLM_MODULE_TIMEOUT
Module (or section) timed out.
@ RLM_MODULE_NOTFOUND
User not found.
@ RLM_MODULE_UPDATED
OK (pairs modified).
@ RLM_MODULE_NOT_SET
Error resolving rcode (should not be returned by modules).
@ RLM_MODULE_NOOP
Module succeeded without doing anything.
@ RLM_MODULE_HANDLED
The module handled the request, so stop.
@ FR_SIGNAL_CANCEL
Request has been cancelled.
#define fr_time_delta_lt(_a, _b)
A time delta, a difference in time measured in nanoseconds.
fr_time_delta_t fr_timer_remaining(fr_timer_t *ev)
Return time delta between now and when the timer should fire.
void * state
Stack frame specialisations.
@ UNLANG_TYPE_FINALLY
run at the end of a virtual server.
static void frame_repeat(unlang_stack_frame_t *frame, unlang_process_t process)
Mark the current stack frame up for repeat, and set a new process function.
@ UNLANG_OP_FLAG_NO_CANCEL
Must not be cancelled.
unlang_type_t type
The specialisation of this node.
A node in a graph of unlang_op_t (s) that we execute.
Our interpreter stack, as distinct from the C stack.
An unlang stack associated with a request.