summaryrefslogtreecommitdiffstats
path: root/include/cache.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-01-15 23:19:58 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2009-01-15 23:19:58 +0100
commit8dce3504fde7da933dc6e7ecfeb99b4b45125f32 (patch)
tree9d12a1e54caf8a6718eb2ad5187e4e13c3791d3e /include/cache.h
parent50339f96638eed35dac2b673b64cc6f1eb96406c (diff)
cache: add status field to store the object status
This patch adds the status field to the cache object. This avoids the (ab)use of the alarm to check if an entry is active or dead. This is the first step to possibly move the alarm to the cache_extra memory space of the ftfw (which is the only use by now). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/cache.h')
-rw-r--r--include/cache.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/cache.h b/include/cache.h
index dcd6bcd..fd8e05f 100644
--- a/include/cache.h
+++ b/include/cache.h
@@ -23,11 +23,19 @@ enum {
};
#define CACHE_MAX_FEATURE __CACHE_MAX_FEATURE
+enum {
+ C_OBJ_NONE = 0, /* not in the cache */
+ C_OBJ_NEW, /* just added to the cache */
+ C_OBJ_ALIVE, /* in the cache, alive */
+ C_OBJ_DEAD /* still in the cache, but dead */
+};
+
struct cache;
struct cache_object {
struct hashtable_node hashnode;
struct nf_conntrack *ct;
struct cache *cache;
+ int status;
struct alarm_block alarm;
char data[0];
};