Cleanup: remove duplicated implementation of rculfhash
[lttng-tools.git] / src / common / sessiond-comm / inet.h
index 89716b8bafdb0b19cfaa1cca503e34af140711dc..83209bb719fff759e4719ed48f34cf69bb8fd7a2 100644 (file)
 
 #include "sessiond-comm.h"
 
+/* See man tcp(7) for more detail about this value. */
+#define LTTCOMM_INET_PROC_SYN_RETRIES_PATH "/proc/sys/net/ipv4/tcp_syn_retries"
+#define LTTCOMM_INET_PROC_FIN_TIMEOUT_PATH "/proc/sys/net/ipv4/tcp_fin_timeout"
+
+/*
+ * The timeout value of a connect() is computed with an algorithm inside the
+ * kernel using the defined TCP SYN retries so the end value in time is
+ * approximative. According to tcp(7) man page, a value of 5 is roughly 180
+ * seconds of timeout. With that information, we've computed a factor of 36
+ * (180/5) by considering that it grows linearly. This is of course uncertain
+ * but this is the best approximation we can do at runtime.
+ */
+#define LTTCOMM_INET_SYN_TIMEOUT_FACTOR                36
+
+/*
+ * Maximum timeout value in seconds of a TCP connection for both send/recv and
+ * connect operations.
+ */
+extern unsigned long lttcomm_inet_tcp_timeout;
+
 /* Stub */
 struct lttcomm_sock;
 
@@ -41,4 +61,7 @@ extern ssize_t lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
 extern ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
                size_t len, int flags);
 
+/* Initialize inet communication layer. */
+extern void lttcomm_inet_init(void);
+
 #endif /* _LTTCOMM_INET_H */
This page took 0.023361 seconds and 4 git commands to generate.