The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Typedefs | Functions | Variables
compile.c File Reference

Functions to convert configuration sections into unlang structures. More...

#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/modpriv.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/server/tmpl.h>
#include <freeradius-devel/util/time.h>
#include <freeradius-devel/util/dict.h>
#include "call_priv.h"
#include "caller_priv.h"
#include "condition_priv.h"
#include "foreach_priv.h"
#include "load_balance_priv.h"
#include "map_priv.h"
#include "module_priv.h"
#include "parallel_priv.h"
#include "subrequest_priv.h"
#include "switch_priv.h"
#include "edit_priv.h"
#include "timeout_priv.h"
#include "limit_priv.h"
#include "transaction_priv.h"
#include "try_priv.h"
#include "catch_priv.h"
+ Include dependency graph for compile.c:

Go to the source code of this file.

Data Structures

struct  unlang_compile_t
 

Macros

#define RULES_VERIFY(_rules)   do { if (unlang_rules_verify(_rules) < 0) return NULL; } while (0)
 
#define T(_x)   [T_OP_ ## _x] = true
 
#define UNLANG_IGNORE   ((unlang_t *) -1)
 
#define UPDATE_CTX2   compile_copy_context(&unlang_ctx2, unlang_ctx, component)
 

Typedefs

typedef unlang_t *(* unlang_op_compile_t) (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_ITEM *ci)
 

Functions

static int8_t case_cmp (void const *one, void const *two)
 
static uint32_t case_hash (void const *data)
 
static int case_to_key (uint8_t **out, size_t *outlen, void const *data)
 
static int catch_argv (CONF_SECTION *cs, unlang_catch_t *ca, char const *name)
 
static void compile_action_defaults (unlang_t *c, unlang_compile_t *unlang_ctx)
 
static int compile_action_pair (unlang_actions_t *actions, CONF_PAIR *cp)
 
static bool compile_action_subsection (unlang_t *c, CONF_SECTION *cs, CONF_SECTION *subcs)
 
static unlang_tcompile_break (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_ITEM const *ci)
 
