diff options
| author | Christian Hopps <chopps@labn.net> | 2023-10-20 04:53:05 -0400 |
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2023-12-28 17:53:40 +0000 |
| commit | d266b1cc9c454579a175dd3efac238e40e64cd4a (patch) | |
| tree | 187ec26d0d28f4ffa818d136b69217a7aacd734d /zebra/zebra_router.c | |
| parent | ef91d34f01bcabb23a631523e31fceb973b711a3 (diff) | |
zebra: support yielding between oper state routes query
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'zebra/zebra_router.c')
| -rw-r--r-- | zebra/zebra_router.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c index 6271d029fb..3fd4e6eb1f 100644 --- a/zebra/zebra_router.c +++ b/zebra/zebra_router.c @@ -70,6 +70,26 @@ struct zebra_router_table *zebra_router_find_zrt(struct zebra_vrf *zvrf, return zrt; } +struct zebra_router_table *zebra_router_find_next_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_NFIND(zebra_router_table_head, &zrouter.tables, &finder); + if (zrt->afi == afi && zrt->safi == safi && zrt->tableid == tableid && + zrt->ns_id == finder.ns_id) + zrt = RB_NEXT(zebra_router_table_head, zrt); + + return zrt; +} + struct route_table *zebra_router_find_table(struct zebra_vrf *zvrf, uint32_t tableid, afi_t afi, safi_t safi) |
