ripd: add ECMP support
* Each node in the routing table is changed into a list, holding
the multiple equal-cost paths.
* If one of the multiple entries gets less-preferred (greater
metric or greater distance), it will be directly deleted instead
of starting a garbage-collection timer for it.
The garbage-collection timer is started only when the last entry
in the list gets INFINITY.
* Some new functions are used to maintain the ECMP list. And hence
rip_rte_process(), rip_redistribute_add() and rip_timeout() are
significantly simplified.
* rip_zebra_ipv4_add() and rip_zebra_ipv4_delete() now can share
the common code. The common part is moved to rip_zebra_ipv4_send().
Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/ripd/ripd.h b/ripd/ripd.h
index 0fc2fd3..0f0e216 100644
--- a/ripd/ripd.h
+++ b/ripd/ripd.h
@@ -401,8 +401,8 @@
struct in_addr *, unsigned int, unsigned char);
extern void rip_redistribute_delete (int, int, struct prefix_ipv4 *, unsigned int);
extern void rip_redistribute_withdraw (int);
-extern void rip_zebra_ipv4_add (struct prefix_ipv4 *, struct in_addr *, u_int32_t, u_char);
-extern void rip_zebra_ipv4_delete (struct prefix_ipv4 *, struct in_addr *, u_int32_t);
+extern void rip_zebra_ipv4_add (struct route_node *);
+extern void rip_zebra_ipv4_delete (struct route_node *);
extern void rip_interface_multicast_set (int, struct connected *);
extern void rip_distribute_update_interface (struct interface *);
extern void rip_if_rmap_update_interface (struct interface *);
@@ -429,6 +429,10 @@
extern void rip_ifaddr_add (struct interface *, struct connected *);
extern void rip_ifaddr_delete (struct interface *, struct connected *);
+extern struct rip_info *rip_ecmp_add (struct rip_info *);
+extern struct rip_info *rip_ecmp_replace (struct rip_info *);
+extern struct rip_info *rip_ecmp_delete (struct rip_info *);
+
/* There is only one rip strucutre. */
extern struct rip *rip;