[Olsr-cvs] olsrd-current/src two_hop_neighbor_table.c, 1.18, 1.19 process_package.c, 1.40, 1.41 tc_set.c, 1.26, 1.27 process_routes.c, 1.33, 1.34 packet.c, 1.22, 1.23 net_olsr.c, 1.24, 1.25 lq_mpr.c, 1.12, 1.13 link_set.c, 1.68, 1.69 lq_route.c, 1.47, 1.48 lq_packet.c, 1.23, 1.24 ipc_frontend.c, 1.32, 1.33 hysteresis.c, 1.20, 1.21 hna_set.c, 1.19, 1.20

Bernd Petrovitsch (spam-protected)
Fri Aug 3 00:07:21 CEST 2007


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

Modified Files:
	two_hop_neighbor_table.c process_package.c tc_set.c 
	process_routes.c packet.c net_olsr.c lq_mpr.c link_set.c 
	lq_route.c lq_packet.c ipc_frontend.c hysteresis.c hna_set.c 
Log Message:
* pave the way to add -Wshadow

Index: lq_route.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/lq_route.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** lq_route.c	5 Jul 2007 22:43:46 -0000	1.47
--- lq_route.c	2 Aug 2007 22:07:19 -0000	1.48
***************
*** 434,438 ****
    struct topo_dst *tcdst;
    struct olsr_spf_vertex *vert, *myself;
-   struct link_entry *link;
    struct neighbor_entry *neigh;
    struct mid_address *mid_walker;
