summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-08-31 23:13:42 +0200
committerMartin Mares <mj@ucw.cz>1998-08-31 23:13:42 +0200
commit8c43696da0c0680820aa949da35e823e68162788 (patch)
tree95ffc724644c62c6af91c8f1c6f708b8ef17b154
parentbf65d27deaa0bacd801ec06a3257dda03a53fee2 (diff)
downloadbird-8c43696da0c0680820aa949da35e823e68162788.tar
bird-8c43696da0c0680820aa949da35e823e68162788.zip
Route update hook now gets network prefix as well as updated
route attributes.
-rw-r--r--nest/protocol.h3
-rw-r--r--nest/rt-table.c8
2 files changed, 6 insertions, 5 deletions
diff --git a/nest/protocol.h b/nest/protocol.h
index a42f565..92bcbbe 100644
--- a/nest/protocol.h
+++ b/nest/protocol.h
@@ -16,6 +16,7 @@ struct iface;
struct rte;
struct neighbor;
struct rtattr;
+struct network;
/*
* Routing Protocol
@@ -59,7 +60,7 @@ struct proto {
unsigned preference; /* Default route preference */
void (*if_notify)(struct proto *, unsigned flags, struct iface *new, struct iface *old);
- void (*rt_notify)(struct proto *, struct rte *new, struct rte *old);
+ void (*rt_notify)(struct proto *, struct network *net, struct rte *new, struct rte *old);
void (*neigh_notify)(struct neighbor *neigh);
void (*dump)(struct proto *); /* Debugging dump */
void (*start)(struct proto *); /* Start the instance */
diff --git a/nest/rt-table.c b/nest/rt-table.c
index a45b58d..1d0c29c 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -106,14 +106,14 @@ rte_better(rte *new, rte *old)
}
void
-rte_announce(rte *new, rte *old)
+rte_announce(net *net, rte *new, rte *old)
{
struct proto *p;
WALK_LIST(p, proto_list)
if (!new || new->attrs->proto != p)
if (p->rt_notify)
- p->rt_notify(p, new, old);
+ p->rt_notify(p, net, new, old);
}
static inline void
@@ -143,7 +143,7 @@ rte_update(net *net, struct proto *p, rte *new)
if (new && rte_better(new, old_best)) /* It's a new optimal route => announce and relink it */
{
- rte_announce(new, old_best);
+ rte_announce(net, new, old_best);
new->next = net->routes;
net->routes = new;
}
@@ -155,7 +155,7 @@ rte_update(net *net, struct proto *p, rte *new)
for(s=net->routes; s; s=s->next)
if (rte_better(s, r))
r = s;
- rte_announce(r, old_best);
+ rte_announce(net, r, old_best);
if (r) /* Re-link the new optimal route */
{
k = &net->routes;