[Olsr-cvs] olsrd-current/lib/tas/src plugin.c,1.11,1.12
Bernd Petrovitsch
(spam-protected)
Thu Sep 13 17:32:01 CEST 2007
Update of /cvsroot/olsrd/olsrd-current/lib/tas/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16823/lib/tas/src
Modified Files:
plugin.c
Log Message:
* patch by Hannes Gredler <(spam-protected)> to consolidate the the link-state database and the spf-calculation
Index: plugin.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/tas/src/plugin.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** plugin.c 5 Sep 2007 16:17:35 -0000 1.11
--- plugin.c 13 Sep 2007 15:31:59 -0000 1.12
***************
*** 83,87 ****
static struct neighbor_entry *neighTab = NULL;
static struct mid_entry *midTab = NULL;
- static struct tc_entry *tcTab = NULL;
static struct hna_entry *hnaTab = NULL;
static struct olsrd_config *config = NULL;
--- 83,86 ----
***************
*** 244,251 ****
void iterRouteTabInit(void)
{
! avl_init(&routingtree, avl_comp_prefix_default);
! routingtree_version = 0;
- iterRouteTab = (avl_walk_first(&routingtree)->data);
}
--- 243,254 ----
void iterRouteTabInit(void)
{
! struct avl_node *node;
!
! avl_init(&routingtree, avl_comp_prefix_default);
! routingtree_version = 0;
!
! node = avl_walk_first(&routingtree);
! iterRouteTab = node ? node->data : NULL;
}
***************
*** 254,258 ****
int res;
int i;
! struct topo_dst *dest;
if (iterTcTab == NULL)
--- 257,261 ----
int res;
int i;
! struct tc_edge_entry *tc_edge;
if (iterTcTab == NULL)
***************
*** 261,267 ****
res = snprintf(buff, len,
"main~%s~[~destinations~",
! rawIpAddrToString(&iterTcTab->T_last_addr, ipAddrLen));
!
! i = 0;
len -= res;
--- 264,268 ----
res = snprintf(buff, len,
"main~%s~[~destinations~",
! rawIpAddrToString(&iterTcTab->addr, ipAddrLen));
len -= res;
***************
*** 269,279 ****
len -= 2;
- for (dest = iterTcTab->destinations.next; dest != &iterTcTab->destinations;
- dest = dest->next)
- {
res = snprintf(buff, len, "[~%d~address~%s~etx~%f~]~", i,
! rawIpAddrToString(&dest->T_dest_addr, ipAddrLen),
! lqToEtx(dest->link_quality, dest->inverse_link_quality));
if (res < len)
--- 270,280 ----
len -= 2;
+ i = 0;
+
+ OLSR_FOR_ALL_TC_EDGE_ENTRIES(iterTcTab, tc_edge) {
res = snprintf(buff, len, "[~%d~address~%s~etx~%f~]~", i,
! rawIpAddrToString(&tc_edge->T_dest_addr, ipAddrLen),
! lqToEtx(tc_edge->link_quality, tc_edge->inverse_link_quality));
if (res < len)
***************
*** 286,306 ****
i++;
! }
!
strcpy(buff, "]~");
! iterTcTab = iterTcTab->next;
!
! if (iterTcTab == &tcTab[iterIndex])
! {
! iterTcTab = NULL;
!
! while (++iterIndex < HASHSIZE)
! if (tcTab[iterIndex].next != &tcTab[iterIndex])
! {
! iterTcTab = tcTab[iterIndex].next;
! break;
! }
! }
return 0;
--- 287,295 ----
i++;
! } OLSR_FOR_ALL_TC_EDGE_ENTRIES_END(iterTcTab, tc_edge);
!
strcpy(buff, "]~");
! iterTcTab = olsr_getnext_tc_entry(iterTcTab);
return 0;
***************
*** 309,323 ****
void iterTcTabInit(void)
{
! iterTcTab = NULL;
!
! if (tcTab == NULL)
! return;
! for (iterIndex = 0; iterIndex < HASHSIZE; iterIndex++)
! if (tcTab[iterIndex].next != &tcTab[iterIndex])
! {
! iterTcTab = tcTab[iterIndex].next;
! break;
! }
}
--- 298,307 ----
void iterTcTabInit(void)
{
! struct avl_node *node;
!
! avl_init(&tc_tree, avl_comp_prefix_default);
! node = avl_walk_first(&tc_tree);
! iterTcTab = node ? node->data : NULL;
}
***************
*** 465,469 ****
neighTab = neighbortable;
midTab = mid_set;
- tcTab = tc_table;
hnaTab = hna_set;
config = olsr_cnf;
--- 449,452 ----
***************
*** 497,498 ****
--- 480,487 ----
*size = sizeof(plugin_parameters)/sizeof(*plugin_parameters);
}
+
+ /*
+ * Local Variables:
+ * c-basic-offset: 2
+ * End:
+ */
More information about the Olsr-cvs
mailing list