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.
|
#define | A(x) mrb_define_const(mrb, inst->mruby_module, #x, mrb_fixnum_value(x)); |
|
|
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 int | mod_detach (module_detach_ctx_t const *mctx) |
|
static int | mod_instantiate (module_inst_ctx_t const *mctx) |
|
static unlang_action_t | mod_mruby (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request) |
|
static int8_t | mruby_func_def_cmp (void const *one, void const *two) |
| How to compare two Ruby function calls.
|
|
static void | mruby_func_name_safe (char *name) |
|
static int | mruby_func_parse (TALLOC_CTX *ctx, call_env_parsed_head_t *out, UNUSED tmpl_rules_t const *t_rules, UNUSED CONF_ITEM *ci, call_env_ctx_t const *cec, UNUSED call_env_parser_t const *rule) |
|
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
- 99b63b77557430995b83fa96f1a555785689f6cf
- Copyright
- 2016 Herwin Weststrate (freer.nosp@m.adiu.nosp@m.s@her.nosp@m.winw.nosp@m..nl)
-
2016 The FreeRADIUS server project
- Id
- 9545797fed89ff723f40c42ca6fc197322c61c73
- 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.
◆ mruby_call_env_t
◆ mruby_func_def_t
Definition at line 34 of file rlm_mruby.c.
Data Fields |
char const * |
function_name |
Name of the function being called. |
char * |
name1 |
Section name1 where this is called. |
char * |
name2 |
Section name2 where this is called. |
fr_rb_node_t |
node |
Node in tree of function calls. |
◆ rlm_mruby_t
Definition at line 52 of file rlm_mruby.c.
Data Fields |
char const * |
filename |
|
fr_rb_tree_t |
funcs |
Tree of function calls found by call_env parser. |
bool |
funcs_init |
Has the tree been initialised. |
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)); |
◆ 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 |
◆ mod_detach()
◆ mod_instantiate()
◆ mod_mruby()
◆ mruby_func_def_cmp()
static int8_t mruby_func_def_cmp |
( |
void const * |
one, |
|
|
void const * |
two |
|
) |
| |
|
static |
How to compare two Ruby function calls.
Definition at line 78 of file rlm_mruby.c.
◆ mruby_func_name_safe()
static void mruby_func_name_safe |
( |
char * |
name | ) |
|
|
static |
◆ mruby_func_parse()
◆ 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 69 of file rlm_mruby.c.
◆ mruby_method_env
Initial value:= {
}
}
#define CALL_ENV_TERMINATOR
#define FR_CALL_ENV_METHOD_OUT(_inst)
Helper macro for populating the size/type fields of a call_env_method_t from the output structure typ...
@ CALL_ENV_FLAG_PARSE_MISSING
If this subsection is missing, still parse it.
#define FR_CALL_ENV_SUBSECTION_FUNC(_name, _name2, _flags, _func)
Specify a call_env_parser_t which parses a subsection using a callback function.
static int mruby_func_parse(TALLOC_CTX *ctx, call_env_parsed_head_t *out, UNUSED tmpl_rules_t const *t_rules, UNUSED CONF_ITEM *ci, call_env_ctx_t const *cec, UNUSED call_env_parser_t const *rule)
Definition at line 631 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 int mod_detach(module_detach_ctx_t const *mctx)
static unlang_action_t mod_mruby(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
static const call_env_method_t mruby_method_env
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)
#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 649 of file rlm_mruby.c.