diff options
| author | Mark Stapp <mjs@voltanet.io> | 2019-12-09 16:02:57 -0500 | 
|---|---|---|
| committer | Mark Stapp <mjs@voltanet.io> | 2019-12-09 16:25:53 -0500 | 
| commit | e1f3a8eb193267da195088cc515b598ae5a92a12 (patch) | |
| tree | e6d37c76f9b31d8eb37afb2ea43496dc999010e3 /lib/nexthop_group.h | |
| parent | 1c30d64bb63aedd0104aa3525815d3ff16c45522 (diff) | |
lib,zebra: add api to enforce nexthop sort order when copying
Add an api that creates a copy of a list of nexthops and
enforces the canonical sort ordering; consolidate some nhg
code to avoid copy-and-paste. The zebra dplane uses
that api when a plugin sets up a list of nexthops, ensuring
that the plugin's list is ordered when it's processed in
zebra.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'lib/nexthop_group.h')
| -rw-r--r-- | lib/nexthop_group.h | 7 | 
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/nexthop_group.h b/lib/nexthop_group.h index c90b21737a..73b020283a 100644 --- a/lib/nexthop_group.h +++ b/lib/nexthop_group.h @@ -44,6 +44,13 @@ void nexthop_group_delete(struct nexthop_group **nhg);  void nexthop_group_copy(struct nexthop_group *to,  			struct nexthop_group *from); + +/* + * Copy a list of nexthops in 'nh' to an nhg, enforcing canonical sort order + */ +void nexthop_group_copy_nh_sorted(struct nexthop_group *nhg, +				  const struct nexthop *nh); +  void copy_nexthops(struct nexthop **tnh, const struct nexthop *nh,  		   struct nexthop *rparent);  | 
