summaryrefslogtreecommitdiff
path: root/lib/linklist.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-08-10 23:21:59 -0300
committerRenato Westphal <renato@opensourcerouting.org>2020-08-11 20:41:44 -0300
commit0f16688138d40affba369a6e2f394b3a5d4c3bb4 (patch)
tree45ca51783536254928f3ef871beffdc747933837 /lib/linklist.h
parente26e2c15e9e5b7a61512a789a25809038805db47 (diff)
lib: introduce new list_dup() API
This new function will be used by the upcoming TI-LFA code. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/linklist.h')
-rw-r--r--lib/linklist.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/linklist.h b/lib/linklist.h
index 94a1a1604a..d8820c924d 100644
--- a/lib/linklist.h
+++ b/lib/linklist.h
@@ -327,6 +327,19 @@ extern void list_filter_out_nodes(struct list *list, bool (*cond)(void *data));
*/
extern bool listnode_add_sort_nodup(struct list *list, void *val);
+
+/*
+ * Duplicate the specified list, creating a shallow copy of each of its
+ * elements.
+ *
+ * list
+ * list to duplicate
+ *
+ * Returns:
+ * the duplicated list
+ */
+extern struct list *list_dup(struct list *list);
+
/* List iteration macro.
* Usage: for (ALL_LIST_ELEMENTS (...) { ... }
* It is safe to delete the listnode using this macro.