/* THE FINGER TABLE UPDATES*/
int distance_at_nodes(int a, int b)
{
/*a XOR b*/
return a ^ b;
}
/* INIT THE STRUCTURES OF DHT*/
void init_node_hashtable()
{
CIRCULAR_DEQUE *node = start;
/* CURRENT NODE IS NOT THE END*/
while (node != end)
{
for (int i = 0; i < HASHSIZE; i++)
{
strcpy(node->server.data[i], "NULL");
node->server.positions[i] = -1;
}
node->server.count_elem = 0;
node = node->after;
}
/* THE END NODE INIT*/
node->server.count_elem = 0;
for (int i = 0; i < HASHSIZE; i++)
{
strcpy(node->server.data[i], "NULL");
node->server.positions[i] = -1;
}
}