]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Rename ALL_NEXTHOPS_RO to ALL_NEXTHOPS
authorßingen <bingen@voltanet.io>
Mon, 10 Jul 2017 19:14:59 +0000 (21:14 +0200)
committerßingen <bingen@voltanet.io>
Mon, 10 Jul 2017 19:14:59 +0000 (21:14 +0200)
tests/lib/test_nexthop_iter.c
zebra/rib.h
zebra/rt_netlink.c
zebra/rt_socket.c
zebra/zebra_fpm_netlink.c
zebra/zebra_fpm_protobuf.c
zebra/zebra_rib.c
zebra/zebra_rnh.c
zebra/zebra_vty.c

index 5c5550a644f84df425ffa39a6561f990898504c4..156249a1cbbdd9bfe82cfdb38fa9b110a61917c9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Recursive Nexthop Iterator test.
- * This tests the ALL_NEXTHOPS_RO macro.
+ * This tests the ALL_NEXTHOPS macro.
  *
  * Copyright (C) 2012 by Open Source Routing.
  * Copyright (C) 2012 by Internet Systems Consortium, Inc. ("ISC")
@@ -204,8 +204,8 @@ nexthop_chain_free(struct nexthop_chain *nc)
 }
 
 /* This function builds a string representation of
- * the nexthop chain using the ALL_NEXTHOPS_RO macro.
- * It verifies that the ALL_NEXTHOPS_RO macro iterated
+ * the nexthop chain using the ALL_NEXTHOPS macro.
+ * It verifies that the ALL_NEXTHOPS macro iterated
  * correctly over the nexthop chain by comparing the
  * generated representation with the expected representation.
  */
@@ -215,7 +215,7 @@ nexthop_chain_verify_iter(struct nexthop_chain *nc)
   struct nexthop *nh;
   char *repr = NULL;
 
-  for (ALL_NEXTHOPS_RO(nc->head, nh))
+  for (ALL_NEXTHOPS(nc->head, nh))
     add_string_representation (&repr, nh);
 
   if (repr && verbose)
index e4e2c454864d5b709c3e0fde8e04f9cdc7727244..177054af4961828c6b29b10950c7ecda5ef0ba7d 100644 (file)
@@ -208,7 +208,7 @@ typedef struct rib_dest_t_
  * left branch is 'resolved' and right branch is 'next':
  * https://en.wikipedia.org/wiki/Tree_traversal#/media/File:Sorted_binary_tree_preorder.svg
  */
-#define ALL_NEXTHOPS_RO(head, nexthop)                              \
+#define ALL_NEXTHOPS(head, nexthop)                              \
   (nexthop) = (head);                                               \
   (nexthop);                                                        \
   (nexthop) = CHECK_FLAG((nexthop)->flags, NEXTHOP_FLAG_RECURSIVE)  \
