summaryrefslogtreecommitdiff
path: root/lib/nexthop.h
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2020-01-13 13:29:58 -0500
committerStephen Worley <sworley@cumulusnetworks.com>2020-01-15 13:35:04 -0500
commit77bf9504bfcdb977cda2addca27254e22be52f2f (patch)
tree874f0c4118ceafffeafd6c25cd833060f1276a60 /lib/nexthop.h
parent0fff714efa1959f48c8e1d88e88968d15c1ffe78 (diff)
lib,zebra: tighten up the nexthop_copy/nexthop_dup APIs
Make the nexthop_copy/nexthop_dup APIs more consistent by adding a secondary, non-recursive, version of them. Before, it was inconsistent whether the APIs were expected to copy recursive info or not. Make it clear now that the default is recursive info is copied unless the _no_recurse() version is called. These APIs are not heavily used so it is fine to change them for now. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'lib/nexthop.h')
-rw-r--r--lib/nexthop.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/nexthop.h b/lib/nexthop.h
index 040b643a84..cb5efe00cc 100644
--- a/lib/nexthop.h
+++ b/lib/nexthop.h
@@ -187,9 +187,16 @@ extern unsigned int nexthop_level(struct nexthop *nexthop);
/* Copies to an already allocated nexthop struct */
extern void nexthop_copy(struct nexthop *copy, const struct nexthop *nexthop,
struct nexthop *rparent);
+/* Copies to an already allocated nexthop struct, not including recurse info */
+extern void nexthop_copy_no_recurse(struct nexthop *copy,
+ const struct nexthop *nexthop,
+ struct nexthop *rparent);
/* Duplicates a nexthop and returns the newly allocated nexthop */
extern struct nexthop *nexthop_dup(const struct nexthop *nexthop,
struct nexthop *rparent);
+/* Duplicates a nexthop and returns the newly allocated nexthop */
+extern struct nexthop *nexthop_dup_no_recurse(const struct nexthop *nexthop,
+ struct nexthop *rparent);
#ifdef __cplusplus
}