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

Function nhgrp_get_nhops

lib/ff_route.c:590–601  ·  view source on GitHub ↗

* Returns pointer to array of nexthops with weights for * given @nhg. Stores number of items in the array into @pnum_nhops. */

Source from the content-addressed store, hash-verified

588 * given @nhg. Stores number of items in the array into @pnum_nhops.
589 */
590struct weightened_nhop *
591nhgrp_get_nhops(struct nhgrp_object *nhg, uint32_t *pnum_nhops)
592{
593 struct nhgrp_priv *nhg_priv;
594
595 KASSERT(((nhg->nhg_flags & MPF_MULTIPATH) != 0), ("nhop is not mpath"));
596
597 nhg_priv = NHGRP_PRIV(nhg);
598 *pnum_nhops = nhg_priv->nhg_nh_count;
599
600 return (nhg_priv->nhg_nh_weights);
601}
602
603static struct nhop_object *
604select_nhop(struct nhop_object *nh, const struct sockaddr *gw)

Callers 1

select_nhopFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected