netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cache.c File Reference
#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>
Include dependency graph for cache.c:

Functions

struct cachecache_create (const char *name, enum cache_type type, unsigned int features, struct cache_extra *extra, struct cache_ops *ops)
 
void cache_destroy (struct cache *c)
 
struct cache_objectcache_object_new (struct cache *c, void *ptr)
 
void cache_object_free (struct cache_object *obj)
 
int cache_object_put (struct cache_object *obj)
 
void cache_object_get (struct cache_object *obj)
 
void cache_object_set_status (struct cache_object *obj, int status)
 
int cache_add (struct cache *c, struct cache_object *obj, int id)
 
void cache_update (struct cache *c, struct cache_object *obj, int id, void *ptr)
 
void cache_del (struct cache *c, struct cache_object *obj)
 
struct cache_objectcache_update_force (struct cache *c, void *ptr)
 
struct cache_objectcache_find (struct cache *c, void *ptr, int *id)
 
void * cache_get_extra (struct cache_object *obj)
 
void cache_stats (const struct cache *c, int fd)
 
void cache_stats_extended (const struct cache *c, int fd)
 
void cache_iterate (struct cache *c, void *data, int(*iterate)(void *data1, void *data2))
 
void cache_iterate_limit (struct cache *c, void *data, uint32_t from, uint32_t steps, int(*iterate)(void *data1, void *data2))
 
void cache_dump (struct cache *c, int fd, int type)
 
int cache_commit (struct cache *c, struct nfct_handle *h, int clientfd)
 
void cache_flush (struct cache *c)
 

Variables

struct cache_featurecache_feature [CACHE_MAX_FEATURE]
 

Function Documentation

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().

Here is the caller graph for this function:

int cache_commit ( struct cache c,
struct nfct_handle h,
int  clientfd 
)

References cache_ops::commit, and cache::ops.

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().

Here is the caller graph for this function:

void cache_destroy ( struct cache c)

References cache_flush(), cache::feature_offset, cache::features, cache::h, and hashtable_destroy().

Here is the call graph for this function:

void cache_dump ( struct cache c,
int  fd,
int  type 
)

References cache_ops::dump_step, __dump_container::fd, cache::h, hashtable_iterate(), and cache::ops.

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void cache_flush ( struct cache c)

References cache::flush, cache::h, hashtable_iterate(), and cache::stats.

Referenced by cache_destroy().

Here is the call graph for this function:

Here is the caller graph for this function:

void* cache_get_extra ( struct cache_object obj)
void cache_iterate ( struct cache c,
void *  data,
int(*)(void *data1, void *data2)  iterate 
)

References cache::h, and hashtable_iterate().

Here is the call graph for this function:

void cache_iterate_limit ( struct cache c,
void *  data,
uint32_t  from,
uint32_t  steps,
int(*)(void *data1, void *data2)  iterate 
)

References cache::h, and hashtable_iterate_limit().

Here is the call graph for this function:

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().

Here is the caller graph for this function:

void cache_object_get ( struct cache_object obj)

References cache_object::refcnt.

int cache_object_put ( struct cache_object obj)

References cache_object::cache, cache_del(), cache_object_free(), and cache_object::refcnt.

Here is the call graph for this function:

void cache_object_set_status ( struct cache_object obj,
int  status 
)
struct cache_object* cache_update_force ( struct cache c,
void *  ptr 
)

Variable Documentation

Initial value:
= {
}
Definition: cache.h:13
struct cache_feature timer_feature
Definition: cache_timer.c:69