Add a function nexthop_group_has_label() for determining
if even a single nexthop in the group has a label on it.
Signed-off-by: Stephen Worley <sworley@nvidia.com>
return num;
}
+bool nexthop_group_has_label(const struct nexthop_group *nhg)
+{
+ struct nexthop *nhop;
+
+ for (ALL_NEXTHOPS_PTR(nhg, nhop)) {
+ if (nhop->nh_label)
+ return true;
+ }
+
+ return false;
+}
+
struct nexthop *nexthop_exists(const struct nexthop_group *nhg,
const struct nexthop *nh)
{
extern uint8_t
nexthop_group_active_nexthop_num_no_recurse(const struct nexthop_group *nhg);
+extern bool nexthop_group_has_label(const struct nexthop_group *nhg);
+
#ifdef __cplusplus
}
#endif