|
static void | _lua_fr_request_register (lua_State *L, request_t *request) |
|
static int | _lua_list_iterator (lua_State *L) |
| Iterate over attributes in a list.
|
|
static int | _lua_list_iterator_init (lua_State *L) |
| Initialise a new structural iterator.
|
|
static int | _lua_pair_accessor (lua_State *L) |
| Get an attribute or an instance of an attribute.
|
|
static void | _lua_pair_init (lua_State *L, fr_pair_t *vp, fr_dict_attr_t const *da, unsigned int idx, fr_lua_pair_t *parent) |
| Initialise a table representing a pair.
|
|
static int | _lua_pair_iterator (lua_State *L) |
| Iterate over instances of a leaf attribute.
|
|
static int | _lua_pair_iterator_init (lua_State *L) |
| Initiate an iterator to return all the values of a given attribute.
|
|
static int | _lua_pair_setter (lua_State *L) |
| Set an instance of an attribute.
|
|
static int | _lua_rcode_table_index (lua_State *L) |
|
static int | _lua_rcode_table_newindex (UNUSED lua_State *L) |
|
static int | _lua_rcode_table_pairs (lua_State *L) |
|
int | fr_lua_check_func (module_inst_ctx_t const *mctx, lua_State *L, char const *name) |
| Check if a given function was loaded into an index in the global table.
|
|
static int | fr_lua_get_field (lua_State *L, request_t *request, char const *field) |
| Resolve a path string to a field value in Lua.
|
|
int | fr_lua_init (lua_State **out, module_inst_ctx_t const *mctx) |
| Initialise a new Lua/LuaJIT interpreter.
|
|
bool | fr_lua_isjit (lua_State *L) |
| Check whether the Lua interpreter were actually linked to is LuaJIT.
|
|
static int | fr_lua_marshall (request_t *request, lua_State *L, fr_pair_t const *vp) |
| Convert fr_pair_ts to Lua values.
|
|
static int | fr_lua_pair_parent_build (request_t *request, fr_lua_pair_t *pair_data) |
| Build parent structural pairs needed when a leaf node is set.
|
|
static void | fr_lua_rcode_register (lua_State *L, char const *name) |
|
unlang_action_t | fr_lua_run (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request, char const *funcname) |
|
static int | fr_lua_unmarshall (TALLOC_CTX *ctx, fr_value_box_t *out_vb, request_t *request, lua_State *L, fr_dict_attr_t const *da) |
| Use Lua values to populate a fr_value_box_t.
|
|
char const * | fr_lua_version (lua_State *L) |
|
Library functions for the lua module.
- Id
- 512484de8948670daf8972da4476ce30b25aab4c
- Author
- Arran Cudbard-Bell (a.cud.nosp@m.bard.nosp@m.b@fre.nosp@m.erad.nosp@m.ius.o.nosp@m.rg)
-
Artur Malinowski (artur.nosp@m.@wow.nosp@m..com)
- Copyright
- 2015 The FreeRADIUS Server Project.
Definition in file lua.c.
static int _lua_list_iterator |
( |
lua_State * |
L | ) |
|
|
static |
Iterate over attributes in a list.
Each call returns with two values on the Lua stack
- the name of the next attribute
- the value of the next attribute, or an array of child attribute names
or, nil is pushed to the stack when there are no more attributes in the list.
Definition at line 481 of file lua.c.
static int _lua_pair_accessor |
( |
lua_State * |
L | ) |
|
|
static |
Get an attribute or an instance of an attribute.
When called with a numeric index, it is the instance of the attribute which is being requested. Otherwise, the index is an attribute name.
- Note
- Should only be present in the Lua environment as a closure.
-
Takes one upvalue - the fr_lua_pair_t representing either this attribute in the case it is an index being requested, or the parent in the case an attribute is being requested.
-
Is called as an __index metamethod, so takes the table (can be ignored) and the field (integer index for instance or string for attribute)
- Parameters
-
- Returns
- -1 on failure.
- 0 (no results) on success.
- 1 on success with:
- the fr_pair_t value on the stack for leaf values.
- a lua table for structural items.
Definition at line 567 of file lua.c.
Initialise a table representing a pair.
After calling this function, a new table will be on the lua stack which represents the pair.
The pair may not exist - e.g. when setting a new nested attribute, parent pairs may not have been created yet. In that case, this holds the da and index of the instance which will be created when the leaf is assigned a value.
- Parameters
-
[in] | L | the lua state |
[in] | vp | the actual pair instance being represented, if it already exists |
[in] | da | dictionary attribute for this pair |
[in] | idx | index of the attribute instance (starting at 1) |
[in] | parent | lua userdata for the parent of this attribute. |
Definition at line 794 of file lua.c.
static int fr_lua_get_field |
( |
lua_State * |
L, |
|
|
request_t * |
request, |
|
|
char const * |
field |
|
) |
| |
|
static |
Resolve a path string to a field value in Lua.
Parses a string in the format
obj0[.obj1][.objN]
, adding all tables it traverses to the stack.
All paths are assumed to start at a global, so the first field will be looked up in the global table.
Definition at line 738 of file lua.c.