* Returns pointer to array of nexthops with weights for * given @nhg. Stores number of items in the array into @pnum_nhops. */
| 588 | * given @nhg. Stores number of items in the array into @pnum_nhops. |
| 589 | */ |
| 590 | struct weightened_nhop * |
| 591 | nhgrp_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 | |
| 603 | static struct nhop_object * |
| 604 | select_nhop(struct nhop_object *nh, const struct sockaddr *gw) |