[Olsr-cvs] olsrd-current/lib/quagga/src quagga.c,1.5,1.6

Bernd Petrovitsch (spam-protected)
Wed Sep 5 18:11:12 CEST 2007


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

Modified Files:
	quagga.c 
Log Message:
* applied rt-refactoring-6.diff from Hannes Gredler <(spam-protected)>

Index: quagga.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/quagga/src/quagga.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** quagga.c	25 Aug 2007 19:48:42 -0000	1.5
--- quagga.c	5 Sep 2007 16:11:10 -0000	1.6
***************
*** 164,174 ****
  void zebra_cleanup (void) {
    int i;
-   struct rt_entry *tmp;
    if (zebra.options & OPTION_EXPORT) {
!     for (i = 0; i < HASHSIZE; i++) {
!       for (tmp = routingtable[i].next; tmp != &routingtable[i]; tmp = tmp->next)
! 	zebra_del_olsr_v4_route (tmp);     
!       for (tmp = hna_routes[i].next; tmp != &hna_routes[i]; tmp = tmp->next)
! 	zebra_del_olsr_v4_route (tmp) ;   }
    }  
  
--- 164,172 ----
  void zebra_cleanup (void) {
    int i;
    if (zebra.options & OPTION_EXPORT) {
!     struct rt_entry *rt;
!     OLSR_FOR_ALL_RT_ENTRIES(rt) {
!         zebra_del_olsr_v4_route (rt);
!     } OLSR_FOR_ALL_RT_ENTRIES_END(rt);
    }  
  
***************
*** 179,183 ****
  
  static void zebra_reconnect (void) {
-   struct rt_entry *tmp;
    int i;
  
--- 177,180 ----
***************
*** 186,195 ****
  
    if (zebra.options & OPTION_EXPORT) {
!     for (i = 0; i < HASHSIZE; i++) {
!       for (tmp = routingtable[i].next; tmp != &routingtable[i]; tmp = tmp->next)
! 	zebra_add_olsr_v4_route (tmp);     
!       for (tmp = hna_routes[i].next; tmp != &hna_routes[i]; tmp = tmp->next)
! 	zebra_add_olsr_v4_route (tmp);
!     }
    }  
  
--- 183,190 ----
  
    if (zebra.options & OPTION_EXPORT) {
!     struct rt_entry *rt;
!     OLSR_FOR_ALL_RT_ENTRIES(rt) {
!         zebra_add_olsr_v4_route (rt);
!     } OLSR_FOR_ALL_RT_ENTRIES_END(rt);
    }  
  
***************
*** 741,752 ****
    route.message = ZAPI_MESSAGE_METRIC;
    route.flags = zebra.flags;
!   route.prefixlen = masktoprefixlen (r->rt_mask.v4);
!   route.prefix = r->rt_dst.v4;
!   if ((r->rt_router.v4 == r->rt_dst.v4 && route.prefixlen == 32)){
      route.message |= ZAPI_MESSAGE_IFINDEX | ZAPI_MESSAGE_NEXTHOP;
      route.ind_num = 1;
      route.index = olsr_malloc (sizeof *route.index, 
  			       "zebra_add_olsr_v4_route");
!     *route.index = htonl(r->rt_if->if_index);
      route.nexthops = olsr_malloc (sizeof route.nexthops->type +
  				  sizeof route.nexthops->payload,
--- 736,748 ----
    route.message = ZAPI_MESSAGE_METRIC;
    route.flags = zebra.flags;
!   route.prefixlen = r->rt_dst.prefix_len;
!   route.prefix = r->rt_dst.prefix.v4;
!   if ((r->rt_best->rtp_nexthop.gateway.v4 == r->rt_dst.prefix.v4 &&
!        route.prefixlen == 32)) {
      route.message |= ZAPI_MESSAGE_IFINDEX | ZAPI_MESSAGE_NEXTHOP;
      route.ind_num = 1;
      route.index = olsr_malloc (sizeof *route.index, 
  			       "zebra_add_olsr_v4_route");
!     *route.index = htonl(r->rt_best->rtp_nexthop.iface->if_index);
      route.nexthops = olsr_malloc (sizeof route.nexthops->type +
  				  sizeof route.nexthops->payload,
***************
*** 763,770 ****
  				   "zebra_add_olsr_v4_route");
      route.nexthops->type = ZEBRA_NEXTHOP_IPV4;
!     route.nexthops->payload.v4 = r->rt_router.v4;
    }
  
!   route.metric = r->rt_metric;
    route.metric = htonl(route.metric);
  
--- 759,766 ----
  				   "zebra_add_olsr_v4_route");
      route.nexthops->type = ZEBRA_NEXTHOP_IPV4;
!     route.nexthops->payload.v4 = r->rt_best->rtp_nexthop.gateway.v4;
    }
  
!   route.metric = r->rt_best->rtp_metric.hops;
    route.metric = htonl(route.metric);
  
***************
*** 786,797 ****
    route.message = ZAPI_MESSAGE_METRIC;
    route.flags = zebra.flags;
!   route.prefixlen = masktoprefixlen (r->rt_mask.v4);
!   route.prefix = r->rt_dst.v4;
!   if ((r->rt_router.v4 == r->rt_dst.v4 && route.prefixlen == 32)){
      route.message |= ZAPI_MESSAGE_IFINDEX;
      route.ind_num = 1;
      route.index = olsr_malloc (sizeof *route.index, 
  			       "zebra_add_olsr_v4_route");
!     *route.index = htonl (r->rt_if->if_index);
      route.nexthops = olsr_malloc (sizeof route.nexthops->type +
  				  sizeof route.nexthops->payload,
--- 782,793 ----
    route.message = ZAPI_MESSAGE_METRIC;
    route.flags = zebra.flags;
!   route.prefixlen = r->rt_dst.prefix_len;
!   route.prefix = r->rt_dst.prefix.v4;
!   if ((r->rt_best->rtp_nexthop.gateway.v4 == r->rt_dst.prefix.v4 && route.prefixlen == 32)){
      route.message |= ZAPI_MESSAGE_IFINDEX;
      route.ind_num = 1;
      route.index = olsr_malloc (sizeof *route.index, 
  			       "zebra_add_olsr_v4_route");
!     *route.index = htonl (r->rt_best->rtp_nexthop.iface->if_index);
      route.nexthops = olsr_malloc (sizeof route.nexthops->type +
  				  sizeof route.nexthops->payload,
***************
*** 808,814 ****
  				  "zebra_add_olsr_v4_route");
      route.nexthops->type = ZEBRA_NEXTHOP_IPV4;
!     route.nexthops->payload.v4 = r->rt_router.v4;
    }
!   route.metric = r->rt_metric;
    route.metric = htonl (route.metric);
    
--- 804,810 ----
  				  "zebra_add_olsr_v4_route");
      route.nexthops->type = ZEBRA_NEXTHOP_IPV4;
!     route.nexthops->payload.v4 = r->rt_best->rtp_nexthop.gateway.v4;
    }
!   route.metric = r->rt_best->rtp_metric.hops;
    route.metric = htonl (route.metric);
    





More information about the Olsr-cvs mailing list