diff options
author | Uros Majstorovic <majstor@majstor.org> | 2022-08-09 21:54:45 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2022-08-09 21:54:45 +0200 |
commit | 810dde21ee65653c15606917b19566cfbaaf165e (patch) | |
tree | 4cd84b109e06660a9c59f2487822905e5672681e /ecp/server/ht.c | |
parent | aee853a208d6abec53ec81dc4ef110b63e13342f (diff) |
ecp server added
Diffstat (limited to 'ecp/server/ht.c')
-rw-r--r-- | ecp/server/ht.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ecp/server/ht.c b/ecp/server/ht.c new file mode 100644 index 0000000..0daf8d5 --- /dev/null +++ b/ecp/server/ht.c @@ -0,0 +1,34 @@ +#include <ecp/core.h> +#include <ecp/dir/dir.h> +#include <ecp/ht.h> + +#include "dir.h" +#include "ht.h" + +int ht_insert_node(ecp_ht_table_t *table, DirNode *node) { + return ecp_ht_insert(table, &node->dir_item.node.key_perma.public, node); +} + +void ht_remove_node(ecp_ht_table_t *table, DirNode *node) { + ecp_ht_remove(table, &node->dir_item.node.key_perma.public); +} + +void *ht_search_node(ecp_ht_table_t *table, DirNode *node) { + return ecp_ht_search(table, &node->dir_item.node.key_perma.public); +} + +int ht_insert_conn(ecp_ht_table_t *table, ECPConnection *conn) { + return ecp_ht_insert(table, &conn->remote.key_perma.public, conn); +} + +void ht_remove_conn(ecp_ht_table_t *table, ECPConnection *conn) { + ecp_ht_remove(table, &conn->remote.key_perma.public); +} + +void *ht_search_conn(ecp_ht_table_t *table, ECPConnection *conn) { + return ecp_ht_search(table, &conn->remote.key_perma.public); +} + +void *ht_search_item(ecp_ht_table_t *table, ECPDirItem *dir_item) { + return ecp_ht_search(table, &dir_item->node.key_perma.public); +} |