mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
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.
This commit is contained in:
18
nest/route.h
18
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
|
||||
|
Reference in New Issue
Block a user