#include "cache.h"
#include "jhash.h"
#include "hash.h"
#include "log.h"
#include "conntrackd.h"
#include <libnetfilter_conntrack/libnetfilter_conntrack.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
Variables | |
struct cache_feature * | cache_feature [CACHE_MAX_FEATURE] |
int cache_add | ( | struct cache * | c, |
struct cache_object * | obj, | ||
int | id | ||
) |
References cache::add_fail, cache::add_fail_enospc, cache::add_ok, and cache::stats.
Referenced by cache_update_force().
int cache_commit | ( | struct cache * | c, |
struct nfct_handle * | h, | ||
int | clientfd | ||
) |
References cache_ops::commit, and cache::ops.
struct cache* cache_create | ( | const char * | name, |
enum cache_type | type, | ||
unsigned int | features, | ||
struct cache_extra * | extra, | ||
struct cache_ops * | ops | ||
) |
References cache_ops::alloc, CACHE_MAX_FEATURE, CACHE_T_MAX, CACHE_T_NONE, cache_ops::cmp, CONFIG, cache_ops::copy, cache::extra, cache::extra_offset, cache::feature_offset, cache::feature_type, cache::features, cache_ops::free, cache::h, cache_ops::hash, hashtable_create(), cache::name, NULL, cache::num_features, cache::object_size, cache::ops, cache_feature::size, cache_extra::size, size, cache::type, and type.
void cache_del | ( | struct cache * | c, |
struct cache_object * | obj | ||
) |
References cache::active, C_OBJ_DEAD, cache::del_ok, cache::stats, and cache_object::status.
Referenced by cache_object_put(), and cache_update_force().
References cache_flush(), cache::feature_offset, cache::features, cache::h, and hashtable_destroy().
References cache_ops::dump_step, __dump_container::fd, cache::h, hashtable_iterate(), and cache::ops.
struct cache_object* cache_find | ( | struct cache * | c, |
void * | ptr, | ||
int * | id | ||
) |
References cache::h, hashtable_find(), and hashtable_hash().
Referenced by cache_update_force().
References cache::flush, cache::h, hashtable_iterate(), and cache::stats.
Referenced by cache_destroy().
void* cache_get_extra | ( | struct cache_object * | obj | ) |
References cache_object::cache, and cache::extra_offset.
void cache_object_free | ( | struct cache_object * | obj | ) |
References cache_object::cache, cache_ops::free, cache::objects, cache::ops, cache_object::ptr, and cache::stats.
Referenced by cache_object_put(), and cache_update_force().
void cache_object_get | ( | struct cache_object * | obj | ) |
References cache_object::refcnt.
struct cache_object* cache_object_new | ( | struct cache * | c, |
void * | ptr | ||
) |
References cache::add_fail_enomem, cache_ops::alloc, C_OBJ_NONE, cache_object::cache, cache_ops::copy, NFCT_CP_OVERRIDE, NULL, cache::object_size, cache::objects, cache::ops, cache_object::ptr, cache::stats, and cache_object::status.
Referenced by cache_update_force().
int cache_object_put | ( | struct cache_object * | obj | ) |
References cache_object::cache, cache_del(), cache_object_free(), and cache_object::refcnt.
void cache_object_set_status | ( | struct cache_object * | obj, |
int | status | ||
) |
References cache::active, C_OBJ_DEAD, cache_object::cache, cache::del_ok, cache::stats, and cache_object::status.
References cache::active, cache::add_fail, cache::add_ok, buf, cache::del_fail, cache::del_ok, cache::name, size, cache::stats, cache::upd_fail, and cache::upd_ok.
References cache::active, cache::add_fail, cache::add_fail_enomem, cache::add_fail_enospc, cache::add_ok, buf, cache::del_fail, cache::del_fail_enoent, cache::del_ok, cache::h, hashtable_counter(), cache::name, cache::objects, size, cache::stats, cache::upd_fail, cache::upd_fail_enoent, and cache::upd_ok.
void cache_update | ( | struct cache * | c, |
struct cache_object * | obj, | ||
int | id, | ||
void * | ptr | ||
) |
References C_OBJ_ALIVE, cache_ops::copy, cache_object::data, cache::extra, cache::extra_offset, cache::features, cache_object::lastupdate, NFCT_CP_META, cache::num_features, cache::ops, cache_object::ptr, cache_feature::size, cache::stats, cache_object::status, time_cached(), cache::upd_ok, cache_feature::update, and cache_extra::update.
Referenced by cache_update_force().
struct cache_object* cache_update_force | ( | struct cache * | c, |
void * | ptr | ||
) |
References C_OBJ_DEAD, cache_add(), cache_del(), cache_find(), cache_object_free(), cache_object_new(), cache_update(), id, NULL, and cache_object::status.