diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/DHT.c | 14 | ||||
-rw-r--r-- | core/DHT.h | 11 |
2 files changed, 12 insertions, 13 deletions
@@ -16,10 +16,10 @@ int ping(IP_Port ip_port) | |||
16 | char data[37]; | 16 | char data[37]; |
17 | data[0] = 00; | 17 | data[0] = 00; |
18 | memcpy(data + 5, self_client_id, 32); | 18 | memcpy(data + 5, self_client_id, 32); |
19 | ADDR addr = {.family = AF_INET, .ip = ip_port.ip, .port = ip_port.port}; | 19 | //ADDR addr = {.family = AF_INET, .ip = ip_port.ip, .port = ip_port.port}; |
20 | 20 | ||
21 | return sendto(sock, data, sizeof(data) - 1, 0, (struct sockaddr *)&addr, addrlen); | 21 | //return sendto(sock, data, sizeof(data) - 1, 0, (struct sockaddr *)&addr, addrlen); |
22 | //sendto(int socket_descriptor, char *buffer, int buffer_length, int flags, struct sockaddr *destination_address, int address_length); | 22 | //sendto(int socket_descriptor, char *buffer, int buffer_length, int flags, struct sockaddr *destination_address, int address_length); |
23 | } | 23 | } |
24 | 24 | ||
25 | 25 | ||
@@ -36,7 +36,7 @@ void addfriend(char * client_id) | |||
36 | 36 | ||
37 | 37 | ||
38 | 38 | ||
39 | char delfriend(char * client_id); | 39 | char delfriend(char * client_id) |
40 | { | 40 | { |
41 | 41 | ||
42 | 42 | ||
@@ -60,8 +60,7 @@ IP_Port getfriendip(char * client_id) | |||
60 | 60 | ||
61 | void DHT_recvpacket(char * packet, uint32_t length) | 61 | void DHT_recvpacket(char * packet, uint32_t length) |
62 | { | 62 | { |
63 | 63 | ||
64 | |||
65 | } | 64 | } |
66 | 65 | ||
67 | 66 | ||
@@ -83,4 +82,5 @@ void bootstrap(IP_Port ip_port) | |||
83 | 82 | ||
84 | 83 | ||
85 | 84 | ||
86 | } \ No newline at end of file | 85 | } |
86 | |||
@@ -4,13 +4,10 @@ | |||
4 | #include <string.h> | 4 | #include <string.h> |
5 | #include <time.h> | 5 | #include <time.h> |
6 | 6 | ||
7 | #ifdef WIN32 | 7 | #ifdef WIN32 //Put win32 includes here |
8 | 8 | ||
9 | |||
10 | //Put win32 includes here | ||
11 | #include <windows.h> | ||
12 | #include <winsock2.h> | 9 | #include <winsock2.h> |
13 | 10 | #include <windows.h> | |
14 | 11 | ||
15 | #else //Linux includes | 12 | #else //Linux includes |
16 | 13 | ||
@@ -116,4 +113,6 @@ uint16_t num_friends; | |||
116 | //TODO: make this more efficient looping up to 128 times is a bit... | 113 | //TODO: make this more efficient looping up to 128 times is a bit... |
117 | Pinged pings[128]; | 114 | Pinged pings[128]; |
118 | 115 | ||
119 | Pinged send_nodes[64]; \ No newline at end of file | 116 | Pinged send_nodes[64]; |
117 | |||
118 | |||