summaryrefslogtreecommitdiffstats
path: root/lib/net/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/common.h')
-rw-r--r--lib/net/common.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/net/common.h b/lib/net/common.h
new file mode 100644
index 0000000..f7c4c9a
--- /dev/null
+++ b/lib/net/common.h
@@ -0,0 +1,19 @@
+#ifndef NET__COMMON_H
+#define NET__COMMON_H
+
+#include "../common.h"
+
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/tcp.h>
+
+typedef struct {
+ int conn_socket_fd;
+} conn_t;
+
+struct sockaddr_in* get_addr(const char* addr, const char* port);
+
+int conn_configure_tcpalive(conn_t* conn);
+void conn_close(conn_t* conn);
+
+#endif // NET__COMMON_H