summaryrefslogtreecommitdiff
path: root/core/network.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-05 17:00:39 -0400
committerirungentoo <irungentoo@gmail.com>2013-07-05 17:00:39 -0400
commita480c0195a78f56116b3bf58fe17d930bf4e64f4 (patch)
treec549b6347e28b8570ed27b5c53b768b8f7b11a61 /core/network.c
parent358f46f6483f0c24186272914952e44221c76871 (diff)
Crypto done(still need to test it a bit more thought)
Replaced chars with uint8_t Added a new test program. Added some functions to Lossless UDP. And some other stuff.
Diffstat (limited to 'core/network.c')
-rw-r--r--core/network.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/network.c b/core/network.c
index 601066cd..6b5f9970 100644
--- a/core/network.c
+++ b/core/network.c
@@ -63,10 +63,10 @@ static int sock;
63 63
64//Basic network functions: 64//Basic network functions:
65//Function to send packet(data) of length length to ip_port 65//Function to send packet(data) of length length to ip_port
66int sendpacket(IP_Port ip_port, char * data, uint32_t length) 66int sendpacket(IP_Port ip_port, uint8_t * data, uint32_t length)
67{ 67{
68 ADDR addr = {AF_INET, ip_port.port, ip_port.ip}; 68 ADDR addr = {AF_INET, ip_port.port, ip_port.ip};
69 return sendto(sock, data, length, 0, (struct sockaddr *)&addr, sizeof(addr)); 69 return sendto(sock,(char *) data, length, 0, (struct sockaddr *)&addr, sizeof(addr));
70 70
71} 71}
72 72
@@ -74,7 +74,7 @@ int sendpacket(IP_Port ip_port, char * data, uint32_t length)
74//the packet data into data 74//the packet data into data
75//the packet length into length. 75//the packet length into length.
76//dump all empty packets. 76//dump all empty packets.
77int recievepacket(IP_Port * ip_port, char * data, uint32_t * length) 77int recievepacket(IP_Port * ip_port, uint8_t * data, uint32_t * length)
78{ 78{
79 ADDR addr; 79 ADDR addr;
80 #ifdef WIN32 80 #ifdef WIN32
@@ -82,7 +82,7 @@ int recievepacket(IP_Port * ip_port, char * data, uint32_t * length)
82 #else 82 #else
83 uint32_t addrlen = sizeof(addr); 83 uint32_t addrlen = sizeof(addr);
84 #endif 84 #endif
85 (*(int32_t *)length) = recvfrom(sock, data, MAX_UDP_PACKET_SIZE, 0, (struct sockaddr *)&addr, &addrlen); 85 (*(int32_t *)length) = recvfrom(sock,(char *) data, MAX_UDP_PACKET_SIZE, 0, (struct sockaddr *)&addr, &addrlen);
86 if(*(int32_t *)length <= 0) 86 if(*(int32_t *)length <= 0)
87 { 87 {
88 //nothing received 88 //nothing received