diff options
-rw-r--r-- | core/Lossless_UDP.c | 4 | ||||
-rw-r--r-- | core/Lossless_UDP.h | 5 | ||||
-rw-r--r-- | core/network.c | 4 | ||||
-rw-r--r-- | core/network.h | 2 | ||||
-rw-r--r-- | docs/TODO.txt | 5 |
5 files changed, 15 insertions, 5 deletions
diff --git a/core/Lossless_UDP.c b/core/Lossless_UDP.c index bf9fa893..7513e5b4 100644 --- a/core/Lossless_UDP.c +++ b/core/Lossless_UDP.c | |||
@@ -27,11 +27,11 @@ | |||
27 | 27 | ||
28 | 28 | ||
29 | 29 | ||
30 | //maximum data packets in sent and recieve queues. | 30 | //maximum data packets in sent and recieve queues. |
31 | #define MAX_QUEUE_NUM 16 | 31 | #define MAX_QUEUE_NUM 16 |
32 | 32 | ||
33 | //maximum length of the data in the data packets | 33 | //maximum length of the data in the data packets |
34 | #define MAX_DATA_SIZE 1024 | 34 | //#define MAX_DATA_SIZE 1024 //defined in Lossless_UDP.h |
35 | 35 | ||
36 | //maximum number of data packets in the buffer | 36 | //maximum number of data packets in the buffer |
37 | #define BUFFER_PACKET_NUM (16-1) | 37 | #define BUFFER_PACKET_NUM (16-1) |
diff --git a/core/Lossless_UDP.h b/core/Lossless_UDP.h index 91e71019..8bdeb43e 100644 --- a/core/Lossless_UDP.h +++ b/core/Lossless_UDP.h | |||
@@ -28,6 +28,11 @@ | |||
28 | #include "network.h" | 28 | #include "network.h" |
29 | 29 | ||
30 | 30 | ||
31 | //maximum length of the data in the data packets | ||
32 | #define MAX_DATA_SIZE 1024 | ||
33 | |||
34 | |||
35 | |||
31 | //Functions | 36 | //Functions |
32 | 37 | ||
33 | //initialize a new connection to ip_port | 38 | //initialize a new connection to ip_port |
diff --git a/core/network.c b/core/network.c index e7999416..35257d54 100644 --- a/core/network.c +++ b/core/network.c | |||
@@ -40,10 +40,10 @@ uint64_t current_time() | |||
40 | 40 | ||
41 | } | 41 | } |
42 | 42 | ||
43 | int random_int() | 43 | uint32_t random_int() |
44 | { | 44 | { |
45 | #ifdef WIN32 | 45 | #ifdef WIN32 |
46 | //TODO replace rand with a more random windows function | 46 | //TODO replace rand with something cryptograhically secure |
47 | return rand(); | 47 | return rand(); |
48 | #else | 48 | #else |
49 | return random(); | 49 | return random(); |
diff --git a/core/network.h b/core/network.h index da92837d..f84ceccb 100644 --- a/core/network.h +++ b/core/network.h | |||
@@ -80,7 +80,7 @@ typedef struct | |||
80 | uint64_t current_time(); | 80 | uint64_t current_time(); |
81 | 81 | ||
82 | //return a random number | 82 | //return a random number |
83 | int random_int(); | 83 | uint32_t random_int(); |
84 | 84 | ||
85 | //Basic network functions: | 85 | //Basic network functions: |
86 | 86 | ||
diff --git a/docs/TODO.txt b/docs/TODO.txt index 8b7020c2..d9c988a2 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt | |||
@@ -15,6 +15,11 @@ Things to do now: | |||
15 | 15 | ||
16 | -Add NaCl to our build system. | 16 | -Add NaCl to our build system. |
17 | 17 | ||
18 | -Make NaCl work on windows | ||
19 | The randombytes function for example in NaCl needs to be ported to windows (it works by reading bytes from /dev/urandom) | ||
20 | The first result on google for how to compile it on windows replaces /dev/urandom with rand() (DO NOT DO THIS) | ||
21 | Instead replace it with RtlGenRandom() or rand_s(). | ||
22 | |||
18 | -Crypto (In progress) | 23 | -Crypto (In progress) |
19 | 24 | ||
20 | -Find and fix bugs in the code. | 25 | -Find and fix bugs in the code. |