summaryrefslogtreecommitdiff
path: root/testing/DHT_test.c
diff options
context:
space:
mode:
authorslvr <slvr@unsafeio.com>2013-08-10 00:30:18 +0100
committerslvr <slvr@unsafeio.com>2013-08-10 00:43:50 +0100
commit6052b1f119d2b1494a7f2691f4dfed235b560636 (patch)
treeb3f24c586180ba526baf33e3d3814d3c10b8821d /testing/DHT_test.c
parent1ec95162a0b0c4f54bb97ca39684573e73beac87 (diff)
network_registerhandler
Diffstat (limited to 'testing/DHT_test.c')
-rw-r--r--testing/DHT_test.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/testing/DHT_test.c b/testing/DHT_test.c
index c8feaf4b..350093fd 100644
--- a/testing/DHT_test.c
+++ b/testing/DHT_test.c
@@ -156,14 +156,20 @@ int main(int argc, char *argv[])
156 bootstrap_ip_port.ip.i = inet_addr(argv[1]); 156 bootstrap_ip_port.ip.i = inet_addr(argv[1]);
157 DHT_bootstrap(bootstrap_ip_port, hex_string_to_bin(argv[3])); 157 DHT_bootstrap(bootstrap_ip_port, hex_string_to_bin(argv[3]));
158 158
159/*
159 IP_Port ip_port; 160 IP_Port ip_port;
160 uint8_t data[MAX_UDP_PACKET_SIZE]; 161 uint8_t data[MAX_UDP_PACKET_SIZE];
161 uint32_t length; 162 uint32_t length;
163*/
164
165 DHT_init();
166 friendreq_init();
162 167
163 while(1) { 168 while(1) {
164 169
165 doDHT(); 170 doDHT();
166 171
172/* slvrTODO:
167 while(receivepacket(&ip_port, data, &length) != -1) { 173 while(receivepacket(&ip_port, data, &length) != -1) {
168 if(DHT_handlepacket(data, length, ip_port) && friendreq_handlepacket(data, length, ip_port)) { 174 if(DHT_handlepacket(data, length, ip_port) && friendreq_handlepacket(data, length, ip_port)) {
169 //unhandled packet 175 //unhandled packet
@@ -172,11 +178,14 @@ int main(int argc, char *argv[])
172 printf("Received handled packet with length: %u\n", length); 178 printf("Received handled packet with length: %u\n", length);
173 } 179 }
174 } 180 }
181*/
182 networking_poll();
183
175 print_clientlist(); 184 print_clientlist();
176 print_friendlist(); 185 print_friendlist();
177 c_sleep(300); 186 c_sleep(300);
178 } 187 }
179 188
180 shutdown_networking(); 189 shutdown_networking();
181 return 0; 190 return 0;
182} 191}