[Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.80, 1.81

Bernd Petrovitsch (spam-protected)
Fri Nov 2 21:58:09 CET 2007


Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21496/lib/httpinfo/src

Modified Files:
	olsrd_httpinfo.c 
Log Message:
Some minor and trivial cleanup: Added two functions to calculate the ETX
value from a struct tc_edge_entry and a struct link_entry, respectively.
And use them everywhere.


Index: olsrd_httpinfo.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -C2 -d -r1.80 -r1.81
*** olsrd_httpinfo.c	14 Oct 2007 22:46:03 -0000	1.80
--- olsrd_httpinfo.c	2 Nov 2007 20:58:07 -0000	1.81
***************
*** 981,994 ****
          if (olsr_cnf->lq_level > 0) {
  	    size += snprintf(&buf[size], bufsize-size,
!                            "<td align=\"right\">%0.2f</td>"
!                            "<td>%d</td>"
!                            "<td>%d</td>"
!                            "<td align=\"right\">%0.2f</td>"
!                            "<td align=\"right\">%0.2f</td></tr>\n",
!                            link->loss_link_quality,
!                            link->lost_packets, 
!                            link->total_packets,
!                            link->neigh_link_quality, 
!                            (link->loss_link_quality * link->neigh_link_quality) ? 1.0 / (link->loss_link_quality * link->neigh_link_quality) : 0.0);
          }
  	size += snprintf(&buf[size], bufsize-size, "</tr>\n");
--- 981,994 ----
          if (olsr_cnf->lq_level > 0) {
  	    size += snprintf(&buf[size], bufsize-size,
!                              "<td align=\"right\">%0.2f</td>"
!                              "<td>%d</td>"
!                              "<td>%d</td>"
!                              "<td align=\"right\">%0.2f</td>"
!                              "<td align=\"right\">%0.2f</td></tr>\n",
!                              link->loss_link_quality,
!                              link->lost_packets, 
!                              link->total_packets,
!                              link->neigh_link_quality, 
!                              olsr_calc_link_etx(link));
          }
  	size += snprintf(&buf[size], bufsize-size, "</tr>\n");
***************
*** 1062,1066 ****
            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>"
--- 1062,1065 ----
***************
*** 1069,1073 ****
                                 tc_edge->link_quality,
                                 tc_edge->inverse_link_quality,
!                                d ? 1.0 / d : 0.0);
            }
            size += snprintf(&buf[size], bufsize-size, "</tr>\n");
--- 1068,1072 ----
                                 tc_edge->link_quality,
                                 tc_edge->inverse_link_quality,
!                                olsr_calc_tc_etx(tc_edge));
            }
            size += snprintf(&buf[size], bufsize-size, "</tr>\n");





More information about the Olsr-cvs mailing list