The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Enumerations | Functions
map.c File Reference
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/unlang/tmpl.h>
#include "map_priv.h"
+ Include dependency graph for map.c:

Go to the source code of this file.

Data Structures

struct  unlang_frame_state_map_proc_t
 State of a map block. More...
 
struct  unlang_frame_state_update_t
 State of an update block. More...
 

Enumerations

enum  unlang_update_state_t {
  UNLANG_UPDATE_MAP_INIT = 0 ,
  UNLANG_UPDATE_MAP_EXPANDED_LHS ,
  UNLANG_UPDATE_MAP_EXPANDED_RHS
}
 map and unlang integration. More...
 

Functions

static unlang_action_t list_mod_apply (rlm_rcode_t *p_result, request_t *request)
 Apply a list of modifications on one or more fr_pair_t lists. More...
 
static unlang_action_t list_mod_create (rlm_rcode_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 Create a list of modifications to apply to one or more fr_pair_t lists. More...
 
static unlang_action_t map_proc_apply (rlm_rcode_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 
static unlang_action_t map_proc_resume (UNUSED rlm_rcode_t *p_result, UNUSED request_t *request, unlang_stack_frame_t *frame)
 
void unlang_map_init (void)
 
static unlang_action_t unlang_map_state_init (rlm_rcode_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 
static unlang_action_t unlang_update_state_init (rlm_rcode_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 Execute an update block. More...
 

Data Structure Documentation

◆ unlang_frame_state_map_proc_t

struct unlang_frame_state_map_proc_t

State of a map block.

Definition at line 60 of file map.c.

Data Fields
fr_value_box_list_t src_result Result of expanding the map source.

◆ unlang_frame_state_update_t

struct unlang_frame_state_update_t

State of an update block.

Definition at line 46 of file map.c.

+ Collaboration diagram for unlang_frame_state_update_t:
Data Fields
fr_value_box_list_t lhs_result Result of expanding the LHS.
fr_dcursor_t maps Cursor of maps to evaluate.
fr_value_box_list_t rhs_result Result of expanding the RHS.
unlang_update_state_t state What we're currently doing.
fr_dlist_head_t vlm_head Head of list of VP List Mod.

Enumeration Type Documentation

◆ unlang_update_state_t

map and unlang integration.

Id
5c65cef060a3a7e819eb8c35fafc447382323e72

Unlang "map" keyword evaluation.

Enumerator
UNLANG_UPDATE_MAP_INIT 

Start processing a map.

UNLANG_UPDATE_MAP_EXPANDED_LHS 

Expand the LHS xlat or exec (if needed).

UNLANG_UPDATE_MAP_EXPANDED_RHS 

Expand the RHS xlat or exec (if needed).

Definition at line 37 of file map.c.

Function Documentation

◆ list_mod_apply()

static unlang_action_t list_mod_apply ( rlm_rcode_t p_result,
request_t request 
)
static

Apply a list of modifications on one or more fr_pair_t lists.

Parameters
[in]requestThe current request.
[out]p_resultThe rcode indicating what the result of the operation was.
Returns
  • UNLANG_ACTION_CALCULATE_RESULT changes were applied.
  • UNLANG_ACTION_PUSHED_CHILD async execution of an expansion is required.

Definition at line 73 of file map.c.

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

◆ list_mod_create()

static unlang_action_t list_mod_create ( rlm_rcode_t p_result,
request_t request,
unlang_stack_frame_t frame 
)
static

Create a list of modifications to apply to one or more fr_pair_t lists.

Parameters
[out]p_resultThe rcode indicating what the result of the operation was.
[in]requestThe current request.
[in]frameCurrent stack frame.
Returns
  • UNLANG_ACTION_CALCULATE_RESULT changes were applied.
  • UNLANG_ACTION_PUSHED_CHILD async execution of an expansion is required.

Definition at line 119 of file map.c.

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

◆ map_proc_apply()

static unlang_action_t map_proc_apply ( rlm_rcode_t p_result,
request_t request,
unlang_stack_frame_t frame 
)
static

Definition at line 294 of file map.c.

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

◆ map_proc_resume()

static unlang_action_t map_proc_resume ( UNUSED rlm_rcode_t p_result,
UNUSED request_t request,
unlang_stack_frame_t frame 
)
static

Definition at line 286 of file map.c.

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

◆ unlang_map_init()

void unlang_map_init ( void  )

Definition at line 374 of file map.c.

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

◆ unlang_map_state_init()

static unlang_action_t unlang_map_state_init ( rlm_rcode_t p_result,
request_t request,
unlang_stack_frame_t frame 
)
static

Definition at line 309 of file map.c.

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

◆ unlang_update_state_init()

static unlang_action_t unlang_update_state_init ( rlm_rcode_t p_result,
request_t request,
unlang_stack_frame_t frame 
)
static

Execute an update block.

Update blocks execute in two phases, first there's an evaluation phase where each input map is evaluated, outputting one or more modification maps. The modification maps detail a change that should be made to a list in the current request. The request is not modified during this phase.

The second phase applies those modification maps to the current request. This re-enables the atomic functionality of update blocks provided in v2.x.x. If one map fails in the evaluation phase, no more maps are processed, and the current result is discarded.

Definition at line 260 of file map.c.

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