summaryrefslogtreecommitdiff
path: root/core/DHT.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/DHT.h')
-rw-r--r--core/DHT.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/core/DHT.h b/core/DHT.h
index 7493761a..82a16cb7 100644
--- a/core/DHT.h
+++ b/core/DHT.h
@@ -1,3 +1,6 @@
1#ifndef DHT_H
2#define DHT_H
3
1#include <stdlib.h> 4#include <stdlib.h>
2#include <stdio.h> 5#include <stdio.h>
3#include <stdint.h> 6#include <stdint.h>
@@ -48,15 +51,22 @@ typedef struct
48 uint32_t timestamp; 51 uint32_t timestamp;
49 52
50}Client_data; 53}Client_data;
51 54//maximum number of clients stored per friend.
52 55#define MAX_FRIEND_CLIENTS 8
53typedef struct 56typedef struct
54{ 57{
55 char client_id[CLIENT_ID_SIZE]; 58 char client_id[CLIENT_ID_SIZE];
56 Client_data client_list[8]; 59 Client_data client_list[MAX_FRIEND_CLIENTS];
57 60
58}Friend; 61}Friend;
59 62
63
64typedef struct
65{
66 char client_id[CLIENT_ID_SIZE];
67 IP_Port ip_port;
68}Node_format;
69
60typedef struct 70typedef struct
61{ 71{
62 IP_Port ip_port; 72 IP_Port ip_port;
@@ -153,4 +163,6 @@ int sendpacket(IP_Port ip_port, char * data, uint32_t length);
153//Function to recieve data, ip and port of sender is put into ip_port 163//Function to recieve data, ip and port of sender is put into ip_port
154//the packet data into data 164//the packet data into data
155//the packet length into length. 165//the packet length into length.
156int recievepacket(IP_Port * ip_port, char * data, uint32_t * length); \ No newline at end of file 166int recievepacket(IP_Port * ip_port, char * data, uint32_t * length);
167
168#endif \ No newline at end of file