diff options
author | Martin Mares <mj@ucw.cz> | 1999-05-17 20:14:52 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1999-05-17 20:14:52 +0000 |
commit | 0e02abfd5770062768eeb4c75061b7d2f656489d (patch) | |
tree | c9ee70e3b8d7eff81ced44994b58e878d9edafdc /nest/route.h | |
parent | 4107df1d1b7454a16e6f45ea55aae13b01c9f566 (diff) |
From now we support multiple tables. The master_table variable is
definitely gone. Both rte_update() and rte_discard() have an additional
argument telling which table should they modify.
Also, rte_update() no longer walks the whole protocol list -- each table
has a list of all protocols connected to this table and having the
rt_notify hook set. Each protocol can also freely decide (by calling
proto_add_announce_hook) to connect to any other table, but it will
be probably used only by the table-to-table protocol.
The default debugging dumps now include all routing tables and also
all their connections.
Diffstat (limited to 'nest/route.h')
-rw-r--r-- | nest/route.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/nest/route.h b/nest/route.h index 10628cdb..5e6b8739 100644 --- a/nest/route.h +++ b/nest/route.h @@ -9,6 +9,7 @@ #ifndef _BIRD_ROUTE_H_ #define _BIRD_ROUTE_H_ +#include "lib/lists.h" #include "lib/resource.h" #include "lib/timer.h" @@ -104,9 +105,17 @@ void fit_put(struct fib_iterator *, struct fib_node *); * It's guaranteed that there is at most one RTE for every (prefix,proto) pair. */ +struct rtable_config { + node n; + char *name; + struct rtable *table; +}; + typedef struct rtable { + node n; /* Node in list of all tables */ struct fib fib; char *name; /* Name of this table */ + list hooks; /* List of announcement hooks */ } rtable; typedef struct network { @@ -152,16 +161,18 @@ typedef struct rte { #define REF_COW 1 /* Copy this rte on write */ -extern rtable master_table; +struct config; void rt_init(void); +void rt_preconfig(struct config *); +void rt_commit(struct config *); void rt_setup(pool *, rtable *, char *); static inline net *net_find(rtable *tab, ip_addr addr, unsigned len) { return (net *) fib_find(&tab->fib, &addr, len); } static inline net *net_get(rtable *tab, ip_addr addr, unsigned len) { return (net *) fib_get(&tab->fib, &addr, len); } rte *rte_find(net *net, struct proto *p); rte *rte_get_temp(struct rta *); -void rte_update(net *net, struct proto *p, rte *new); -void rte_discard(rte *old); +void rte_update(rtable *tab, net *net, struct proto *p, rte *new); +void rte_discard(rtable *tab, rte *old); void rte_dump(rte *); void rte_free(rte *); rte *rte_do_cow(rte *); @@ -170,6 +181,7 @@ void rt_dump(rtable *); void rt_dump_all(void); void rt_feed_baby(struct proto *p); void rt_prune(rtable *tab); +void rt_prune_all(void); /* * Route Attributes |