26 RCSIDH(cache_h,
"$Id: 7915bb91ec36f02cb9e12c7cc4809c282a3c33b1 $")
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
122 void *instance,
request_t *request,
void *handle,
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[]
rlm_cache_entry_t *(* cache_entry_alloc_t)(rlm_cache_config_t const *config, void *instance, request_t *request)
Allocate a new cache entry.
uint32_t max_entries
Maximum entries allowed.
cache_entry_find_t find
Retrieve an existing cache entry.
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_status_t(* cache_entry_insert_t)(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_set_ttl_t set_ttl
(Optional) Update the TTL of an entry.
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.
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.
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_count_t count
(Optional) Number of entries currently in the cache.
int(* cache_acquire_t)(void **handle, rlm_cache_config_t const *config, void *instance, request_t *request)
Acquire a handle to access the cache.
module_t common
Common fields for all loadable modules.
@ CACHE_ERROR
Fatal error.
@ CACHE_RECONNECT
Handle needs to be reconnected.
@ 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.
cache_status_t(* cache_entry_find_t)(rlm_cache_entry_t **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.
cache_acquire_t acquire
(optional) Acquire exclusive access to a resource used to retrieve the cache entry.
cache_status_t(* cache_entry_expire_t)(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.
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