|
Electroneum
|
#include "util/storage/slabhash.h"
Go to the source code of this file.
Classes | |
| struct | key_cache |
Functions | |
| struct key_cache * | key_cache_create (struct config_file *cfg) |
| void | key_cache_delete (struct key_cache *kcache) |
| void | key_cache_insert (struct key_cache *kcache, struct key_entry_key *kkey, struct module_qstate *qstate) |
| void | key_cache_remove (struct key_cache *kcache, uint8_t *name, size_t namelen, uint16_t key_class) |
| struct key_entry_key * | key_cache_obtain (struct key_cache *kcache, uint8_t *name, size_t namelen, uint16_t key_class, struct regional *region, time_t now) |
| size_t | key_cache_get_mem (struct key_cache *kcache) |
This file contains functions for caching validated key entries.
Definition in file val_kcache.h.
| struct key_cache* key_cache_create | ( | struct config_file * | cfg | ) |
Create the key cache
| cfg | config settings for the key cache. |
| void key_cache_delete | ( | struct key_cache * | kcache | ) |
Delete the key cache
| kcache | to delete |
| size_t key_cache_get_mem | ( | struct key_cache * | kcache | ) |
Get memory in use by the key cache.
| kcache | the key cache. |
| void key_cache_insert | ( | struct key_cache * | kcache, |
| struct key_entry_key * | kkey, | ||
| struct module_qstate * | qstate | ||
| ) |
Insert or update a key cache entry. Note that the insert may silently fail if there is not enough memory.
| kcache | the key cache. |
| kkey | key entry key, assumed malloced in a region, is copied to perform update or insertion. Its data pointer is also copied. |
| qstate | store errinf reason in case its bad. |
| struct key_entry_key* key_cache_obtain | ( | struct key_cache * | kcache, |
| uint8_t * | name, | ||
| size_t | namelen, | ||
| uint16_t | key_class, | ||
| struct regional * | region, | ||
| time_t | now | ||
| ) |
Lookup key entry in the cache. Looks up the closest key entry above the given name.
| kcache | the key cache. |
| name | for what name to look; uncompressed wireformat |
| namelen | length of the name. |
| key_class | class of the key. |
| region | a copy of the key_entry is allocated in this region. |
| now | current time. |