Translates requests between the server an an mruby interpreter.
More...
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/server/pairmove.h>
#include <freeradius-devel/util/debug.h>
#include "rlm_mruby.h"
Go to the source code of this file.
|
static void | add_vp_tuple (TALLOC_CTX *ctx, request_t *request, fr_pair_list_t *vps, mrb_state *mrb, mrb_value value, char const *function_name) |
|
static unlang_action_t | do_mruby (rlm_rcode_t *p_result, request_t *request, rlm_mruby_t const *inst, char const *function_name) |
|
static int | mod_detach (module_detach_ctx_t const *mctx) |
|
static int | mod_instantiate (module_inst_ctx_t const *mctx) |
|
static mrb_value | mruby_log (mrb_state *mrb, UNUSED mrb_value self) |
|
static void | mruby_parse_config (mrb_state *mrb, CONF_SECTION *cs, int lvl, mrb_value hash) |
|
static int | mruby_set_vps (request_t *request, mrb_state *mrb, mrb_value mruby_request, char const *list_name, fr_pair_list_t *vps) |
|
static int | mruby_vps_to_array (request_t *request, mrb_value *out, mrb_state *mrb, fr_pair_list_t *vps) |
|
Translates requests between the server an an mruby interpreter.
- Id
- 6da6d896f5309ff932d9f2f4a2a53bc4b90cdff0
- Copyright
- 2016 Herwin Weststrate (freer.nosp@m.adiu.nosp@m.s@her.nosp@m.winw.nosp@m..nl)
-
2016 The FreeRADIUS server project
- Id
- 9b3290940629e0a41f8e355bb87886c5e7c65805
- Copyright
- 2016 Herwin Weststrate (freer.nosp@m.adiu.nosp@m.s@her.nosp@m.winw.nosp@m..nl)
-
2016 The FreeRADIUS server project
Definition in file rlm_mruby.c.
◆ rlm_mruby_t
Definition at line 41 of file rlm_mruby.c.
Data Fields |
char const * |
filename |
|
char const * |
module_name |
|
mrb_state * |
mrb |
|
struct RClass * |
mruby_module |
|
struct RClass * |
mruby_request |
|
mrb_value |
mrubyconf_hash |
|
#define A |
( |
|
x | ) |
mrb_define_const(mrb, inst->mruby_module, #x, mrb_fixnum_value(x)); |
◆ RLM_MRUBY_FUNC
Value:
{ \
request, \
#foo); \
}
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
Temporary structure to hold arguments for module calls.
rlm_rcode_t
Return codes indicating the result of the module call.
static unlang_action_t do_mruby(rlm_rcode_t *p_result, request_t *request, rlm_mruby_t const *inst, char const *function_name)
Definition at line 472 of file rlm_mruby.c.
◆ add_vp_tuple()
static void add_vp_tuple |
( |
TALLOC_CTX * |
ctx, |
|
|
request_t * |
request, |
|
|
fr_pair_list_t * |
vps, |
|
|
mrb_state * |
mrb, |
|
|
mrb_value |
value, |
|
|
char const * |
function_name |
|
) |
| |
|
static |
◆ do_mruby()
◆ mod_detach()
◆ mod_instantiate()
◆ mruby_log()
static mrb_value mruby_log |
( |
mrb_state * |
mrb, |
|
|
UNUSED mrb_value |
self |
|
) |
| |
|
static |
◆ mruby_parse_config()
static void mruby_parse_config |
( |
mrb_state * |
mrb, |
|
|
CONF_SECTION * |
cs, |
|
|
int |
lvl, |
|
|
mrb_value |
hash |
|
) |
| |
|
static |
◆ mruby_set_vps()
static int mruby_set_vps |
( |
request_t * |
request, |
|
|
mrb_state * |
mrb, |
|
|
mrb_value |
mruby_request, |
|
|
char const * |
list_name, |
|
|
fr_pair_list_t * |
vps |
|
) |
| |
|
inlinestatic |
◆ mruby_vps_to_array()
◆ module_config
Initial value:= {
}
#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.
Definition at line 55 of file rlm_mruby.c.
◆ rlm_mruby
Initial value:= {
.common = {
.name = "mruby",
},
.method_group = {
}
}
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
static const conf_parser_t config[]
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)
static const conf_parser_t module_config[]
static int mod_instantiate(module_inst_ctx_t const *mctx)
static int 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.
@ MODULE_TYPE_THREAD_UNSAFE
Module is not threadsafe.
#define MODULE_BINDING_TERMINATOR
Terminate a module binding list.
Named methods exported by a module.
Definition at line 510 of file rlm_mruby.c.