The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
map.c File Reference
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/map.h>
#include <freeradius-devel/unlang/tmpl.h>
#include <freeradius-devel/unlang/map.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
 map and unlang integration. More...
 

Macros

#define MAP_CTX(_mod_inst, _map_inst, _rctx)   &(map_ctx_t){ .moi = _mod_inst, .mpi = _map_inst, .rctx = _rctx }
 Wrapper to create a map_ctx_t as a compound literal.
 

Functions

static int compile_map_name (unlang_group_t *g)
 
static int fixup_map_cb (map_t *map, UNUSED void *ctx)
 Validate and fixup a map that's part of an map section.
 
static unlang_action_t map_proc_apply (unlang_result_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 
static unlang_action_t map_proc_resume (unlang_result_t *p_result, request_t *request, UNUSED unlang_stack_frame_t *frame)
 
static unlang_tunlang_compile_map (unlang_t *parent, unlang_compile_ctx_t *unlang_ctx, CONF_ITEM const *ci)
 
void unlang_map_init (void)
 
static unlang_action_t unlang_map_state_init (unlang_result_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 
unlang_action_t unlang_map_yield (request_t *request, map_proc_func_t resume, unlang_map_signal_t signal, fr_signal_t sigmask, void *rctx)
 Yield a request back to the interpreter from within a module.
 

Data Structure Documentation

◆ unlang_frame_state_map_proc_t

struct unlang_frame_state_map_proc_t

map and unlang integration.

Id
a25cb00f2919c50c33b40f4b17080451cd62c80c

Unlang "map" keyword evaluation.

Definition at line 40 of file map.c.

+ Collaboration diagram for unlang_frame_state_map_proc_t:
Data Fields
void * rctx for resume / signal
map_proc_func_t resume resumption handler
fr_signal_t sigmask Signals to block.
unlang_map_signal_t signal for signal handlers
fr_value_box_list_t src_result Result of expanding the map source.

Macro Definition Documentation

◆ MAP_CTX

#define MAP_CTX (   _mod_inst,
  _map_inst,
  _rctx 
)    &(map_ctx_t){ .moi = _mod_inst, .mpi = _map_inst, .rctx = _rctx }

Wrapper to create a map_ctx_t as a compound literal.

Parameters
[in]_mod_instof the module being called.
[in]_map_instof the map being called.
[in]_rctxResume ctx (if any).

Definition at line 60 of file map.c.

Function Documentation

◆ compile_map_name()

static int compile_map_name ( unlang_group_t g)
static

Definition at line 213 of file map.c.

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

◆ fixup_map_cb()

static int fixup_map_cb ( 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 266 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 ( unlang_result_t p_result,
request_t request,
unlang_stack_frame_t frame 
)
static

Definition at line 134 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 ( unlang_result_t p_result,
request_t request,
UNUSED unlang_stack_frame_t frame 
)
static

Definition at line 62 of file map.c.

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

◆ unlang_compile_map()

static unlang_t * unlang_compile_map ( unlang_t parent,
unlang_compile_ctx_t unlang_ctx,
CONF_ITEM const *  ci 
)
static

Definition at line 306 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 440 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 ( unlang_result_t p_result,
request_t request,
unlang_stack_frame_t frame 
)
static

Definition at line 151 of file map.c.

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

◆ unlang_map_yield()

unlang_action_t unlang_map_yield ( request_t request,
map_proc_func_t  resume,
unlang_map_signal_t  signal,
fr_signal_t  sigmask,
void *  rctx 
)

Yield a request back to the interpreter from within a module.

This passes control of the request back to the unlang interpreter, setting callbacks to execute when the request is 'signalled' asynchronously, or whatever timer or I/O event the module was waiting for occurs.

Note
The module function which calls unlang_module_yield should return control of the C stack to the unlang interpreter immediately after calling unlang_module_yield. A common pattern is to use return unlang_module_yield(...).
Parameters
[in]requestThe current request.
[in]resumeCalled on unlang_interpret_mark_runnable().
[in]signalCalled on unlang_action().
[in]sigmaskSet of signals to block.
[in]rctxto pass to the callbacks.
Returns
  • UNLANG_ACTION_YIELD.

Definition at line 110 of file map.c.

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