![]() |
The FreeRADIUS server $Id: f3670dba8951ca10eb4948feb3dc3db9423a334f $
|
Driver for the Redis noSQL key value store. More...
#include <assert.h>#include <stdint.h>#include <freeradius-devel/redis/base.h>#include <freeradius-devel/redis/cluster_async.h>#include <freeradius-devel/server/modpriv.h>#include <freeradius-devel/server/module_rlm.h>#include <freeradius-devel/io/coord_pair.h>#include <freeradius-devel/unlang/xlat_func.h>#include <freeradius-devel/util/base16.h>#include <freeradius-devel/util/debug.h>#include <freeradius-devel/util/types.h>
Include dependency graph for rlm_redis.c:Go to the source code of this file.
Data Structures | |
| struct | redis_lua_func_inst_t |
| Instance of a redis lua func xlat. More... | |
| struct | redis_lua_func_t |
| A lua function or stored procedure we make available as an xlat. More... | |
| struct | rlm_redis_lua_t |
| struct | rlm_redis_lua_xlat_rctx_t |
| Resume context for redis lua xlat. More... | |
| struct | rlm_redis_t |
| rlm_redis module instance More... | |
| struct | rlm_redis_thread_t |
| struct | rlm_redis_xlat_rctx_t |
| Resume context for redis xlat. More... | |
Macros | |
| #define | REDIS_XLAT_CMD_SETUP(_cmds, _argc, _argv, _arg_len, _rctx, _read_only, _func) |
Functions | |
| static int | lua_func_body_parse (TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule) |
| Do basic processing for a lua function body and compute its sha1 hash. | |
| static void | lua_script_load (fr_redis_trunk_t *rtrunk, void *uctx) |
| static void | lua_script_load_results (UNUSED request_t *request, UNUSED fr_redis_command_t *cmd, UNUSED redisReply *reply, void *rctx) |
| static int | mod_bootstrap (module_inst_ctx_t const *mctx) |
| static int | mod_coord_attach (module_thread_inst_ctx_t const *mctx) |
| static int | mod_detach (module_detach_ctx_t const *mctx) |
| static int | mod_instantiate (module_inst_ctx_t const *mctx) |
| static int | mod_load (void) |
| static int | mod_thread_detach (module_thread_inst_ctx_t const *mctx) |
| static int | mod_thread_instantiate (module_thread_inst_ctx_t const *mctx) |
| REDIS_ASYNC_COORD_CALLBACKS (rlm_redis_thread_t) | |
| static void | redis_lua_cancel (xlat_ctx_t const *xctx, request_t *request, UNUSED fr_signal_t action) |
| Cancellation of Redis Lua load / exec. | |
| static int | redis_lua_func_instantiate (xlat_inst_ctx_t const *xctx) |
| Copies the function configuration into xlat function instance data. | |
| static xlat_action_t | redis_lua_func_resume (UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, UNUSED request_t *request, UNUSED fr_value_box_list_t *in) |
| Process the results from calling a lua script. | |
| static xlat_action_t | redis_lua_func_xlat (TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in) |
| Call a lua function on the redis server. | |
| static void | redis_lua_load_results (request_t *request, UNUSED fr_redis_command_t *cmd, redisReply *reply, void *rctx) |
| Callback to verify reply to SCRIPT LOAD. | |
| static xlat_action_t | redis_lua_load_resume (UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, xlat_ctx_t const *xctx, UNUSED request_t *request, UNUSED fr_value_box_list_t *in) |
| Process the results of loading a lua script to a redis server. | |
| static void | redis_lua_xlat_results (request_t *request, fr_redis_command_t *cmd, redisReply *reply, void *rctx) |
| Callback to convert redis reply to value boxes. | |
| static xlat_action_t | redis_node_xlat (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in) |
| Return the node that is currently servicing a particular key. | |
| static xlat_action_t | redis_remap_xlat (TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, UNUSED fr_value_box_list_t *in) |
| Force a redis cluster remap. | |
| static xlat_action_t | redis_remap_xlat_resume (UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, UNUSED request_t *request, UNUSED fr_value_box_list_t *in) |
| static xlat_action_t | redis_xlat (TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in) |
| Xlat to make calls to redis. | |
| static void | redis_xlat_cancel (xlat_ctx_t const *xctx, request_t *request, UNUSED fr_signal_t action) |
| Common cancellation for redis xlats. | |
| static void | redis_xlat_ping_check (request_t *request, fr_redis_command_t *cmd, redisReply *reply, void *rctx) |
| Callback to check redis replied with "PONG" when expected. | |
| static void | redis_xlat_results (request_t *request, fr_redis_command_t *cmd, redisReply *reply, void *rctx) |
| Callback to convert redis reply to value boxes. | |
| static xlat_action_t | redis_xlat_resume (UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, UNUSED fr_value_box_list_t *in) |
| static void | redis_xlat_status_check (request_t *request, fr_redis_command_t *cmd, redisReply *reply, void *rctx) |
| Callback to check redis replied with "OK" when expected. | |
Variables | |
| static fr_dict_t const * | dict_redis |
| static conf_parser_t | module_config [] |
| static conf_parser_t | module_lua [] |
| static conf_parser_t | module_lua_func [] |
| static xlat_arg_parser_t const | redis_args [] |
| static xlat_arg_parser_t const | redis_lua_func_args [] |
| static xlat_arg_parser_t const | redis_node_xlat_args [] |
| module_rlm_t | rlm_redis |
| fr_dict_autoload_t | rlm_redis_dict [] |
Driver for the Redis noSQL key value store.
Definition in file rlm_redis.c.
| struct redis_lua_func_inst_t |
Instance of a redis lua func xlat.
Definition at line 68 of file rlm_redis.c.
Collaboration diagram for redis_lua_func_inst_t:| Data Fields | ||
|---|---|---|
| redis_lua_func_t * | func | Function configuration. |
| struct redis_lua_func_t |
A lua function or stored procedure we make available as an xlat.
Definition at line 58 of file rlm_redis.c.
| Data Fields | ||
|---|---|---|
| char const * | body | the actual lua code. |
| char | digest[(SHA1_DIGEST_LENGTH *2)+1] | pre-computed hash of lua code. |
| char const * | name | Friendly name for the function. Used to register the equivalent xlat. |
| bool | read_only | Function has no side effects. |
| struct rlm_redis_lua_t |
Definition at line 73 of file rlm_redis.c.
Collaboration diagram for rlm_redis_lua_t:| Data Fields | ||
|---|---|---|
| redis_lua_func_t ** | funcs | Array of functions to register. |
| struct rlm_redis_lua_xlat_rctx_t |
Resume context for redis lua xlat.
Definition at line 101 of file rlm_redis.c.
Collaboration diagram for rlm_redis_lua_xlat_rctx_t:| Data Fields | ||
|---|---|---|
| xlat_action_t | action | Xlat action set in callback. |
| fr_redis_async_cmd_t * | cmd | Async command context. |
| fr_redis_command_set_t * | cmds | Command set for this xlat. |
| TALLOC_CTX * | ctx | Context to allocate boxes. |
| redis_lua_func_t const * | func | Lua function. |
| fr_value_box_list_t | out | List to store boxes in callback. |
| struct rlm_redis_t |
rlm_redis module instance
Definition at line 81 of file rlm_redis.c.
Collaboration diagram for rlm_redis_t:| Data Fields | ||
|---|---|---|
| fr_redis_conf_t | conf |
Connection parameters for the Redis server. Must be first field in this struct. |
| fr_coord_pair_reg_t * | coord_pair_reg | Coord pair registration. |
| fr_coord_reg_t * | coord_reg | Coordinator registration. |
| rlm_redis_lua_t | lua | Array of functions to register. |
| CONF_SECTION * | tls_conf | TLS CONF_SECTION. |
| struct rlm_redis_thread_t |
Definition at line 93 of file rlm_redis.c.
Collaboration diagram for rlm_redis_thread_t:| Data Fields | ||
|---|---|---|
| fr_coord_worker_t * | cw | Coord-worker for fetching cluster map. |
| rlm_redis_t const * | inst | Module instance. |
| fr_redis_ct_t * | rtcluster | Per thread Redis cluster. |
| struct rlm_redis_xlat_rctx_t |
Resume context for redis xlat.
Definition at line 112 of file rlm_redis.c.
Collaboration diagram for rlm_redis_xlat_rctx_t:| Data Fields | ||
|---|---|---|
| xlat_action_t | action | Xlat action set in callback. |
| fr_redis_async_cmd_t * | cmd | Async command context. |
| fr_redis_command_set_t * | cmds | Command set for this xlat. |
| TALLOC_CTX * | ctx | Context to allocate boxes. |
| bool | forced_node | Was the xlat called with a specific node. |
| fr_value_box_list_t | out | List to store boxes in callback. |
| bool | read_only | Should the xlat be run read only. |
| #define REDIS_XLAT_CMD_SETUP | ( | _cmds, | |
| _argc, | |||
| _argv, | |||
| _arg_len, | |||
| _rctx, | |||
| _read_only, | |||
| _func | |||
| ) |
Definition at line 122 of file rlm_redis.c.
|
static |
Do basic processing for a lua function body and compute its sha1 hash.
Definition at line 156 of file rlm_redis.c.
Here is the call graph for this function:
|
static |
Definition at line 845 of file rlm_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| REDIS_ASYNC_COORD_CALLBACKS | ( | rlm_redis_thread_t | ) |
|
static |
Cancellation of Redis Lua load / exec.
Definition at line 385 of file rlm_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Copies the function configuration into xlat function instance data.
Definition at line 641 of file rlm_redis.c.
Here is the caller graph for this function:
|
static |
Process the results from calling a lua script.
Enqueuing SCRIPT LOAD ... if the server reports that the script is missing
Definition at line 468 of file rlm_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Call a lua function on the redis server.
Lua functions either get uploaded when the trunk connection becomes active or the first time they get executed.
Definition at line 541 of file rlm_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Callback to verify reply to SCRIPT LOAD.
Definition at line 423 of file rlm_redis.c.
Here is the caller graph for this function:
|
static |
Process the results of loading a lua script to a redis server.
If the load succeeds, re-enqueue the original EVALSHA command.
Definition at line 400 of file rlm_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Callback to convert redis reply to value boxes.
Definition at line 443 of file rlm_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 237 of file rlm_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Common cancellation for redis xlats.
Definition at line 229 of file rlm_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Callback to check redis replied with "PONG" when expected.
Definition at line 210 of file rlm_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Callback to convert redis reply to value boxes.
Definition at line 658 of file rlm_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 679 of file rlm_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Callback to check redis replied with "OK" when expected.
Definition at line 192 of file rlm_redis.c.
Here is the call graph for this function:
|
static |
Definition at line 47 of file rlm_redis.c.
|
static |
Definition at line 147 of file rlm_redis.c.
|
static |
Definition at line 140 of file rlm_redis.c.
|
static |
Definition at line 134 of file rlm_redis.c.
|
static |
Definition at line 650 of file rlm_redis.c.
|
static |
Definition at line 376 of file rlm_redis.c.
|
static |
Definition at line 319 of file rlm_redis.c.
| module_rlm_t rlm_redis |
Definition at line 1026 of file rlm_redis.c.
| fr_dict_autoload_t rlm_redis_dict |
Definition at line 50 of file rlm_redis.c.
1.9.8