diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-06-01 13:26:25 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-06-01 14:00:05 +0200 |
commit | f0f77c9a590bf538033602a0b2da6084c9ea22e2 (patch) | |
tree | 80113c30accb622589bcd67ef25fdda17fba0189 /zebra/zebra_fpm_dt.c | |
parent | Merge pull request #634 from dwalton76/bgp-ipv6-nexthop-ll-and-global-takeII (diff) | |
download | frr-f0f77c9a590bf538033602a0b2da6084c9ea22e2.tar.xz frr-f0f77c9a590bf538033602a0b2da6084c9ea22e2.zip |
zebra: Refactor 'struct rib' to be 'struct route_entry'
The 'struct rib' data structure is missnamed. It really
is a 'struct route_entry' as part of the 'struct route_node'.
We have 1 'struct route_entry' per route src. As such
1 route node can have multiple route entries if multiple
protocols attempt to install the same route.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_fpm_dt.c')
-rw-r--r-- | zebra/zebra_fpm_dt.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/zebra/zebra_fpm_dt.c b/zebra/zebra_fpm_dt.c index db28b6f0e..916640928 100644 --- a/zebra/zebra_fpm_dt.c +++ b/zebra/zebra_fpm_dt.c @@ -67,13 +67,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) +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); @@ -88,15 +88,15 @@ 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; } @@ -117,7 +117,7 @@ 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; @@ -125,12 +125,12 @@ 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, sizeof(buf)); + len = zfpm_netlink_encode_route(RTM_NEWROUTE, dest, re, buf, sizeof(buf)); if (len <= 0) { return 2; } @@ -150,7 +150,7 @@ 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; @@ -158,12 +158,12 @@ 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; } @@ -229,7 +229,7 @@ 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; @@ -240,13 +240,13 @@ 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; |