summaryrefslogtreecommitdiffstats
path: root/nest/route.h
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-04-05 22:25:03 +0200
committerMartin Mares <mj@ucw.cz>1999-04-05 22:25:03 +0200
commite2dc2f30efd65cf3da4db150fae695978388e247 (patch)
treea3f95159dd62141fa6d350dbd8ff6f055dff291b /nest/route.h
parent9e0e485e50ea74c4f1c5cb65bdfe6ce819c2cee2 (diff)
downloadbird-e2dc2f30efd65cf3da4db150fae695978388e247.tar
bird-e2dc2f30efd65cf3da4db150fae695978388e247.zip
Routing table core changes to support full route filtering:
o Introduced rte_cow() which should be used for copying on write the rte's in filters. Each rte now carries a flag saying whether it's a real route (possessing table linkage and other insignia) or a local copy. This function can be expected to be fast since its fast-path is inlined. o Introduced rte_update_pool which is a linear memory pool used for all temporary data during rte_update. You should not reference it directly -- instead use a pool pointer passed to all related functions. o Split rte_update to three functions: rte_update The front end: handles all checking, inbound filtering and calls rte_recalculate() for the final version of the route. rte_recalculate Update the table according to already filtered route. rte_announce Announce routing table changes to all protocols, passing them through export filters and so on. The interface has _not_ changed -- still call rte_update() and it will do the rest for you automagically. o Use new filtering semantics to be explained in a separate mail.
Diffstat (limited to 'nest/route.h')
-rw-r--r--nest/route.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/nest/route.h b/nest/route.h
index 5fcae2b..ebe10f1 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -1,7 +1,7 @@
/*
* BIRD Internet Routing Daemon -- Routing Table
*
- * (c) 1998 Martin Mares <mj@ucw.cz>
+ * (c) 1998--1999 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
@@ -150,6 +150,8 @@ typedef struct rte {
} u;
} rte;
+#define REF_COW 1 /* Copy this rte on write */
+
extern rtable master_table;
void rt_init(void);
@@ -162,6 +164,8 @@ void rte_update(net *net, struct proto *p, rte *new);
void rte_discard(rte *old);
void rte_dump(rte *);
void rte_free(rte *);
+rte *rte_do_cow(rte *);
+static inline rte * rte_cow(rte *r) { return (r->flags & REF_COW) ? rte_do_cow(r) : r; }
void rt_dump(rtable *);
void rt_dump_all(void);
void rt_feed_baby(struct proto *p);