From 5ec5c706d993a68502801433c3bb2bcbb078efff Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 29 Apr 2021 22:23:05 +0200 Subject: cache: add hashtable cache for table Add a hashtable for fast table lookups. Tables that reside in the cache use the table->cache_hlist and table->cache_list heads. Table that are created from command line / ruleset are also added to the cache. Signed-off-by: Pablo Neira Ayuso --- include/rule.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include/rule.h') diff --git a/include/rule.h b/include/rule.h index c6fd4c4c..fbd2c9a7 100644 --- a/include/rule.h +++ b/include/rule.h @@ -152,6 +152,7 @@ const char *table_flag_name(uint32_t flag); */ struct table { struct list_head list; + struct cache_item cache; struct handle handle; struct location location; struct scope scope; @@ -173,9 +174,6 @@ struct table { extern struct table *table_alloc(void); extern struct table *table_get(struct table *table); extern void table_free(struct table *table); -extern void table_add_hash(struct table *table, struct nft_cache *cache); -extern struct table *table_lookup(const struct handle *h, - const struct nft_cache *cache); extern struct table *table_lookup_fuzzy(const struct handle *h, const struct nft_cache *cache); -- cgit v1.2.3