summaryrefslogtreecommitdiff
path: root/code/ecp/posix
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2018-01-16 23:43:07 +0100
committerUros Majstorovic <majstor@majstor.org>2018-01-16 23:43:07 +0100
commit01c3e3af2394f863323b846fa304ff7e0a30e9df (patch)
tree84b499e6ece88e637ed86bbdd87333613e2433c5 /code/ecp/posix
parent0d0e9facfcea3cf96da3b63285865182fdd5477e (diff)
eos support
Diffstat (limited to 'code/ecp/posix')
-rw-r--r--code/ecp/posix/Makefile2
-rw-r--r--code/ecp/posix/transport.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/code/ecp/posix/Makefile b/code/ecp/posix/Makefile
index 6dd42e2..595b0b5 100644
--- a/code/ecp/posix/Makefile
+++ b/code/ecp/posix/Makefile
@@ -1,4 +1,4 @@
-include ../../Makefile.platform
+include ../Makefile.platform
CFLAGS=$(CFLAGS_PL) $(PIC) -I..
obj_tr = transport.o
diff --git a/code/ecp/posix/transport.c b/code/ecp/posix/transport.c
index df8e0f5..bdd166a 100644
--- a/code/ecp/posix/transport.c
+++ b/code/ecp/posix/transport.c
@@ -71,17 +71,17 @@ static void t_close(int *sock) {
close(*sock);
}
-static ssize_t t_send(int *sock, void *msg, size_t msg_size, ECPNetAddr *addr) {
+static ssize_t t_send(int *sock, ECPBuffer *packet, size_t msg_size, ECPNetAddr *addr, unsigned char flags) {
struct sockaddr_in servaddr;
memset((void *)&servaddr, 0, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_port = addr->port;
memcpy((void *)&servaddr.sin_addr, addr->host, sizeof(addr->host));
- return sendto(*sock, msg, msg_size, 0, (struct sockaddr *)&servaddr, sizeof(servaddr));
+ return sendto(*sock, packet->buffer, msg_size, 0, (struct sockaddr *)&servaddr, sizeof(servaddr));
}
-static ssize_t t_recv(int *sock, void *msg, size_t msg_size, ECPNetAddr *addr, int timeout) {
+static ssize_t t_recv(int *sock, ECPBuffer *packet, ECPNetAddr *addr, int timeout) {
struct sockaddr_in servaddr;
socklen_t addrlen = sizeof(servaddr);
struct pollfd fds[] = {
@@ -91,7 +91,7 @@ static ssize_t t_recv(int *sock, void *msg, size_t msg_size, ECPNetAddr *addr, i
int rv = poll(fds, 1, timeout);
memset((void *)&servaddr, 0, sizeof(servaddr));
if (rv == 1) {
- ssize_t recvlen = recvfrom(*sock, msg, msg_size, 0, (struct sockaddr *)&servaddr, &addrlen);
+ ssize_t recvlen = recvfrom(*sock, packet->buffer, packet->size, 0, (struct sockaddr *)&servaddr, &addrlen);
if (recvlen < 0) return recvlen;
if (recvlen < ECP_MIN_PKT) return ECP_ERR_RECV;