26RCSIDH(rlm_cache_h,
"$Id: 3208cbcdb9230e1d1449ddefe50e7ec4dbffc609 $")
28#include <freeradius-devel/server/base.h>
29#include <freeradius-devel/server/dl_module.h>
30#include <freeradius-devel/server/map.h>
31#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
37#define MAX_ATTRMAP 128
125 void *instance,
request_t *request,
void *handle,
148 void *instance,
request_t *request,
void *handle,
void *rctx);
202 void *instance,
request_t *request,
void *handle,
void *rctx);
242 request_t *request,
void *handle,
void *rctx);
337 void *handle,
void *rctx);
int(* call_env_parse_pair_t)(TALLOC_CTX *ctx, void *out, tmpl_rules_t const *t_rules, CONF_ITEM *ci, call_env_ctx_t const *cec, call_env_parser_t const *rule)
Callback for performing custom parsing of a CONF_PAIR.
static const conf_parser_t config[]
cache_status_t(* cache_entry_find_t)(rlm_cache_entry_t **out, void **rctx_out, rlm_cache_config_t const *config, void *instance, request_t *request, void *handle, fr_value_box_t const *key)
Retrieve an entry from the cache.
uint32_t max_entries
Maximum entries allowed.
cache_entry_find_t find
Retrieve an existing cache entry.
cache_entry_insert_resume_t insert_resume
Resume an async insert.
cache_status_t(* cache_entry_expire_t)(void **rctx_out, rlm_cache_config_t const *config, void *instance, request_t *request, void *handle, fr_value_box_t const *key)
Remove an entry from the cache.
int32_t epoch
Time after which entries are considered valid.
cache_entry_insert_t insert
Add a new entry.
module_instance_t * driver_submodule
Driver's instance data.
cache_status_t(* cache_entry_set_ttl_t)(rlm_cache_config_t const *config, void *instance, request_t *request, void *handle, rlm_cache_entry_t *c)
Update the ttl of an entry in the cache.
fr_time_delta_t ttl
How long an entry is valid for.
cache_entry_expire_t expire
Remove an old entry.
cache_entry_set_ttl_t set_ttl
(Optional) Update the TTL of an entry.
cache_entry_request_cancel_t expire_cancel
Cancel an async expire.
bool stats
Generate statistics.
cache_entry_alloc_t alloc
(optional) Allocate a new entry.
fr_value_box_t key
Key used to identify entry.
map_list_t maps
Head of the maps list.
uint64_t(* cache_entry_count_t)(rlm_cache_config_t const *config, void *instance, request_t *request, void *handle)
Get the number of entries in the cache.
fr_unix_time_t created
When the entry was created.
rlm_cache_config_t config
Must come first because of icky hacks.
void(* cache_entry_free_t)(rlm_cache_entry_t *c)
Free a cache entry.
cache_entry_request_cancel_t insert_cancel
Cancel an async insert.
int(* cache_reconnect_t)(rlm_cache_handle_t **handle, rlm_cache_config_t const *config, void *instance, request_t *request)
Reconnect a previously acquired handle.
cache_status_t(* cache_entry_insert_resume_t)(rlm_cache_entry_t **out, rlm_cache_config_t const *config, void *instance, request_t *request, void *handle, void *rctx)
Resume inserting a cache entry.
rlm_cache_driver_t const * driver
Driver's exported interface.
long long int hits
How many times the entry has been retrieved.
cache_release_t release
(optional) Release access to resource acquired with acquire callback.
cache_entry_free_t free
(optional) Free memory used by an entry.
void(* cache_release_t)(rlm_cache_config_t const *config, void *instance, request_t *request, rlm_cache_handle_t *handle)
Release a previously acquired handle.
cache_entry_find_resume_t find_resume
Resume an async find.
cache_status_t(* cache_entry_insert_t)(void **rctx_out, rlm_cache_config_t const *config, void *instance, request_t *request, void *handle, rlm_cache_entry_t const *c)
Insert an entry into the cache.
cache_entry_expire_resume_t expire_resume
Resume an async expire.
cache_entry_count_t count
(Optional) Number of entries currently in the cache.
cache_entry_request_cancel_t find_cancel
Cancel an async find.
cache_status_t(* cache_entry_find_resume_t)(rlm_cache_entry_t **out, rlm_cache_config_t const *config, void *instance, request_t *request, void *handle, void *rctx)
Resume retrieving a cache entry.
int(* cache_acquire_t)(void **handle, rlm_cache_config_t const *config, void *instance, request_t *request)
Acquire a handle to access the cache.
rlm_cache_entry_t *(* cache_entry_alloc_t)(rlm_cache_config_t const *config, void *instance, request_t *request)
Allocate a new cache entry.
module_t common
Common fields for all loadable modules.
@ CACHE_ERROR
Fatal error.
@ CACHE_RECONNECT
Handle needs to be reconnected.
@ CACHE_YIELD
The driver has pushed an async.
@ CACHE_OK
Cache entry found/updated.
@ CACHE_MISS
Cache entry notfound.
cache_reconnect_t reconnect
(optional) Re-initialise resource.
call_env_parse_pair_t key_parse
(optional) custom key parser.
fr_unix_time_t expires
When the entry expires.
void(* cache_entry_request_cancel_t)(rlm_cache_config_t const *config, void *instance, request_t *request, void *handle, void *rctx)
Cancel an async cache request.
cache_acquire_t acquire
(optional) Acquire exclusive access to a resource used to retrieve the cache entry.
cache_status_t(* cache_entry_expire_resume_t)(rlm_cache_config_t const *config, void *instance, request_t *request, void *handle, void *rctx)
Resume removing a cache entry.
Configuration for the rlm_cache module.
Struct exported by a rlm_* module.
A time delta, a difference in time measured in nanoseconds.
static size_t char ** out