index 87ead20e863739c6f9030a58ebd3d4a75e8542b3..e09f81ba22b9a4af336b6262e50f219692a129ee 100644 (file)
@@ -1282,7 +1282,7 @@ netlink_route_multipath (int cmd, struct prefix *p, struct prefix *src_p,
   if (discard)
     {
       if (cmd == RTM_NEWROUTE)
-        for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+        for (ALL_NEXTHOPS(re->nexthop, nexthop))
           {
             /* We shouldn't encounter recursive nexthops on discard routes,
              * but it is probably better to handle that case correctly anyway.
@@ -1296,7 +1296,7 @@ netlink_route_multipath (int cmd, struct prefix *p, struct prefix *src_p,
   /* Count overall nexthops so we can decide whether to use singlepath
    * or multipath case. */
   nexthop_num = 0;
-  for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+  for (ALL_NEXTHOPS(re->nexthop, nexthop))
     {
       if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
         continue;
@@ -1312,7 +1312,7 @@ netlink_route_multipath (int cmd, struct prefix *p, struct prefix *src_p,
   if (nexthop_num == 1 || multipath_num == 1)
     {
       nexthop_num = 0;
-      for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+      for (ALL_NEXTHOPS(re->nexthop, nexthop))
         {
           if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
             {
@@ -1383,7 +1383,7 @@ netlink_route_multipath (int cmd, struct prefix *p, struct prefix *src_p,
       rtnh = RTA_DATA (rta);
 
       nexthop_num = 0;
-      for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+      for (ALL_NEXTHOPS(re->nexthop, nexthop))
         {
           if (nexthop_num >= multipath_num)
             break;
index caf4da257935677a02e1d1eeb836fee70f2ba70a..3ae09945b246134fd1114de010d85d04b037869f 100644 (file)
@@ -105,7 +105,7 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct route_entry *re)
 #endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
 
   /* Make gateway. */
-  for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+  for (ALL_NEXTHOPS(re->nexthop, nexthop))
     {
       if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
         continue;
@@ -225,7 +225,7 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct route_entry *re)
          if (IS_ZEBRA_DEBUG_RIB)
            zlog_debug ("%s: odd command %s for flags %d",
              __func__, lookup_msg(rtm_type_str, cmd, NULL), nexthop->flags);
-     } /* for (ALL_NEXTHOPS_RO(...))*/
+     } /* for (ALL_NEXTHOPS(...))*/
  
    /* If there was no useful nexthop, then complain. */
    if (nexthop_num == 0 && IS_ZEBRA_DEBUG_KERNEL)
@@ -287,7 +287,7 @@ kernel_rtm_ipv6 (int cmd, struct prefix *p, struct route_entry *re)
 #endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
 
   /* Make gateway. */
-  for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+  for (ALL_NEXTHOPS(re->nexthop, nexthop))
     {
       if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
        continue;
index a6c526ee6cec4f2bc473d8cd57fbb1a24fa237f2..7ecde52e6313e63de555a5555c0543171a1ca1a1 100644 (file)
@@ -285,7 +285,7 @@ netlink_route_info_fill (netlink_route_info_t *ri, int cmd,
   if (discard)
     return 1;
 
-  for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+  for (ALL_NEXTHOPS(re->nexthop, nexthop))
     {
       if (ri->num_nhs >= multipath_num)
         break;
index bb09aeece65fc44fd3f386a2870d4511597d5e73..1e8af19ea7f215badf95a9380c7a4403d1220f1d 100644 (file)
@@ -194,7 +194,7 @@ create_add_route_message (qpb_allocator_t *allocator, rib_dest_t *dest,
    * Figure out the set of nexthops to be added to the message.
    */
   num_nhs = 0;
-  for (ALL_NEXTHOPS_RO (re->nexthop, nexthop))
+  for (ALL_NEXTHOPS (re->nexthop, nexthop))
     {
       if (num_nhs >= multipath_num)
         break;
index eed21254832fbc34199a012e48a2bc9b2e8743db..7016292ac0c10237b399072df4f8de2df062b002 100644 (file)
@@ -529,7 +529,7 @@ nexthop_active (afi_t afi, struct route_entry *re, struct nexthop *nexthop, int
       else if (CHECK_FLAG (re->flags, ZEBRA_FLAG_INTERNAL))
        {
          resolved = 0;
-         for (ALL_NEXTHOPS_RO(match->nexthop, newhop))
+         for (ALL_NEXTHOPS(match->nexthop, newhop))
            if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB)
                && ! CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_RECURSIVE))
              {
@@ -547,7 +547,7 @@ nexthop_active (afi_t afi, struct route_entry *re, struct nexthop *nexthop, int
       else if (re->type == ZEBRA_ROUTE_STATIC)
        {
          resolved = 0;
-         for (ALL_NEXTHOPS_RO(match->nexthop, newhop))
+         for (ALL_NEXTHOPS(match->nexthop, newhop))
            if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB))
              {
                if (set)
@@ -628,7 +628,7 @@ rib_match (afi_t afi, safi_t safi, vrf_id_t vrf_id,
          if (match->type != ZEBRA_ROUTE_CONNECT)
            {
              int found = 0;
-             for (ALL_NEXTHOPS_RO(match->nexthop, newhop))
+             for (ALL_NEXTHOPS(match->nexthop, newhop))
                if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB))
                  {
                    found = 1;
@@ -754,7 +754,7 @@ rib_lookup_ipv4 (struct prefix_ipv4 *p, vrf_id_t vrf_id)
   if (match->type == ZEBRA_ROUTE_CONNECT)
     return match;
 
-  for (ALL_NEXTHOPS_RO(match->nexthop, nexthop))
+  for (ALL_NEXTHOPS(match->nexthop, nexthop))
     if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
       return match;
 
@@ -816,7 +816,7 @@ rib_lookup_ipv4_route (struct prefix_ipv4 *p, union sockunion * qgate,
   
   /* Ok, we have a cood candidate, let's check it's nexthop list... */
   nexthops_active = 0;
-  for (ALL_NEXTHOPS_RO(match->nexthop, nexthop))
+  for (ALL_NEXTHOPS(match->nexthop, nexthop))
     if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
       {
         nexthops_active = 1;
@@ -1028,7 +1028,7 @@ zebra_rib_labeled_unicast (struct route_entry *re)
   if (re->type != ZEBRA_ROUTE_BGP)
     return 0;
 
-  for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+  for (ALL_NEXTHOPS(re->nexthop, nexthop))
     if (!nexthop->nh_label || !nexthop->nh_label->num_labels)
       return 0;
 
@@ -1051,7 +1051,7 @@ rib_install_kernel (struct route_node *rn, struct route_entry *re, struct route_
 
   if (info->safi != SAFI_UNICAST)
     {
-      for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+      for (ALL_NEXTHOPS(re->nexthop, nexthop))
         SET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
       return ret;
     }
@@ -1067,7 +1067,7 @@ rib_install_kernel (struct route_node *rn, struct route_entry *re, struct route_
   /* If install succeeds, update FIB flag for nexthops. */
   if (!ret)
     {
-      for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+      for (ALL_NEXTHOPS(re->nexthop, nexthop))
         {
           if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
             continue;
@@ -1096,7 +1096,7 @@ rib_uninstall_kernel (struct route_node *rn, struct route_entry *re)
 
   if (info->safi != SAFI_UNICAST)
     {
-      for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+      for (ALL_NEXTHOPS(re->nexthop, nexthop))
         SET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
       return ret;
     }
@@ -1109,7 +1109,7 @@ rib_uninstall_kernel (struct route_node *rn, struct route_entry *re)
   ret = kernel_route_rib (p, src_p, re, NULL);
   zvrf->removals++;
 
-  for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+  for (ALL_NEXTHOPS(re->nexthop, nexthop))
     UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
 
   return ret;
@@ -1397,7 +1397,7 @@ rib_process_update_fib (struct zebra_vrf *zvrf, struct route_node *rn,
         {
           int in_fib = 0;
 
-          for (ALL_NEXTHOPS_RO(new->nexthop, nexthop))
+          for (ALL_NEXTHOPS(new->nexthop, nexthop))
             if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
               {
                 in_fib = 1;
@@ -1632,7 +1632,7 @@ rib_process (struct route_node *rn)
 
       /* Check if we have a FIB route for the destination, otherwise,
        * don't redistribute it */
-      for (ALL_NEXTHOPS_RO(new_fib ? new_fib->nexthop : NULL, nexthop))
+      for (ALL_NEXTHOPS(new_fib ? new_fib->nexthop : NULL, nexthop))
         {
           if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB))
             {
@@ -2168,7 +2168,7 @@ void _route_entry_dump (const char * func,
     re->nexthop_active_num
   );
 
-  for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+  for (ALL_NEXTHOPS(re->nexthop, nexthop))
     {
       inet_ntop (p->family, &nexthop->gate, straddr, INET6_ADDRSTRLEN);
       zlog_debug
@@ -2453,7 +2453,7 @@ rib_delete (afi_t afi, safi_t safi, vrf_id_t vrf_id, int type, u_short instance,
               same = re;
               break;
             }
-          for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+          for (ALL_NEXTHOPS(re->nexthop, nexthop))
             if (IPV4_ADDR_SAME (&nexthop->gate.ipv4, gate) ||
                IPV6_ADDR_SAME (&nexthop->gate.ipv6, gate))
               {
index 352ac4f4cffd14f9b3a37adca437290d6da7416f..880002b2d05bfa2f7677d7c56df69c9822651f02 100644 (file)
@@ -424,7 +424,7 @@ zebra_rnh_eval_import_check_entry (vrf_id_t vrfid, int family, int force,
 
   if (re && (rnh->state == NULL))
     {
-      for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+      for (ALL_NEXTHOPS(re->nexthop, nexthop))
         if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
           {
             state_changed = 1;
index a19859440a9ccc738f0e22918f3e95279f96d513..182223b05886261eb8ae5f2a293a765cfb93f811 100644 (file)
@@ -719,7 +719,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(re->nexthop, nexthop))
+      for (ALL_NEXTHOPS(re->nexthop, nexthop))
     {
           char addrstr[32];
 
@@ -866,7 +866,7 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct route_entry *r
           json_object_string_add(json_route, "uptime", buf);
         }
 
-      for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+      for (ALL_NEXTHOPS(re->nexthop, nexthop))
         {
           json_nexthop = json_object_new_object();
 
@@ -960,7 +960,7 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct route_entry *r
     }
 
   /* Nexthop information. */
-  for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
+  for (ALL_NEXTHOPS(re->nexthop, nexthop))
     {
       if (nexthop == re->nexthop)
        {