From 48eebc1951d08bced194289112643f91dfe59bc2 Mon Sep 17 00:00:00 2001 From: CPunch Date: Mon, 24 Jan 2022 10:17:54 -0600 Subject: [PATCH] Added laikaS_acceptFrom() to lsocket.h, added LAIKA_MAGIC & LAIKA_MAGICLEN --- lib/include/lpacket.h | 3 +++ lib/include/lsocket.h | 1 + 2 files changed, 4 insertions(+) diff --git a/lib/include/lpacket.h b/lib/include/lpacket.h index 366d0cb..3480975 100644 --- a/lib/include/lpacket.h +++ b/lib/include/lpacket.h @@ -1,6 +1,9 @@ #ifndef LAIKA_PACKET_H #define LAIKA_PACKET_H +#define LAIKA_MAGIC "LAI\x12" +#define LAIKA_MAGICLEN 4 + typedef enum { LAIKAPKT_HANDSHAKE_REQ, LAIKAPKT_HANDSHAKE_RES, diff --git a/lib/include/lsocket.h b/lib/include/lsocket.h index 64adcf4..c93b543 100644 --- a/lib/include/lsocket.h +++ b/lib/include/lsocket.h @@ -74,6 +74,7 @@ void laikaS_cleanSocket(struct sLaika_socket *sock); void laikaS_kill(struct sLaika_socket *sock); /* kills a socket */ void laikaS_connect(struct sLaika_socket *sock, char *ip, char *port); /* connect to ip & port */ void laikaS_bind(struct sLaika_socket *sock, uint16_t port); /* bind sock to port */ +void laikaS_acceptFrom(struct sLaika_socket *sock, struct sLaika_socket *from); bool laikaS_setNonBlock(struct sLaika_socket *sock); void laikaS_read(struct sLaika_socket *sock, void *buf, size_t sz); /* reads from inBuf */