mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-01-04 18:27:53 +00:00
zebra: Add function to duplicate nhg dependencies
Add a function to duplicate a nhg dependency linked list. We will use this for duplicating the dependency list rather than the linked list dup function in lib/linkedlist. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
parent
55eeb2ae7f
commit
d6e0094f88
@ -96,6 +96,28 @@ struct list *nhg_depend_new_list()
|
||||
return nhg_depends;
|
||||
}
|
||||
|
||||
/**
|
||||
* nhg_depend_dup_list() - Duplicate the dependency linked list
|
||||
*
|
||||
* @from: List to duplicate
|
||||
*
|
||||
* Return: New list
|
||||
*/
|
||||
struct list *nhg_depend_dup_list(struct list *from)
|
||||
{
|
||||
struct list *to = NULL;
|
||||
struct listnode *ln = NULL;
|
||||
struct nhg_depend *n_dp = NULL;
|
||||
|
||||
to = nhg_depend_new_list();
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(from, ln, n_dp)) {
|
||||
nhg_depend_add(to, n_dp->nhe);
|
||||
}
|
||||
|
||||
return to;
|
||||
}
|
||||
|
||||
/**
|
||||
* zebra_nhg_lookup_id() - Lookup the nexthop group id in the id table
|
||||
*
|
||||
|
||||
@ -90,6 +90,7 @@ extern struct nhg_depend *nhg_depend_new(void);
|
||||
extern void nhg_depend_free(struct nhg_depend *depends);
|
||||
|
||||
extern struct list *nhg_depend_new_list(void);
|
||||
extern struct list *nhg_depend_dup_list(struct list *from);
|
||||
|
||||
extern struct nhg_hash_entry *zebra_nhg_lookup_id(uint32_t id);
|
||||
extern int zebra_nhg_insert_id(struct nhg_hash_entry *nhe);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user