]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_vty.c
zebra: Refactor 'struct rib' to be 'struct route_entry'
[mirror_frr.git] / zebra / zebra_vty.c
index d0d761af95c31958282b1586df56354eb66783fb..c865a8ed1e45f744afb08792544a4569742a5c16 100644 (file)
@@ -321,7 +321,7 @@ DEFUN (show_ip_rpf_addr,
   int idx_ipv4 = 3;
   struct in_addr addr;
   struct route_node *rn;
-  struct rib *rib;
+  struct route_entry *re;
   int ret;
 
   ret = inet_aton (argv[idx_ipv4]->arg, &addr);
@@ -331,9 +331,9 @@ DEFUN (show_ip_rpf_addr,
       return CMD_WARNING;
     }
 
-  rib = rib_match_ipv4_multicast (VRF_DEFAULT, addr, &rn);
+  re = rib_match_ipv4_multicast (VRF_DEFAULT, addr, &rn);
 
-  if (rib)
+  if (re)
     vty_show_ip_route_detail (vty, rn, 1);
   else
     vty_out (vty, "%% No match for RPF lookup%s", VTY_NEWLINE);
@@ -640,13 +640,13 @@ DEFUN (no_ip_route_mask_flags,
 static void
 vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
 {
-  struct rib *rib;
+  struct route_entry *re;
   struct nexthop *nexthop, *tnexthop;
   int recursing;
   char buf[SRCDEST2STR_BUFFER];
   struct zebra_vrf *zvrf;
 
-  RNODE_FOREACH_RIB (rn, rib)
+  RNODE_FOREACH_RE (rn, re)
     {
       const char *mcast_info = "";
       if (mcast)
@@ -660,42 +660,42 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
       vty_out (vty, "Routing entry for %s%s%s",
               srcdest_rnode2str(rn, buf, sizeof(buf)), mcast_info,
               VTY_NEWLINE);
-      vty_out (vty, "  Known via \"%s", zebra_route_string (rib->type));
-      if (rib->instance)
-        vty_out (vty, "[%d]", rib->instance);
+      vty_out (vty, "  Known via \"%s", zebra_route_string (re->type));
+      if (re->instance)
+        vty_out (vty, "[%d]", re->instance);
       vty_out (vty, "\"");
-      vty_out (vty, ", distance %u, metric %u", rib->distance, rib->metric);
-      if (rib->tag)
-       vty_out (vty, ", tag %d", rib->tag);
-       if (rib->mtu)
-        vty_out (vty, ", mtu %u", rib->mtu);
-      if (rib->vrf_id != VRF_DEFAULT)
+      vty_out (vty, ", distance %u, metric %u", re->distance, re->metric);
+      if (re->tag)
+       vty_out (vty, ", tag %d", re->tag);
+       if (re->mtu)
+        vty_out (vty, ", mtu %u", re->mtu);
+      if (re->vrf_id != VRF_DEFAULT)
         {
-          zvrf = vrf_info_lookup(rib->vrf_id);
+          zvrf = vrf_info_lookup(re->vrf_id);
           vty_out (vty, ", vrf %s", zvrf_name (zvrf));
         }
-      if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
+      if (CHECK_FLAG (re->flags, ZEBRA_FLAG_SELECTED))
        vty_out (vty, ", best");
-      if (rib->refcnt)
-       vty_out (vty, ", refcnt %ld", rib->refcnt);
-      if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_BLACKHOLE))
+      if (re->refcnt)
+       vty_out (vty, ", refcnt %ld", re->refcnt);
+      if (CHECK_FLAG (re->flags, ZEBRA_FLAG_BLACKHOLE))
        vty_out (vty, ", blackhole");
-      if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_REJECT))
+      if (CHECK_FLAG (re->flags, ZEBRA_FLAG_REJECT))
        vty_out (vty, ", reject");
       vty_out (vty, "%s", VTY_NEWLINE);
 
