The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
function.c File Reference

Unlang "function" keyword evaluation. More...

#include "action.h"
#include "unlang_priv.h"
#include "function.h"
+ Include dependency graph for function.c:

Go to the source code of this file.

Data Structures

struct  unlang_frame_state_func_t
 
union  unlang_frame_state_func_t.func
 
union  unlang_frame_state_func_t.repeat
 

Macros

#define FUNC(_state)   *((void **)&state->func)
 
#define REPEAT(_state)   *((void **)&state->repeat)
 
#define RESTORE_CALLER    request->module = caller;
 
#define STORE_CALLER
 

Functions

static unlang_action_t call_no_result (UNUSED unlang_result_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 Call a generic function that produces a result.
 
static unlang_action_t call_no_result_repeat (UNUSED unlang_result_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 Call a generic function that produces a result.
 
static unlang_action_t call_with_result (unlang_result_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 Call a generic function that produces a result.
 
static unlang_action_t call_with_result_repeat (unlang_result_t *p_result, request_t *request, unlang_stack_frame_t *frame)
 Call a generic function that produces a result.
 
int unlang_function_clear (request_t *request)
 Clear pending repeat function calls, and remove the signal handler.
 
static void unlang_function_dump (request_t *request, unlang_stack_frame_t *frame)
 Custom frame state dumper.
 
void unlang_function_init (void)
 
static unlang_action_t unlang_function_push_common (unlang_result_t *p_result, request_t *request, void *func, char const *func_name, void *repeat, char const *repeat_name, unlang_function_signal_t signal, fr_signal_t sigmask, char const *signal_name, unlang_function_type_t type, bool top_frame, void *uctx)
 
static void unlang_function_signal (request_t *request, unlang_stack_frame_t *frame, fr_signal_t action)
 Generic signal handler.
 

Variables

static unlang_t function_instruction
 Static instruction for allowing modules/xlats to call functions within themselves, or submodules.
 

Detailed Description

Unlang "function" keyword evaluation.

Id
7c8dc1174b0cb1ccc14088ac2ed07cffc5aac71b

Definition in file function.c.


Data Structure Documentation

◆ unlang_frame_state_func_t

struct unlang_frame_state_func_t

Definition at line 38 of file function.c.

+ Collaboration diagram for unlang_frame_state_func_t:
Data Fields
union unlang_frame_state_func_t.func func
char const * func_name Debug name for the function.
union unlang_frame_state_func_t.repeat repeat
char const * repeat_name Debug name for the repeat function.
fr_signal_t sigmask Signals to block.
unlang_function_signal_t signal Signal function to call.
char const * signal_name Debug name for the signal function.
unlang_function_type_t type Record whether we need to call the.
void * uctx Uctx to pass to function.

◆ unlang_frame_state_func_t.func

union unlang_frame_state_func_t.func

Definition at line 39 of file function.c.

Data Fields
unlang_function_no_result_t nres To call when going down the stack.
unlang_function_with_result_t wres To call when going down the stack.

◆ unlang_frame_state_func_t.repeat

union unlang_frame_state_func_t.repeat

Definition at line 45 of file function.c.

Data Fields
unlang_function_no_result_t nres To call when going back up the stack.
unlang_function_with_result_t wres To call when going back up the stack.

Macro Definition Documentation

◆ FUNC

#define FUNC (   _state)    *((void **)&state->func)

Definition at line 32 of file function.c.

◆ REPEAT

#define REPEAT (   _state)    *((void **)&state->repeat)

Definition at line 33 of file function.c.

◆ RESTORE_CALLER

#define RESTORE_CALLER    request->module = caller;

Definition at line 94 of file function.c.

◆ STORE_CALLER

#define STORE_CALLER
Value:
char const *caller; \
caller = request->module; \
request->module = NULL

Definition at line 89 of file function.c.

Function Documentation

◆ call_no_result()

static unlang_action_t call_no_result ( UNUSED unlang_result_t p_result,
request_t request,
unlang_stack_frame_t frame 
)
static

Call a generic function that produces a result.

Parameters
[out]p_resultThe frame result.
[in]requestThe current request.
[in]frameThe current frame.

Definition at line 243 of file function.c.

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

◆ call_no_result_repeat()

static unlang_action_t call_no_result_repeat ( UNUSED unlang_result_t p_result,
request_t request,
unlang_stack_frame_t frame 
)
static

Call a generic function that produces a result.

Parameters
[out]p_resultThe frame result.
[in]requestThe current request.
[in]frameThe current frame.

Definition at line 186 of file function.c.

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

◆ call_with_result()

static unlang_action_t call_with_result ( unlang_result_t p_result,
request_t request,
unlang_stack_frame_t frame 
)
static

Call a generic function that produces a result.

Parameters
[out]p_resultThe frame result.
[in]requestThe current request.
[in]frameThe current frame.

Definition at line 151 of file function.c.

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

◆ call_with_result_repeat()

static unlang_action_t call_with_result_repeat ( unlang_result_t p_result,
request_t request,
unlang_stack_frame_t frame 
)
static

Call a generic function that produces a result.

Parameters
[out]p_resultThe frame result.
[in]requestThe current request.
[in]frameThe current frame.

Definition at line 103 of file function.c.

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

◆ unlang_function_clear()

int unlang_function_clear ( request_t request)

Clear pending repeat function calls, and remove the signal handler.

The function frame being modified must be at the top of the stack.

Parameters
[in]requestThe current request.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 289 of file function.c.

+ Here is the call graph for this function:

◆ unlang_function_dump()

static void unlang_function_dump ( request_t request,
unlang_stack_frame_t frame 
)
static

Custom frame state dumper.

Definition at line 549 of file function.c.

+ Here is the caller graph for this function:

◆ unlang_function_init()

void unlang_function_init ( void  )

Definition at line 559 of file function.c.

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

◆ unlang_function_push_common()

static unlang_action_t unlang_function_push_common ( unlang_result_t p_result,
request_t request,
void *  func,
char const *  func_name,
void *  repeat,
char const *  repeat_name,
unlang_function_signal_t  signal,
fr_signal_t  sigmask,
char const *  signal_name,
unlang_function_type_t  type,
bool  top_frame,
void *  uctx 
)
inlinestatic

Definition at line 393 of file function.c.

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

◆ unlang_function_signal()

static void unlang_function_signal ( request_t request,
unlang_stack_frame_t frame,
fr_signal_t  action 
)
static

Generic signal handler.

Parameters
[in]requestbeing signalled.
[in]framebeing signalled.
[in]actionType of signal.

Definition at line 74 of file function.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ function_instruction

unlang_t function_instruction
static
Initial value:
= {
.name = "function",
.debug_name = "function",
.actions = DEFAULT_MOD_ACTIONS,
}
#define DEFAULT_MOD_ACTIONS
Definition mod_action.h:68
@ UNLANG_TYPE_FUNCTION
Internal call to a function or submodule.
Definition unlang_priv.h:50

Static instruction for allowing modules/xlats to call functions within themselves, or submodules.

Definition at line 61 of file function.c.