summaryrefslogtreecommitdiff
path: root/nacl/curvecp/socket_recv.c
diff options
context:
space:
mode:
Diffstat (limited to 'nacl/curvecp/socket_recv.c')
-rw-r--r--nacl/curvecp/socket_recv.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/nacl/curvecp/socket_recv.c b/nacl/curvecp/socket_recv.c
deleted file mode 100644
index 8b266ba2..00000000
--- a/nacl/curvecp/socket_recv.c
+++ /dev/null
@@ -1,23 +0,0 @@
1#include <sys/types.h>
2#include <sys/socket.h>
3#include <netinet/in.h>
4#include <errno.h>
5#include "socket.h"
6#include "byte.h"
7
8long long socket_recv(int fd,unsigned char *x,long long xlen,unsigned char *ip,unsigned char *port)
9{
10 struct sockaddr_in sa;
11 socklen_t salen;
12 int r;
13
14 if (xlen < 0) { errno = EPROTO; return -1; }
15 if (xlen > 1048576) xlen = 1048576;
16
17 byte_zero(&sa,sizeof sa);
18 salen = sizeof sa;
19 r = recvfrom(fd,x,xlen,0,(struct sockaddr *) &sa,&salen);
20 byte_copy(ip,4,&sa.sin_addr);
21 byte_copy(port,2,&sa.sin_port);
22 return r;
23}