From: Sree Harsha Totakura Date: Tue, 22 May 2012 15:43:30 +0000 (+0000) Subject: testing port checking (incomplete) X-Git-Tag: initial-import-from-subversion-38251~13427 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b3d9661ee98a67d716eccded939690caedd7f271;p=oweals%2Fgnunet.git testing port checking (incomplete) --- 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 @@ */ #include "platform.h" #include "gnunet_disk_lib.h" +#include "gnunet_network_lib.h" #include "gnunet_testing_lib-new.h" @@ -193,6 +194,38 @@ uint16_t reserve_port (struct GNUNET_TESTING_System *system, int is_tcp) { + /* struct GNUNET_NETWORK_Handle *socket; */ + /* struct sockaddr_in addr; */ + /* uint32_t *port_buckets; */ + /* uint32_t xor_image; */ + /* uint16_t index; */ + /* uint16_t buckets; */ + + /* if (GNUNET_YES == is_tcp) */ + /* { */ + /* socket = GNUNET_NETWORK_socket_create (AF_INET, */ + /* SOCKET_STREAM, */ + /* 0); */ + /* port_buckets = system->reserved_tcp_ports; */ + /* } */ + /* else */ + /* { */ + /* socket = GNUNET_NETWORK_socket_create (AF_INET, */ + /* SOCKET_DGRAM, */ + /* 0); */ + /* port_buckets = system->reserved_udp_ports; */ + /* } */ + /* buckets = 65536 / 32; */ + /* for (index = (LOW_PORT / 32) + 1; index < (HIGH_PORT / 32); index++) */ + /* { */ + /* xor_image = ((uint32_t) 0xffffffff) ^ port_buckets[index]; */ + /* if (0 == xor_image) /\* Ports in the bucket are full *\/ */ + /* continue; */ + + /* } */ + /* addr.sin_family = AF_INET; */ + /* addr.sin_port = ??; */ + GNUNET_break (0); return 0; }