From ebabaa69c0a3ba992895c7a66729e81e0923d5f1 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Thu, 5 Apr 2018 17:53:27 +0200 Subject: Initial commit. Signed-off-by: Toni Uhlig --- src/socket.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/socket.h (limited to 'src/socket.h') diff --git a/src/socket.h b/src/socket.h new file mode 100644 index 0000000..1b1a762 --- /dev/null +++ b/src/socket.h @@ -0,0 +1,19 @@ +#ifndef POTD_SOCKET_H +#define POTD_SOCKET_H 1 + +#include + +#define POTD_BACKLOG 3 + +typedef struct psocket { + int fd; + struct sockaddr_in sock; +} psocket; + + +int socket_init_in(psocket *psocket, const char *listen_addr, + unsigned int listen_port); + +int socket_bind_listen(psocket *psocket); + +#endif -- cgit v1.2.3