summaryrefslogtreecommitdiffstats
path: root/nest/route.h
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-07-26 16:39:27 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-07-26 16:39:27 +0200
commitf2b76f2c45bb8e7c1f13f6d4924e10f0c6b12778 (patch)
tree8422a17c9967b57e0d0fcd7e77a5b524394d4286 /nest/route.h
parent852b7062e33b9886eb869fac8b9354497c49b126 (diff)
downloadbird-f2b76f2c45bb8e7c1f13f6d4924e10f0c6b12778.tar
bird-f2b76f2c45bb8e7c1f13f6d4924e10f0c6b12778.zip
For hostentry cache, replace FIB with a hash table using (IP, dep table) as a key.
Diffstat (limited to 'nest/route.h')
-rw-r--r--nest/route.h13
1 files changed, 10 insertions, 3 deletions
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 {