The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Library function signatures for lua module. More...
Go to the source code of this file.
Data Structures | |
struct | rlm_lua_t |
struct | rlm_lua_thread_t |
Functions | |
int | fr_lua_init (lua_State **out, module_inst_ctx_t const *mctx) |
Initialise a new Lua/LuaJIT interpreter. More... | |
bool | fr_lua_isjit (lua_State *L) |
Check whether the Lua interpreter were actually linked to is LuaJIT. More... | |
unlang_action_t | fr_lua_run (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request, char const *funcname) |
void | fr_lua_util_fr_register (lua_State *L) |
module_ctx_t const * | fr_lua_util_get_mctx (void) |
Get the thread local instance. More... | |
request_t * | fr_lua_util_get_request (void) |
Get the thread local request. More... | |
void | fr_lua_util_jit_log_debug (char const *msg) |
Emit a debug log message. More... | |
void | fr_lua_util_jit_log_error (char const *msg) |
Emit a error log message. More... | |
void | fr_lua_util_jit_log_info (char const *msg) |
Emit an info log message. More... | |
int | fr_lua_util_jit_log_register (lua_State *L) |
Insert cdefs into the lua environment. More... | |
void | fr_lua_util_jit_log_warn (char const *msg) |
Emit a warning log message. More... | |
int | fr_lua_util_log_register (lua_State *L) |
Register utililiary functions in the lua environment. More... | |
void | fr_lua_util_set_mctx (module_ctx_t const *mctx) |
Set the thread local instance. More... | |
void | fr_lua_util_set_request (request_t *request) |
Set the thread local request. More... | |
char const * | fr_lua_version (lua_State *L) |
Library function signatures for lua module.
Definition in file lua.h.
struct rlm_lua_t |
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 * | func_instantiate | 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. |
const char * | module | Full path to lua script to load and execute. |
bool | threads | Whether to create new interpreters on a per-instance/per-thread basis, or use a single mutex protected interpreter. |
struct rlm_lua_thread_t |
int fr_lua_init | ( | lua_State ** | out, |
module_inst_ctx_t const * | mctx | ||
) |
Initialise a new Lua/LuaJIT interpreter.
Creates a new lua_State and verifies all required functions have been loaded correctly.
[in] | out | Where to write a pointer to the new state. |
[in] | mctx | configuration data for the |
Definition at line 893 of file lua.c.
bool fr_lua_isjit | ( | lua_State * | L | ) |
unlang_action_t fr_lua_run | ( | rlm_rcode_t * | p_result, |
module_ctx_t const * | mctx, | ||
request_t * | request, | ||
char const * | funcname | ||
) |
void fr_lua_util_fr_register | ( | lua_State * | L | ) |
module_ctx_t const* fr_lua_util_get_mctx | ( | void | ) |
request_t* fr_lua_util_get_request | ( | void | ) |
void fr_lua_util_jit_log_debug | ( | char const * | msg | ) |
void fr_lua_util_jit_log_error | ( | char const * | msg | ) |
void fr_lua_util_jit_log_info | ( | char const * | msg | ) |
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.
L | Lua interpreter. |
Definition at line 202 of file util.c.
void fr_lua_util_jit_log_warn | ( | char const * | msg | ) |
int fr_lua_util_log_register | ( | lua_State * | L | ) |
void fr_lua_util_set_mctx | ( | module_ctx_t const * | mctx | ) |
void fr_lua_util_set_request | ( | request_t * | request | ) |