![]() |
The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
|
Execute compiled unlang structures using an iterative interpret. More...
#include <freeradius-devel/unlang/action.h>#include <freeradius-devel/unlang/interpret.h>#include <freeradius-devel/util/timer.h>#include <freeradius-devel/server/base.h>#include <freeradius-devel/server/modpriv.h>#include <freeradius-devel/unlang/xlat_func.h>#include "interpret_priv.h"#include "unlang_priv.h"#include "module_priv.h"#include "load_balance_priv.h"#include <freeradius-devel/unlang/module_priv.h>
Include dependency graph for interpret.c:Go to the source code of this file.
Data Structures | |
| struct | unlang_interpret_shutdown_t |
| struct | unlang_variable_ref_t |
Macros | |
| #define | DUMP_STACK if (DEBUG_ENABLED5) stack_dump(request) |
| #define | SHUTDOWN |
Enumerations | |
| enum | p_result_location_t : uint8_t { P_RESULT_LOCATION_UNKNOWN = 0 , P_RESULT_LOCATION_FRAME , P_RESULT_LOCATION_SCRATCH , P_RESULT_LOCATION_STATE , P_RESULT_LOCATION_MODULE_RCTX , P_RESULT_LOCATION_FUNCTION_RCTX } |
Functions | |
| static int | _local_variables_free (unlang_variable_ref_t *ref) |
| static int | _unlang_interpret_el_free (unlang_interpret_t **p_self) |
| Remove the event list from the interpreter when the event list is freed. | |
| static int | _unlang_interpret_free (unlang_interpret_t *intp) |
| Remove the event list from the interpreter when the interpreter is freed. | |
| static void | _unlang_interpret_shutdown_detach (request_t *request, void *uctx) |
| Wrapper for "detach" during interpreter shutdown. | |
| static void | _unlang_interpret_shutdown_done_detached (request_t *request, rlm_rcode_t rcode, void *uctx) |
| Wrapper for "done_detached" during interpreter shutdown. | |
| static void | _unlang_interpret_shutdown_done_external (request_t *request, rlm_rcode_t rcode, void *uctx) |
| Wrapper for "done_external" during interpreter shutdown. | |
| static void | _unlang_interpret_shutdown_done_internal (request_t *request, rlm_rcode_t rcode, void *uctx) |
| Wrapper for "done_internal" during interpreter shutdown. | |
| static void | _unlang_interpret_shutdown_init_internal (request_t *request, void *uctx) |
| Wrapper for "init_internal" during interpreter shutdown. | |
| static void | _unlang_interpret_shutdown_mark_runnable (request_t *request, void *uctx) |
| Wrapper for "mark_runnable". | |
| static void | _unlang_interpret_shutdown_prioritise (request_t *request, void *uctx) |
| Wrapper for "prioritise" during interpreter shutdown. | |
| static void | _unlang_interpret_shutdown_resume (request_t *request, void *uctx) |
| Wrapper for "resume" during interpreter shutdown. | |
| static bool | _unlang_interpret_shutdown_scheduled (request_t const *request, void *uctx) |
| Wrapper for "scheduled" during interpreter shutdown. | |
| static void | _unlang_interpret_shutdown_yield (request_t *request, void *uctx) |
| Wrapper for "yield". | |
| static void | actions_dump (request_t *request, unlang_t const *instruction) |
| static int | find_p_result_location (p_result_location_t *location, void **chunk, request_t *request, void *ptr) |
| Try and figure out where p_result points to. | |
| static void | forced_result_expiry_handler (UNUSED fr_timer_list_t *tl, UNUSED fr_time_t now, void *ctx) |
| static void | frame_dump (request_t *request, unlang_stack_frame_t *frame, bool with_actions) |
| static unlang_frame_action_t | frame_eval (request_t *request, unlang_stack_frame_t *frame) |
| Evaluates all the unlang nodes in a section. | |
| static void | instruction_done_debug (request_t *request, unlang_stack_frame_t *frame, unlang_t const *instruction) |
| static void | instruction_dump (request_t *request, unlang_t const *instruction) |
| static void | instruction_retry_handler (UNUSED fr_timer_list_t *tl, UNUSED fr_time_t now, void *ctx) |
| static void | instruction_timeout_handler (UNUSED fr_timer_list_t *tl, UNUSED fr_time_t now, void *ctx) |
| static unlang_frame_action_t | result_calculate (request_t *request, unlang_stack_frame_t *frame, unlang_result_t *result) |
| Update the current result after each instruction, and after popping each stack frame. | |
| static unlang_frame_action_t | result_pop (request_t *request, unlang_stack_frame_t *frame, unlang_result_t *result) |
| Function called to merge inter-stack-frame results. | |
| void | stack_dump (request_t *request) |
| static void | stack_dump_body (request_t *request, bool with_actions) |
| void | stack_dump_with_actions (request_t *request) |
| static void | unlang_cancel_event (UNUSED fr_timer_list_t *tl, UNUSED fr_time_t now, void *uctx) |
| Signal the request to stop executing. | |
| static xlat_action_t | unlang_cancel_xlat (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *args) |
| Allows a request to dynamically alter its own lifetime. | |
| void | unlang_interpet_frame_discard (request_t *request) |
| Discard the bottom most frame on the request's stack. | |
| rlm_rcode_t | unlang_interpret (request_t *request, bool running) |
| 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. | |
| int | unlang_interpret_force_result (unlang_t const *instruction, unlang_result_t *p_result, fr_timer_list_t *tl, fr_time_delta_t expire) |
| Set (or clear) a forced result. | |
| TALLOC_CTX * | unlang_interpret_frame_talloc_ctx (request_t *request) |
| Get a talloc_ctx which is valid only for this frame. | |
| unlang_interpret_t * | unlang_interpret_get (request_t *request) |
| Get the interpreter set for a request. | |
| unlang_interpret_t * | unlang_interpret_get_thread_default (void) |
| Get the default interpreter for this thread. | |
| unlang_interpret_t * | unlang_interpret_init (TALLOC_CTX *ctx, fr_event_list_t *el, unlang_request_func_t *funcs, void *uctx) |
| Initialize a unlang compiler / interpret. | |
| int | unlang_interpret_init_global (TALLOC_CTX *ctx) |
| unlang_t const * | unlang_interpret_instruction (request_t *request) |
| Get the current instruction. | |
| bool | unlang_interpret_is_resumable (request_t *request) |
| Check if a request as resumable. | |
| static xlat_action_t | unlang_interpret_lb_child_xlat (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, UNUSED fr_value_box_list_t *in) |
| Tell the load-balance keyword to persist this child selection. | |
| static xlat_action_t | unlang_interpret_lb_persist_xlat (UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, UNUSED fr_value_box_list_t *in) |
| Tell the load-balance keyword to persist this child selection. | |
| void | unlang_interpret_mark_runnable (request_t *request) |
| Mark a request as resumable. | |
| static xlat_action_t | unlang_interpret_module_force (UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in) |
| Enable a module. | |
| unlang_mod_action_t | unlang_interpret_priority (request_t *request) |
| Get the last instruction priority OR the last frame that was popped. | |
| int | unlang_interpret_push (unlang_result_t *p_result, request_t *request, unlang_t const *instruction, unlang_frame_conf_t const *conf, bool do_next_sibling) |
| Push a new frame onto the stack. | |
| unlang_action_t | unlang_interpret_push_children (unlang_result_t *p_result, request_t *request, rlm_rcode_t default_rcode, bool do_next_sibling) |
| Push the children of the current frame onto a new frame onto the stack. | |
| int | unlang_interpret_push_instruction (unlang_result_t *p_result, request_t *request, void *instruction, unlang_frame_conf_t const *conf) |
| Push an instruction onto the request stack for later interpretation. | |
| int | unlang_interpret_push_section (unlang_result_t *p_result, request_t *request, CONF_SECTION *cs, unlang_frame_conf_t const *conf) |
| Push a configuration section onto the request stack for later interpretation. | |
| rlm_rcode_t | unlang_interpret_rcode (request_t *request) |
| Get the last instruction result OR the last frame that was popped. | |
| void | unlang_interpret_request_cancel_retry (request_t *request) |
| Cancel any pending retry. | |
| static void | unlang_interpret_request_detach (request_t *request) |
| Tell the interpreter to detach the request. | |
| void | unlang_interpret_request_done (request_t *request) |
| Indicate to the caller of the interpreter that this request is complete. | |
| void | unlang_interpret_request_prioritise (request_t *request, uint32_t priority) |
| unlang_result_t * | unlang_interpret_result (request_t *request) |
| Get the last instruction result OR the last frame that was popped. | |
| void | unlang_interpret_set (request_t *request, unlang_interpret_t *intp) |
| Set a specific interpreter for a request. | |
| void | unlang_interpret_set_thread_default (unlang_interpret_t *intp) |
| Set the default interpreter for this thread. | |
| int | unlang_interpret_set_timeout (request_t *request, fr_time_delta_t timeout) |
| Set a timeout for a request. | |
| static void | unlang_interpret_shutdown_cancel (request_t *request) |
| Cancel every frame of a request which is shutting down. | |
| void | unlang_interpret_shutting_down (unlang_interpret_t *intp) |
| Prepare to shutdown an unlang interpreter. | |
| void | unlang_interpret_signal (request_t *request, fr_signal_t action) |
| Send a signal (usually stop) to a request. | |
| void * | unlang_interpret_stack_alloc (TALLOC_CTX *ctx) |
| Allocate a new unlang stack. | |
| int | unlang_interpret_stack_depth (request_t *request) |
| Return the depth of the request's stack. | |
| char const * | unlang_interpret_virtual_server (request_t *request) |
| Return the current virtual server for this request. | |
| static xlat_action_t | unlang_interpret_xlat (TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in) |
| Get information about the interpreter state. | |
| bool | unlang_request_is_cancelled (request_t const *request) |
| Return whether a request has been cancelled. | |
| bool | unlang_request_is_done (request_t const *request) |
| Return whether a request has been marked done. | |
| bool | unlang_request_is_scheduled (request_t const *request) |
| Return whether a request is currently scheduled. | |
| void | unlang_stack_signal (request_t *request, fr_signal_t action, int limit) |
| Delivers a frame to one or more frames in the stack. | |
| static unlang_thread_t * | unlang_thread_data (unlang_t const *instruction) |
| Get the thread-instance data for an instruction. | |
| void * | unlang_thread_instance (unlang_t const *instruction) |
| Get the thread-instance data for an instruction. | |
| int | unlang_thread_instantiate (TALLOC_CTX *ctx) |
| Create thread-specific data structures for unlang. | |
| unlang_thread_t const * | unlang_thread_stats (unlang_t const *instruction) |
Variables | |
| static unlang_group_t | empty_group |
| static _Thread_local unlang_interpret_t * | intp_thread_default |
| The default interpreter instance for this thread. | |
| static fr_table_num_ordered_t const | p_result_location_table [] |
| static size_t | p_result_location_table_len = NUM_ELEMENTS(p_result_location_table) |
| static fr_table_num_ordered_t const | unlang_action_table [] |
| static size_t | unlang_action_table_len = NUM_ELEMENTS(unlang_action_table) |
| static xlat_arg_parser_t const | unlang_cancel_xlat_args [] |
| static fr_table_num_ordered_t const | unlang_frame_action_table [] |
| static size_t | unlang_frame_action_table_len = NUM_ELEMENTS(unlang_frame_action_table) |
| fr_rb_tree_t * | unlang_instruction_tree |
| static xlat_arg_parser_t const | unlang_interpret_module_force_args [] |
| static xlat_arg_parser_t const | unlang_interpret_xlat_args [] |
| uint64_t | unlang_number = 1 |
| static char const | unlang_spaces [] = " " |
| static _Thread_local unlang_thread_t * | unlang_thread_array |
Execute compiled unlang structures using an iterative interpret.
Definition in file interpret.c.
| struct unlang_interpret_shutdown_t |
Definition at line 2525 of file interpret.c.
Collaboration diagram for unlang_interpret_shutdown_t:| Data Fields | ||
|---|---|---|
| unlang_request_func_t | funcs | original functions |
| void * | uctx | original uctx |
| struct unlang_variable_ref_t |
Definition at line 682 of file interpret.c.
Collaboration diagram for unlang_variable_ref_t:| Data Fields | ||
|---|---|---|
| fr_dict_t const * | old_dict | the previous dictionary for the request |
| request_t * | request | the request |
| fr_dict_t const * | to_free_dict | Free entries matching this dictionary. |
| #define DUMP_STACK if (DEBUG_ENABLED5) stack_dump(request) |
Definition at line 599 of file interpret.c.
| #define SHUTDOWN |
Definition at line 2530 of file interpret.c.
| enum p_result_location_t : uint8_t |
| Enumerator | |
|---|---|
| P_RESULT_LOCATION_UNKNOWN | |
| P_RESULT_LOCATION_FRAME | |
| P_RESULT_LOCATION_SCRATCH | |
| P_RESULT_LOCATION_STATE | |
| P_RESULT_LOCATION_MODULE_RCTX | |
| P_RESULT_LOCATION_FUNCTION_RCTX | |
Definition at line 406 of file interpret.c.
|
static |
Definition at line 688 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Remove the event list from the interpreter when the event list is freed.
If the event list is freed before the interpreter, then we don't want the interpreter to use a freed event list.
Definition at line 2485 of file interpret.c.
Here is the caller graph for this function:
|
static |
Remove the event list from the interpreter when the interpreter is freed.
Definition at line 2497 of file interpret.c.
Here is the caller graph for this function:
|
static |
Wrapper for "detach" during interpreter shutdown.
A request which is running when the owner tells the request to detach continues to run, and the interpreter calls the done callback when the cancelled frames are unwound.
Definition at line 2543 of file interpret.c.
Here is the caller graph for this function:
|
static |
Wrapper for "done_detached" during interpreter shutdown.
Definition at line 2618 of file interpret.c.
Here is the caller graph for this function:
|
static |
Wrapper for "done_external" during interpreter shutdown.
Definition at line 2609 of file interpret.c.
Here is the caller graph for this function:
|
static |
Wrapper for "done_internal" during interpreter shutdown.
Definition at line 2600 of file interpret.c.
Here is the caller graph for this function:
|
static |
Wrapper for "init_internal" during interpreter shutdown.
The request is initialized, and then a later call will cancel it.
Definition at line 2591 of file interpret.c.
Here is the caller graph for this function:
|
static |
Wrapper for "mark_runnable".
Definition at line 2578 of file interpret.c.
Here is the caller graph for this function:
|
static |
Wrapper for "prioritise" during interpreter shutdown.
Definition at line 2636 of file interpret.c.
Here is the caller graph for this function:
|
static |
Wrapper for "resume" during interpreter shutdown.
The interpreter continues to run the request after this callback returns, and unwinds the cancelled frames.
Definition at line 2568 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:Wrapper for "scheduled" during interpreter shutdown.
Definition at line 2627 of file interpret.c.
Here is the caller graph for this function:
|
static |
Wrapper for "yield".
Definition at line 2554 of file interpret.c.
Here is the caller graph for this function:
|
static |
Try and figure out where p_result points to.
If it's somewhere other than these three locations, it's probably wrong.
Definition at line 419 of file interpret.c.
Here is the caller graph for this function:
|
static |
|
static |
Definition at line 517 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Evaluates all the unlang nodes in a section.
This function interprets a list of unlang instructions at a given level using the same stack frame, and pushes additional frames onto the stack as needed.
This function can be seen as moving horizontally.
| [in] | request | The current request. |
| [in] | frame | The current stack frame. |
Definition at line 1077 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
|
static |
Definition at line 1876 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 1892 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Update the current result after each instruction, and after popping each stack frame.
| [in] | request | The current request. |
| [in] | frame | The current stack frame. |
| [in] | result | from the previous action. |
Definition at line 793 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Function called to merge inter-stack-frame results.
This function is called whenever a frame is popped from the stack.
'result' is the result from the frame being popped, and 'frame' is the next highest frame in the stack.
The logic here is very similar to result_eval(), with two important differences:
Definition at line 1003 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void stack_dump | ( | request_t * | request | ) |
Definition at line 575 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void stack_dump_with_actions | ( | request_t * | request | ) |
|
static |
Signal the request to stop executing.
The request can't be running at this point because we're in the event loop. This means the request is always in a consistent state when the timeout event fires, even if that's state is waiting on I/O.
Definition at line 2097 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Allows a request to dynamically alter its own lifetime.
cancel(<timeout>)
If timeout is 0, then the request is immediately cancelled.
Definition at line 2117 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void unlang_interpet_frame_discard | ( | request_t * | request | ) |
Discard the bottom most frame on the request's stack.
This is used for cleaning up after errors. i.e. the caller uses a push function, and experiences an error and needs to remove the frame that was just pushed.
Definition at line 2751 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| rlm_rcode_t unlang_interpret | ( | request_t * | request, |
| bool | running | ||
| ) |
Run the interpreter for a current request.
This function runs the interpreter for a request. It deals with popping stack frames, and calculating the final result for the frame.
| [in] | request | to run. If this is an internal request the request may be freed by the interpreter. |
| [in] | running | Is the interpreter already running. |
Definition at line 1302 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_event_list_t * unlang_interpret_event_list | ( | request_t * | request | ) |
Get the event list for the current interpreter.
Definition at line 2778 of file interpret.c.
Here is the caller graph for this function:| int unlang_interpret_force_result | ( | unlang_t const * | instruction, |
| unlang_result_t * | p_result, | ||
| fr_timer_list_t * | tl, | ||
| fr_time_delta_t | expire | ||
| ) |
Set (or clear) a forced result.
If timer list is passed, and a future expiry time, the function will set a timer that removes the forced result at that time.
Definition at line 350 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| TALLOC_CTX * unlang_interpret_frame_talloc_ctx | ( | request_t * | request | ) |
Get a talloc_ctx which is valid only for this frame.
| [in] | request | The current request. |
Definition at line 2067 of file interpret.c.
| unlang_interpret_t * unlang_interpret_get | ( | request_t * | request | ) |
Get the interpreter set for a request.
Definition at line 2768 of file interpret.c.
Here is the caller graph for this function:| unlang_interpret_t * unlang_interpret_get_thread_default | ( | void | ) |
Get the default interpreter for this thread.
This allows detached requests to be executed asynchronously
Definition at line 2801 of file interpret.c.
Here is the caller graph for this function:| unlang_interpret_t * unlang_interpret_init | ( | TALLOC_CTX * | ctx, |
| fr_event_list_t * | el, | ||
| unlang_request_func_t * | funcs, | ||
| void * | uctx | ||
| ) |
Initialize a unlang compiler / interpret.
| [in] | ctx | to bind lifetime of the interpret to. Shouldn't be any free order issues here as the interpret itself has no state. But event loop should be stopped before freeing the interpret. |
| [in] | el | for any timer or I/O events. |
| [in] | funcs | Callbacks to used to communicate request state to our owner. |
| [in] | uctx | Data to pass to callbacks. |
Definition at line 2710 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int unlang_interpret_init_global | ( | TALLOC_CTX * | ctx | ) |
Definition at line 2808 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:Get the current instruction.
Definition at line 327 of file interpret.c.
Here is the caller graph for this function:Check if a request as resumable.
| [in] | request | The current request. |
Definition at line 2004 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void unlang_interpret_mark_runnable | ( | request_t * | request | ) |
Mark a request as resumable.
It's not called "unlang_interpret", because it doesn't actually resume the request, it just schedules it for resumption.
| [in] | request | The current request. |
Definition at line 2022 of file interpret.c.
Here is the call graph for this function:| unlang_mod_action_t unlang_interpret_priority | ( | request_t * | request | ) |
Get the last instruction priority OR the last frame that was popped.
| [in] | request | The current request. |
Definition at line 1957 of file interpret.c.
Here is the call graph for this function:| int unlang_interpret_push | ( | unlang_result_t * | p_result, |
| request_t * | request, | ||
| unlang_t const * | instruction, | ||
| unlang_frame_conf_t const * | conf, | ||
| bool | do_next_sibling | ||
| ) |
Push a new frame onto the stack.
| [in] | p_result | Where to write the result of evaluating the section. If NULL, results will be written to frame->section_result and will be automatically merged with the next highest frame when this one is popped. |
| [in] | request | to push the frame onto. |
| [in] | instruction | One or more unlang_t nodes describing the operations to execute. |
| [in] | conf | Configuration for the frame. If NULL, the following values areused:
|
| [in] | do_next_sibling | Whether to only execute the first node in the unlang_t program or to execute subsequent nodes. |
Definition at line 622 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| unlang_action_t unlang_interpret_push_children | ( | unlang_result_t * | p_result, |
| request_t * | request, | ||
| rlm_rcode_t | default_rcode, | ||
| bool | do_next_sibling | ||
| ) |
Push the children of the current frame onto a new frame onto the stack.
| [out] | p_result | set to RLM_MODULE_FAIL if pushing the children fails |
| [in] | request | to push the frame onto. |
| [in] | default_rcode | The default result. |
| [in] | do_next_sibling | Whether to only execute the first node in the unlang_t program or to execute subsequent nodes. |
Definition at line 726 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int unlang_interpret_push_instruction | ( | unlang_result_t * | p_result, |
| request_t * | request, | ||
| void * | instruction, | ||
| unlang_frame_conf_t const * | conf | ||
| ) |
Push an instruction onto the request stack for later interpretation.
Definition at line 1565 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int unlang_interpret_push_section | ( | unlang_result_t * | p_result, |
| request_t * | request, | ||
| CONF_SECTION * | cs, | ||
| unlang_frame_conf_t const * | conf | ||
| ) |
Push a configuration section onto the request stack for later interpretation.
Definition at line 1535 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| rlm_rcode_t unlang_interpret_rcode | ( | request_t * | request | ) |
Get the last instruction result OR the last frame that was popped.
| [in] | request | The current request. |
Definition at line 1947 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void unlang_interpret_request_cancel_retry | ( | request_t * | request | ) |
Cancel any pending retry.
| [in] | request | The current request. |
Definition at line 1698 of file interpret.c.
|
inlinestatic |
Tell the interpreter to detach the request.
This function should not be called directly use unlang_interpret_signal(request, FR_SIGNAL_DETACH) instead. This will ensure all frames on the request's stack receive the detach signal.
Definition at line 1666 of file interpret.c.
Here is the caller graph for this function:| void unlang_interpret_request_done | ( | request_t * | request | ) |
Indicate to the caller of the interpreter that this request is complete.
Definition at line 1630 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| unlang_result_t * unlang_interpret_result | ( | request_t * | request | ) |
Get the last instruction result OR the last frame that was popped.
| [in] | request | The current request. |
Definition at line 1967 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void unlang_interpret_set | ( | request_t * | request, |
| unlang_interpret_t * | intp | ||
| ) |
Set a specific interpreter for a request.
Definition at line 2759 of file interpret.c.
Here is the caller graph for this function:| void unlang_interpret_set_thread_default | ( | unlang_interpret_t * | intp | ) |
Set the default interpreter for this thread.
Definition at line 2790 of file interpret.c.
Here is the caller graph for this function:| int unlang_interpret_set_timeout | ( | request_t * | request, |
| fr_time_delta_t | timeout | ||
| ) |
Set a timeout for a request.
The timeout is associated with the current stack frame.
Definition at line 1910 of file interpret.c.
Here is the call graph for this function:
|
static |
Cancel every frame of a request which is shutting down.
The request is marked as cancelled, and each frame receives FR_SIGNAL_CANCEL. The frames are unwound by the interpreter when the request next runs.
| [in] | request | to cancel. |
Definition at line 2514 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void unlang_interpret_shutting_down | ( | unlang_interpret_t * | intp | ) |
Prepare to shutdown an unlang interpreter.
Once this function is called, the interpreter stops processing new actions. It should be called before the interpreter is freed. The idea is that we can mark up the interpreter as shutting down, and then call the various request cancel, etc. routines. The various request cancel routines have no idea that the interpreter is shutting down, and can't tell the difference between "stop everything", and "this stack frame was cancelled, but the request should continue running".
Rather than hacking up every call to the interpreter with checks as to whether or not the interpreter is shutting down, the main worker thread can call this function, and then the interpreter will take care of checking things.
| [in] | intp | the interpreter |
Definition at line 2664 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void unlang_interpret_signal | ( | request_t * | request, |
| fr_signal_t | action | ||
| ) |
Send a signal (usually stop) to a request.
This is typically called via an "async" action, i.e. an action outside of the normal processing of the request.
| [in] | request | The current request. |
| [in] | action | to signal. |
Definition at line 1794 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void * unlang_interpret_stack_alloc | ( | TALLOC_CTX * | ctx | ) |
Allocate a new unlang stack.
| [in] | ctx | to allocate stack in. |
Definition at line 1593 of file interpret.c.
Here is the caller graph for this function:| int unlang_interpret_stack_depth | ( | request_t * | request | ) |
Return the depth of the request's stack.
Definition at line 1935 of file interpret.c.
Here is the caller graph for this function:| char const * unlang_interpret_virtual_server | ( | request_t * | request | ) |
Return the current virtual server for this request.
| [in] | request | To return virtual server for. |
Definition at line 2451 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:Return whether a request has been cancelled.
Definition at line 1985 of file interpret.c.
Here is the caller graph for this function:Return whether a request has been marked done.
Definition at line 1992 of file interpret.c.
Here is the caller graph for this function:Return whether a request is currently scheduled.
Definition at line 1975 of file interpret.c.
Here is the caller graph for this function:| void unlang_stack_signal | ( | request_t * | request, |
| fr_signal_t | action, | ||
| int | limit | ||
| ) |
Delivers a frame to one or more frames in the stack.
This is typically called via an "async" action, i.e. an action outside of the normal processing of the request.
For FR_SIGNAL_CANCEL all frames are marked up for cancellation, but the cancellation is handled by the interpret.
Other signal types are delivered immediately, inrrespecitve of whether the request is currently being processed or not.
Signaling stops at the "limit" frame. This is so that keywords such as "timeout" and "limit" can signal frames lower than theirs to stop, but then continue with their own work.
| [in] | request | The current request. |
| [in] | action | to signal. |
| [in] | limit | the frame at which to stop signaling. |
Definition at line 1729 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Get the thread-instance data for an instruction.
| [in] | instruction | the instruction to use |
Definition at line 130 of file interpret.c.
Here is the caller graph for this function:| void * unlang_thread_instance | ( | unlang_t const * | instruction | ) |
Get the thread-instance data for an instruction.
| [in] | instruction | the instruction to use |
Definition at line 116 of file interpret.c.
Here is the caller graph for this function:| int unlang_thread_instantiate | ( | TALLOC_CTX * | ctx | ) |
Create thread-specific data structures for unlang.
Definition at line 69 of file interpret.c.
Here is the call graph for this function:
Here is the caller graph for this function:| unlang_thread_t const * unlang_thread_stats | ( | unlang_t const * | instruction | ) |
|
static |
Definition at line 1500 of file interpret.c.
|
static |
The default interpreter instance for this thread.
Definition at line 45 of file interpret.c.
|
static |
Definition at line 479 of file interpret.c.
|
static |
Definition at line 486 of file interpret.c.
|
static |
Definition at line 387 of file interpret.c.
|
static |
Definition at line 394 of file interpret.c.
|
static |
Definition at line 2082 of file interpret.c.
|
static |
Definition at line 396 of file interpret.c.
|
static |
Definition at line 401 of file interpret.c.
|
extern |
|
static |
Definition at line 2400 of file interpret.c.
|
static |
Definition at line 2195 of file interpret.c.
| uint64_t unlang_number = 1 |
Definition at line 55 of file interpret.c.
|
static |
Definition at line 59 of file interpret.c.
|
static |
Definition at line 52 of file interpret.c.
1.9.8