summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_fpm.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-06-01 13:26:25 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-06-01 14:00:05 +0200
commitf0f77c9a590bf538033602a0b2da6084c9ea22e2 (patch)
tree80113c30accb622589bcd67ef25fdda17fba0189 /zebra/zebra_fpm.c
parentMerge pull request #634 from dwalton76/bgp-ipv6-nexthop-ll-and-global-takeII (diff)
downloadfrr-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.c')
-rw-r--r--zebra/zebra_fpm.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c
index 2a23ff102..37068c1fa 100644
--- a/zebra/zebra_fpm.c
+++ b/zebra/zebra_fpm.c
@@ -866,7 +866,7 @@ zfpm_writes_pending (void)
* value indicates an error.
*/
static inline int
-zfpm_encode_route (rib_dest_t *dest, struct rib *rib, char *in_buf,
+zfpm_encode_route (rib_dest_t *dest, struct route_entry *re, char *in_buf,
size_t in_buf_len, fpm_msg_type_e *msg_type)
{
size_t len;
@@ -881,7 +881,7 @@ zfpm_encode_route (rib_dest_t *dest, struct rib *rib, char *in_buf,
case ZFPM_MSG_FORMAT_PROTOBUF:
#ifdef HAVE_PROTOBUF
- len = zfpm_protobuf_encode_route (dest, rib, (uint8_t *) in_buf,
+ len = zfpm_protobuf_encode_route (dest, re, (uint8_t *) in_buf,
in_buf_len);
*msg_type = FPM_MSG_TYPE_PROTOBUF;
#endif
@@ -890,8 +890,8 @@ zfpm_encode_route (rib_dest_t *dest, struct rib *rib, char *in_buf,
case ZFPM_MSG_FORMAT_NETLINK:
#ifdef HAVE_NETLINK
*msg_type = FPM_MSG_TYPE_NETLINK;
- cmd = rib ? RTM_NEWROUTE : RTM_DELROUTE;
- len = zfpm_netlink_encode_route (cmd, dest, rib, in_buf, in_buf_len);
+ cmd = re ? RTM_NEWROUTE : RTM_DELROUTE;
+ len = zfpm_netlink_encode_route (cmd, dest, re, in_buf, in_buf_len);
assert(fpm_msg_align(len) == len);
*msg_type = FPM_MSG_TYPE_NETLINK;
#endif /* HAVE_NETLINK */
@@ -908,19 +908,19 @@ zfpm_encode_route (rib_dest_t *dest, struct rib *rib, char *in_buf,
/*
* zfpm_route_for_update
*
- * Returns the rib that is to be sent to the FPM for a given dest.
+ * Returns the re that is to be sent to the FPM for a given dest.
*/
-struct rib *
+struct route_entry *
zfpm_route_for_update (rib_dest_t *dest)
{
- struct rib *rib;
+ struct route_entry *re;
- RIB_DEST_FOREACH_ROUTE (dest, rib)
+ RE_DEST_FOREACH_ROUTE (dest, re)
{
- if (!CHECK_FLAG (rib->status, RIB_ENTRY_SELECTED_FIB))
+ if (!CHECK_FLAG (re->status, ROUTE_ENTRY_SELECTED_FIB))
continue;
- return rib;
+ return re;
}
/*
@@ -944,7 +944,7 @@ zfpm_build_updates (void)
size_t msg_len;
size_t data_len;
fpm_msg_hdr_t *hdr;
- struct rib *rib;
+ struct route_entry *re;
int is_add, write_msg;
fpm_msg_type_e msg_type;
@@ -974,8 +974,8 @@ zfpm_build_updates (void)
data = fpm_msg_data (hdr);
- rib = zfpm_route_for_update (dest);
- is_add = rib ? 1 : 0;
+ re = zfpm_route_for_update (dest);
+ is_add = re ? 1 : 0;
write_msg = 1;
@@ -990,7 +990,7 @@ zfpm_build_updates (void)
}
if (write_msg) {
- data_len = zfpm_encode_route (dest, rib, (char *) data, buf_end - data,
+ data_len = zfpm_encode_route (dest, re, (char *) data, buf_end - data,
&msg_type);
assert (data_len);