Diff for /embedaddon/quagga/ospf6d/ospf6_route.c between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2012/02/21 17:26:12 version 1.1.1.2, 2016/11/02 10:09:11
Line 304  ospf6_route_lookup_bestmatch (struct prefix *prefix, Line 304  ospf6_route_lookup_bestmatch (struct prefix *prefix,
   return route;    return route;
 }  }
   
#ifndef NDEBUG#ifdef DEBUG
 static void  static void
 route_table_assert (struct ospf6_route_table *table)  route_table_assert (struct ospf6_route_table *table)
 {  {
Line 350  route_table_assert (struct ospf6_route_table *table) Line 350  route_table_assert (struct ospf6_route_table *table)
 #define ospf6_route_table_assert(t) (route_table_assert (t))  #define ospf6_route_table_assert(t) (route_table_assert (t))
 #else  #else
 #define ospf6_route_table_assert(t) ((void) 0)  #define ospf6_route_table_assert(t) ((void) 0)
#endif /*NDEBUG*/#endif /*DEBUG*/
   
 struct ospf6_route *  struct ospf6_route *
 ospf6_route_add (struct ospf6_route *route,  ospf6_route_add (struct ospf6_route *route,
Line 374  ospf6_route_add (struct ospf6_route *route, Line 374  ospf6_route_add (struct ospf6_route *route,
   
   if (IS_OSPF6_DEBUG_ROUTE (MEMORY))    if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
     zlog_debug ("%s %p: route add %p: %s", ospf6_route_table_name (table),      zlog_debug ("%s %p: route add %p: %s", ospf6_route_table_name (table),
                table, route, buf);                (void *)table, (void *)route, buf);
   else if (IS_OSPF6_DEBUG_ROUTE (TABLE))    else if (IS_OSPF6_DEBUG_ROUTE (TABLE))
     zlog_debug ("%s: route add: %s", ospf6_route_table_name (table), buf);      zlog_debug ("%s: route add: %s", ospf6_route_table_name (table), buf);
   
Line 408  ospf6_route_add (struct ospf6_route *route, Line 408  ospf6_route_add (struct ospf6_route *route,
         {          {
           if (IS_OSPF6_DEBUG_ROUTE (MEMORY))            if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
             zlog_debug ("%s %p: route add %p: needless update of %p",              zlog_debug ("%s %p: route add %p: needless update of %p",
                        ospf6_route_table_name (table), table, route, old);                        ospf6_route_table_name (table),
                         (void *)table, (void *)route, (void *)old);
           else if (IS_OSPF6_DEBUG_ROUTE (TABLE))            else if (IS_OSPF6_DEBUG_ROUTE (TABLE))
             zlog_debug ("%s: route add: needless update",              zlog_debug ("%s: route add: needless update",
                         ospf6_route_table_name (table));                          ospf6_route_table_name (table));
Line 422  ospf6_route_add (struct ospf6_route *route, Line 423  ospf6_route_add (struct ospf6_route *route,
   
       if (IS_OSPF6_DEBUG_ROUTE (MEMORY))        if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
         zlog_debug ("%s %p: route add %p: update of %p",          zlog_debug ("%s %p: route add %p: update of %p",
                    ospf6_route_table_name (table), table, route, old);                    ospf6_route_table_name (table),
                     (void *)table, (void *)route, (void *)old);
       else if (IS_OSPF6_DEBUG_ROUTE (TABLE))        else if (IS_OSPF6_DEBUG_ROUTE (TABLE))
         zlog_debug ("%s: route add: update",          zlog_debug ("%s: route add: update",
                     ospf6_route_table_name (table));                      ospf6_route_table_name (table));
Line 463  ospf6_route_add (struct ospf6_route *route, Line 465  ospf6_route_add (struct ospf6_route *route,
     {      {
       if (IS_OSPF6_DEBUG_ROUTE (MEMORY))        if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
         zlog_debug ("%s %p: route add %p: another path: prev %p, next %p",          zlog_debug ("%s %p: route add %p: another path: prev %p, next %p",
                   ospf6_route_table_name (table), table, route, prev, next);                    ospf6_route_table_name (table),
                     (void *)table, (void *)route, (void *)prev, (void *)next);
       else if (IS_OSPF6_DEBUG_ROUTE (TABLE))        else if (IS_OSPF6_DEBUG_ROUTE (TABLE))
         zlog_debug ("%s: route add: another path found",          zlog_debug ("%s: route add: another path found",
                     ospf6_route_table_name (table));                      ospf6_route_table_name (table));
Line 488  ospf6_route_add (struct ospf6_route *route, Line 491  ospf6_route_add (struct ospf6_route *route,
           SET_FLAG (route->flag, OSPF6_ROUTE_BEST);            SET_FLAG (route->flag, OSPF6_ROUTE_BEST);
           if (IS_OSPF6_DEBUG_ROUTE (MEMORY))            if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
             zlog_info ("%s %p: route add %p: replacing previous best: %p",              zlog_info ("%s %p: route add %p: replacing previous best: %p",
                       ospf6_route_table_name (table), table, route, next);                       ospf6_route_table_name (table),
                        (void *)table, (void *)route, (void *)next);
         }          }
   
       route->installed = now;        route->installed = now;
Line 510  ospf6_route_add (struct ospf6_route *route, Line 514  ospf6_route_add (struct ospf6_route *route,
   /* Else, this is the brand new route regarding to the prefix */    /* Else, this is the brand new route regarding to the prefix */
   if (IS_OSPF6_DEBUG_ROUTE (MEMORY))    if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
     zlog_debug ("%s %p: route add %p: brand new route",      zlog_debug ("%s %p: route add %p: brand new route",
                ospf6_route_table_name (table), table, route);                ospf6_route_table_name (table), (void *)table, (void *)route);
   else if (IS_OSPF6_DEBUG_ROUTE (TABLE))    else if (IS_OSPF6_DEBUG_ROUTE (TABLE))
     zlog_debug ("%s: route add: brand new route",      zlog_debug ("%s: route add: brand new route",
                 ospf6_route_table_name (table));                  ospf6_route_table_name (table));
Line 589  ospf6_route_remove (struct ospf6_route *route, Line 593  ospf6_route_remove (struct ospf6_route *route,
   
   if (IS_OSPF6_DEBUG_ROUTE (MEMORY))    if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
     zlog_debug ("%s %p: route remove %p: %s",      zlog_debug ("%s %p: route remove %p: %s",
                ospf6_route_table_name (table), table, route, buf);                ospf6_route_table_name (table),
                 (void *)table, (void *)route, buf);
   else if (IS_OSPF6_DEBUG_ROUTE (TABLE))    else if (IS_OSPF6_DEBUG_ROUTE (TABLE))
     zlog_debug ("%s: route remove: %s", ospf6_route_table_name (table), buf);      zlog_debug ("%s: route remove: %s", ospf6_route_table_name (table), buf);
   
Line 661  ospf6_route_head (struct ospf6_route_table *table) Line 666  ospf6_route_head (struct ospf6_route_table *table)
   
   if (IS_OSPF6_DEBUG_ROUTE (MEMORY))    if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
     zlog_info ("%s %p: route head: %p<-[%p]->%p",      zlog_info ("%s %p: route head: %p<-[%p]->%p",
               ospf6_route_table_name (table), table,               ospf6_route_table_name (table), (void *)table,
               route->prev, route, route->next);               (void *)route->prev, (void *)route, (void *)route->next);
   
   return route;    return route;
 }  }
Line 674  ospf6_route_next (struct ospf6_route *route) Line 679  ospf6_route_next (struct ospf6_route *route)
   
   if (IS_OSPF6_DEBUG_ROUTE (MEMORY))    if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
     zlog_info ("%s %p: route next: %p<-[%p]->%p",      zlog_info ("%s %p: route next: %p<-[%p]->%p",
               ospf6_route_table_name (route->table), route->table,               ospf6_route_table_name (route->table), (void *)route->table,
               route->prev, route, route->next);               (void *)route->prev, (void *)route, (void *)route->next);
   
   ospf6_route_unlock (route);    ospf6_route_unlock (route);
   if (next)    if (next)
Line 780  ospf6_route_table_delete (struct ospf6_route_table *ta Line 785  ospf6_route_table_delete (struct ospf6_route_table *ta
   XFREE (MTYPE_OSPF6_ROUTE, table);    XFREE (MTYPE_OSPF6_ROUTE, table);
 }  }
   
 /* VTY commands */  /* VTY commands */
 void  void
 ospf6_route_show (struct vty *vty, struct ospf6_route *route)  ospf6_route_show (struct vty *vty, struct ospf6_route *route)
 {  {
   int i;    int i;
   char destination[64], nexthop[64];    char destination[64], nexthop[64];
  char duration[16], ifname[IFNAMSIZ];  char duration[16];
   const char *ifname;
   struct timeval now, res;    struct timeval now, res;
   
   quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);    quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
Line 807  ospf6_route_show (struct vty *vty, struct ospf6_route  Line 813  ospf6_route_show (struct vty *vty, struct ospf6_route 
   /* nexthop */    /* nexthop */
   inet_ntop (AF_INET6, &route->nexthop[0].address, nexthop,    inet_ntop (AF_INET6, &route->nexthop[0].address, nexthop,
              sizeof (nexthop));               sizeof (nexthop));
  if (! if_indextoname (route->nexthop[0].ifindex, ifname))  ifname = ifindex2ifname (route->nexthop[0].ifindex);
    snprintf (ifname, sizeof (ifname), "%d", route->nexthop[0].ifindex); 
   
   vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s%s",    vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s%s",
            (ospf6_route_is_best (route) ? '*' : ' '),             (ospf6_route_is_best (route) ? '*' : ' '),
Line 822  ospf6_route_show (struct vty *vty, struct ospf6_route  Line 827  ospf6_route_show (struct vty *vty, struct ospf6_route 
       /* nexthop */        /* nexthop */
       inet_ntop (AF_INET6, &route->nexthop[i].address, nexthop,        inet_ntop (AF_INET6, &route->nexthop[i].address, nexthop,
                  sizeof (nexthop));                   sizeof (nexthop));
      if (! if_indextoname (route->nexthop[i].ifindex, ifname))      ifname = ifindex2ifname (route->nexthop[i].ifindex);
        snprintf (ifname, sizeof (ifname), "%d", route->nexthop[i].ifindex); 
   
       vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s%s",        vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s%s",
                ' ', "", "", "", nexthop, IFNAMSIZ, ifname, "", VNL);                 ' ', "", "", "", nexthop, IFNAMSIZ, ifname, "", VNL);
Line 833  ospf6_route_show (struct vty *vty, struct ospf6_route  Line 837  ospf6_route_show (struct vty *vty, struct ospf6_route 
 void  void
 ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route)  ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route)
 {  {
  char destination[64], nexthop[64], ifname[IFNAMSIZ];  const char *ifname;
   char destination[64], nexthop[64];
   char area_id[16], id[16], adv_router[16], capa[16], options[16];    char area_id[16], id[16], adv_router[16], capa[16], options[16];
   struct timeval now, res;    struct timeval now, res;
   char duration[16];    char duration[16];
Line 874  ospf6_route_show_detail (struct vty *vty, struct ospf6 Line 879  ospf6_route_show_detail (struct vty *vty, struct ospf6
            (CHECK_FLAG (route->flag, OSPF6_ROUTE_CHANGE) ? "C" : "-"),             (CHECK_FLAG (route->flag, OSPF6_ROUTE_CHANGE) ? "C" : "-"),
            VNL);             VNL);
   vty_out (vty, "Memory: prev: %p this: %p next: %p%s",    vty_out (vty, "Memory: prev: %p this: %p next: %p%s",
           route->prev, route, route->next, VNL);           (void *)route->prev, (void *)route, (void *)route->next, VNL);
   
   /* Path section */    /* Path section */
   
Line 919  ospf6_route_show_detail (struct vty *vty, struct ospf6 Line 924  ospf6_route_show_detail (struct vty *vty, struct ospf6
       /* nexthop */        /* nexthop */
       inet_ntop (AF_INET6, &route->nexthop[i].address, nexthop,        inet_ntop (AF_INET6, &route->nexthop[i].address, nexthop,
                  sizeof (nexthop));                   sizeof (nexthop));
      if (! if_indextoname (route->nexthop[i].ifindex, ifname))      ifname = ifindex2ifname (route->nexthop[i].ifindex);
        snprintf (ifname, sizeof (ifname), "%d", route->nexthop[i].ifindex); 
       vty_out (vty, "  %s %.*s%s", nexthop, IFNAMSIZ, ifname, VNL);        vty_out (vty, "  %s %.*s%s", nexthop, IFNAMSIZ, ifname, VNL);
     }      }
   vty_out (vty, "%s", VNL);    vty_out (vty, "%s", VNL);

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>