![]() |
The FreeRADIUS server $Id: f3670dba8951ca10eb4948feb3dc3db9423a334f $
|
redis based cache. More...
#include <freeradius-devel/server/base.h>#include <freeradius-devel/util/debug.h>#include "../../rlm_cache.h"#include <freeradius-devel/redis/base.h>#include <freeradius-devel/redis/cluster_async.h>#include <freeradius-devel/io/coord_pair.h>
Include dependency graph for rlm_cache_redis.c:Go to the source code of this file.
Data Structures | |
| struct | rlm_cache_redis_rctx_t |
| struct | rlm_cache_redis_t |
| struct | rlm_cache_redis_thread_t |
Macros | |
| #define | LOG_PREFIX "cache - redis" |
Variables | |
| static fr_dict_attr_t const * | attr_cache_created |
| static fr_dict_attr_t const * | attr_cache_expires |
| static fr_dict_t const * | dict_freeradius |
| static fr_dict_t const * | dict_redis |
| static conf_parser_t | driver_config [] |
| rlm_cache_driver_t | rlm_cache_redis |
| fr_dict_autoload_t | rlm_cache_redis_dict [] |
| fr_dict_attr_autoload_t | rlm_cache_redis_dict_attr [] |
redis based cache.
Definition in file rlm_cache_redis.c.
| struct rlm_cache_redis_rctx_t |
Definition at line 60 of file rlm_cache_redis.c.
Collaboration diagram for rlm_cache_redis_rctx_t:| Data Fields | ||
|---|---|---|
| fr_redis_async_cmd_t * | cmd | |
| char ** | cmd_str | |
| fr_redis_command_set_t * | cmds | |
| rlm_cache_entry_t * | entry | |
| fr_value_box_t const * | key | |
| cache_status_t | rcode | |
| struct rlm_cache_redis_t |
Definition at line 39 of file rlm_cache_redis.c.
Collaboration diagram for rlm_cache_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. |
| tmpl_t * | created_attr | LHS of the Cache-Created map. |
| tmpl_t * | expires_attr | LHS of the Cache-Expires map. |
| module_instance_t const * | mi | Module instance. |
| CONF_SECTION * | tls_conf | TLS CONF_SECTION. |
| struct rlm_cache_redis_thread_t |
Definition at line 54 of file rlm_cache_redis.c.
Collaboration diagram for rlm_cache_redis_thread_t:| Data Fields | ||
|---|---|---|
| fr_coord_worker_t * | cw | Coord-worker for fetching cluster map. |
| rlm_cache_redis_t const * | inst | Module instance. |
| fr_redis_ct_t * | rtcluster | Per thread Redis cluster. |
| #define LOG_PREFIX "cache - redis" |
Definition at line 24 of file rlm_cache_redis.c.
|
static |
Call delete the cache entry from redis.
| [out] | rctx_out | Where to write a pointer to a resume context for async drivers. |
| [in] | config | for this instance of the rlm_cache module. |
| [in] | instance | Driver specific instance data. |
| [in] | request | The current request. |
| [in] | handle | the driver gave us when we called cache_acquire_t, or NULL if no cache_acquire_t callback was provided. |
| [in] | key | of entry to expire. |
Definition at line 659 of file rlm_cache_redis.c.
Here is the call graph for this function:
|
static |
|
static |
|
static |
Locate a cache entry in redis.
If a cache entry is found, but the cache entry needs to be deserialized, the driver is expected to allocate an appropriately sized rlm_cache_entry_t, perform the deserialisation, and write a pointer to the new entry to out, returning CACHE_OK.
If the rlm_cache_handle_t is inviable, the driver should return CACHE_RECONNECT, to have it reinitialised/reconnected.
| [out] | out | Where to write a pointer to the retrieved entry (if there was one). |
| [out] | rctx_out | Where to write a pointer to a resume context for async drivers. |
| [in] | config | for this instance of the rlm_cache module. |
| [in] | instance | Driver specific instance data. |
| [in] | request | The current request. |
| [in] | handle | the driver gave us when we called cache_acquire_t, or NULL if no cache_acquire_t callback was provided. |
| [in] | key | to use to lookup cache entry |
Definition at line 395 of file rlm_cache_redis.c.
Here is the call graph for this function:
|
static |
Definition at line 296 of file rlm_cache_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
|
static |
|
static |
Insert a new entry into the data store.
Serialize (if necessary) the entry passed to us, and write it to the cache with the key c->key.
The cache entry should not be freed by the driver, irrespective of success or failure. If the entry needs to be freed after insertion because a local copy should not be kept, the driver should provide a cache_entry_free_t callback.
If the rlm_cache_handle_t is inviable, the driver should return CACHE_RECONNECT, to have it reinitialised/reconnected.
| rctx_out | Where to write a pointer to a resume context for async drivers. |
| config | for this instance of the rlm_cache module. |
| instance | Driver specific instance data. |
| request | The current request. |
| handle | the driver gave us when we called cache_acquire_t, or NULL if no cache_acquire_t callback was provided. |
| c | to insert. |
Definition at line 461 of file rlm_cache_redis.c.
Here is the call graph for this function:
|
static |
Definition at line 445 of file rlm_cache_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
|
static |
|
static |
|
static |
Process the results of Redis cache commands.
Initiating a cluster remap and query redirection if needed.
Definition at line 242 of file rlm_cache_redis.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
|
static |
|
static |
Create a new rlm_cache_redis instance.
| [in] | mctx | Data required for instantiation. |
Definition at line 98 of file rlm_cache_redis.c.
Here is the call graph for this function:
|
static |
|
static |
|
static |
| REDIS_ASYNC_COORD_CALLBACKS | ( | rlm_cache_redis_thread_t | ) |
|
static |
Definition at line 79 of file rlm_cache_redis.c.
|
static |
Definition at line 80 of file rlm_cache_redis.c.
|
static |
Definition at line 69 of file rlm_cache_redis.c.
|
static |
Definition at line 70 of file rlm_cache_redis.c.
|
static |
Definition at line 34 of file rlm_cache_redis.c.
| rlm_cache_driver_t rlm_cache_redis |
Definition at line 696 of file rlm_cache_redis.c.
| fr_dict_autoload_t rlm_cache_redis_dict |
Definition at line 73 of file rlm_cache_redis.c.
| fr_dict_attr_autoload_t rlm_cache_redis_dict_attr |
Definition at line 83 of file rlm_cache_redis.c.
1.9.8