]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/linklist.c
lib: Allow adding arrays of ferr's
[mirror_frr.git] / lib / linklist.c
index 86649dd4952ec12dbdfec6c5272df9f8ce06ea8a..effd384e46d8971e643e74fa2029b34e87499572 100644 (file)
@@ -70,6 +70,26 @@ void listnode_add(struct list *list, void *val)
        list->count++;
 }
 
+void listnode_add_head(struct list *list, void *val)
+{
+       struct listnode *node;
+
+       assert(val != NULL);
+
+       node = listnode_new();
+
+       node->next = list->head;
+       node->data = val;
+
+       if (list->head == NULL)
+               list->head = node;
+       else
+               list->head->prev = node;
+       list->head = node;
+
+       list->count++;
+}
+
 void listnode_add_sort(struct list *list, void *val)
 {
        struct listnode *n;