7 typedef struct _flxCache flxCache;
12 #include "timeeventq.h"
22 typedef struct flxCacheEntry flxCacheEntry;
24 struct flxCacheEntry {
32 flxCacheEntryState state;
33 flxTimeEvent *time_event;
35 FLX_LLIST_FIELDS(flxCacheEntry, by_key);
36 FLX_LLIST_FIELDS(flxCacheEntry, entry);
42 flxInterface *interface;
44 GHashTable *hash_table;
46 FLX_LLIST_HEAD(flxCacheEntry, entries);
49 flxCache *flx_cache_new(flxServer *server, flxInterface *interface);
50 void flx_cache_free(flxCache *c);
52 flxCacheEntry *flx_cache_lookup_key(flxCache *c, flxKey *k);
53 flxCacheEntry *flx_cache_lookup_record(flxCache *c, flxRecord *r);
55 void flx_cache_update(flxCache *c, flxRecord *r, gboolean unique, const flxAddress *a);
57 void flx_cache_drop_record(flxCache *c, flxRecord *r);
59 void flx_cache_dump(flxCache *c, FILE *f);
61 typedef gpointer flxCacheWalkCallback(flxCache *c, flxKey *pattern, flxCacheEntry *e, gpointer userdata);
62 gpointer flx_cache_walk(flxCache *c, flxKey *pattern, flxCacheWalkCallback cb, gpointer userdata);
64 gboolean flx_cache_entry_half_ttl(flxCache *c, flxCacheEntry *e);