From 9d86e091bb2bf1a1385408631c90a4bf3694468f Mon Sep 17 00:00:00 2001 From: Chirag Shah Date: Thu, 27 Feb 2020 18:38:24 -0800 Subject: 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 --- zebra/zebra_router.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'zebra/zebra_router.c') 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, -- cgit v1.2.3