From f2b76f2c45bb8e7c1f13f6d4924e10f0c6b12778 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 26 Jul 2010 16:39:27 +0200 Subject: For hostentry cache, replace FIB with a hash table using (IP, dep table) as a key. --- nest/route.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'nest/route.h') diff --git a/nest/route.h b/nest/route.h index e599f5b..97678e1 100644 --- a/nest/route.h +++ b/nest/route.h @@ -150,20 +150,27 @@ typedef struct network { } net; struct hostcache { - struct fib htable; + slab *slab; /* Slab holding all hostentries */ + struct hostentry **hash_table; /* Hash table for hostentries */ + unsigned hash_order, hash_shift; + unsigned hash_max, hash_min; + unsigned hash_items; + list hostentries; byte update_hostcache; }; struct hostentry { - struct fib_node fn; node ln; + ip_addr addr; /* IP of host, part of key */ + struct rtable *tab; /* Dependent table, part of key*/ + struct hostentry *next; /* Next in hash chain */ + unsigned hash_key; /* Hash key */ unsigned uc; /* Use count */ struct iface *iface; /* Chosen outgoing interface */ ip_addr gw; /* Chosen next hop */ byte dest; /* Chosen route destination type (RTD_...) */ byte pxlen; /* Pxlen from net that matches route */ - struct rtable *tab; }; typedef struct rte { -- cgit v1.2.3