[Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.74, 1.75
Bernd Petrovitsch
(spam-protected)
Thu Sep 13 17:32:01 CEST 2007
Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16823/lib/httpinfo/src
Modified Files:
olsrd_httpinfo.c
Log Message:
* patch by Hannes Gredler <(spam-protected)> to consolidate the the link-state database and the spf-calculation
Index: olsrd_httpinfo.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -d -r1.74 -r1.75
*** olsrd_httpinfo.c 12 Sep 2007 14:08:00 -0000 1.74
--- olsrd_httpinfo.c 13 Sep 2007 15:31:59 -0000 1.75
***************
*** 1065,1072 ****
{
int size = 0;
! olsr_u8_t index;
! struct tc_entry *entry;
! struct topo_dst *dst_entry;
!
size += snprintf(&buf[size], bufsize-size, "<h2>Topology entries</h2>\n<table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Destination IP</th><th>Last Hop IP</th>");
--- 1065,1070 ----
{
int size = 0;
! struct tc_entry *tc;
! struct tc_edge_entry *tc_edge;
size += snprintf(&buf[size], bufsize-size, "<h2>Topology entries</h2>\n<table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Destination IP</th><th>Last Hop IP</th>");
***************
*** 1075,1111 ****
size += snprintf(&buf[size], bufsize-size, "</tr>\n");
! /* Topology */
! for(index=0;index<HASHSIZE;index++)
! {
! /* For all TC entries */
! entry = tc_table[index].next;
! while(entry != &tc_table[index])
! {
! /* For all destination entries of that TC entry */
! dst_entry = entry->destinations.next;
! while(dst_entry != &entry->destinations)
! {
! size += snprintf(&buf[size], bufsize-size, "<tr>");
! size += build_ipaddr_with_link(&buf[size], bufsize, &dst_entry->T_dest_addr, -1);
! size += build_ipaddr_with_link(&buf[size], bufsize, &entry->T_last_addr, -1);
! if (olsr_cnf->lq_level > 0)
! {
! const double d = dst_entry->link_quality * dst_entry->inverse_link_quality;
! size += snprintf(&buf[size], bufsize-size,
! "<td align=\"right\">%0.2f</td>"
! "<td align=\"right\">%0.2f</td>"
! "<td align=\"right\">%0.2f</td>\n",
! dst_entry->link_quality,
! dst_entry->inverse_link_quality,
! d ? 1.0 / d : 0.0);
! }
! size += snprintf(&buf[size], bufsize-size, "</tr>\n");
! dst_entry = dst_entry->next;
! }
! entry = entry->next;
! }
! }
size += snprintf(&buf[size], bufsize-size, "</table>\n");
--- 1073,1097 ----
size += snprintf(&buf[size], bufsize-size, "</tr>\n");
+ OLSR_FOR_ALL_TC_ENTRIES(tc) {
+ OLSR_FOR_ALL_TC_EDGE_ENTRIES(tc, tc_edge) {
! size += snprintf(&buf[size], bufsize-size, "<tr>");
! size += build_ipaddr_with_link(&buf[size], bufsize, &tc_edge->T_dest_addr, -1);
! size += build_ipaddr_with_link(&buf[size], bufsize, &tc->addr, -1);
! if (olsr_cnf->lq_level > 0)
! {
! const double d = tc_edge->link_quality * tc_edge->inverse_link_quality;
! size += snprintf(&buf[size], bufsize-size,
! "<td align=\"right\">%0.2f</td>"
! "<td align=\"right\">%0.2f</td>"
! "<td align=\"right\">%0.2f</td>\n",
! tc_edge->link_quality,
! tc_edge->inverse_link_quality,
! d ? 1.0 / d : 0.0);
! }
! size += snprintf(&buf[size], bufsize-size, "</tr>\n");
! } OLSR_FOR_ALL_TC_EDGE_ENTRIES_END(tc, tc_edge);
! } OLSR_FOR_ALL_TC_ENTRIES_END(tc);
size += snprintf(&buf[size], bufsize-size, "</table>\n");
More information about the Olsr-cvs
mailing list