diff options
author | irungentoo <irungentoo@gmail.com> | 2013-06-24 00:40:33 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-06-24 00:40:33 -0400 |
commit | f3dfd885ccaa7b94fe2937580b27358473b2ad48 (patch) | |
tree | 7645e68d56d568598b0c5b15a47d3fb7dba9ff22 /core | |
parent | 6e881efad6fc6e26350c64376e7265e90ef0c08d (diff) |
Updated readme and DHT.h
Diffstat (limited to 'core')
-rw-r--r-- | core/DHT.h | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -53,6 +53,13 @@ typedef struct | |||
53 | 53 | ||
54 | }Friend; | 54 | }Friend; |
55 | 55 | ||
56 | typedef struct | ||
57 | { | ||
58 | IP_Port ip_port; | ||
59 | uint32_t ping_id; | ||
60 | uint32_t timestamp; | ||
61 | |||
62 | }Pinged; | ||
56 | 63 | ||
57 | 64 | ||
58 | //Add a new friend to the friends list | 65 | //Add a new friend to the friends list |
@@ -92,6 +99,9 @@ void bootstrap(IP_Port ip_port); | |||
92 | 99 | ||
93 | //Global variables | 100 | //Global variables |
94 | 101 | ||
102 | //Our client id | ||
103 | char self_client_id[32]; | ||
104 | |||
95 | //Our UDP socket. | 105 | //Our UDP socket. |
96 | //We only use one so it's much easier to have it as a global variable | 106 | //We only use one so it's much easier to have it as a global variable |
97 | int sock; | 107 | int sock; |
@@ -99,4 +109,11 @@ int sock; | |||
99 | Client_data client_list[32]; | 109 | Client_data client_list[32]; |
100 | 110 | ||
101 | //Let's start with a static array for testing. | 111 | //Let's start with a static array for testing. |
102 | Friend friends_list[256] \ No newline at end of file | 112 | Friend friends_list[256]; |
113 | uint16_t num_friends; | ||
114 | |||
115 | //The list of ip ports along with the ping_id of what we sent them and a timestamp | ||
116 | //TODO: make this more efficient looping up to 128 times is a bit... | ||
117 | Pinged pings[128]; | ||
118 | |||
119 | Pinged send_nodes[64]; \ No newline at end of file | ||