summaryrefslogtreecommitdiff
path: root/nest/route.h
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2012-03-15 11:58:08 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2012-03-15 12:13:04 +0100
commitc0adf7e9fc0bb920175a639c6f56ed7b4190f3e4 (patch)
tree8bc6ac9e4c9288d7e7009a80a04d7278325ff05c /nest/route.h
parent46c1a583a5c1ea81e8d8f372bd7f614506a63938 (diff)
Better support for multitable protocols.
The nest-protocol interaction is changed to better handle multitable protocols. Multitable protocols now declare that by 'multitable' field, which tells nest that a protocol handles things related to proto-rtable interaction (table locking, announce hook adding, reconfiguration of filters) itself. Filters and stats are moved to announce hooks, a protocol could have different filters and stats to different tables. The patch is based on one from Alexander V. Chernikov, thanks.
Diffstat (limited to 'nest/route.h')
-rw-r--r--nest/route.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/nest/route.h b/nest/route.h
index e6712c64..fcb4f283 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -12,6 +12,7 @@
#include "lib/lists.h"
#include "lib/resource.h"
#include "lib/timer.h"
+#include "nest/protocol.h"
struct protocol;
struct proto;
@@ -179,7 +180,7 @@ struct hostentry {
typedef struct rte {
struct rte *next;
net *net; /* Network this RTE belongs to */
- struct proto *sender; /* Protocol instance that sent the route to the routing table */
+ struct announce_hook *sender; /* Announce hook used to send the route to the routing table */
struct rta *attrs; /* Attributes of this route */
byte flags; /* Flags (REF_...) */
byte pflags; /* Protocol-specific flags */
@@ -234,7 +235,8 @@ static inline net *net_find(rtable *tab, ip_addr addr, unsigned len) { return (n
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(rtable *tab, net *net, struct proto *p, struct proto *src, rte *new);
+void rte_update2(struct announce_hook *ah, net *net, rte *new, struct proto *src);
+static inline void rte_update(rtable *tab, net *net, struct proto *p, struct proto *src, rte *new) { rte_update2(p->main_ahook, net, new, src); }
void rte_discard(rtable *tab, rte *old);
void rte_dump(rte *);
void rte_free(rte *);