-      if (rib->type == ZEBRA_ROUTE_RIP
-         || rib->type == ZEBRA_ROUTE_OSPF
-         || rib->type == ZEBRA_ROUTE_ISIS
-         || rib->type == ZEBRA_ROUTE_NHRP
-         || rib->type == ZEBRA_ROUTE_TABLE
-         || rib->type == ZEBRA_ROUTE_BGP)
+      if (re->type == ZEBRA_ROUTE_RIP
+         || re->type == ZEBRA_ROUTE_OSPF
+         || re->type == ZEBRA_ROUTE_ISIS
+         || re->type == ZEBRA_ROUTE_NHRP
+         || re->type == ZEBRA_ROUTE_TABLE
+         || re->type == ZEBRA_ROUTE_BGP)
        {
          time_t uptime;
          struct tm *tm;
 
          uptime = time (NULL);
-         uptime -= rib->uptime;
+         uptime -= re->uptime;
          tm = gmtime (&uptime);
 
          vty_out (vty, "  Last update ");
@@ -713,7 +713,7 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
          vty_out (vty, " ago%s", VTY_NEWLINE);
        }
 
-      for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
+      for (ALL_NEXTHOPS_RO(re->nexthop, nexthop, tnexthop, recursing))
        {
           char addrstr[32];
 
@@ -728,7 +728,7 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
              vty_out (vty, " %s", inet_ntoa (nexthop->gate.ipv4));
              if (nexthop->ifindex)
                vty_out (vty, ", via %s",
-                         ifindex2ifname (nexthop->ifindex, rib->vrf_id));
+                         ifindex2ifname (nexthop->ifindex, re->vrf_id));
              break;
            case NEXTHOP_TYPE_IPV6:
            case NEXTHOP_TYPE_IPV6_IFINDEX:
@@ -736,11 +736,11 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
                       inet_ntop (AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ));
              if (nexthop->ifindex)
                vty_out (vty, ", via %s",
-                         ifindex2ifname (nexthop->ifindex, rib->vrf_id));
+                         ifindex2ifname (nexthop->ifindex, re->vrf_id));
              break;
            case NEXTHOP_TYPE_IFINDEX:
              vty_out (vty, " directly connected, %s",
-                      ifindex2ifname (nexthop->ifindex, rib->vrf_id));
+                      ifindex2ifname (nexthop->ifindex, re->vrf_id));
              break;
            case NEXTHOP_TYPE_BLACKHOLE:
              vty_out (vty, " directly connected, Null0");
@@ -796,7 +796,7 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
 }
 
 static void
-vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib,
+vty_show_ip_route (struct vty *vty, struct route_node *rn, struct route_entry *re,
                    json_object *json)
 {
   struct nexthop *nexthop, *tnexthop;
@@ -814,41 +814,41 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib,
       json_nexthops = json_object_new_array();
 
       json_object_string_add(json_route, "prefix", srcdest_rnode2str (rn, buf, sizeof buf));
-      json_object_string_add(json_route, "protocol", zebra_route_string(rib->type));
+      json_object_string_add(json_route, "protocol", zebra_route_string(re->type));
 
-      if (rib->instance)
-        json_object_int_add(json_route, "instance", rib->instance);
+      if (re->instance)
+        json_object_int_add(json_route, "instance", re->instance);
 
-      if (rib->vrf_id)
-        json_object_int_add(json_route, "vrfId", rib->vrf_id);
+      if (re->vrf_id)
+        json_object_int_add(json_route, "vrfId", re->vrf_id);
 
-      if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
+      if (CHECK_FLAG (re->flags, ZEBRA_FLAG_SELECTED))
         json_object_boolean_true_add(json_route, "selected");
 
-      if (rib->type != ZEBRA_ROUTE_CONNECT && rib->type != ZEBRA_ROUTE_KERNEL)
+      if (re->type != ZEBRA_ROUTE_CONNECT && re->type != ZEBRA_ROUTE_KERNEL)
         {
-          json_object_int_add(json_route, "distance", rib->distance);
-          json_object_int_add(json_route, "metric", rib->metric);
+          json_object_int_add(json_route, "distance", re->distance);
+          json_object_int_add(json_route, "metric", re->metric);
         }
 
-      if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_BLACKHOLE))
+      if (CHECK_FLAG (re->flags, ZEBRA_FLAG_BLACKHOLE))
         json_object_boolean_true_add(json_route, "blackhole");
 
