summaryrefslogtreecommitdiffstats
path: root/rtrlib/spki/hashtable/ht-spkitable_private.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:54:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:54:46 +0000
commitcd7b005519ade8ab6c97fcb21590b71b7d1be6e3 (patch)
treec611a8d0cd5e8f68f41b8c2d16ba580e0f40a38d /rtrlib/spki/hashtable/ht-spkitable_private.h
parentInitial commit. (diff)
downloadlibrtr-cd7b005519ade8ab6c97fcb21590b71b7d1be6e3.tar.xz
librtr-cd7b005519ade8ab6c97fcb21590b71b7d1be6e3.zip
Adding upstream version 0.8.0.upstream/0.8.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'rtrlib/spki/hashtable/ht-spkitable_private.h')
-rw-r--r--rtrlib/spki/hashtable/ht-spkitable_private.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/rtrlib/spki/hashtable/ht-spkitable_private.h b/rtrlib/spki/hashtable/ht-spkitable_private.h
new file mode 100644
index 0000000..05b0a48
--- /dev/null
+++ b/rtrlib/spki/hashtable/ht-spkitable_private.h
@@ -0,0 +1,35 @@
+/*
+ * This file is part of RTRlib.
+ *
+ * This file is subject to the terms and conditions of the MIT license.
+ * See the file LICENSE in the top level directory for more details.
+ *
+ * Website: http://rtrlib.realmv6.org/
+ */
+#ifndef RTR_HT_SPKITABLE_PRIVATE_H
+#define RTR_HT_SPKITABLE_PRIVATE_H
+
+#include "rtrlib/spki/spkitable_private.h"
+
+#include "third-party/tommyds/tommyhashlin.h"
+#include "third-party/tommyds/tommylist.h"
+
+typedef int (*hash_cmp_fp)(const void *arg, const void *obj);
+
+/**
+ * @brief spki_table.
+ * @param hashtable Linear hashtable
+ * @param list List that holds the same entries as hashtable, used to iterate.
+ * @param cmp_fp Compare function used to find entries in the hashtable
+ * @param update_fp Update function, called when the hashtable changes
+ * @param lock Read-Write lock to prevent data races
+ */
+struct spki_table {
+ tommy_hashlin hashtable;
+ tommy_list list;
+ hash_cmp_fp cmp_fp;
+ spki_update_fp update_fp;
+ pthread_rwlock_t lock;
+};
+
+#endif