summaryrefslogtreecommitdiff
path: root/ecp/src/ecp/htable/htable.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2022-03-12 13:08:52 +0100
committerUros Majstorovic <majstor@majstor.org>2022-03-12 13:08:52 +0100
commit3436ce5d3ffbc2777e785310bac971c830cbb4ff (patch)
treec3ffb0d18bb992e8b97818e4d0b369844979012d /ecp/src/ecp/htable/htable.c
parentd359dd9981f4137e8873a7a571e5c54c5b2449c4 (diff)
new rev compile OK
Diffstat (limited to 'ecp/src/ecp/htable/htable.c')
-rw-r--r--ecp/src/ecp/htable/htable.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/ecp/src/ecp/htable/htable.c b/ecp/src/ecp/htable/htable.c
index 104d2aa..bd8ab2d 100644
--- a/ecp/src/ecp/htable/htable.c
+++ b/ecp/src/ecp/htable/htable.c
@@ -1,28 +1,34 @@
+#include <stdlib.h>
+
#include <core.h>
-#include <ht.h>
#include <cr.h>
+#include <tr.h>
+#include <ht.h>
#include "hashtable.h"
-void *ecp_ht_create(ECPContext *ctx) {
- return hashtable_create(1000, (unsigned int (*)(void *))ecp_cr_dh_pub_hash_fn, (int (*)(void *, void *))ecp_cr_dh_pub_hash_eq);
+void *ecp_ht_create_keys(void) {
+ return hashtable_create(1000, (unsigned int (*)(void *))ecp_ecdh_pub_hash, (int (*)(void *, void *))ecp_ecdh_pub_eq);
+}
+
+void *ecp_ht_create_addrs(void) {
+ return hashtable_create(1000, (unsigned int (*)(void *))ecp_tr_addr_hash, (int (*)(void *, void *))ecp_tr_addr_eq);
}
void ecp_ht_destroy(void *h) {
hashtable_destroy(h, 0);
}
-int ecp_ht_insert(void *h, unsigned char *k, ECPConnection *v) {
+int ecp_ht_insert(void *h, void *k, ECPConnection *v) {
int rv = hashtable_insert(h, k, v);
if (!rv) return ECP_ERR;
return ECP_OK;
}
-ECPConnection *ecp_ht_remove(void *h, unsigned char *k) {
+ECPConnection *ecp_ht_remove(void *h, void *k) {
return hashtable_remove(h, k);
}
-ECPConnection *ecp_ht_search(void *h, unsigned char *k) {
+ECPConnection *ecp_ht_search(void *h, void *k) {
return hashtable_search(h, k);
}
-