[Olsr-cvs] olsrd-current/lib/tas/src plugin.c,1.13,1.14

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


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

Modified Files:
	plugin.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: plugin.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/tas/src/plugin.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** plugin.c	17 Sep 2007 22:24:22 -0000	1.13
--- plugin.c	2 Nov 2007 20:58:07 -0000	1.14
***************
*** 104,116 ****
  }
  
- static double lqToEtx(double lq, double nlq)
- {
-   if (lq < MIN_LINK_QUALITY || nlq < MIN_LINK_QUALITY)
-     return 0.0;
- 
-   else
-     return 1.0 / (lq * nlq);
- }
- 
  int iterLinkTabNext(char *buff, int len)
  {
--- 104,107 ----
***************
*** 120,125 ****
      return -1;
  
!   etx = lqToEtx(iterLinkTab->loss_link_quality,
!                 iterLinkTab->neigh_link_quality);
  
    snprintf(buff, len, "local~%s~remote~%s~main~%s~hysteresis~%f~lq~%f~nlq~%f~etx~%f~",
--- 111,115 ----
      return -1;
  
!   etx = olsr_calc_link_etx(iterLinkTab);
  
    snprintf(buff, len, "local~%s~remote~%s~main~%s~hysteresis~%f~lq~%f~nlq~%f~etx~%f~",
***************
*** 276,280 ****
      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)
--- 266,270 ----
      res = snprintf(buff, len, "[~%d~address~%s~etx~%f~]~", i,
                     rawIpAddrToString(&tc_edge->T_dest_addr, ipAddrLen),
!                    olsr_calc_tc_etx(tc_edge));
  
      if (res < len)





More information about the Olsr-cvs mailing list