aboutsummaryrefslogtreecommitdiff
path: root/src/socket.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-04-05 17:53:27 +0200
committerToni Uhlig <matzeton@googlemail.com>2018-04-07 00:03:28 +0200
commitebabaa69c0a3ba992895c7a66729e81e0923d5f1 (patch)
tree39b4a5b90a4f51c98486e8a00898e983b8878a12 /src/socket.h
Initial commit.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/socket.h')
-rw-r--r--src/socket.h19
1 files changed, 19 insertions, 0 deletions
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 <netinet/in.h>
+
+#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