MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rib_foreach_table_walk

Function rib_foreach_table_walk

freebsd/net/route/route_helpers.c:138–153  ·  view source on GitHub ↗

* Iterates over all existing fibs in system calling * @hook_f function before/after traversing each fib. * Calls @wa_f function for each element in current fib. * If af is not AF_UNSPEC, iterates over fibs in particular * address family. */

Source from the content-addressed store, hash-verified

136 * address family.
137 */
138void
139rib_foreach_table_walk(int family, bool wlock, rib_walktree_f_t *wa_f,
140 rib_walk_hook_f_t *hook_f, void *arg)
141{
142
143 for (uint32_t fibnum = 0; fibnum < rt_numfibs; fibnum++) {
144 /* Do we want some specific family? */
145 if (family != AF_UNSPEC) {
146 rib_walk_ext(fibnum, family, wlock, wa_f, hook_f, arg);
147 continue;
148 }
149
150 for (int i = 1; i <= AF_MAX; i++)
151 rib_walk_ext(fibnum, i, wlock, wa_f, hook_f, arg);
152 }
153}
154
155/*
156 * Iterates over all existing fibs in system and deletes each element

Callers

nothing calls this directly

Calls 1

rib_walk_extFunction · 0.85

Tested by

no test coverage detected