Diff for /embedaddon/quagga/zebra/zebra_vty.c between versions 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2012/10/09 09:22:29 version 1.1.1.3, 2013/07/21 23:54:41
Line 535  vty_show_ip_route_detail (struct vty *vty, struct rout Line 535  vty_show_ip_route_detail (struct vty *vty, struct rout
   struct rib *rib;    struct rib *rib;
   struct nexthop *nexthop;    struct nexthop *nexthop;
   
  for (rib = rn->info; rib; rib = rib->next)  RNODE_FOREACH_RIB (rn, rib)
     {      {
       vty_out (vty, "Routing entry for %s/%d%s",         vty_out (vty, "Routing entry for %s/%d%s", 
                inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen,                 inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen,
                VTY_NEWLINE);                 VTY_NEWLINE);
       vty_out (vty, "  Known via \"%s\"", zebra_route_string (rib->type));        vty_out (vty, "  Known via \"%s\"", zebra_route_string (rib->type));
      vty_out (vty, ", distance %d, metric %d", rib->distance, rib->metric);      vty_out (vty, ", distance %u, metric %u", rib->distance, rib->metric);
       if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))        if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
         vty_out (vty, ", best");          vty_out (vty, ", best");
       if (rib->refcnt)        if (rib->refcnt)
Line 822  DEFUN (show_ip_route, Line 822  DEFUN (show_ip_route,
   
   /* Show all IPv4 routes. */    /* Show all IPv4 routes. */
   for (rn = route_top (table); rn; rn = route_next (rn))    for (rn = route_top (table); rn; rn = route_next (rn))
    for (rib = rn->info; rib; rib = rib->next)    RNODE_FOREACH_RIB (rn, rib)
       {        {
         if (first)          if (first)
           {            {
Line 863  DEFUN (show_ip_route_prefix_longer, Line 863  DEFUN (show_ip_route_prefix_longer,
   
   /* Show matched type IPv4 routes. */    /* Show matched type IPv4 routes. */
   for (rn = route_top (table); rn; rn = route_next (rn))    for (rn = route_top (table); rn; rn = route_next (rn))
    for (rib = rn->info; rib; rib = rib->next)    RNODE_FOREACH_RIB (rn, rib)
       if (prefix_match (&p, &rn->p))        if (prefix_match (&p, &rn->p))
         {          {
           if (first)            if (first)
Line 896  DEFUN (show_ip_route_supernets, Line 896  DEFUN (show_ip_route_supernets,
   
   /* Show matched type IPv4 routes. */    /* Show matched type IPv4 routes. */
   for (rn = route_top (table); rn; rn = route_next (rn))    for (rn = route_top (table); rn; rn = route_next (rn))
    for (rib = rn->info; rib; rib = rib->next)    RNODE_FOREACH_RIB (rn, rib)
       {        {
         addr = ntohl (rn->p.u.prefix4.s_addr);          addr = ntohl (rn->p.u.prefix4.s_addr);
   
Line 942  DEFUN (show_ip_route_protocol, Line 942  DEFUN (show_ip_route_protocol,
   
   /* Show matched type IPv4 routes. */    /* Show matched type IPv4 routes. */
   for (rn = route_top (table); rn; rn = route_next (rn))    for (rn = route_top (table); rn; rn = route_next (rn))
    for (rib = rn->info; rib; rib = rib->next)    RNODE_FOREACH_RIB (rn, rib)
       if (rib->type == type)        if (rib->type == type)
         {          {
           if (first)            if (first)
Line 1046  vty_show_ip_route_summary (struct vty *vty, struct rou Line 1046  vty_show_ip_route_summary (struct vty *vty, struct rou
   memset (&rib_cnt, 0, sizeof(rib_cnt));    memset (&rib_cnt, 0, sizeof(rib_cnt));
   memset (&fib_cnt, 0, sizeof(fib_cnt));    memset (&fib_cnt, 0, sizeof(fib_cnt));
   for (rn = route_top (table); rn; rn = route_next (rn))    for (rn = route_top (table); rn; rn = route_next (rn))
    for (rib = rn->info; rib; rib = rib->next)    RNODE_FOREACH_RIB (rn, rib)
       for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)        for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)
         {          {
           rib_cnt[ZEBRA_ROUTE_TOTAL]++;            rib_cnt[ZEBRA_ROUTE_TOTAL]++;
Line 1197  DEFUN (show_ip_protocol, Line 1197  DEFUN (show_ip_protocol,
     return CMD_SUCCESS;      return CMD_SUCCESS;
 }  }
   
   /*
    * Show IP mroute command to dump the BGP Multicast
    * routing table
    */
   DEFUN (show_ip_mroute,
          show_ip_mroute_cmd,
          "show ip mroute",
          SHOW_STR
          IP_STR
          "IP Multicast routing table\n")
   {
     struct route_table *table;
     struct route_node *rn;
     struct rib *rib;
     int first = 1;
   
     table = vrf_table (AFI_IP, SAFI_MULTICAST, 0);
     if (! table)
       return CMD_SUCCESS;
   
     /* Show all IPv4 routes. */
     for (rn = route_top (table); rn; rn = route_next (rn))
       RNODE_FOREACH_RIB (rn, rib)
         {
          if (first)
            {
              vty_out (vty, SHOW_ROUTE_V4_HEADER);
              first = 0;
            }
          vty_show_ip_route (vty, rn, rib);
         }
     return CMD_SUCCESS;
   }
   
   
 #ifdef HAVE_IPV6  #ifdef HAVE_IPV6
 /* General fucntion for IPv6 static route. */  /* General fucntion for IPv6 static route. */
Line 1512  vty_show_ipv6_route_detail (struct vty *vty, struct ro Line 1546  vty_show_ipv6_route_detail (struct vty *vty, struct ro
   struct nexthop *nexthop;    struct nexthop *nexthop;
   char buf[BUFSIZ];    char buf[BUFSIZ];
   
  for (rib = rn->info; rib; rib = rib->next)  RNODE_FOREACH_RIB (rn, rib)
     {      {
       vty_out (vty, "Routing entry for %s/%d%s",         vty_out (vty, "Routing entry for %s/%d%s", 
                inet_ntop (AF_INET6, &rn->p.u.prefix6, buf, BUFSIZ),                 inet_ntop (AF_INET6, &rn->p.u.prefix6, buf, BUFSIZ),
                rn->p.prefixlen,                 rn->p.prefixlen,
                VTY_NEWLINE);                 VTY_NEWLINE);
       vty_out (vty, "  Known via \"%s\"", zebra_route_string (rib->type));        vty_out (vty, "  Known via \"%s\"", zebra_route_string (rib->type));
      vty_out (vty, ", distance %d, metric %d", rib->distance, rib->metric);      vty_out (vty, ", distance %u, metric %u", rib->distance, rib->metric);
       if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))        if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
         vty_out (vty, ", best");          vty_out (vty, ", best");
       if (rib->refcnt)        if (rib->refcnt)
Line 1761  DEFUN (show_ipv6_route, Line 1795  DEFUN (show_ipv6_route,
   
   /* Show all IPv6 route. */    /* Show all IPv6 route. */
   for (rn = route_top (table); rn; rn = route_next (rn))    for (rn = route_top (table); rn; rn = route_next (rn))
    for (rib = rn->info; rib; rib = rib->next)    RNODE_FOREACH_RIB (rn, rib)
       {        {
         if (first)          if (first)
           {            {
Line 1802  DEFUN (show_ipv6_route_prefix_longer, Line 1836  DEFUN (show_ipv6_route_prefix_longer,
   
   /* Show matched type IPv6 routes. */    /* Show matched type IPv6 routes. */
   for (rn = route_top (table); rn; rn = route_next (rn))    for (rn = route_top (table); rn; rn = route_next (rn))
    for (rib = rn->info; rib; rib = rib->next)    RNODE_FOREACH_RIB (rn, rib)
       if (prefix_match (&p, &rn->p))        if (prefix_match (&p, &rn->p))
         {          {
           if (first)            if (first)
Line 1842  DEFUN (show_ipv6_route_protocol, Line 1876  DEFUN (show_ipv6_route_protocol,
   
   /* Show matched type IPv6 routes. */    /* Show matched type IPv6 routes. */
   for (rn = route_top (table); rn; rn = route_next (rn))    for (rn = route_top (table); rn; rn = route_next (rn))
    for (rib = rn->info; rib; rib = rib->next)    RNODE_FOREACH_RIB (rn, rib)
       if (rib->type == type)        if (rib->type == type)
         {          {
           if (first)            if (first)
Line 1952  DEFUN (show_ipv6_route_summary, Line 1986  DEFUN (show_ipv6_route_summary,
 }  }
   
 /*  /*
  * Show IP mroute command to dump the BGP Multicast   
  * routing table  
  */  
 DEFUN (show_ip_mroute,  
        show_ip_mroute_cmd,  
        "show ip mroute",  
        SHOW_STR  
        IP_STR  
        "IP Multicast routing table\n")  
 {  
   struct route_table *table;  
   struct route_node *rn;  
   struct rib *rib;  
   int first = 1;  
   
   table = vrf_table (AFI_IP, SAFI_MULTICAST, 0);  
   if (! table)  
     return CMD_SUCCESS;  
   
   /* Show all IPv4 routes. */  
   for (rn = route_top (table); rn; rn = route_next (rn))  
     for (rib = rn->info; rib; rib = rib->next)  
       {  
        if (first)  
          {  
            vty_out (vty, SHOW_ROUTE_V4_HEADER);  
            first = 0;  
          }  
        vty_show_ip_route (vty, rn, rib);  
       }  
   return CMD_SUCCESS;  
 }  
   
 /*  
  * Show IPv6 mroute command.Used to dump   * Show IPv6 mroute command.Used to dump
  * the Multicast routing table.   * the Multicast routing table.
  */   */
Line 2008  DEFUN (show_ipv6_mroute, Line 2008  DEFUN (show_ipv6_mroute,
   
   /* Show all IPv6 route. */    /* Show all IPv6 route. */
   for (rn = route_top (table); rn; rn = route_next (rn))    for (rn = route_top (table); rn; rn = route_next (rn))
    for (rib = rn->info; rib; rib = rib->next)    RNODE_FOREACH_RIB (rn, rib)
       {        {
        if (first)         if (first)
          {           {
Line 2019  DEFUN (show_ipv6_mroute, Line 2019  DEFUN (show_ipv6_mroute,
       }        }
   return CMD_SUCCESS;    return CMD_SUCCESS;
 }  }
   
   
   
   
   
   
 /* Write IPv6 static route configuration. */  /* Write IPv6 static route configuration. */
 static int  static int

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


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