26 RCSID(
"$Id: 10ed6f412b481fbeb7bb1cb9a3fc5b67ecf7bc86 $")
28 #define LOG_PREFIX mctx->inst->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->inst->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);
190 { .name1 =
"recv", .name2 =
"accounting-request", .method =
mod_preacct },
#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.
void *_CONST data
Module instance's parsed configuration.
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
dl_module_inst_t const * inst
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.
dl_module_inst_t const * inst
Dynamic loader API handle for the module.
void * thread
Thread instance data.
#define MODULE_CTX(_dl_inst, _thread, _env_data, _rctx)
Wrapper to create a module_ctx_t as a compound literal.
Temporary structure to hold arguments for instantiation calls.
Temporary structure to hold arguments for thread_instantiation calls.
Specifies a module method identifier.
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)
@ MODULE_TYPE_THREAD_SAFE
Module is threadsafe.
#define MODULE_NAME_TERMINATOR
eap_aka_sim_process_conf_t * inst