summaryrefslogtreecommitdiffstats
path: root/include/cache.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2021-04-29 21:55:34 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2021-05-02 23:30:35 +0200
commiteac934393c18c094da3dba2131340f3a82459d97 (patch)
tree53f30be475a394382ee905bfd5536c659bfc1a4e /include/cache.h
parent1f4b36a18d945fced71bdfc0a2e369c44b8d8fe3 (diff)
src: consolidate object cache infrastructure
This patch consolidates the object cache infrastructure. Update set and chains to use it. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/cache.h')
-rw-r--r--include/cache.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/cache.h b/include/cache.h
index 987b122b..4d91a736 100644
--- a/include/cache.h
+++ b/include/cache.h
@@ -72,4 +72,19 @@ struct chain *chain_cache_find(const struct table *table, const char *name);
void set_cache_add(struct set *set, struct table *table);
struct set *set_cache_find(const struct table *table, const char *name);
+struct cache {
+ struct list_head *ht;
+ struct list_head list;
+};
+
+struct cache_item {
+ struct list_head hlist;
+ struct list_head list;
+};
+
+void cache_init(struct cache *cache);
+void cache_free(struct cache *cache);
+void cache_add(struct cache_item *item, struct cache *cache, uint32_t hash);
+void cache_del(struct cache_item *item);
+
#endif /* _NFT_CACHE_H_ */