Functions to allow tmpls to push resumption frames onto the stack and inform the interpreter about the conditions they need to be resumed under (usually an I/O event or timer event).
More...
#include <freeradius-devel/server/rcode.h>
#include <freeradius-devel/server/tmpl.h>
#include <freeradius-devel/unlang/tmpl.h>
Go to the source code of this file.
|
#define | TMPL_ARGS_EXEC(_env, _timeout, _stdout_on_error, _status_out) |
| Create a temporary argument structure for evaluating an exec type tmpl. More...
|
|
Functions to allow tmpls to push resumption frames onto the stack and inform the interpreter about the conditions they need to be resumed under (usually an I/O event or timer event).
- Id
- f9ce7ac95985e3d133fc19384637fb804b8965e7
- Copyright
- 2016-2019 The FreeRADIUS server project
Definition in file tmpl.h.
◆ unlang_tmpl_args_t
struct unlang_tmpl_args_t |
Arguments for evaluating different types of tmpls.
Definition at line 47 of file tmpl.h.
◆ unlang_tmpl_args_t.exec
struct unlang_tmpl_args_t.exec |
Exec specific arguments.
Definition at line 55 of file tmpl.h.
Data Fields |
fr_pair_list_t * |
env |
Environmental variables. |
int * |
status_out |
Where to write the exit code or fatal signal that killed the process. |
bool |
stdout_on_error |
If true don't clear stdout if we get a non-zero status code. This allows more nuanced interpretation of status codes.
|
fr_time_delta_t |
timeout |
How long to wait for the process to finish. |
◆ TMPL_ARGS_EXEC
#define TMPL_ARGS_EXEC |
( |
|
_env, |
|
|
|
_timeout, |
|
|
|
_stdout_on_error, |
|
|
|
_status_out |
|
) |
| |
Value:
.exec = { \
.env = _env, \
.timeout = _timeout, \
.stdout_on_error = _stdout_on_error, \
.status_out = _status_out \
}, \
}
@ UNLANG_TMPL_ARGS_TYPE_EXEC
We have arguments for performing an exec.
Arguments for evaluating different types of tmpls.
Create a temporary argument structure for evaluating an exec type tmpl.
- Parameters
-
[in] | _env | Environmental variables specified as a pair list. |
[in] | _timeout | How long to wait for program to complete. |
[in] | _stdout_on_error | If true we keep stdout even on non-zero status code. |
[out] | _status_out | Where to store the exit code of the program.
- Will be positive if it's an exit code.
- Will be negative if it's a fatal signal.
|
Definition at line 75 of file tmpl.h.
◆ fr_unlang_tmpl_resume_t
A callback for when the request is resumed.
The resumed request cannot call the normal "authorize", etc. method. It needs a separate callback.
- Parameters
-
[in] | p_result | the module return code. |
[in] | request | the current request. |
[in] | rctx | a local context for the callback. |
- Returns
- an unlang action.
Definition at line 108 of file tmpl.h.
◆ fr_unlang_tmpl_signal_t
A callback when the request gets a fr_signal_t.
A module may call unlang_yeild(), but still need to do something on FR_SIGNAL_DUP. If so, it's set here.
- Note
- The callback is automatically removed on unlang_interpret_mark_runnable().
- Parameters
-
[in] | rctx | Resume ctx for the callback. |
[in] | request | The current request. |
[in] | action | which is signalling the request. |
Definition at line 97 of file tmpl.h.
◆ unlang_tmpl_args_type_t
Flags that show the type of arguments included.
Enumerator |
---|
UNLANG_TMPL_ARGS_TYPE_EXEC | We have arguments for performing an exec.
|
Definition at line 40 of file tmpl.h.
◆ unlang_tmpl_push()
Push a tmpl onto the stack for evaluation.
- Parameters
-
[in] | ctx | To allocate value boxes and values in. |
[out] | out | The value_box created from the tmpl. May be NULL, in which case the result is discarded. |
[in] | request | The current request. |
[in] | tmpl | the tmpl to expand |
[in] | args | additional controls for expanding TMPL_TYPE_EXEC, and where the status of exited programs will be stored. |
Definition at line 259 of file tmpl.c.