25RCSID(
"$Id: 70ef78fb7dd8c6b5878ad275e4acd2d4737c6714 $")
27#include <freeradius-devel/server/rcode.h>
39 unlang = unlang->
next) {
82 unlang = unlang->
next) {
87 RDEBUG3(
"No catch section for %s",
97 if (!unlang)
goto not_caught;
136 cf_log_err(cs,
"Found 'catch' section with no previous 'try'");
144 if ((strcmp(
name,
"try") != 0) && (strcmp(
name,
"catch") != 0)) {
207 .unlang_name =
"unlang_catch_t",
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
static unlang_action_t unlang_catch(UNUSED unlang_result_t *p_result, request_t *request, unlang_stack_frame_t *frame)
static int catch_argv(CONF_SECTION *cs, unlang_catch_t *ca, char const *name)
unlang_action_t unlang_interpret_skip_to_catch(UNUSED unlang_result_t *p_result, request_t *request, unlang_stack_frame_t *frame)
Skip ahead to a particular "catch" instruction.
void unlang_catch_init(void)
static unlang_t * unlang_compile_catch(unlang_t *parent, unlang_compile_ctx_t *unlang_ctx, CONF_ITEM const *ci)
static unlang_action_t catch_skip_to_next(UNUSED unlang_result_t *p_result, UNUSED request_t *request, unlang_stack_frame_t *frame)
Declarations for the "catch" keyword.
static unlang_catch_t * unlang_group_to_catch(unlang_group_t *g)
Cast a group structure to the transaction keyword extension.
static unlang_catch_t const * unlang_generic_to_catch(unlang_t const *g)
Cast a generic structure to the catch keyword extension.
bool catching[RLM_MODULE_NUMCODES]
Common header for all CONF_* types.
A section grouping multiple CONF_PAIR.
char const * cf_section_name2(CONF_SECTION const *cs)
Return the second identifier of a CONF_SECTION.
char const * cf_section_name1(CONF_SECTION const *cs)
Return the second identifier of a CONF_SECTION.
CONF_SECTION * cf_item_to_section(CONF_ITEM const *ci)
Cast a CONF_ITEM to a CONF_SECTION.
bool cf_item_is_data(CONF_ITEM const *ci)
Determine if CONF_ITEM is CONF_DATA.
bool cf_item_is_section(CONF_ITEM const *ci)
Determine if CONF_ITEM is a CONF_SECTION.
char const * cf_section_argv(CONF_SECTION const *cs, int argc)
Return variadic argument at the specified index.
#define cf_log_err(_cf, _fmt,...)
#define cf_item_prev(_parent, _curr)
unlang_t * unlang_compile_children(unlang_group_t *g, unlang_compile_ctx_t *unlang_ctx_in)
unlang_group_t * unlang_group_allocate(unlang_t *parent, CONF_SECTION *cs, unlang_type_t type)
fr_table_num_sorted_t const mod_rcode_table[]
rlm_rcode_t unlang_interpret_rcode(request_t *request)
Get the last instruction result OR the last frame that was popped.
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.
static TALLOC_CTX * unlang_ctx
void unlang_register(unlang_op_t *op)
Register an operation with the interpreter.
rlm_rcode_t
Return codes indicating the result of the module call.
@ RLM_MODULE_INVALID
The module considers the request invalid.
@ 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_NOT_SET
Error resolving rcode (should not be returned by modules).
@ RLM_MODULE_NUMCODES
How many valid return codes there are.
#define fr_table_value_by_str(_table, _name, _def)
Convert a string to a value using a sorted or ordered table.
#define fr_table_str_by_value(_table, _number, _def)
Convert an integer to a string.
char * talloc_typed_asprintf(TALLOC_CTX *ctx, char const *fmt,...)
Call talloc vasprintf, setting the type on the new chunk correctly.
Private interpreter structures and functions.
unlang_t * next
Next node (executed on UNLANG_ACTION_EXECUTE_NEXT et al).
#define UNLANG_NEXT_SIBLING
char const * debug_name
Printed in log messages when the node is executed.
static unlang_t * unlang_group_to_generic(unlang_group_t const *p)
char const * name
Unknown...
@ UNLANG_TYPE_TRY
try / catch blocks
@ UNLANG_TYPE_CATCH
catch a previous try
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_t const * instruction
The unlang node we're evaluating.
static unlang_action_t frame_set_next(unlang_stack_frame_t *frame, unlang_t *unlang)
@ UNLANG_OP_FLAG_DEBUG_BRACES
Print debug braces.
unlang_type_t type
The specialisation of this node.
Generic representation of a grouping.
A node in a graph of unlang_op_t (s) that we execute.
Our interpreter stack, as distinct from the C stack.
#define DOC_KEYWORD_REF(_x)