summaryrefslogtreecommitdiffstats
path: root/lib/net/common.h
diff options
context:
space:
mode:
authormrfoxygmfr <mrfoxygmfr@sch9.ru>2025-05-20 21:50:25 +0300
committermrfoxygmfr <mrfoxygmfr@sch9.ru>2025-05-20 21:50:58 +0300
commit6416c8feecc760807f4edf5d9c8e8be9c2df8981 (patch)
tree8a8b734e3ab97060c7ed239f6217b5985b7f1189 /lib/net/common.h
parent78bd565b9c54a962e28ea4865be286b0605ca941 (diff)
feat(lib/net): network library implemented
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