-      if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_REJECT))
+      if (CHECK_FLAG (re->flags, ZEBRA_FLAG_REJECT))
         json_object_boolean_true_add(json_route, "reject");
 
-      if (rib->type == ZEBRA_ROUTE_RIP
-          || rib->type == ZEBRA_ROUTE_OSPF
-          || rib->type == ZEBRA_ROUTE_ISIS
-         || rib->type == ZEBRA_ROUTE_NHRP
-          || rib->type == ZEBRA_ROUTE_TABLE
-          || rib->type == ZEBRA_ROUTE_BGP)
+      if (re->type == ZEBRA_ROUTE_RIP
+          || re->type == ZEBRA_ROUTE_OSPF
+          || re->type == ZEBRA_ROUTE_ISIS
+         || re->type == ZEBRA_ROUTE_NHRP
+          || re->type == ZEBRA_ROUTE_TABLE
+          || re->type == ZEBRA_ROUTE_BGP)
         {
           time_t uptime;
           struct tm *tm;
 
           uptime = time (NULL);
-          uptime -= rib->uptime;
+          uptime -= re->uptime;
           tm = gmtime (&uptime);
 
           if (uptime < ONE_DAY_SECOND)
@@ -861,7 +861,7 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib,
           json_object_string_add(json_route, "uptime", buf);
         }
 
-      for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
+      for (ALL_NEXTHOPS_RO(re->nexthop, nexthop, tnexthop, recursing))
         {
           json_nexthop = json_object_new_object();
 
@@ -878,7 +878,7 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib,
               if (nexthop->ifindex)
                 {
                   json_object_int_add(json_nexthop, "interfaceIndex", nexthop->ifindex);
-                  json_object_string_add(json_nexthop, "interfaceName", ifindex2ifname (nexthop->ifindex, rib->vrf_id));
+                  json_object_string_add(json_nexthop, "interfaceName", ifindex2ifname (nexthop->ifindex, re->vrf_id));
                 }
               break;
             case NEXTHOP_TYPE_IPV6:
@@ -889,14 +889,14 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib,
               if (nexthop->ifindex)
                 {
                   json_object_int_add(json_nexthop, "interfaceIndex", nexthop->ifindex);
-                  json_object_string_add(json_nexthop, "interfaceName", ifindex2ifname (nexthop->ifindex, rib->vrf_id));
+                  json_object_string_add(json_nexthop, "interfaceName", ifindex2ifname (nexthop->ifindex, re->vrf_id));
                 }
               break;
 
             case NEXTHOP_TYPE_IFINDEX:
               json_object_boolean_true_add(json_nexthop, "directlyConnected");
               json_object_int_add(json_nexthop, "interfaceIndex", nexthop->ifindex);
-              json_object_string_add(json_nexthop, "interfaceName", ifindex2ifname (nexthop->ifindex, rib->vrf_id));
+              json_object_string_add(json_nexthop, "interfaceName", ifindex2ifname (nexthop->ifindex, re->vrf_id));
               break;
             case NEXTHOP_TYPE_BLACKHOLE:
               json_object_boolean_true_add(json_nexthop, "blackhole");
@@ -955,26 +955,26 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib,
     }
 
   /* Nexthop information. */
