From 45a84088ecbdd7403de849e169fe2f57f34a8bf1 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 29 Apr 2021 22:09:15 +0200 Subject: cache: add hashtable cache for object This patch adds a hashtable for object lookups. This patch also splits table->objs in two: - Sets that reside in the cache are stored in the new tables->cache_obj and tables->cache_obj_ht. - Set that defined via command line / ruleset file reside in tables->obj. Sets in the cache (already in the kernel) are not placed in the table->objs list. By keeping separated lists, objs defined via command line / ruleset file can be added to cache. Signed-off-by: Pablo Neira Ayuso --- include/cache.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/cache.h') diff --git a/include/cache.h b/include/cache.h index 4d91a736..9605ef96 100644 --- a/include/cache.h +++ b/include/cache.h @@ -87,4 +87,9 @@ 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); +void obj_cache_add(struct obj *obj, struct table *table); +void obj_cache_del(struct obj *obj); +struct obj *obj_cache_find(const struct table *table, const char *name, + uint32_t obj_type); + #endif /* _NFT_CACHE_H_ */ -- cgit v1.2.3