aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-05-22 15:43:30 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-05-22 15:43:30 +0000
commitb3d9661ee98a67d716eccded939690caedd7f271 (patch)
tree57f9d7baba81a74d63b7340aa079f9c6f5b9fcd4 /src
parent4af62f9eece2cabd6cd2693a7791e8a778ad3c93 (diff)
downloadgnunet-b3d9661ee98a67d716eccded939690caedd7f271.tar.gz
gnunet-b3d9661ee98a67d716eccded939690caedd7f271.zip
testing port checking (incomplete)
Diffstat (limited to 'src')
-rw-r--r--src/testing/testing_new.c33
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
193reserve_port (struct GNUNET_TESTING_System *system, 194reserve_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}