Implemented DHT
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#define NODE_IP_MAX_SIZE 16
|
||||
|
||||
typedef struct{
|
||||
int message_type;
|
||||
int node_id;
|
||||
char node_ip[NODE_IP_MAX_SIZE];
|
||||
int node_port;
|
||||
@@ -14,7 +15,13 @@ typedef struct{
|
||||
char node_request[HTTP_MAX_SIZE];
|
||||
}lookup_request;
|
||||
|
||||
void lookup_request_init(lookup_request*, int node_id, char *node_ip, int node_port, uint16_t hash_id, char *node_request);
|
||||
void create_lookup_request(lookup_request*, char *request);
|
||||
void lookup_request_init(lookup_request*, int message_type, int node_id, char *node_ip, int node_port, uint16_t hash_id, char *node_request);
|
||||
void build_lookup_request(lookup_request*);
|
||||
|
||||
void extract_lookup_request(lookup_request*, char*);
|
||||
|
||||
int call_network(lookup_request*, char*, int);
|
||||
|
||||
void clone_lookup_request(lookup_request* dest, lookup_request* source);
|
||||
|
||||
#endif //DHT_H
|
||||
|
||||
Reference in New Issue
Block a user