-  for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
+  for (ALL_NEXTHOPS_RO(re->nexthop, nexthop, tnexthop, recursing))
     {
-      if (nexthop == rib->nexthop)
+      if (nexthop == re->nexthop)
        {
          /* Prefix information. */
-         len = vty_out (vty, "%c", zebra_route_char (rib->type));
-          if (rib->instance)
-           len += vty_out (vty, "[%d]", rib->instance);
+         len = vty_out (vty, "%c", zebra_route_char (re->type));
+          if (re->instance)
+           len += vty_out (vty, "[%d]", re->instance);
           len += vty_out (vty, "%c%c %s",
-                         CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED)
+                         CHECK_FLAG (re->flags, ZEBRA_FLAG_SELECTED)
                          ? '>' : ' ',
                          CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
                          ? '*' : ' ',
                          srcdest_rnode2str (rn, buf, sizeof buf));
 
          /* Distance and metric display. */
-         if (rib->type != ZEBRA_ROUTE_CONNECT
-             && rib->type != ZEBRA_ROUTE_KERNEL)
-           len += vty_out (vty, " [%d/%d]", rib->distance,
-                           rib->metric);
+         if (re->type != ZEBRA_ROUTE_CONNECT
+             && re->type != ZEBRA_ROUTE_KERNEL)
+           len += vty_out (vty, " [%d/%d]", re->distance,
+                           re->metric);
        }
       else
        vty_out (vty, "  %c%*c",
@@ -989,7 +989,7 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib,
          vty_out (vty, " via %s", inet_ntoa (nexthop->gate.ipv4));
          if (nexthop->ifindex)
            vty_out (vty, ", %s",
-                     ifindex2ifname (nexthop->ifindex, rib->vrf_id));
+                     ifindex2ifname (nexthop->ifindex, re->vrf_id));
          break;
         case NEXTHOP_TYPE_IPV6:
        case NEXTHOP_TYPE_IPV6_IFINDEX:
@@ -997,12 +997,12 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib,
                   inet_ntop (AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ));
          if (nexthop->ifindex)
            vty_out (vty, ", %s",
-                     ifindex2ifname (nexthop->ifindex, rib->vrf_id));
+                     ifindex2ifname (nexthop->ifindex, re->vrf_id));
          break;
 
        case NEXTHOP_TYPE_IFINDEX:
          vty_out (vty, " is directly connected, %s",
-                  ifindex2ifname (nexthop->ifindex, rib->vrf_id));
+                  ifindex2ifname (nexthop->ifindex, re->vrf_id));
          break;
        case NEXTHOP_TYPE_BLACKHOLE:
          vty_out (vty, " is directly connected, Null0");
@@ -1049,23 +1049,23 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib,
                                   nexthop->nh_label->label, buf, BUFSIZ, 1));
        }
 
-      if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_BLACKHOLE))
+      if (CHECK_FLAG (re->flags, ZEBRA_FLAG_BLACKHOLE))
                vty_out (vty, ", bh");
-      if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_REJECT))
+      if (CHECK_FLAG (re->flags, ZEBRA_FLAG_REJECT))
                vty_out (vty, ", rej");
 
