]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Route update hook now gets network prefix as well as updated
authorMartin Mares <mj@ucw.cz>
Mon, 31 Aug 1998 21:13:42 +0000 (21:13 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 31 Aug 1998 21:13:42 +0000 (21:13 +0000)
route attributes.

nest/protocol.h
nest/rt-table.c

index a42f565dd4c7f84c4443d4a4919907f9b4052b67..92bcbbe1bdca47792a3b0a13bac9406a306bab86 100644 (file)
@@ -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 */
index a45b58dacdb56554a146ea0456534b4de77ea5b8..1d0c29c8e79939fd76d1afaf40a18b6a6e29af6b 100644 (file)
@@ -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;