summaryrefslogtreecommitdiff
path: root/zebra/zebra_router.c
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2020-02-27 18:38:24 -0800
committerChirag Shah <chirag@cumulusnetworks.com>2020-05-12 13:25:10 -0700
commit9d86e091bb2bf1a1385408631c90a4bf3694468f (patch)
tree8c1a576332be502119eea50b7fbe987c843e9a7d /zebra/zebra_router.c
parent02b89bdca2152ade522a10cc26bacae4aa660b84 (diff)
zebra: northbound changes for the rib model
This commit implements: RIB operational list create/destroy. Walk over RIB tables using keys. The first RIB table will be IPV4/unicast (table-id 254) will be fetched. Create a new api to fetch RIB table based on afi-safi and table id as the keys. remove mandatory true statement from the leaf which is part of the list key. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_router.c')
-rw-r--r--zebra/zebra_router.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c
index ab426ae603..61fef8779f 100644
--- a/zebra/zebra_router.c
+++ b/zebra/zebra_router.c
@@ -66,6 +66,22 @@ zebra_router_table_entry_compare(const struct zebra_router_table *e1,
return (e1->safi - e2->safi);
}
+struct zebra_router_table *zebra_router_find_zrt(struct zebra_vrf *zvrf,
+ uint32_t tableid, afi_t afi,
+ safi_t safi)
+{
+ struct zebra_router_table finder;
+ struct zebra_router_table *zrt;
+
+ memset(&finder, 0, sizeof(finder));
+ finder.afi = afi;
+ finder.safi = safi;
+ finder.tableid = tableid;
+ finder.ns_id = zvrf->zns->ns_id;
+ zrt = RB_FIND(zebra_router_table_head, &zrouter.tables, &finder);
+
+ return zrt;
+}
struct route_table *zebra_router_find_table(struct zebra_vrf *zvrf,
uint32_t tableid, afi_t afi,