Library function signatures for lua module.
More...
#include <lua.h>
#include <lauxlib.h>
#include <freeradius-devel/server/base.h>
Go to the source code of this file.
Library function signatures for lua module.
- Id
- f61ffb1e706c2ae9060d546c63d9cb63667d3541
Definition in file lua.h.
◆ rlm_lua_t
Definition at line 43 of file lua.h.
Data Fields |
const char * |
func_accounting |
Name of function to run on accounting. |
const char * |
func_authenticate |
Name of function to run on authentication. |
const char * |
func_authorize |
Name of function to run on authorization. |
const char * |
func_detach |
Name of function to run on detach. |
const char *const char * |
func_instantiate |
< Full path to lua script to load and execute. Name of function to run on instantiation.
|
const char * |
func_post_auth |
Name of function to run after authentication. |
const char * |
func_preacct |
Name of function to run on preacct. |
const char * |
func_xlat |
Name of function to be called for string expansions. |
lua_State * |
interpreter |
Interpreter used for single threaded mode, and environment tests. |
bool |
jit |
Whether the linked interpreter is Lua 5.1 or LuaJIT. |
bool |
threads |
Whether to create new interpreters on a per-instance/per-thread basis, or use a single mutex protected interpreter. |
◆ rlm_lua_thread_t
Definition at line 62 of file lua.h.
Data Fields |
lua_State * |
interpreter |
Thread specific interpreter. |
◆ fr_lua_init()
Initialise a new Lua/LuaJIT interpreter.
Creates a new lua_State and verifies all required functions have been loaded correctly.
- Parameters
-
[in] | out | Where to write a pointer to the new state. |
[in] | mctx | configuration data for the |
- Returns
- 0 on success else -1.
Definition at line 893 of file lua.c.
◆ fr_lua_isjit()
bool fr_lua_isjit |
( |
lua_State * |
L | ) |
|
Check whether the Lua interpreter were actually linked to is LuaJIT.
- Parameters
-
- Returns
- true if were running with LuaJIT else false.
Definition at line 591 of file lua.c.
◆ fr_lua_run()
◆ fr_lua_util_fr_register()
void fr_lua_util_fr_register |
( |
lua_State * |
L | ) |
|
◆ fr_lua_util_get_mctx()
Get the thread local instance.
- Returns
- mctx all helper and C functions callable from Lua should use.
Definition at line 330 of file util.c.
◆ fr_lua_util_get_request()
Get the thread local request.
- Returns
- request all helper and C functions callable from Lua should use.
Definition at line 348 of file util.c.
◆ fr_lua_util_jit_log_debug()
void fr_lua_util_jit_log_debug |
( |
char const * |
msg | ) |
|
Emit a debug log message.
- Parameters
-
Definition at line 154 of file util.c.
◆ fr_lua_util_jit_log_error()
void fr_lua_util_jit_log_error |
( |
char const * |
msg | ) |
|
Emit a error log message.
- Parameters
-
Definition at line 187 of file util.c.
◆ fr_lua_util_jit_log_info()
void fr_lua_util_jit_log_info |
( |
char const * |
msg | ) |
|
Emit an info log message.
- Parameters
-
Definition at line 165 of file util.c.
◆ fr_lua_util_jit_log_register()
int fr_lua_util_jit_log_register |
( |
lua_State * |
L | ) |
|
Insert cdefs into the lua environment.
For LuaJIT using the FFI is significantly faster than the Lua interface. Help people wishing to use the FFI by inserting cdefs for standard functions.
- Parameters
-
- Returns
- 0 (no arguments).
Definition at line 202 of file util.c.
◆ fr_lua_util_jit_log_warn()
void fr_lua_util_jit_log_warn |
( |
char const * |
msg | ) |
|
Emit a warning log message.
- Parameters
-
Definition at line 176 of file util.c.
◆ fr_lua_util_log_register()
int fr_lua_util_log_register |
( |
lua_State * |
L | ) |
|
Register utililiary functions in the lua environment.
- Parameters
-
- Returns
- 0 (no arguments).
Definition at line 280 of file util.c.
◆ fr_lua_util_set_mctx()
Set the thread local instance.
- Parameters
-
[in] | mctx | all helper and C functions callable from Lua should use. |
Definition at line 321 of file util.c.
◆ fr_lua_util_set_request()
void fr_lua_util_set_request |
( |
request_t * |
request | ) |
|
Set the thread local request.
- Parameters
-
[in] | request | all helper and C functions callable from Lua should use. |
Definition at line 339 of file util.c.
◆ fr_lua_version()
char const * fr_lua_version |
( |
lua_State * |
L | ) |
|