diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-05-22 15:43:30 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-05-22 15:43:30 +0000 |
commit | b3d9661ee98a67d716eccded939690caedd7f271 (patch) | |
tree | 57f9d7baba81a74d63b7340aa079f9c6f5b9fcd4 | |
parent | 4af62f9eece2cabd6cd2693a7791e8a778ad3c93 (diff) | |
download | gnunet-b3d9661ee98a67d716eccded939690caedd7f271.tar.gz gnunet-b3d9661ee98a67d716eccded939690caedd7f271.zip |
testing port checking (incomplete)
-rw-r--r-- | src/testing/testing_new.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/testing/testing_new.c b/src/testing/testing_new.c index 087afb723..329f58c9d 100644 --- a/src/testing/testing_new.c +++ b/src/testing/testing_new.c | |||
@@ -31,6 +31,7 @@ | |||
31 | */ | 31 | */ |
32 | #include "platform.h" | 32 | #include "platform.h" |
33 | #include "gnunet_disk_lib.h" | 33 | #include "gnunet_disk_lib.h" |
34 | #include "gnunet_network_lib.h" | ||
34 | #include "gnunet_testing_lib-new.h" | 35 | #include "gnunet_testing_lib-new.h" |
35 | 36 | ||
36 | 37 | ||
@@ -193,6 +194,38 @@ uint16_t | |||
193 | reserve_port (struct GNUNET_TESTING_System *system, | 194 | reserve_port (struct GNUNET_TESTING_System *system, |
194 | int is_tcp) | 195 | int is_tcp) |
195 | { | 196 | { |
197 | /* struct GNUNET_NETWORK_Handle *socket; */ | ||
198 | /* struct sockaddr_in addr; */ | ||
199 | /* uint32_t *port_buckets; */ | ||
200 | /* uint32_t xor_image; */ | ||
201 | /* uint16_t index; */ | ||
202 | /* uint16_t buckets; */ | ||
203 | |||
204 | /* if (GNUNET_YES == is_tcp) */ | ||
205 | /* { */ | ||
206 | /* socket = GNUNET_NETWORK_socket_create (AF_INET, */ | ||
207 | /* SOCKET_STREAM, */ | ||
208 | /* 0); */ | ||
209 | /* port_buckets = system->reserved_tcp_ports; */ | ||
210 | /* } */ | ||
211 | /* else */ | ||
212 | /* { */ | ||
213 | /* socket = GNUNET_NETWORK_socket_create (AF_INET, */ | ||
214 | /* SOCKET_DGRAM, */ | ||
215 | /* 0); */ | ||
216 | /* port_buckets = system->reserved_udp_ports; */ | ||
217 | /* } */ | ||
218 | /* buckets = 65536 / 32; */ | ||
219 | /* for (index = (LOW_PORT / 32) + 1; index < (HIGH_PORT / 32); index++) */ | ||
220 | /* { */ | ||
221 | /* xor_image = ((uint32_t) 0xffffffff) ^ port_buckets[index]; */ | ||
222 | /* if (0 == xor_image) /\* Ports in the bucket are full *\/ */ | ||
223 | /* continue; */ | ||
224 | |||
225 | /* } */ | ||
226 | /* addr.sin_family = AF_INET; */ | ||
227 | /* addr.sin_port = ??; */ | ||
228 | |||
196 | GNUNET_break (0); | 229 | GNUNET_break (0); |
197 | return 0; | 230 | return 0; |
198 | } | 231 | } |