TODO updated.

This commit is contained in:
irungentoo 2013-07-03 09:45:01 -04:00
parent 1767fd574e
commit c86c1c8132
5 changed files with 15 additions and 5 deletions

View File

@ -27,11 +27,11 @@
//maximum data packets in sent and recieve queues.
//maximum data packets in sent and recieve queues.
#define MAX_QUEUE_NUM 16
//maximum length of the data in the data packets
#define MAX_DATA_SIZE 1024
//#define MAX_DATA_SIZE 1024 //defined in Lossless_UDP.h
//maximum number of data packets in the buffer
#define BUFFER_PACKET_NUM (16-1)

View File

@ -28,6 +28,11 @@
#include "network.h"
//maximum length of the data in the data packets
#define MAX_DATA_SIZE 1024
//Functions
//initialize a new connection to ip_port

View File

@ -40,10 +40,10 @@ uint64_t current_time()
}
int random_int()
uint32_t random_int()
{
#ifdef WIN32
//TODO replace rand with a more random windows function
//TODO replace rand with something cryptograhically secure
return rand();
#else
return random();

View File

@ -80,7 +80,7 @@ typedef struct
uint64_t current_time();
//return a random number
int random_int();
uint32_t random_int();
//Basic network functions:

View File

@ -15,6 +15,11 @@ Things to do now:
-Add NaCl to our build system.
-Make NaCl work on windows
The randombytes function for example in NaCl needs to be ported to windows (it works by reading bytes from /dev/urandom)
The first result on google for how to compile it on windows replaces /dev/urandom with rand() (DO NOT DO THIS)
Instead replace it with RtlGenRandom() or rand_s().
-Crypto (In progress)
-Find and fix bugs in the code.