From c35fafdf887aa32c5be6ad738d3a3b0140cea6e8 Mon Sep 17 00:00:00 2001 From: Matthieu Boutier Date: Mon, 23 Jan 2012 23:46:32 +0100 Subject: babeld: babelz merge. Babelz is the last version of the stand-alone babel daemon. In particular, it use multiple channels to diminuate interferences. Please refer to this one for more details. --- babeld/xroute.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'babeld/xroute.c') diff --git a/babeld/xroute.c b/babeld/xroute.c index 8330b492..80651671 100644 --- a/babeld/xroute.c +++ b/babeld/xroute.c @@ -50,9 +50,12 @@ THE SOFTWARE. #include "util.h" #include "babel_interface.h" -struct xroute *xroutes; -int numxroutes = 0; -int maxxroutes = 0; +static int xroute_add_new_route(unsigned char prefix[16], unsigned char plen, + unsigned short metric, unsigned int ifindex, + int proto, int send_updates); + +static struct xroute *xroutes; +static int numxroutes = 0, maxxroutes = 0; /* Add redistributed route to Babel table. */ int @@ -189,8 +192,24 @@ add_xroute(unsigned char prefix[16], unsigned char plen, return 1; } -/* add an xroute, verifying some conditions; return 0 if there is no changes */ +/* Returns an overestimate of the number of xroutes. */ int +xroutes_estimate() +{ + return numxroutes; +} + +void +for_all_xroutes(void (*f)(struct xroute*, void*), void *closure) +{ + int i; + + for(i = 0; i < numxroutes; i++) + (*f)(&xroutes[i], closure); +} + +/* add an xroute, verifying some conditions; return 0 if there is no changes */ +static int xroute_add_new_route(unsigned char prefix[16], unsigned char plen, unsigned short metric, unsigned int ifindex, int proto, int send_updates) -- cgit v1.2.1