The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Declarations for generic unlang functions. More...
#include <freeradius-devel/server/rcode.h>
#include <freeradius-devel/server/request.h>
#include <freeradius-devel/server/signal.h>
Go to the source code of this file.
Macros | |
#define | unlang_function_push(_request, _func, _repeat, _signal, _sigmask, _top_frame, _uctx) |
Push a generic function onto the unlang stack. | |
#define | unlang_function_repeat_set(_request, _repeat) _unlang_function_repeat_set(_request, _repeat, STRINGIFY(_repeat)) |
Set a new repeat function for an existing function frame. | |
#define | unlang_function_signal_set(_request, _signal, _sigmask) _unlang_function_signal_set(_request, _signal, _sigmask, STRINGIFY(_signal)) |
Set a new signal function for an existing function frame. | |
Typedefs | |
typedef void(* | unlang_function_signal_t) (request_t *request, fr_signal_t action, void *uctx) |
Function to call if the request was signalled. | |
typedef unlang_action_t(* | unlang_function_t) (rlm_rcode_t *p_result, int *priority, request_t *request, void *uctx) |
A generic function pushed by a module or xlat to functions deeper in the C call stack to create resumption points. | |
Functions | |
unlang_action_t | _unlang_function_push (request_t *request, unlang_function_t func, char const *func_name, unlang_function_t repeat, char const *repeat_name, unlang_function_signal_t signal, fr_signal_t sigmask, char const *signal_name, bool top_frame, void *uctx) |
Push a generic function onto the unlang stack. | |
int | _unlang_function_repeat_set (request_t *request, unlang_function_t repeat, char const *name) |
Set a new repeat function for an existing function frame. | |
int | _unlang_function_signal_set (request_t *request, unlang_function_signal_t signal, fr_signal_t sigmask, char const *name) |
Set a new signal function for an existing function frame. | |
int | unlang_function_clear (request_t *request) |
Clear pending repeat function calls, and remove the signal handler. | |
Declarations for generic unlang functions.
These are a useful alternative to module methods for library code. They're more light weight, and don't require instance data lookups to function.
Definition in file function.h.
#define unlang_function_push | ( | _request, | |
_func, | |||
_repeat, | |||
_signal, | |||
_sigmask, | |||
_top_frame, | |||
_uctx | |||
) |
Push a generic function onto the unlang stack.
These can be pushed by any other type of unlang op to allow a submodule or function deeper in the C call stack to establish a new resumption point.
[in] | _request | The current request. |
[in] | _func | to call going up the stack. |
[in] | _repeat | function to call going back down the stack (may be NULL). This may be the same as func. |
[in] | _signal | function to call if the request is signalled. |
[in] | _sigmask | Signals to block. |
[in] | _top_frame | Return out of the unlang interpreter when popping this frame. |
[in] | _uctx | to pass to func(s). |
Definition at line 111 of file function.h.
#define unlang_function_repeat_set | ( | _request, | |
_repeat | |||
) | _unlang_function_repeat_set(_request, _repeat, STRINGIFY(_repeat)) |
Set a new repeat function for an existing function frame.
The function frame being modified must be at the top of the stack.
[in] | _request | The current request. |
[in] | _repeat | the repeat function to set. |
Definition at line 89 of file function.h.
#define unlang_function_signal_set | ( | _request, | |
_signal, | |||
_sigmask | |||
) | _unlang_function_signal_set(_request, _signal, _sigmask, STRINGIFY(_signal)) |
Set a new signal function for an existing function frame.
The function frame being modified must be at the top of the stack.
[in] | _request | The current request. |
[in] | _signal | The signal function to set. |
[in] | _sigmask | Signals to block. |
Definition at line 74 of file function.h.
typedef void(* unlang_function_signal_t) (request_t *request, fr_signal_t action, void *uctx) |
Function to call if the request was signalled.
[in] | request | The current request. |
[in] | action | We're being signalled with. |
[in,out] | uctx | Provided by whatever pushed the function. Is opaque to the interpreter, but should be usable by the function. All input (args) and output will be done using this structure. |
Definition at line 59 of file function.h.
typedef unlang_action_t(* unlang_function_t) (rlm_rcode_t *p_result, int *priority, request_t *request, void *uctx) |
A generic function pushed by a module or xlat to functions deeper in the C call stack to create resumption points.
[in] | p_result | The module return code. |
[in] | priority | for the return code. |
[in] | request | The current request. |
[in,out] | uctx | Provided by whatever pushed the function. Is opaque to the interpreter, but should be usable by the function. All input (args) and output will be done using this structure. |
Definition at line 49 of file function.h.
unlang_action_t _unlang_function_push | ( | request_t * | request, |
unlang_function_t | func, | ||
char const * | func_name, | ||
unlang_function_t | repeat, | ||
char const * | repeat_name, | ||
unlang_function_signal_t | signal, | ||
fr_signal_t | sigmask, | ||
char const * | signal_name, | ||
bool | top_frame, | ||
void * | uctx | ||
) |
Push a generic function onto the unlang stack.
These can be pushed by any other type of unlang op to allow a submodule or function deeper in the C call stack to establish a new resumption point.
[in] | request | The current request. |
[in] | func | to call going up the stack. |
[in] | func_name | Name of the function call (for debugging). |
[in] | repeat | function to call going back down the stack (may be NULL). This may be the same as func. |
[in] | repeat_name | Name of the repeat function call (for debugging). |
[in] | signal | function to call if the request is signalled. |
[in] | sigmask | Signals to block. |
[in] | signal_name | Name of the signal function call (for debugging). |
[in] | top_frame | Return out of the unlang interpreter when popping this frame. |
[in] | uctx | to pass to func(s). |
Definition at line 279 of file function.c.
int _unlang_function_repeat_set | ( | request_t * | request, |
unlang_function_t | repeat, | ||
char const * | repeat_name | ||
) |
Set a new repeat function for an existing function frame.
The function frame being modified must be at the top of the stack.
[in] | request | The current request. |
[in] | repeat | the repeat function to set. |
[in] | repeat_name | Name of the repeat function call (for debugging). |
Definition at line 232 of file function.c.
int _unlang_function_signal_set | ( | request_t * | request, |
unlang_function_signal_t | signal, | ||
fr_signal_t | sigmask, | ||
char const * | signal_name | ||
) |
Set a new signal function for an existing function frame.
The function frame being modified must be at the top of the stack.
[in] | request | The current request. |
[in] | signal | The signal function to set. |
[in] | sigmask | Signals to block. |
[in] | signal_name | Name of the signal function call (for debugging). |
Definition at line 194 of file function.c.
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.
[in] | request | The current request. |
Definition at line 160 of file function.c.