[Olsr-cvs] olsrd-current/lib/tas/src plugin.c,1.9,1.10
Bernd Petrovitsch
(spam-protected)
Wed Sep 5 18:11:12 CEST 2007
Update of /cvsroot/olsrd/olsrd-current/lib/tas/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18959/lib/tas/src
Modified Files:
plugin.c
Log Message:
* applied rt-refactoring-6.diff from Hannes Gredler <(spam-protected)>
Index: plugin.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/tas/src/plugin.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** plugin.c 2 Sep 2007 22:17:00 -0000 1.9
--- plugin.c 5 Sep 2007 16:11:10 -0000 1.10
***************
*** 85,89 ****
static struct tc_entry *tcTab = NULL;
static struct hna_entry *hnaTab = NULL;
- static struct rt_entry *routeTab = NULL;
static struct olsrd_config *config = NULL;
--- 85,88 ----
***************
*** 222,245 ****
int iterRouteTabNext(char *buff, int len)
{
if (iterRouteTab == NULL)
return -1;
snprintf(buff, len, "destination~%s~gateway~%s~interface~%s~metric~%d~",
! rawIpAddrToString(&iterRouteTab->rt_dst, ipAddrLen),
! rawIpAddrToString(&iterRouteTab->rt_router, ipAddrLen),
! iterRouteTab->rt_if->int_name, iterRouteTab->rt_metric);
!
! iterRouteTab = iterRouteTab->next;
! if (iterRouteTab == &routeTab[iterIndex])
! {
! iterRouteTab = NULL;
!
! while (++iterIndex < HASHSIZE)
! if (routeTab[iterIndex].next != &routeTab[iterIndex])
! {
! iterRouteTab = routeTab[iterIndex].next;
! break;
! }
}
--- 221,240 ----
int iterRouteTabNext(char *buff, int len)
{
+ struct avl_node *rt_tree_node;
+
if (iterRouteTab == NULL)
return -1;
snprintf(buff, len, "destination~%s~gateway~%s~interface~%s~metric~%d~",
! rawIpAddrToString(&iterRouteTab->rt_dst.prefix, ipAddrLen),
! rawIpAddrToString(&iterRouteTab->rt_best->rtp_nexthop.gateway, ipAddrLen),
! iterRouteTab->rt_best->rtp_nexthop.iface->int_name,
! iterRouteTab->rt_best->rtp_metric.hops);
! rt_tree_node = avl_walk_next(&iterRouteTab->rt_tree_node);
! if (rt_tree_node) {
! iterRouteTab = rt_tree_node->data;
! } else {
! iterRouteTab = NULL;
}
***************
*** 249,263 ****
void iterRouteTabInit(void)
{
! iterRouteTab = NULL;
!
! if (routeTab == NULL)
! return;
! for (iterIndex = 0; iterIndex < HASHSIZE; iterIndex++)
! if (routeTab[iterIndex].next != &routeTab[iterIndex])
! {
! iterRouteTab = routeTab[iterIndex].next;
! break;
! }
}
--- 244,251 ----
void iterRouteTabInit(void)
{
! avl_init(&routingtree, avl_comp_prefix_default);
! routingtree_version = 0;
! iterRouteTab = (avl_walk_first(&routingtree)->data);
}
***************
*** 479,483 ****
tcTab = tc_table;
hnaTab = hna_set;
- routeTab = routingtable;
config = olsr_cnf;
--- 467,470 ----
More information about the Olsr-cvs
mailing list