15 lines
467 B
C
15 lines
467 B
C
#include "dht.h"
|
|
|
|
#define cpy(x, y, z) char *x_c = x; char *y_c = y; while(*y_c && z--) *x_c++ = *y_c++
|
|
|
|
void lookup_request_init(lookup_request* lr, int node_id, char *node_ip, int node_port, uint16_t hash_id, char *node_request)
|
|
{
|
|
int size = NODE_IP_MAX_SIZE;
|
|
lr->node_id = node_id;
|
|
{ cpy(lr->node_ip, node_ip, size); }
|
|
lr->node_port = node_port;
|
|
lr->hash_id = hash_id;
|
|
size = HTTP_MAX_SIZE;
|
|
cpy(lr->node_request, node_request, size);
|
|
}
|