extern cache_module_t rlm_cache_memcached;
cache_module_t rlm_cache_memcached = {
- "rlm_cache_memcached",
- mod_instantiate,
- NULL, /* alloc */
- cache_entry_free,
- cache_entry_find,
- cache_entry_insert,
- cache_entry_expire,
- NULL, /* count */
-
- mod_conn_get,
- mod_conn_release,
- mod_conn_reconnect
+ .name = "rlm_cache_memcached",
+ .instantiate = mod_instantiate,
+ .free = cache_entry_free,
+
+ .find = cache_entry_find,
+ .insert = cache_entry_insert,
+ .expire = cache_entry_expire,
+
+ .acquire = mod_conn_get,
+ .release = mod_conn_release,
+ .reconnect = mod_conn_reconnect
};
extern cache_module_t rlm_cache_rbtree;
cache_module_t rlm_cache_rbtree = {
- "rlm_cache_rbtree",
- mod_instantiate,
- cache_entry_alloc,
- NULL, /* free */
- cache_entry_find,
- cache_entry_insert,
- cache_entry_expire,
- cache_entry_count,
-
- cache_acquire,
- cache_release,
- NULL /* no reconnect method */
+ .name = "rlm_cache_rbtree",
+ .instantiate = mod_instantiate,
+ .alloc = cache_entry_alloc,
+
+ .find = cache_entry_find,
+ .insert = cache_entry_insert,
+ .expire = cache_entry_expire,
+ .count = cache_entry_count,
+
+ .acquire = cache_acquire,
+ .release = cache_release,
};
rad_assert(inst->module->insert);
rad_assert(inst->module->expire);
- if (inst->module->mod_instantiate) {
+ if (inst->module->instantiate) {
CONF_SECTION *cs;
char const *name;
* Should write its instance data in inst->driver,
* and parent it off of inst.
*/
- if (inst->module->mod_instantiate(cs, inst) < 0) return -1;
+ if (inst->module->instantiate(cs, inst) < 0) return -1;
}
rad_assert(inst->key && *inst->key);
VALUE_PAIR *state; //!< Cached session-state list.
} rlm_cache_entry_t;
-typedef int (*mod_instantiate_t)(CONF_SECTION *conf, rlm_cache_t *inst);
+typedef int (*cache_instantiate_t)(CONF_SECTION *conf, rlm_cache_t *inst);
typedef rlm_cache_entry_t *(*cache_entry_alloc_t)(rlm_cache_t *inst, REQUEST *request);
typedef void (*cache_entry_free_t)(rlm_cache_entry_t *c);
struct cache_module {
char const *name; //!< Driver name.
- mod_instantiate_t mod_instantiate; //!< (optional) Instantiate a driver.
+ cache_instantiate_t instantiate; //!< (optional) Instantiate a driver.
cache_entry_alloc_t alloc; //!< (optional) Allocate a new entry.
cache_entry_free_t free; //!< (optional) Free memory used by an entry.