]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_fpm_dt.c
eigrpd: eigrp usage of uint32_t to struct in_addr for router_id data
[mirror_frr.git] / zebra / zebra_fpm_dt.c
index f520fd156f45da1f2573574b92781f0d47406703..e87fa0ad711843566ceddbf48cf61c89dbd8c642 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
@@ -67,13 +66,13 @@ extern int zfpm_dt_benchmark_protobuf_decode(int argc, const char **argv);
  *
  * Selects a suitable rib destination for fpm interface tests.
  */
-static int zfpm_dt_find_route(rib_dest_t **dest_p, struct rib **rib_p)
+static int zfpm_dt_find_route(rib_dest_t **dest_p, struct route_entry **re_p)
 {
        struct route_node *rnode;
        route_table_iter_t iter;
        struct route_table *table;
        rib_dest_t *dest;
-       struct rib *rib;
+       struct route_entry *re;
        int ret;
 
        table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, VRF_DEFAULT);
@@ -87,15 +86,15 @@ static int zfpm_dt_find_route(rib_dest_t **dest_p, struct rib **rib_p)
                if (!dest)
                        continue;
 
-               rib = zfpm_route_for_update(dest);
-               if (!rib)
+               re = zfpm_route_for_update(dest);
+               if (!re)
                        continue;
 
-               if (rib->nexthop_active_num <= 0)
+               if (re->nexthop_active_num <= 0)
                        continue;
 
                *dest_p = dest;
-               *rib_p = rib;
+               *re_p = re;
                ret = 1;
                goto done;
        }
@@ -115,7 +114,7 @@ int zfpm_dt_benchmark_netlink_encode(int argc, const char **argv)
 {
        int times, i, len;
        rib_dest_t *dest;
-       struct rib *rib;
+       struct route_entry *re;
        char buf[4096];
 
        times = 100000;
@@ -123,12 +122,12 @@ int zfpm_dt_benchmark_netlink_encode(int argc, const char **argv)
                times = atoi(argv[0]);
        }
 
-       if (!zfpm_dt_find_route(&dest, &rib)) {
+       if (!zfpm_dt_find_route(&dest, &re)) {
                return 1;
        }
 
        for (i = 0; i < times; i++) {
-               len = zfpm_netlink_encode_route(RTM_NEWROUTE, dest, rib, buf,
+               len = zfpm_netlink_encode_route(RTM_NEWROUTE, dest, re, buf,
                                                sizeof(buf));
                if (len <= 0) {
                        return 2;
@@ -148,7 +147,7 @@ int zfpm_dt_benchmark_protobuf_encode(int argc, const char **argv)
 {
        int times, i, len;
        rib_dest_t *dest;
-       struct rib *rib;
+       struct route_entry *re;
        uint8_t buf[4096];
 
        times = 100000;
@@ -156,12 +155,12 @@ int zfpm_dt_benchmark_protobuf_encode(int argc, const char **argv)
                times = atoi(argv[0]);
        }
 
-       if (!zfpm_dt_find_route(&dest, &rib)) {
+       if (!zfpm_dt_find_route(&dest, &re)) {
                return 1;
        }
 
        for (i = 0; i < times; i++) {
-               len = zfpm_protobuf_encode_route(dest, rib, buf, sizeof(buf));
+               len = zfpm_protobuf_encode_route(dest, re, buf, sizeof(buf));
                if (len <= 0) {
                        return 2;
                }
@@ -177,7 +176,7 @@ static void zfpm_dt_log_fpm_message(Fpm__Message *msg)
        Fpm__AddRoute *add_route;
        Fpm__Nexthop *nexthop;
        struct prefix prefix;
-       u_char family, nh_family;
+       uint8_t family, nh_family;
        uint if_index;
        char *if_name;
        size_t i;
@@ -225,7 +224,7 @@ int zfpm_dt_benchmark_protobuf_decode(int argc, const char **argv)
 {
        int times, i, len;
        rib_dest_t *dest;
-       struct rib *rib;
+       struct route_entry *re;
        uint8_t msg_buf[4096];
        QPB_DECLARE_STACK_ALLOCATOR(allocator, 8192);
        Fpm__Message *fpm_msg;
@@ -236,13 +235,13 @@ int zfpm_dt_benchmark_protobuf_decode(int argc, const char **argv)
        if (argc > 0)
                times = atoi(argv[0]);
 
-       if (!zfpm_dt_find_route(&dest, &rib))
+       if (!zfpm_dt_find_route(&dest, &re))
                return 1;
 
        /*
         * Encode the route into the message buffer once only.
         */
-       len = zfpm_protobuf_encode_route(dest, rib, msg_buf, sizeof(msg_buf));
+       len = zfpm_protobuf_encode_route(dest, re, msg_buf, sizeof(msg_buf));
        if (len <= 0)
                return 2;