[Olsr-cvs] olsrd-current/src tc_set.c, 1.34, 1.35 tc_set.h, 1.20, 1.21

Bernd Petrovitsch (spam-protected)
Sun Nov 4 18:52:15 CET 2007


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

Modified Files:
	tc_set.c tc_set.h 
Log Message:
* cleanup:
  - #ifdef more away if NODEBUG is enabled.
  - reduce the size of the data and code


Index: tc_set.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/tc_set.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** tc_set.h	2 Nov 2007 20:58:06 -0000	1.20
--- tc_set.h	4 Nov 2007 17:52:13 -0000	1.21
***************
*** 68,77 ****
  };
  
! #define OLSR_TC_EDGE_DOWN (1 <<  0) /* this edge is down */
  
  /*
   * Garbage collection time for downed edges
   */
! #define OLSR_TC_EDGE_GC_TIME 15*1000 /* milliseconds */
  
  struct tc_entry
--- 68,77 ----
  };
  
! #define OLSR_TC_EDGE_DOWN (1 << 0) /* this edge is down */
  
  /*
   * Garbage collection time for downed edges
   */
! #define OLSR_TC_EDGE_GC_TIME (15*1000) /* milliseconds */
  
  struct tc_entry
***************
*** 120,124 ****
  int olsr_tc_delete_mprs(struct tc_entry *, struct tc_message *);
  int olsr_tc_update_mprs(struct tc_entry *, struct tc_message *);
! int olsr_print_tc_table(void);
  void olsr_time_out_tc_set(void);
  
--- 120,124 ----
  int olsr_tc_delete_mprs(struct tc_entry *, struct tc_message *);
  int olsr_tc_update_mprs(struct tc_entry *, struct tc_message *);
! void olsr_print_tc_table(void);
  void olsr_time_out_tc_set(void);
  

Index: tc_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/tc_set.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** tc_set.c	2 Nov 2007 20:58:06 -0000	1.34
--- tc_set.c	4 Nov 2007 17:52:13 -0000	1.35
***************
*** 610,649 ****
   * Print the topology table to stdout
   */
! int
  olsr_print_tc_table(void)
  {
    struct tc_entry *tc;
!   struct tc_edge_entry *tc_edge;
!   char *fstr;
!   
!   OLSR_PRINTF(1, "\n--- %02d:%02d:%02d.%02d ------------------------------------------------- TOPOLOGY\n\n",
!               nowtm->tm_hour,
!               nowtm->tm_min,
!               nowtm->tm_sec,
!               (int)now.tv_usec / 10000);
  
!   if (olsr_cnf->ip_version == AF_INET)
!     {
!       OLSR_PRINTF(1, "Source IP addr   Dest IP addr     LQ     ILQ    ETX\n");
!       fstr = "%-15s  %-15s  %5.3f  %5.3f  %.2f\n";
!     }
!   else
!     {
!       OLSR_PRINTF(1, "Source IP addr                Dest IP addr                    LQ     ILQ    ETX\n");
!       fstr = "%-30s%-30s  %5.3f  %5.3f  %.2f\n";
!     }
  
    OLSR_FOR_ALL_TC_ENTRIES(tc) {
      OLSR_FOR_ALL_TC_EDGE_ENTRIES(tc, tc_edge) {
!       OLSR_PRINTF(1, fstr, olsr_ip_to_string(&tc->addr),
!                   olsr_ip_to_string(&tc_edge->T_dest_addr),
                    tc_edge->link_quality,
                    tc_edge->inverse_link_quality,
                    olsr_calc_tc_etx(tc_edge));
- 
      } OLSR_FOR_ALL_TC_EDGE_ENTRIES_END(tc, tc_edge);
    } OLSR_FOR_ALL_TC_ENTRIES_END(tc);
! 
!   return 1;
  }
  
--- 610,639 ----
   * Print the topology table to stdout
   */
! void
  olsr_print_tc_table(void)
  {
+ #ifndef NODEBUG
+   /* The whole function makes no sense without it. */
    struct tc_entry *tc;
!   const int ipwidth = olsr_cnf->ip_version == AF_INET ? 15 : 30;
  
!   OLSR_PRINTF(1,
!               "\n--- %02d:%02d:%02d.%02d ------------------------------------------------- TOPOLOGY\n\n"
!               "%-*s %-*s %-5s  %-5s  %s\n",
!               nowtm->tm_hour, nowtm->tm_min, nowtm->tm_sec, (int)now.tv_usec / 10000,
!               ipwidth, "Source IP addr", ipwidth, "Dest IP addr", "LQ", "ILQ", "ETX");
  
    OLSR_FOR_ALL_TC_ENTRIES(tc) {
+     struct tc_edge_entry *tc_edge;
      OLSR_FOR_ALL_TC_EDGE_ENTRIES(tc, tc_edge) {
!       OLSR_PRINTF(1, "%-*s %-*s  %5.3f  %5.3f  %.2f\n",
!                   ipwidth, olsr_ip_to_string(&tc->addr),
!                   ipwidth, olsr_ip_to_string(&tc_edge->T_dest_addr),
                    tc_edge->link_quality,
                    tc_edge->inverse_link_quality,
                    olsr_calc_tc_etx(tc_edge));
      } OLSR_FOR_ALL_TC_EDGE_ENTRIES_END(tc, tc_edge);
    } OLSR_FOR_ALL_TC_ENTRIES_END(tc);
! #endif
  }
  





More information about the Olsr-cvs mailing list