summaryrefslogtreecommitdiff
path: root/ecp/server/ht.c
blob: 0daf8d58009c299a7c5e18aa3bdddda388c82e0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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);
}