struct rte;
struct neighbor;
struct rtattr;
+struct network;
/*
* Routing Protocol
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 */
}
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
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;
}
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;