--- 434,437 ----
***************
*** 526,538 ****
        if (neigh->status == SYM)
        {
!         link = get_best_link_to_neighbor(&neigh->neighbor_main_addr);
  
! 	if(!link)
  	  continue;
  
!         if (link->loss_link_quality2 >= MIN_LINK_QUALITY &&
!             link->neigh_link_quality2 >= MIN_LINK_QUALITY)
            {
!             etx = 1.0 / (link->loss_link_quality2 * link->neigh_link_quality2);
  
              olsr_spf_add_edge(&vertex_tree, &neigh->neighbor_main_addr, &olsr_cnf->main_addr, etx);
--- 525,537 ----
        if (neigh->status == SYM)
        {
!         struct link_entry *lnk = get_best_link_to_neighbor(&neigh->neighbor_main_addr);
  
! 	if(!lnk)
  	  continue;
  
!         if (lnk->loss_link_quality2 >= MIN_LINK_QUALITY &&
!             lnk->neigh_link_quality2 >= MIN_LINK_QUALITY)
            {
!             etx = 1.0 / (lnk->loss_link_quality2 * lnk->neigh_link_quality2);
  
              olsr_spf_add_edge(&vertex_tree, &neigh->neighbor_main_addr, &olsr_cnf->main_addr, etx);
***************
*** 607,611 ****
         tree_node != NULL;
         tree_node = avl_walk_next(tree_node)) {
! 
      vert = tree_node->data;
  
--- 606,610 ----
         tree_node != NULL;
         tree_node = avl_walk_next(tree_node)) {
!     struct link_entry *lnk;
      vert = tree_node->data;
  
***************
*** 617,621 ****
      // find the best link to the one-hop neighbour
  
!     link = get_best_link_to_neighbor(vert->next_hop);
  
      // we may see NULL here, if the one-hop neighbour is not in the
--- 616,620 ----
      // find the best link to the one-hop neighbour
  
!     lnk = get_best_link_to_neighbor(vert->next_hop);
  
      // we may see NULL here, if the one-hop neighbour is not in the
***************
*** 623,631 ****
      // between us and the one-hop neighbour from the TC set
  
!     if (link != NULL)
      {
        // find the interface for the found link
!       inter = link->if_name ? if_ifwithname(link->if_name) : 
!               if_ifwithaddr(&link->local_iface_addr);
  
        // we may see NULL here if the interface is down, but we have
--- 622,630 ----
      // between us and the one-hop neighbour from the TC set
  
!     if (lnk != NULL)
      {
        // find the interface for the found link
!       inter = lnk->if_name ? if_ifwithname(lnk->if_name) : 
!               if_ifwithaddr(&lnk->local_iface_addr);
  
        // we may see NULL here if the interface is down, but we have
***************
*** 641,645 ****
  
          if (olsr_lookup_routing_table(&vert->addr) == NULL)
!           olsr_insert_routing_table(&vert->addr, &link->neighbor_iface_addr,
                                      inter, vert->hops, vert->path_etx);
  
--- 640,644 ----
  
          if (olsr_lookup_routing_table(&vert->addr) == NULL)
!           olsr_insert_routing_table(&vert->addr, &lnk->neighbor_iface_addr,
                                      inter, vert->hops, vert->path_etx);
  
***************
*** 651,655 ****
            if (olsr_lookup_routing_table(&mid_walker->alias) == NULL)
              olsr_insert_routing_table(&mid_walker->alias,
!                                       &link->neighbor_iface_addr, inter, vert->hops, 
                                        vert->path_etx);
  
--- 650,654 ----
            if (olsr_lookup_routing_table(&mid_walker->alias) == NULL)
              olsr_insert_routing_table(&mid_walker->alias,
!                                       &lnk->neighbor_iface_addr, inter, vert->hops, 
                                        vert->path_etx);
  
***************
*** 664,670 ****
          // MID entry has timed out
  
!         if (olsr_lookup_routing_table(&link->neighbor_iface_addr) == NULL)
!           olsr_insert_routing_table(&link->neighbor_iface_addr,
!                                     &link->neighbor_iface_addr, inter, 1,
                                      vert->path_etx);
        }
--- 663,669 ----
          // MID entry has timed out
  
!         if (olsr_lookup_routing_table(&lnk->neighbor_iface_addr) == NULL)
!           olsr_insert_routing_table(&lnk->neighbor_iface_addr,
!                                     &lnk->neighbor_iface_addr, inter, 1,
                                      vert->path_etx);
        }

Index: process_package.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/process_package.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** process_package.c	25 Apr 2007 22:08:13 -0000	1.40
--- process_package.c	2 Aug 2007 22:07:19 -0000	1.41
***************
*** 87,91 ****
     * Update link status
     */
!   struct link_entry         *link = update_link_entry(&in_if->ip_addr, from_addr, message, in_if);
  
    if (olsr_cnf->lq_level > 0)
--- 87,91 ----
     * Update link status
     */
!   struct link_entry *lnk = update_link_entry(&in_if->ip_addr, from_addr, message, in_if);
  
    if (olsr_cnf->lq_level > 0)
***************
*** 95,99 ****
        struct hello_neighbor *walker;
        // just in case our neighbor has changed its HELLO interval
!       olsr_update_packet_loss_hello_int(link, message->htime);
  
        // find the input interface in the list of neighbor interfaces
--- 95,99 ----
        struct hello_neighbor *walker;
        // just in case our neighbor has changed its HELLO interval
!       olsr_update_packet_loss_hello_int(lnk, message->htime);
  
        // find the input interface in the list of neighbor interfaces
***************
*** 105,109 ****
        // the current reference link quality
  
!       saved_lq = link->saved_neigh_link_quality;
  
        if (saved_lq == 0.0)
--- 105,109 ----
        // the current reference link quality
  
!       saved_lq = lnk->saved_neigh_link_quality;
  
        if (saved_lq == 0.0)
***************
*** 114,130 ****
  
        if (walker != NULL)
!         link->neigh_link_quality = walker->link_quality;
  
        else
!         link->neigh_link_quality = 0.0;
  
        // if the link quality has changed by more than 10 percent,
        // print the new link quality table
  
!       rel_lq = link->neigh_link_quality / saved_lq;
  
        if (rel_lq > 1.1 || rel_lq < 0.9)
          {
!           link->saved_neigh_link_quality = link->neigh_link_quality;
  
            if (olsr_cnf->lq_dlimit > 0)
--- 114,130 ----
  
        if (walker != NULL)
!         lnk->neigh_link_quality = walker->link_quality;
  
        else
!         lnk->neigh_link_quality = 0.0;
  
        // if the link quality has changed by more than 10 percent,
        // print the new link quality table
  
!       rel_lq = lnk->neigh_link_quality / saved_lq;
  
        if (rel_lq > 1.1 || rel_lq < 0.9)
          {
!           lnk->saved_neigh_link_quality = lnk->neigh_link_quality;
  
            if (olsr_cnf->lq_dlimit > 0)
***************
*** 146,150 ****
      }
    
!   neighbor = link->neighbor;
  
    /*
--- 146,150 ----
      }
    
!   neighbor = lnk->neighbor;
  
    /*
***************
*** 155,159 ****
        /* Update HELLO timeout */
        //printf("MESSAGE HTIME: %f\n", message->htime);
!       olsr_update_hysteresis_hello(link, message->htime);
      }
  
--- 155,159 ----
        /* Update HELLO timeout */
        //printf("MESSAGE HTIME: %f\n", message->htime);
!       olsr_update_hysteresis_hello(lnk, message->htime);
      }
  
***************
*** 161,165 ****
    if(olsr_lookup_mpr_status(message, in_if))
      /* source_addr is always the main addr of a node! */
!     olsr_update_mprs_set(&message->source_addr, (float)message->vtime);
  
  
--- 161,165 ----
    if(olsr_lookup_mpr_status(message, in_if))
      /* source_addr is always the main addr of a node! */
!     olsr_update_mprs_set(&message->source_addr, message->vtime);
  
  
***************
*** 625,632 ****
    if (olsr_cnf->lq_level > 0)
      {
!       struct link_entry *link =
          get_best_link_to_neighbor(&neighbor->neighbor_main_addr);
  
!       if(!link)
  	return;
  
--- 625,632 ----
    if (olsr_cnf->lq_level > 0)
      {
!       struct link_entry *lnk =
          get_best_link_to_neighbor(&neighbor->neighbor_main_addr);
  
!       if(!lnk)
  	return;
  
***************
*** 696,700 ****
                        new_path_link_quality =
                          new_second_hop_link_quality *
!                         link->loss_link_quality * link->neigh_link_quality;
  
                        // Only copy the link quality if it is better than what we have
--- 696,700 ----
                        new_path_link_quality =
                          new_second_hop_link_quality *
!                         lnk->loss_link_quality * lnk->neigh_link_quality;
  
                        // Only copy the link quality if it is better than what we have

Index: ipc_frontend.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/ipc_frontend.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** ipc_frontend.c	1 Aug 2007 16:19:48 -0000	1.32
--- ipc_frontend.c	2 Aug 2007 22:07:19 -0000	1.33
***************
*** 336,340 ****
    struct rt_entry  *destination;
    struct interface *ifn;
!   olsr_u8_t        index;
    struct ipcmsg packet;
    char *tmp;
--- 336,340 ----
    struct rt_entry  *destination;
    struct interface *ifn;
!   int               idx;
    struct ipcmsg packet;
    char *tmp;
***************
*** 344,351 ****
      return 0;
    
!   for(index=0;index<HASHSIZE;index++)
      {
!       for(destination = routingtable[index].next;
! 	  destination != &routingtable[index];
  	  destination = destination->next)
  	{
--- 344,351 ----
      return 0;
    
!   for(idx=0;idx<HASHSIZE;idx++)
      {
!       for(destination = routingtable[idx].next;
! 	  destination != &routingtable[idx];
  	  destination = destination->next)
  	{
***************
*** 391,398 ****
      }
  
!   for(index=0;index<HASHSIZE;index++)
      {
!       for(destination = hna_routes[index].next;
! 	  destination != &hna_routes[index];
  	  destination = destination->next)
  	{
--- 391,398 ----
      }
  
!   for(idx=0;idx<HASHSIZE;idx++)
      {
!       for(destination = hna_routes[idx].next;
! 	  destination != &hna_routes[idx];
  	  destination = destination->next)
  	{

Index: packet.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/packet.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** packet.c	25 Apr 2007 22:08:09 -0000	1.22
--- packet.c	2 Aug 2007 22:07:19 -0000	1.23
***************
*** 91,96 ****
    struct link_entry       *links;
    struct neighbor_entry   *neighbor;
!   olsr_u16_t              index;
!   int                     link;
  
  #ifdef DEBUG
--- 91,95 ----
    struct link_entry       *links;
    struct neighbor_entry   *neighbor;
!   int                     idx;
  
  #ifdef DEBUG
***************
*** 124,129 ****
    while(links != NULL)
      {      
!       
!       link = lookup_link_status(links);
        /* Update the status */
        
--- 123,127 ----
    while(links != NULL)
      {      
!       int lnk = lookup_link_status(links);
        /* Update the status */
        
***************
*** 139,143 ****
  
        /* Find the link status */
!       message_neighbor->link = link;
  
        /*
--- 137,141 ----
  
        /* Find the link status */
!       message_neighbor->link = lnk;
  
        /*
***************
*** 214,221 ****
    
    if(ifnet != NULL && ifnet->int_next != NULL)
!     for(index=0;index<HASHSIZE;index++)
        {       
! 	for(neighbor = neighbortable[index].next;
! 	    neighbor != &neighbortable[index];
  	    neighbor=neighbor->next)
  	  {
--- 212,219 ----
    
    if(ifnet != NULL && ifnet->int_next != NULL)
!     for(idx=0;idx<HASHSIZE;idx++)
        {       
! 	for(neighbor = neighbortable[idx].next;
! 	    neighbor != &neighbortable[idx];
  	    neighbor=neighbor->next)
  	  {
***************
*** 340,349 ****
  olsr_build_tc_packet(struct tc_message *message)
  {
!   struct tc_mpr_addr        *message_mpr;
    //struct mpr_selector       *mprs;
!   olsr_u8_t              index;
    struct neighbor_entry  *entry;
    //struct mpr_selector_hash  *mprs_hash;
-   //olsr_u16_t          index;
    olsr_bool entry_added = OLSR_FALSE;
  
--- 338,346 ----
  olsr_build_tc_packet(struct tc_message *message)
  {
!   struct tc_mpr_addr     *message_mpr;
    //struct mpr_selector       *mprs;
!   int                     idx;
    struct neighbor_entry  *entry;
    //struct mpr_selector_hash  *mprs_hash;
    olsr_bool entry_added = OLSR_FALSE;
  
***************
*** 360,367 ****
  
    /* Loop trough all neighbors */  
!   for(index=0;index<HASHSIZE;index++)
      {
!       for(entry = neighbortable[index].next;
! 	  entry != &neighbortable[index];
  	  entry = entry->next)
  	{
--- 357,364 ----
  
    /* Loop trough all neighbors */  
!   for(idx=0;idx<HASHSIZE;idx++)
      {
!       for(entry = neighbortable[idx].next;
! 	  entry != &neighbortable[idx];
  	  entry = entry->next)
  	{
***************
*** 418,422 ****
  	    } /* Switch */
  	} /* For */
!     } /* For index */
  
    if(entry_added)
--- 415,419 ----
  	    } /* Switch */
  	} /* For */
!     } /* For idx */
  
    if(entry_added)

Index: lq_packet.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/lq_packet.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** lq_packet.c	10 Feb 2007 17:36:51 -0000	1.23
--- lq_packet.c	2 Aug 2007 22:07:19 -0000	1.24
***************
*** 151,155 ****
    int i;
    struct neighbor_entry *walker;
-   struct link_entry *link;
    static int ttl_list[] = { 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, MAX_TTL-1, 0};
  
--- 151,154 ----
***************
*** 200,203 ****
--- 199,203 ----
            walker = walker->next)
          {
+           struct link_entry *lnk;
            // only consider symmetric neighbours
  
***************
*** 227,235 ****
            // set the entry's link quality
  
!           link = get_best_link_to_neighbor(&neigh->main);
  
!           if (link) {
!             neigh->link_quality = link->loss_link_quality;
!             neigh->neigh_link_quality = link->neigh_link_quality;
            }
  
--- 227,235 ----
            // set the entry's link quality
  
!           lnk = get_best_link_to_neighbor(&neigh->main);
  
!           if (lnk) {
!             neigh->link_quality = lnk->loss_link_quality;
!             neigh->neigh_link_quality = lnk->neigh_link_quality;
            }
  

Index: tc_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/tc_set.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** tc_set.c	25 Apr 2007 22:08:17 -0000	1.26
--- tc_set.c	2 Aug 2007 22:07:19 -0000	1.27
***************
*** 58,70 ****
  olsr_init_tc(void)
  {
!   int index;
    OLSR_PRINTF(5, "TC: init topo\n");
  
    olsr_register_timeout_function(&olsr_time_out_tc_set);
  
!   for(index=0;index<HASHSIZE;index++)
      {
!       tc_table[index].next = &tc_table[index];
!       tc_table[index].prev = &tc_table[index];
      }
  
--- 58,70 ----
  olsr_init_tc(void)
  {
!   int idx;
    OLSR_PRINTF(5, "TC: init topo\n");
  
    olsr_register_timeout_function(&olsr_time_out_tc_set);
  
!   for(idx=0;idx<HASHSIZE;idx++)
      {
!       tc_table[idx].next = &tc_table[idx];
!       tc_table[idx].prev = &tc_table[idx];
      }
  
***************
*** 373,386 ****
  olsr_time_out_tc_set(void)
  {
!   int index;
  
!   for(index=0;index<HASHSIZE;index++)
      {
        /* For all TC entries */
!       struct tc_entry *entry = tc_table[index].next;
!       while(entry != &tc_table[index])
  	{
            struct tc_entry *entry2;
! 	  //printf("INDEX: %d\n", index);
  	  /* For all destination entries of that TC entry */
  	  int deleted = 0;
--- 373,386 ----
  olsr_time_out_tc_set(void)
  {
!   int idx;
  
!   for(idx=0;idx<HASHSIZE;idx++)
      {
        /* For all TC entries */
!       struct tc_entry *entry = tc_table[idx].next;
!       while(entry != &tc_table[idx])
  	{
            struct tc_entry *entry2;
! 	  //printf("INDEX: %d\n", idx);
  	  /* For all destination entries of that TC entry */
  	  int deleted = 0;

Index: hysteresis.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/hysteresis.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** hysteresis.c	25 Apr 2007 22:08:08 -0000	1.20
--- hysteresis.c	2 Aug 2007 22:07:19 -0000	1.21
***************
*** 165,178 ****
  update_hysteresis_incoming(union olsr_ip_addr *remote, struct interface *local, olsr_u16_t seqno)
  {
!   struct link_entry *link;
! 
!   link = lookup_link_entry(remote, NULL, local);
  
    /* Calculate new quality */      
!   if(link != NULL)
      {
!       link->L_link_quality = olsr_hyst_calc_stability(link->L_link_quality);
  #ifdef DEBUG
!       OLSR_PRINTF(3, "HYST[%s]: %0.3f\n", olsr_ip_to_string(remote), link->L_link_quality);
  #endif
  
--- 165,176 ----
  update_hysteresis_incoming(union olsr_ip_addr *remote, struct interface *local, olsr_u16_t seqno)
  {
!   struct link_entry *lnk = lookup_link_entry(remote, NULL, local);
  
    /* Calculate new quality */      
!   if(lnk != NULL)
      {
!       lnk->L_link_quality = olsr_hyst_calc_stability(lnk->L_link_quality);
  #ifdef DEBUG
!       OLSR_PRINTF(3, "HYST[%s]: %0.3f\n", olsr_ip_to_string(remote), lnk->L_link_quality);
  #endif
  
***************
*** 184,207 ****
         */
  
!       if (link->olsr_seqno_valid && 
!           (unsigned short)(seqno - link->olsr_seqno) < 100)
! 	  while (link->olsr_seqno != seqno)
  	    {
! 	      link->L_link_quality = olsr_hyst_calc_instability(link->L_link_quality);
  #ifdef DEBUG
  	      OLSR_PRINTF(5, "HYST[%s] PACKET LOSS! %0.3f\n",
! 			  olsr_ip_to_string(remote), link->L_link_quality);
  #endif
! 	      if(link->L_link_quality < olsr_cnf->hysteresis_param.thr_low)
  		break;
  
! 	      link->olsr_seqno++;
  	    }
  
  
!       link->olsr_seqno = seqno + 1;
!       link->olsr_seqno_valid = OLSR_TRUE;
  
!       //printf("Updating seqno to: %d\n", link->olsr_seqno);
      }
    return;
--- 182,205 ----
         */
  
!       if (lnk->olsr_seqno_valid && 
!           (unsigned short)(seqno - lnk->olsr_seqno) < 100)
! 	  while (lnk->olsr_seqno != seqno)
  	    {
! 	      lnk->L_link_quality = olsr_hyst_calc_instability(lnk->L_link_quality);
  #ifdef DEBUG
  	      OLSR_PRINTF(5, "HYST[%s] PACKET LOSS! %0.3f\n",
! 			  olsr_ip_to_string(remote), lnk->L_link_quality);
  #endif
! 	      if(lnk->L_link_quality < olsr_cnf->hysteresis_param.thr_low)
  		break;
  
! 	      lnk->olsr_seqno++;
  	    }
  
  
!       lnk->olsr_seqno = seqno + 1;
!       lnk->olsr_seqno_valid = OLSR_TRUE;
  
!       //printf("Updating seqno to: %d\n", lnk->olsr_seqno);
      }
    return;

Index: net_olsr.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** net_olsr.c	5 Jul 2007 22:43:47 -0000	1.24
--- net_olsr.c	2 Aug 2007 22:07:19 -0000	1.25
***************
*** 613,617 ****
  olsr_ip_to_string(const union olsr_ip_addr *addr)
  {
!   static int index = 0;
    static char buff[4][INET6_ADDRSTRLEN > INET_ADDRSTRLEN ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN];
    const char *ret;
--- 613,617 ----
  olsr_ip_to_string(const union olsr_ip_addr *addr)
  {
!   static int idx = 0;
    static char buff[4][INET6_ADDRSTRLEN > INET_ADDRSTRLEN ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN];
    const char *ret;
***************
*** 626,632 ****
        struct in_addr in;
        in.s_addr = addr->v4;
!       ret = inet_ntop(AF_INET, &in, buff[index], sizeof(buff[index]));
  #else
!       ret = inet_ntop(AF_INET, &addr->v6, buff[index], sizeof(buff[index]));
  #endif
      }
--- 626,632 ----
        struct in_addr in;
        in.s_addr = addr->v4;
!       ret = inet_ntop(AF_INET, &in, buff[idx], sizeof(buff[idx]));
  #else
!       ret = inet_ntop(AF_INET, &addr->v4, buff[idx], sizeof(buff[idx]));
  #endif
      }
***************
*** 634,640 ****
      {
        /* IPv6 */
!       ret = inet_ntop(AF_INET6, &addr->v6, buff[index], sizeof(buff[index]));
      }
!   index = (index + 1) & 3;
  
    return ret;
--- 634,640 ----
      {
        /* IPv6 */
!       ret = inet_ntop(AF_INET6, &addr->v6, buff[idx], sizeof(buff[idx]));
      }
!   idx = (idx + 1) & 3;
  
    return ret;

Index: hna_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/hna_set.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** hna_set.c	25 Apr 2007 22:08:08 -0000	1.19
--- hna_set.c	2 Aug 2007 22:07:19 -0000	1.20
***************
*** 56,60 ****
  {
  
!   int index;
  
    if(olsr_cnf->ip_version == AF_INET)
--- 56,60 ----
  {
  
!   int idx;
  
    if(olsr_cnf->ip_version == AF_INET)
***************
*** 72,79 ****
    olsr_register_scheduler_event(&olsr_time_out_hna_set, NULL, 1, 0, NULL);
  
!   for(index=0;index<HASHSIZE;index++)
      {
!       hna_set[index].next = &hna_set[index];
!       hna_set[index].prev = &hna_set[index];
      }
  
--- 72,79 ----
    olsr_register_scheduler_event(&olsr_time_out_hna_set, NULL, 1, 0, NULL);
  
!   for(idx=0;idx<HASHSIZE;idx++)
      {
!       hna_set[idx].next = &hna_set[idx];
!       hna_set[idx].prev = &hna_set[idx];
      }
  
***************
*** 268,278 ****
  olsr_time_out_hna_set(void *foo __attribute__((unused)))
  {
!   int index;
  
!   for(index=0;index<HASHSIZE;index++)
      {
!       struct hna_entry *tmp_hna = hna_set[index].next;
        /* Check all entrys */
!       while(tmp_hna != &hna_set[index])
  	{
  	  /* Check all networks */
--- 268,278 ----
  olsr_time_out_hna_set(void *foo __attribute__((unused)))
  {
!   int idx;
  
!   for(idx=0;idx<HASHSIZE;idx++)
      {
!       struct hna_entry *tmp_hna = hna_set[idx].next;
        /* Check all entrys */
!       while(tmp_hna != &hna_set[idx])
  	{
  	  /* Check all networks */
***************
*** 322,326 ****
  olsr_print_hna_set(void)
  {
!   int index;
  
    OLSR_PRINTF(1, "\n--- %02d:%02d:%02d.%02d ------------------------------------------------- HNA SET\n\n",
--- 322,326 ----
  olsr_print_hna_set(void)
  {
!   int idx;
  
    OLSR_PRINTF(1, "\n--- %02d:%02d:%02d.%02d ------------------------------------------------- HNA SET\n\n",
***************
*** 335,343 ****
      OLSR_PRINTF(1, "IP net/prefixlen               GW IP\n");
  
!   for(index=0;index<HASHSIZE;index++)
      {
!       struct hna_entry *tmp_hna = hna_set[index].next;
        /* Check all entrys */
!       while(tmp_hna != &hna_set[index])
  	{
  	  /* Check all networks */
--- 335,343 ----
      OLSR_PRINTF(1, "IP net/prefixlen               GW IP\n");
  
!   for(idx=0;idx<HASHSIZE;idx++)
      {
!       struct hna_entry *tmp_hna = hna_set[idx].next;
        /* Check all entrys */
!       while(tmp_hna != &hna_set[idx])
  	{
  	  /* Check all networks */

Index: process_routes.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/process_routes.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** process_routes.c	13 May 2007 22:23:55 -0000	1.33
--- process_routes.c	2 Aug 2007 22:07:19 -0000	1.34
***************
*** 214,225 ****
  olsr_init_old_table(void)
  {
!   int index;
  
!   for(index=0;index<HASHSIZE;index++)
      {
!       old_routes[index].next = &old_routes[index];
!       old_routes[index].prev = &old_routes[index];
!       old_hna[index].next = &old_hna[index];
!       old_hna[index].prev = &old_hna[index];
      }
  
--- 214,225 ----
  olsr_init_old_table(void)
  {
!   int idx;
  
!   for(idx=0;idx<HASHSIZE;idx++)
      {
!       old_routes[idx].next = &old_routes[idx];
!       old_routes[idx].prev = &old_routes[idx];
!       old_hna[idx].next = &old_hna[idx];
!       old_hna[idx].prev = &old_hna[idx];
      }
  
***************
*** 278,287 ****
    struct destination_n *kernel_route_list = NULL;
    struct rt_entry      *destination;
!   olsr_u8_t            index;
    
!   for(index=0;index<HASHSIZE;index++)
      {
!       for(destination = from_table[index].next;
! 	  destination != &from_table[index];
  	  destination = destination->next)
  	{
--- 278,287 ----
    struct destination_n *kernel_route_list = NULL;
    struct rt_entry      *destination;
!   int                   idx;
    
!   for(idx=0;idx<HASHSIZE;idx++)
      {
!       for(destination = from_table[idx].next;
! 	  destination != &from_table[idx];
  	  destination = destination->next)
  	{
***************
*** 400,423 ****
  olsr_move_route_table(struct rt_entry *original, struct rt_entry *new)
  {
!   olsr_16_t index;
  
!   for(index=0;index<HASHSIZE;index++)
      {
!       if(original[index].next == &original[index])
  	{
! 	  new[index].next = &new[index];
! 	  new[index].prev = &new[index];
  	}
        else
  	{
  	  /* Copy to old */
! 	  new[index].next = original[index].next;
! 	  new[index].next->prev = &new[index];
! 	  new[index].prev = original[index].prev;
! 	  new[index].prev->next = &new[index];
  
  	  /* Clear original */
! 	  original[index].next = &original[index];
! 	  original[index].prev = &original[index];
  	}
      }
--- 400,423 ----
  olsr_move_route_table(struct rt_entry *original, struct rt_entry *new)
  {
!   int idx;
  
!   for(idx=0;idx<HASHSIZE;idx++)
      {
!       if(original[idx].next == &original[idx])
  	{
! 	  new[idx].next = &new[idx];
! 	  new[idx].prev = &new[idx];
  	}
        else
  	{
  	  /* Copy to old */
! 	  new[idx].next = original[idx].next;
! 	  new[idx].next->prev = &new[idx];
! 	  new[idx].prev = original[idx].prev;
! 	  new[idx].prev->next = &new[idx];
  
  	  /* Clear original */
! 	  original[idx].next = &original[idx];
! 	  original[idx].prev = &original[idx];
  	}
      }

Index: two_hop_neighbor_table.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/two_hop_neighbor_table.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** two_hop_neighbor_table.c	25 Apr 2007 22:08:17 -0000	1.18
--- two_hop_neighbor_table.c	2 Aug 2007 22:07:19 -0000	1.19
***************
*** 57,66 ****
  olsr_init_two_hop_table(void)
  {
!   int index;
  
!   for(index=0;index<HASHSIZE;index++)
      {
!       two_hop_neighbortable[index].next = &two_hop_neighbortable[index];
!       two_hop_neighbortable[index].prev = &two_hop_neighbortable[index];
      }
    return 1;
--- 57,66 ----
  olsr_init_two_hop_table(void)
  {
!   int idx;
  
!   for(idx=0;idx<HASHSIZE;idx++)
      {
!       two_hop_neighbortable[idx].next = &two_hop_neighbortable[idx];
!       two_hop_neighbortable[idx].prev = &two_hop_neighbortable[idx];
      }
    return 1;

Index: link_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/link_set.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** link_set.c	25 Apr 2007 22:08:09 -0000	1.68
--- link_set.c	2 Aug 2007 22:07:19 -0000	1.69
***************
*** 199,210 ****
      {
        struct mid_address   *aliases;
!       struct link_entry  *link;
  
        //printf("\tChecking %s->", olsr_ip_to_string(&ifs->ip_addr));
        //printf("%s : ", olsr_ip_to_string(main_addr)); 
!       if((link = lookup_link_entry(main_addr, NULL, ifs)) != NULL)
  	{
  	  //printf("%d\n", lookup_link_status(link));
! 	  if(lookup_link_status(link) == SYM_LINK)
  	    return SYM_LINK;
  	}
--- 199,210 ----
      {
        struct mid_address   *aliases;
!       struct link_entry  *lnk = lookup_link_entry(main_addr, NULL, ifs);
  
        //printf("\tChecking %s->", olsr_ip_to_string(&ifs->ip_addr));
        //printf("%s : ", olsr_ip_to_string(main_addr)); 
!       if(lnk != NULL)
  	{
  	  //printf("%d\n", lookup_link_status(link));
! 	  if(lookup_link_status(lnk) == SYM_LINK)
  	    return SYM_LINK;
  	}
***************
*** 216,224 ****
  	  //printf("\tChecking %s->", olsr_ip_to_string(&ifs->ip_addr));
  	  //printf("%s : ", olsr_ip_to_string(&aliases->address)); 
!             if((link = lookup_link_entry(&aliases->alias, NULL, ifs)) != NULL)
  	    {
  	      //printf("%d\n", lookup_link_status(link));
  
! 	      if(lookup_link_status(link) == SYM_LINK)
  		return SYM_LINK;
  	    }
--- 216,225 ----
  	  //printf("\tChecking %s->", olsr_ip_to_string(&ifs->ip_addr));
  	  //printf("%s : ", olsr_ip_to_string(&aliases->address)); 
!             lnk = lookup_link_entry(&aliases->alias, NULL, ifs);
!             if(lnk != NULL)
  	    {
  	      //printf("%d\n", lookup_link_status(link));
  
! 	      if(lookup_link_status(lnk) == SYM_LINK)
  		return SYM_LINK;
  	    }
***************
*** 979,983 ****
  {
    unsigned char mask = 1 << (entry->loss_index & 7);
!   int index = entry->loss_index >> 3;
    double rel_lq, saved_lq;
  
--- 980,984 ----
  {
    unsigned char mask = 1 << (entry->loss_index & 7);
!   const int idx = entry->loss_index >> 3;
    double rel_lq, saved_lq;
  
***************
*** 986,995 ****
        // packet not lost
  
!       if ((entry->loss_bitmap[index] & mask) != 0)
          {
            // but the packet that we replace was lost
            // => decrement packet loss
  
!           entry->loss_bitmap[index] &= ~mask;
            entry->lost_packets--;
          }
--- 987,996 ----
        // packet not lost
  
!       if ((entry->loss_bitmap[idx] & mask) != 0)
          {
            // but the packet that we replace was lost
            // => decrement packet loss
  
!           entry->loss_bitmap[idx] &= ~mask;
            entry->lost_packets--;
          }
***************
*** 1000,1009 ****
        // packet lost
  
!       if ((entry->loss_bitmap[index] & mask) == 0)
          {
            // but the packet that we replace was not lost
            // => increment packet loss
  
!           entry->loss_bitmap[index] |= mask;
            entry->lost_packets++;
          }
--- 1001,1010 ----
        // packet lost
  
!       if ((entry->loss_bitmap[idx] & mask) == 0)
          {
            // but the packet that we replace was not lost
            // => increment packet loss
  
!           entry->loss_bitmap[idx] |= mask;
            entry->lost_packets++;
          }

Index: lq_mpr.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/lq_mpr.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** lq_mpr.c	10 Feb 2007 19:27:32 -0000	1.12
--- lq_mpr.c	2 Aug 2007 22:07:19 -0000	1.13
***************
*** 55,59 ****
    double best, best_1hop;
    olsr_bool mpr_changes = OLSR_FALSE;
-   struct link_entry *link;
  
    for(i = 0; i < HASHSIZE; i++)
--- 55,58 ----
***************
*** 109,118 ****
                // determine the link quality of the direct link
  
!               link = get_best_link_to_neighbor(&neigh->neighbor_main_addr);
  
! 	      if(!link)
  		continue;
  
!               best_1hop = link->loss_link_quality * link->neigh_link_quality;
  
                // see wether we find a better route via an MPR
--- 108,117 ----
                // determine the link quality of the direct link
  
!               struct link_entry *lnk = get_best_link_to_neighbor(&neigh->neighbor_main_addr);
  
! 	      if (!lnk)
  		continue;
  
!               best_1hop = lnk->loss_link_quality * lnk->neigh_link_quality;
  
                // see wether we find a better route via an MPR





More information about the Olsr-cvs mailing list