26 RCSID(
"$Id: f65d06bfcf8297adb3e158d97fefe2ade77acd77 $")
28 #define LOG_PREFIX mctx->mi->name
30 #include <freeradius-devel/server/base.h>
31 #include <freeradius-devel/util/debug.h>
32 #include <freeradius-devel/server/module_rlm.h>
59 static unlang_action_t mod_##_s(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request) \
61 rlm_lua_t const *inst = talloc_get_type_abort_const(mctx->mi->data, rlm_lua_t);\
62 if (!inst->func_##_s) RETURN_MODULE_NOOP;\
63 return fr_lua_run(p_result, mctx, request, inst->func_##_s);\
115 if (
inst->interpreter) {
116 if (
inst->func_detach) {
120 .interpreter = inst->interpreter
123 NULL,
inst->func_detach);
125 lua_close(
inst->interpreter);
141 if (!
inst->jit)
WARN(
"Using standard Lua interpreter, performance will be suboptimal");
145 if (
inst->func_instantiate) {
149 .interpreter = inst->interpreter
152 NULL,
inst->func_instantiate);
#define CONF_PARSER_TERMINATOR
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
#define FR_CONF_OFFSET_FLAGS(_name, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
@ CONF_FLAG_REQUIRED
Error out if no matching CONF_PAIR is found, and no dflt value is set.
@ CONF_FLAG_FILE_INPUT
File matching value must exist, and must be readable.
Defines a CONF_PAIR to C data type mapping.
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
unlang_action_t fr_lua_run(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request, char const *funcname)
char const * fr_lua_version(lua_State *L)
bool fr_lua_isjit(lua_State *L)
Check whether the Lua interpreter were actually linked to is LuaJIT.
int fr_lua_init(lua_State **out, module_inst_ctx_t const *mctx)
Initialise a new Lua/LuaJIT interpreter.
Library function signatures for lua module.
lua_State * interpreter
Thread specific interpreter.
module_instance_t * mi
Module instance to detach.
void * thread
Thread instance data.
#define MODULE_CTX(_mi, _thread, _env_data, _rctx)
Wrapper to create a module_ctx_t as a compound literal.
module_instance_t * mi
Instance of the module being instantiated.
Temporary structure to hold arguments for detach calls.
Temporary structure to hold arguments for instantiation calls.
Temporary structure to hold arguments for thread_instantiation calls.
module_t common
Common fields presented by all modules.
rlm_rcode_t
Return codes indicating the result of the module call.
static unlang_action_t mod_authenticate(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
static unlang_action_t mod_authorize(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
static unlang_action_t mod_accounting(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Write accounting data to Couchbase documents.
static unlang_action_t mod_post_auth(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
static int mod_detach(module_detach_ctx_t const *mctx)
Close the global interpreter.
static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx)
Create thread-specific connections and buffers.
static const conf_parser_t module_config[]
static int mod_thread_detach(module_thread_inst_ctx_t const *mctx)
Free any thread specific interpreters.
static int mod_instantiate(module_inst_ctx_t const *mctx)
static unlang_action_t mod_preacct(rlm_rcode_t *p_result, module_ctx_t const *mctx, UNUSED request_t *request)
#define SECTION_NAME(_name1, _name2)
Define a section name consisting of a verb and a noun.
void * data
Module's instance data.
#define MODULE_BINDING_TERMINATOR
Terminate a module binding list.
Named methods exported by a module.
eap_aka_sim_process_conf_t * inst