-      if (rib->type == ZEBRA_ROUTE_RIP
-         || rib->type == ZEBRA_ROUTE_OSPF
-         || rib->type == ZEBRA_ROUTE_ISIS
-         || rib->type == ZEBRA_ROUTE_NHRP
-         || rib->type == ZEBRA_ROUTE_TABLE
-         || rib->type == ZEBRA_ROUTE_BGP)
+      if (re->type == ZEBRA_ROUTE_RIP
+         || re->type == ZEBRA_ROUTE_OSPF
+         || re->type == ZEBRA_ROUTE_ISIS
+         || re->type == ZEBRA_ROUTE_NHRP
+         || re->type == ZEBRA_ROUTE_TABLE
+         || re->type == ZEBRA_ROUTE_BGP)
        {
          time_t uptime;
          struct tm *tm;
 
          uptime = time (NULL);
-         uptime -= rib->uptime;
+         uptime -= re->uptime;
          tm = gmtime (&uptime);
 
          if (uptime < ONE_DAY_SECOND)
@@ -1097,7 +1097,7 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi,
 {
   struct route_table *table;
   struct route_node *rn;
-  struct rib *rib;
+  struct route_entry *re;
   int first = 1;
   struct zebra_vrf *zvrf = NULL;
   char buf[BUFSIZ];
@@ -1137,12 +1137,12 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi,
   /* Show all routes. */
   for (rn = route_top (table); rn; rn = route_next (rn))
     {
-      RNODE_FOREACH_RIB (rn, rib)
+      RNODE_FOREACH_RE (rn, re)
         {
-          if (use_fib && !CHECK_FLAG(rib->status, RIB_ENTRY_SELECTED_FIB))
+          if (use_fib && !CHECK_FLAG(re->status, ROUTE_ENTRY_SELECTED_FIB))
             continue;
 
-          if (tag && rib->tag != tag)
+          if (tag && re->tag != tag)
             continue;
 
           if (longer_prefix_p && ! prefix_match (longer_prefix_p, &rn->p))
@@ -1163,10 +1163,10 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi,
                 continue;
             }
 
-          if (type && rib->type != type)
+          if (type && re->type != type)
             continue;
 
-          if (ospf_instance_id && (rib->type != ZEBRA_ROUTE_OSPF || rib->instance != ospf_instance_id))
+          if (ospf_instance_id && (re->type != ZEBRA_ROUTE_OSPF || re->instance != ospf_instance_id))
             continue;
 
           if (use_json)
@@ -1190,7 +1190,7 @@ do_show_ip_route (struct vty *vty, const char *vrf_name, afi_t afi, safi_t safi,
                 }
             }
 
-          vty_show_ip_route (vty, rn, rib, json_prefix);
+          vty_show_ip_route (vty, rn, re, json_prefix);
         }
 
       if (json_prefix)
@@ -1567,7 +1567,7 @@ static void
 vty_show_ip_route_summary (struct vty *vty, struct route_table *table)
 {
   struct route_node *rn;
-  struct rib *rib;
+  struct route_entry *re;
 #define ZEBRA_ROUTE_IBGP  ZEBRA_ROUTE_MAX
 #define ZEBRA_ROUTE_TOTAL (ZEBRA_ROUTE_IBGP + 1)
   u_int32_t rib_cnt[ZEBRA_ROUTE_TOTAL + 1];
@@ -1578,25 +1578,25 @@ vty_show_ip_route_summary (struct vty *vty, struct route_table *table)
   memset (&rib_cnt, 0, sizeof(rib_cnt));
   memset (&fib_cnt, 0, sizeof(fib_cnt));
   for (rn = route_top (table); rn; rn = srcdest_route_next (rn))
-    RNODE_FOREACH_RIB (rn, rib)
+    RNODE_FOREACH_RE (rn, re)
       {
-        is_ibgp = (rib->type == ZEBRA_ROUTE_BGP &&
-                   CHECK_FLAG (rib->flags, ZEBRA_FLAG_IBGP));
+        is_ibgp = (re->type == ZEBRA_ROUTE_BGP &&
+                   CHECK_FLAG (re->flags, ZEBRA_FLAG_IBGP));
 
         rib_cnt[ZEBRA_ROUTE_TOTAL]++;
         if (is_ibgp)
           rib_cnt[ZEBRA_ROUTE_IBGP]++;
         else
-          rib_cnt[rib->type]++;
+          rib_cnt[re->type]++;
 
-        if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
+        if (CHECK_FLAG (re->flags, ZEBRA_FLAG_SELECTED))
           {
             fib_cnt[ZEBRA_ROUTE_TOTAL]++;
 
             if (is_ibgp)
               fib_cnt[ZEBRA_ROUTE_IBGP]++;
             else
-              fib_cnt[rib->type]++;
+              fib_cnt[re->type]++;
           }
       }
 
@@ -1642,7 +1642,7 @@ static void
 vty_show_ip_route_summary_prefix (struct vty *vty, struct route_table *table)
 {
   struct route_node *rn;
-  struct rib *rib;
+  struct route_entry *re;
   struct nexthop *nexthop;
 #define ZEBRA_ROUTE_IBGP  ZEBRA_ROUTE_MAX
 #define ZEBRA_ROUTE_TOTAL (ZEBRA_ROUTE_IBGP + 1)
@@ -1654,25 +1654,25 @@ vty_show_ip_route_summary_prefix (struct vty *vty, struct route_table *table)
   memset (&rib_cnt, 0, sizeof(rib_cnt));
   memset (&fib_cnt, 0, sizeof(fib_cnt));
   for (rn = route_top (table); rn; rn = srcdest_route_next (rn))
-    RNODE_FOREACH_RIB (rn, rib)
+    RNODE_FOREACH_RE (rn, re)
       {
 
        /*
         * In case of ECMP, count only once.
         */
        cnt = 0;
-       for (nexthop = rib->nexthop; (!cnt && nexthop); nexthop = nexthop->next)
+       for (nexthop = re->nexthop; (!cnt && nexthop); nexthop = nexthop->next)
          {
           cnt++;
           rib_cnt[ZEBRA_ROUTE_TOTAL]++;
-          rib_cnt[rib->type]++;
+          rib_cnt[re->type]++;
           if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
                {
                 fib_cnt[ZEBRA_ROUTE_TOTAL]++;
-             fib_cnt[rib->type]++;
+             fib_cnt[re->type]++;
             }
-             if (rib->type == ZEBRA_ROUTE_BGP &&
-                 CHECK_FLAG (rib->flags, ZEBRA_FLAG_IBGP))
+             if (re->type == ZEBRA_ROUTE_BGP &&
+                 CHECK_FLAG (re->flags, ZEBRA_FLAG_IBGP))
             {
                 rib_cnt[ZEBRA_ROUTE_IBGP]++;
                     if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
@@ -2816,7 +2816,7 @@ DEFUN (show_ipv6_mroute,
 {
   struct route_table *table;
   struct route_node *rn;
-  struct rib *rib;
+  struct route_entry *re;
   int first = 1;
   vrf_id_t vrf_id = VRF_DEFAULT;
 
@@ -2829,14 +2829,14 @@ DEFUN (show_ipv6_mroute,
 
   /* Show all IPv6 route. */
   for (rn = route_top (table); rn; rn = srcdest_route_next (rn))
-    RNODE_FOREACH_RIB (rn, rib)
+    RNODE_FOREACH_RE (rn, re)
       {
        if (first)
          {
           vty_out (vty, SHOW_ROUTE_V6_HEADER);
            first = 0;
          }
-       vty_show_ip_route (vty, rn, rib, NULL);
+       vty_show_ip_route (vty, rn, re, NULL);
       }
   return CMD_SUCCESS;
 }
@@ -2959,7 +2959,7 @@ DEFUN (show_ipv6_mroute_vrf_all,
 {
   struct route_table *table;
   struct route_node *rn;
-  struct rib *rib;
+  struct route_entry *re;
   struct vrf *vrf;
   struct zebra_vrf *zvrf;
   int first = 1;
@@ -2972,14 +2972,14 @@ DEFUN (show_ipv6_mroute_vrf_all,
 
       /* Show all IPv6 route. */
       for (rn = route_top (table); rn; rn = srcdest_route_next (rn))
-        RNODE_FOREACH_RIB (rn, rib)
+        RNODE_FOREACH_RE (rn, re)
           {
            if (first)
              {
                vty_out (vty, SHOW_ROUTE_V6_HEADER);
                first = 0;
              }
-           vty_show_ip_route (vty, rn, rib, NULL);
+           vty_show_ip_route (vty, rn, re, NULL);
           }
     }
   return CMD_SUCCESS;