summaryrefslogtreecommitdiffstats
path: root/lib/hash.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-05-24 17:44:54 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-05-25 18:16:22 +0200
commit91f1037064d503f2e5f1756f66c10f3926960836 (patch)
tree0f2a75ac569e7f9127c856b7e34287db65f1188e /lib/hash.h
parentlib: add list_sort(), list_dup() (diff)
downloadfrr-91f1037064d503f2e5f1756f66c10f3926960836.tar.xz
frr-91f1037064d503f2e5f1756f66c10f3926960836.zip
lib: add hash_to_list()
Convenience function to convert hash table to an unsorted linked list. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/hash.h')
-rw-r--r--lib/hash.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/hash.h b/lib/hash.h
index b6fe27e25..2510422e2 100644
--- a/lib/hash.h
+++ b/lib/hash.h
@@ -106,6 +106,15 @@ extern void hash_walk(struct hash *, int (*)(struct hash_backet *, void *),
extern void hash_clean(struct hash *, void (*)(void *));
extern void hash_free(struct hash *);
+/*
+ * Converts a hash table to an unsorted linked list.
+ * Does not modify the hash table in any way.
+ *
+ * hash
+ * the hash to convert
+ */
+extern struct list *hash_to_list(struct hash *hash);
+
extern unsigned int string_hash_make(const char *);
extern void hash_cmd_init(void);