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

Unlang "foreach" keyword evaluation. More...

#include <freeradius-devel/server/request_data.h>
#include <freeradius-devel/unlang/xlat_func.h>
#include "foreach_priv.h"
#include "return_priv.h"
#include "xlat_priv.h"
+ Include dependency graph for foreach.c:

Go to the source code of this file.

Data Structures

struct  unlang_frame_state_foreach_t
 State of a foreach loop. More...
 

Macros

#define FOREACH_REQUEST_DATA   (void *)unlang_foreach_xlat
 

Functions

static int _free_unlang_frame_state_foreach (unlang_frame_state_foreach_t *state)
 Ensure request data is pulled out of the request if the frame is popped. More...
 
static unlang_action_t unlang_break (rlm_rcode_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 
static unlang_action_t unlang_foreach (rlm_rcode_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 
void unlang_foreach_init (TALLOC_CTX *ctx)
 
static unlang_action_t unlang_foreach_next (rlm_rcode_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 
static xlat_action_t unlang_foreach_xlat (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, UNUSED fr_value_box_list_t *in)
 Implements the Foreach-Variable-X. More...
 

Variables

static int xlat_foreach_inst [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
 
static char const *const xlat_foreach_names []
 

Detailed Description

Unlang "foreach" keyword evaluation.

Id
07657d98ee7ae7d73f7337513ee5819d7d71c4b6

Definition in file foreach.c.


Data Structure Documentation

◆ unlang_frame_state_foreach_t

struct unlang_frame_state_foreach_t

State of a foreach loop.

Definition at line 50 of file foreach.c.

+ Collaboration diagram for unlang_frame_state_foreach_t:
Data Fields
fr_dcursor_t cursor Used to track our place in the list we're iterating over.
int depth Level of nesting of this foreach loop.
int indent for catching indentation issues
request_t * request The current request.
fr_pair_list_t vps List containing the attribute(s) we're iterating over.

Macro Definition Documentation

◆ FOREACH_REQUEST_DATA

#define FOREACH_REQUEST_DATA   (void *)unlang_foreach_xlat

Definition at line 66 of file foreach.c.

Function Documentation

◆ _free_unlang_frame_state_foreach()

static int _free_unlang_frame_state_foreach ( unlang_frame_state_foreach_t state)
static

Ensure request data is pulled out of the request if the frame is popped.

Definition at line 71 of file foreach.c.

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

◆ unlang_break()

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

Definition at line 222 of file foreach.c.

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

◆ unlang_foreach()

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

Definition at line 122 of file foreach.c.

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

◆ unlang_foreach_init()

void unlang_foreach_init ( TALLOC_CTX *  ctx)

Definition at line 260 of file foreach.c.

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

◆ unlang_foreach_next()

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

Definition at line 78 of file foreach.c.

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

Variable Documentation

◆ xlat_foreach_inst

int xlat_foreach_inst[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
static

Definition at line 45 of file foreach.c.

◆ xlat_foreach_names

char const* const xlat_foreach_names[]
static
Initial value:
= {"Foreach-Variable-0",
"Foreach-Variable-1",
"Foreach-Variable-2",
"Foreach-Variable-3",
"Foreach-Variable-4",
"Foreach-Variable-5",
"Foreach-Variable-6",
"Foreach-Variable-7",
"Foreach-Variable-8",
"Foreach-Variable-9"}

Definition at line 34 of file foreach.c.