static unlang_tcompile_call (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_caller (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_case (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_catch (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_children (unlang_group_t *g, unlang_compile_t *unlang_ctx_in, bool set_action_defaults)
 
static void compile_copy_context (unlang_compile_t *dst, unlang_compile_t const *src, rlm_components_t component)
 
static unlang_tcompile_detach (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_ITEM const *ci)
 
static unlang_tcompile_edit_pair (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_PAIR *cp)
 Compile one edit pair. More...
 
static unlang_tcompile_edit_section (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 Compile one edit section. More...
 
static unlang_tcompile_else (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_elsif (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_empty (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs, unlang_ext_t const *ext)
 
static unlang_tcompile_foreach (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_function (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_ITEM *ci, CONF_SECTION *subcs, rlm_components_t component, bool policy)
 
static unlang_tcompile_group (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_if (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_if_subsection (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs, unlang_ext_t const *ext)
 
static unlang_tcompile_item (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_ITEM *ci)
 
static unlang_tcompile_limit (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_load_balance (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_load_balance_subsection (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs, unlang_ext_t const *ext)
 
static unlang_tcompile_map (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static int compile_map_name (unlang_group_t *g)
 
static unlang_tcompile_module (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_ITEM *ci, module_instance_t *inst, module_method_t method, call_env_method_t const *method_env, char const *realname)
 
static unlang_tcompile_parallel (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_redundant (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_redundant_load_balance (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static bool compile_retry_section (unlang_actions_t *actions, CONF_ITEM *ci)
 
static unlang_tcompile_return (unlang_t *parent, unlang_compile_t *unlang_ctx, UNUSED CONF_ITEM *ci)
 
static unlang_tcompile_section (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs, unlang_ext_t const *ext)
 
static unlang_tcompile_subrequest (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_switch (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_timeout (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_tmpl (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_PAIR *cp)
 
static unlang_tcompile_transaction (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_try (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_update (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_update_to_edit (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
 
static unlang_tcompile_variable (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_PAIR *cp, tmpl_rules_t *t_rules)
 Compile a variable definition. More...
 
static int edit_pair_alloc (CONF_SECTION *cs, CONF_PAIR *original, char const *attr, fr_token_t op, char const *value, fr_token_t list_op)
 
static int edit_section_alloc (CONF_SECTION *parent, CONF_SECTION **child, char const *name1, fr_token_t op)
 
static unlang_group_tgroup_allocate (unlang_t *parent, CONF_SECTION *cs, unlang_ext_t const *ext)
 
static int8_t instruction_cmp (void const *one, void const *two)
 
static bool pass2_fixup_map (map_t *map, tmpl_rules_t const *rules, fr_dict_attr_t const *parent)
 Fixup ONE map (recursively) More...
 
static bool pass2_fixup_map_rhs (unlang_group_t *g, tmpl_rules_t const *rules)
 
static bool pass2_fixup_tmpl (UNUSED TALLOC_CTX *ctx, tmpl_t **vpt_p, CONF_ITEM const *ci, fr_dict_t const *dict)
 
static bool pass2_fixup_update (unlang_group_t *g, tmpl_rules_t const *rules)
 
static bool transaction_ok (CONF_SECTION *cs)
 Limit the operations which can appear in a transaction. More...
 
static int unlang_attr_rules_verify (tmpl_attr_rules_t const *rules)
 
int unlang_compile (CONF_SECTION *cs, rlm_components_t component, tmpl_rules_t const *rules, void **instruction)
 
bool unlang_compile_actions (unlang_actions_t *actions, CONF_SECTION *action_cs, bool module_retry)
 
void unlang_compile_init (TALLOC_CTX *ctx)
 
bool unlang_compile_is_keyword (const char *name)
 Check if name is an unlang keyword. More...
 
static void unlang_dump (unlang_t *instruction, int depth)
 
static int unlang_fixup_edit (map_t *map, void *ctx)
 Validate and fixup a map that's part of an edit section. More...
 
static int unlang_fixup_map (map_t *map, UNUSED void *ctx)
 Validate and fixup a map that's part of an map section. More...
 
int unlang_fixup_update (map_t *map, void *ctx)
 Validate and fixup a map that's part of an update section. More...
 
static int unlang_rules_verify (tmpl_rules_t const *rules)
 
void * unlang_thread_instance (unlang_t const *instruction)
 Get the thread-instance data for an instruction. More...
 
int unlang_thread_instantiate (TALLOC_CTX *ctx)
 Create thread-specific data structures for unlang. More...
 
static bool validate_limited_subsection (CONF_SECTION *cs, char const *name)
 
static CONF_SECTIONvirtual_module_find_cs (CONF_ITEM *ci, rlm_components_t *pcomponent, char const *real_name, char const *virtual_name, char const *method_name, bool *policy)
 Load a named module from the virtual module list, or from the "policy" subsection. More...
 

Variables

static char const *const comp2str []
 
static const unlang_actions_t default_actions [MOD_COUNT]
 
static const bool edit_list_sub_op [T_TOKEN_LAST]
 
static const fr_sbuff_term_t if_terminals
 
fr_table_num_sorted_t const mod_rcode_table []
 
size_t mod_rcode_table_len = NUM_ELEMENTS(mod_rcode_table)
 
static fr_table_num_sorted_t transaction_keywords []
 
static int transaction_keywords_len = NUM_ELEMENTS(transaction_keywords)
 
static fr_rb_tree_tunlang_instruction_tree = NULL
 
static unsigned int unlang_number = 1
 
static fr_table_ptr_sorted_t unlang_pair_keywords []
 
static int unlang_pair_keywords_len = NUM_ELEMENTS(unlang_pair_keywords)
 
static fr_table_ptr_sorted_t unlang_section_keywords []
 
static int unlang_section_keywords_len = NUM_ELEMENTS(unlang_section_keywords)
 
static char const unlang_spaces [] = " "
 
static _Thread_local unlang_thread_tunlang_thread_array
 

Detailed Description

Functions to convert configuration sections into unlang structures.

Id
fe65fdea4b166c04f57339bf24b05612d8248c75

Definition in file compile.c.


Data Structure Documentation

◆ unlang_compile_t

struct unlang_compile_t

Definition at line 96 of file compile.c.

+ Collaboration diagram for unlang_compile_t:
Data Fields
unlang_actions_t actions
rlm_components_t component
tmpl_rules_t const * rules
char const * section_name1
char const * section_name2

Macro Definition Documentation

◆ RULES_VERIFY

#define RULES_VERIFY (   _rules)    do { if (unlang_rules_verify(_rules) < 0) return NULL; } while (0)

Definition at line 234 of file compile.c.

◆ T

#define T (   _x)    [T_OP_ ## _x] = true

Definition at line 1346 of file compile.c.

◆ UNLANG_IGNORE

#define UNLANG_IGNORE   ((unlang_t *) -1)

Definition at line 52 of file compile.c.

◆ UPDATE_CTX2

#define UPDATE_CTX2   compile_copy_context(&unlang_ctx2, unlang_ctx, component)

Definition at line 129 of file compile.c.

Typedef Documentation

◆ unlang_op_compile_t

typedef unlang_t*(* unlang_op_compile_t) (unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_ITEM *ci)

Definition at line 4611 of file compile.c.

Function Documentation

◆ case_cmp()

static int8_t case_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 2725 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ case_hash()

static uint32_t case_hash ( void const *  data)
static

Definition at line 2733 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ case_to_key()

static int case_to_key ( uint8_t **  out,
size_t outlen,
void const *  data 
)
static

Definition at line 2740 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ catch_argv()

static int catch_argv ( CONF_SECTION cs,
unlang_catch_t ca,
char const *  name 
)
static

Definition at line 2651 of file compile.c.

+ Here is the caller graph for this function:

◆ compile_action_defaults()

static void compile_action_defaults ( unlang_t c,
unlang_compile_t unlang_ctx 
)
static

Definition at line 720 of file compile.c.

+ Here is the caller graph for this function:

◆ compile_action_pair()

static int compile_action_pair ( unlang_actions_t actions,
CONF_PAIR cp 
)
static

Definition at line 1834 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_action_subsection()

static bool compile_action_subsection ( unlang_t c,
CONF_SECTION cs,
CONF_SECTION subcs 
)
static

Definition at line 2119 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_break()

static unlang_t* compile_break ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_ITEM const *  ci 
)
static

Definition at line 3395 of file compile.c.

+ Here is the call graph for this function:

◆ compile_call()

static unlang_t* compile_call ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 4173 of file compile.c.

+ Here is the call graph for this function:

◆ compile_caller()

static unlang_t* compile_caller ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 4249 of file compile.c.

+ Here is the call graph for this function:

◆ compile_case()

static unlang_t * compile_case ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 2960 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_catch()

static unlang_t* compile_catch ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 2671 of file compile.c.

+ Here is the call graph for this function:

◆ compile_children()

static unlang_t* compile_children ( unlang_group_t g,
unlang_compile_t unlang_ctx_in,
bool  set_action_defaults 
)
static

Definition at line 2167 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_copy_context()

static void compile_copy_context ( unlang_compile_t dst,
unlang_compile_t const *  src,
rlm_components_t  component 
)
inlinestatic

Definition at line 109 of file compile.c.

+ Here is the caller graph for this function:

◆ compile_detach()

static unlang_t* compile_detach ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_ITEM const *  ci 
)
static

Definition at line 3428 of file compile.c.

+ Here is the call graph for this function:

◆ compile_edit_pair()

static unlang_t* compile_edit_pair ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_PAIR cp 
)
static

Compile one edit pair.

Definition at line 1620 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_edit_section()

static unlang_t* compile_edit_section ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Compile one edit section.

Definition at line 1456 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_else()

static unlang_t* compile_else ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 3646 of file compile.c.

+ Here is the call graph for this function:

◆ compile_elsif()

static unlang_t* compile_elsif ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 3633 of file compile.c.

+ Here is the call graph for this function:

◆ compile_empty()

static unlang_t * compile_empty ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs,
unlang_ext_t const *  ext 
)
static

Definition at line 2078 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_foreach()

static unlang_t* compile_foreach ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 3297 of file compile.c.

+ Here is the call graph for this function:

◆ compile_function()

static unlang_t* compile_function ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_ITEM ci,
CONF_SECTION subcs,
rlm_components_t  component,
bool  policy 
)
static

Definition at line 4339 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_group()

static unlang_t* compile_group ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 2467 of file compile.c.

+ Here is the call graph for this function:

◆ compile_if()

static unlang_t* compile_if ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 3620 of file compile.c.

+ Here is the call graph for this function:

◆ compile_if_subsection()

static unlang_t* compile_if_subsection ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs,
unlang_ext_t const *  ext 
)
static

Definition at line 3527 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_item()

static unlang_t * compile_item ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_ITEM ci 
)
static

Definition at line 4649 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_limit()

static unlang_t* compile_limit ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 3192 of file compile.c.

+ Here is the call graph for this function:

◆ compile_load_balance()

static unlang_t* compile_load_balance ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 3837 of file compile.c.

+ Here is the call graph for this function:

◆ compile_load_balance_subsection()

static unlang_t* compile_load_balance_subsection ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs,
unlang_ext_t const *  ext 
)
static

Definition at line 3742 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_map()

static unlang_t* compile_map ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 814 of file compile.c.

+ Here is the call graph for this function:

◆ compile_map_name()

static int compile_map_name ( unlang_group_t g)
static

Definition at line 765 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_module()

static unlang_t* compile_module ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_ITEM ci,
module_instance_t inst,
module_method_t  method,
call_env_method_t const *  method_env,
char const *  realname 
)
static

Definition at line 4525 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_parallel()

static unlang_t* compile_parallel ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 3860 of file compile.c.

+ Here is the call graph for this function:

◆ compile_redundant()

static unlang_t* compile_redundant ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 3716 of file compile.c.

+ Here is the call graph for this function:

◆ compile_redundant_load_balance()

static unlang_t* compile_redundant_load_balance ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 3849 of file compile.c.

+ Here is the call graph for this function:

◆ compile_retry_section()

static bool compile_retry_section ( unlang_actions_t actions,
CONF_ITEM ci 
)
static

Definition at line 1892 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_return()

static unlang_t* compile_return ( unlang_t parent,
unlang_compile_t unlang_ctx,
UNUSED CONF_ITEM ci 
)
static

Definition at line 3461 of file compile.c.

+ Here is the call graph for this function:

◆ compile_section()

static unlang_t* compile_section ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs,
unlang_ext_t const *  ext 
)
static

Definition at line 2424 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_subrequest()

static unlang_t* compile_subrequest ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 3919 of file compile.c.

+ Here is the call graph for this function:

◆ compile_switch()

static unlang_t* compile_switch ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 2749 of file compile.c.

+ Here is the call graph for this function:

◆ compile_timeout()

static unlang_t* compile_timeout ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 3088 of file compile.c.

+ Here is the call graph for this function:

◆ compile_tmpl()

static unlang_t* compile_tmpl ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_PAIR cp 
)
static

Definition at line 3486 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_transaction()

static unlang_t* compile_transaction ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 2556 of file compile.c.

+ Here is the call graph for this function:

◆ compile_try()

static unlang_t* compile_try ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 2611 of file compile.c.

+ Here is the call graph for this function:

◆ compile_update()

static unlang_t* compile_update ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 1273 of file compile.c.

+ Here is the call graph for this function:

◆ compile_update_to_edit()

static unlang_t* compile_update_to_edit ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_SECTION cs 
)
static

Definition at line 1014 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compile_variable()

static unlang_t* compile_variable ( unlang_t parent,
unlang_compile_t unlang_ctx,
CONF_PAIR cp,
tmpl_rules_t t_rules 
)
static

Compile a variable definition.

Definitions which are adjacent to one another are automatically merged into one larger variable definition.

Definition at line 1704 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ edit_pair_alloc()

static int edit_pair_alloc ( CONF_SECTION cs,
CONF_PAIR original,
char const *  attr,
fr_token_t  op,
char const *  value,
fr_token_t  list_op 
)
static

Definition at line 968 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ edit_section_alloc()

static int edit_section_alloc ( CONF_SECTION parent,
CONF_SECTION **  child,
char const *  name1,
fr_token_t  op 
)
static

Definition at line 954 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ group_allocate()

static unlang_group_t* group_allocate ( unlang_t parent,
CONF_SECTION cs,
unlang_ext_t const *  ext 
)
static

Definition at line 692 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instruction_cmp()

static int8_t instruction_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 4947 of file compile.c.

+ Here is the caller graph for this function:

◆ pass2_fixup_map()

static bool pass2_fixup_map ( map_t map,
tmpl_rules_t const *  rules,
fr_dict_attr_t const *  parent 
)
static

Fixup ONE map (recursively)

This function resolves most things. Most notable it CAN leave the RHS unresolved, for use in map sections.

Definition at line 264 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pass2_fixup_map_rhs()

static bool pass2_fixup_map_rhs ( unlang_group_t g,
tmpl_rules_t const *  rules 
)
static

Definition at line 355 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pass2_fixup_tmpl()

static bool pass2_fixup_tmpl ( UNUSED TALLOC_CTX *  ctx,
tmpl_t **  vpt_p,
CONF_ITEM const *  ci,
fr_dict_t const *  dict 
)
static

Definition at line 236 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pass2_fixup_update()

static bool pass2_fixup_update ( unlang_group_t g,
tmpl_rules_t const *  rules 
)
static

Definition at line 328 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transaction_ok()

static bool transaction_ok ( CONF_SECTION cs)
static

Limit the operations which can appear in a transaction.

Definition at line 2499 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_attr_rules_verify()

static int unlang_attr_rules_verify ( tmpl_attr_rules_t const *  rules)
inlinestatic

Definition at line 216 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_compile()

int unlang_compile ( CONF_SECTION cs,
rlm_components_t  component,
tmpl_rules_t const *  rules,
void **  instruction 
)

Definition at line 4866 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_compile_actions()

bool unlang_compile_actions ( unlang_actions_t actions,
CONF_SECTION action_cs,
bool  module_retry 
)

Definition at line 1970 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_compile_init()

void unlang_compile_init ( TALLOC_CTX *  ctx)

Definition at line 4956 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_compile_is_keyword()

bool unlang_compile_is_keyword ( const char *  name)

Check if name is an unlang keyword.

Parameters
[in]nameto check.
Returns
  • true if it is a keyword.
  • false if it's not a keyword.

Definition at line 4935 of file compile.c.

+ Here is the caller graph for this function:

◆ unlang_dump()

static void unlang_dump ( unlang_t instruction,
int  depth 
)
static

Definition at line 381 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_fixup_edit()

static int unlang_fixup_edit ( map_t map,
void *  ctx 
)
static

Validate and fixup a map that's part of an edit section.

Parameters
mapto validate.
ctxdata to pass to fixup function (currently unused).
Returns
0 if valid else -1.
Todo:
  • this is only called for CONF_PAIR maps, not for CONF_SECTION. So when we parse nested maps, there's no validation done of the CONF_SECTION. In order to fix this, we need to have map_afrom_cs() call the validation function for the CONF_SECTION before recursing.

Definition at line 1369 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_fixup_map()

static int unlang_fixup_map ( map_t map,
UNUSED void *  ctx 
)
static

Validate and fixup a map that's part of an map section.

Parameters
mapto validate.
ctxdata to pass to fixup function (currently unused).
Returns
0 if valid else -1.

Definition at line 487 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_fixup_update()

int unlang_fixup_update ( map_t map,
void *  ctx 
)

Validate and fixup a map that's part of an update section.

Parameters
mapto validate.
ctxdata to pass to fixup function (currently unused).
Returns
  • 0 if valid.
  • -1 not valid.

Definition at line 553 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_rules_verify()

static int unlang_rules_verify ( tmpl_rules_t const *  rules)
inlinestatic

Definition at line 225 of file compile.c.

+ Here is the call graph for this function:

◆ unlang_thread_instance()

void* unlang_thread_instance ( unlang_t const *  instruction)

Get the thread-instance data for an instruction.

Parameters
[in]instructionthe instruction to use
Returns
a pointer to thread-local data

Definition at line 5011 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_thread_instantiate()

int unlang_thread_instantiate ( TALLOC_CTX *  ctx)

Create thread-specific data structures for unlang.

Definition at line 4965 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate_limited_subsection()

static bool validate_limited_subsection ( CONF_SECTION cs,
char const *  name 
)
static

Definition at line 3666 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ virtual_module_find_cs()

static CONF_SECTION* virtual_module_find_cs ( CONF_ITEM ci,
rlm_components_t pcomponent,
char const *  real_name,
char const *  virtual_name,
char const *  method_name,
bool policy 
)
static

Load a named module from the virtual module list, or from the "policy" subsection.

If it's "foo.method", look for "foo", and return "method" as the method we wish to use, instead of the input component.

Parameters
[in]ciConfiguration item to check
[out]pcomponentWhere to write the method we found, if any. If no method is specified will be set to MOD_COUNT.
[in]real_nameComplete name string e.g. foo.authorize.
[in]virtual_nameVirtual module name e.g. foo.
[in]method_nameMethod override (may be NULL) or the method name e.g. authorize.
[out]policywhether or not this thing was a policy
Returns
the CONF_SECTION specifying the virtual module.

Definition at line 4429 of file compile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ comp2str

char const* const comp2str[]
static
Initial value:
= {
"authenticate",
"authorize",
"preacct",
"accounting",
"post-auth"
}

Definition at line 88 of file compile.c.

◆ default_actions

const unlang_actions_t default_actions[MOD_COUNT]
static

Definition at line 137 of file compile.c.

◆ edit_list_sub_op

const bool edit_list_sub_op[T_TOKEN_LAST]
static
Initial value:
= {
T(NE),
T(GE),
T(GT),
T(LE),
T(LT),
T(CMP_EQ),
}
#define T(_x)
Definition: compile.c:1346

Definition at line 1348 of file compile.c.

◆ if_terminals

const fr_sbuff_term_t if_terminals
static
Initial value:
L(""),
L("{"),
)
#define L(_str)
Helper for initialising arrays of string literals.
Definition: build.h:207
#define FR_SBUFF_TERMS(...)
Initialise a terminal structure with a list of sorted strings.
Definition: sbuff.h:167

Definition at line 3522 of file compile.c.

◆ mod_rcode_table

fr_table_num_sorted_t const mod_rcode_table[]
Initial value:
= {
{ L("..."), RLM_MODULE_NOT_SET },
{ L("disallow"), RLM_MODULE_DISALLOW },
{ L("fail"), RLM_MODULE_FAIL },
{ L("handled"), RLM_MODULE_HANDLED },
{ L("invalid"), RLM_MODULE_INVALID },
{ L("noop"), RLM_MODULE_NOOP },
{ L("notfound"), RLM_MODULE_NOTFOUND },
{ L("ok"), RLM_MODULE_OK },
{ L("reject"), RLM_MODULE_REJECT },
{ L("updated"), RLM_MODULE_UPDATED }
}
@ RLM_MODULE_INVALID
The module considers the request invalid.
Definition: rcode.h:45
@ RLM_MODULE_OK
The module is OK, continue.
Definition: rcode.h:43
@ RLM_MODULE_FAIL
Module failed, don't reply.
Definition: rcode.h:42
@ RLM_MODULE_DISALLOW
Reject the request (user is locked out).
Definition: rcode.h:46
@ RLM_MODULE_REJECT
Immediately reject the request.
Definition: rcode.h:41
@ RLM_MODULE_NOTFOUND
User not found.
Definition: rcode.h:47
@ RLM_MODULE_UPDATED
OK (pairs modified).
Definition: rcode.h:49
@ RLM_MODULE_NOT_SET
Error resolving rcode (should not be returned by modules).
Definition: rcode.h:51
@ RLM_MODULE_NOOP
Module succeeded without doing anything.
Definition: rcode.h:48
@ RLM_MODULE_HANDLED
The module handled the request, so stop.
Definition: rcode.h:44

Definition at line 72 of file compile.c.

◆ mod_rcode_table_len

size_t mod_rcode_table_len = NUM_ELEMENTS(mod_rcode_table)

Definition at line 84 of file compile.c.

◆ transaction_keywords

fr_table_num_sorted_t transaction_keywords[]
static
Initial value:
= {
{ L("case"), 1 },
{ L("else"), 1 },
{ L("elsif"), 1 },
{ L("foreach"), 1 },
{ L("group"), 1 },
{ L("if"), 1 },
{ L("limit"), 1 },
{ L("load-balance"), 1 },
{ L("redundant"), 1 },
{ L("redundant-load-balance"), 1 },
{ L("switch"), 1 },
{ L("timeout"), 1 },
{ L("transaction"), 1 },
}

Definition at line 2480 of file compile.c.

◆ transaction_keywords_len

int transaction_keywords_len = NUM_ELEMENTS(transaction_keywords)
static

Definition at line 2495 of file compile.c.

◆ unlang_instruction_tree

fr_rb_tree_t* unlang_instruction_tree = NULL
static

Definition at line 68 of file compile.c.

◆ unlang_number

unsigned int unlang_number = 1
static

Definition at line 54 of file compile.c.

◆ unlang_pair_keywords

fr_table_ptr_sorted_t unlang_pair_keywords[]
static
Initial value:
= {
{ L("break"), (void *) compile_break },
{ L("detach"), (void *) compile_detach },
{ L("return"), (void *) compile_return },
}
static unlang_t * compile_return(unlang_t *parent, unlang_compile_t *unlang_ctx, UNUSED CONF_ITEM *ci)
Definition: compile.c:3461
static unlang_t * compile_break(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_ITEM const *ci)
Definition: compile.c:3395
static unlang_t * compile_detach(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_ITEM const *ci)
Definition: compile.c:3428

Definition at line 4638 of file compile.c.

◆ unlang_pair_keywords_len

int unlang_pair_keywords_len = NUM_ELEMENTS(unlang_pair_keywords)
static

Definition at line 4643 of file compile.c.

◆ unlang_section_keywords

fr_table_ptr_sorted_t unlang_section_keywords[]
static
Initial value:
= {
{ L("call"), (void *) compile_call },
{ L("caller"), (void *) compile_caller },
{ L("case"), (void *) compile_case },
{ L("catch"), (void *) compile_catch },
{ L("else"), (void *) compile_else },
{ L("elsif"), (void *) compile_elsif },
{ L("foreach"), (void *) compile_foreach },
{ L("group"), (void *) compile_group },
{ L("if"), (void *) compile_if },
{ L("limit"), (void *) compile_limit },
{ L("load-balance"), (void *) compile_load_balance },
{ L("map"), (void *) compile_map },
{ L("parallel"), (void *) compile_parallel },
{ L("redundant"), (void *) compile_redundant },
{ L("redundant-load-balance"), (void *) compile_redundant_load_balance },
{ L("subrequest"), (void *) compile_subrequest },
{ L("switch"), (void *) compile_switch },
{ L("timeout"), (void *) compile_timeout },
{ L("transaction"), (void *) compile_transaction },
{ L("try"), (void *) compile_try },
{ L("update"), (void *) compile_update },
}
static unlang_t * compile_subrequest(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:3919
static unlang_t * compile_call(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:4173
static unlang_t * compile_catch(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:2671
static unlang_t * compile_update(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:1273
static unlang_t * compile_group(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:2467
static unlang_t * compile_elsif(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:3633
static unlang_t * compile_foreach(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:3297
static unlang_t * compile_switch(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:2749
static unlang_t * compile_parallel(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:3860
static unlang_t * compile_try(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:2611
static unlang_t * compile_timeout(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:3088
static unlang_t * compile_map(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:814
static unlang_t * compile_load_balance(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:3837
static unlang_t * compile_else(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:3646
static unlang_t * compile_transaction(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:2556
static unlang_t * compile_limit(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:3192
static unlang_t * compile_redundant_load_balance(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:3849
static unlang_t * compile_redundant(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:3716
static unlang_t * compile_caller(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:4249
static unlang_t * compile_if(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:3620
static unlang_t * compile_case(unlang_t *parent, unlang_compile_t *unlang_ctx, CONF_SECTION *cs)
Definition: compile.c:2960

Definition at line 4613 of file compile.c.

◆ unlang_section_keywords_len

int unlang_section_keywords_len = NUM_ELEMENTS(unlang_section_keywords)
static

Definition at line 4636 of file compile.c.

◆ unlang_spaces

char const unlang_spaces[] = " "
static

Definition at line 134 of file compile.c.

◆ unlang_thread_array

_Thread_local unlang_thread_t* unlang_thread_array
static

Definition at line 61 of file compile.c.