From: Mark Stapp Date: Tue, 12 Jun 2018 20:33:30 +0000 (-0400) Subject: libs: add ALL_NEXTHOPS_PTR iterator macro X-Git-Tag: frr-6.1-dev~179^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d826a734af340d12296ccb78cba73828ace66468;p=mirror%2Ffrr.git libs: add ALL_NEXTHOPS_PTR iterator macro Because sometimes we have a pointer to a nexthop_group. Signed-off-by: Mark Stapp --- diff --git a/lib/nexthop_group.h b/lib/nexthop_group.h index a44f4e3542..473ecb34fc 100644 --- a/lib/nexthop_group.h +++ b/lib/nexthop_group.h @@ -56,6 +56,11 @@ void copy_nexthops(struct nexthop **tnh, struct nexthop *nh, (nhop); \ (nhop) = nexthop_next(nhop) +#define ALL_NEXTHOPS_PTR(head, nhop) \ + (nhop) = ((head)->nexthop); \ + (nhop); \ + (nhop) = nexthop_next(nhop) + struct nexthop_hold { char *nhvrf_name;