select: gather statistics for TCP connections

osmocom applications are deployed in a variety of different situations.
Dependung on the medium that interconnects the network components
unexpected behaviour may occur. To debug problems with the
interconnection between network components it might help to monitor the
health of the related TCP connections.

Change-Id: I1416f95aff2adcf13689646b7574845de169fa3d
Related: SYS#5701
diff --git a/configure.ac b/configure.ac
index a69f793..8fb299b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -516,6 +516,28 @@
 CHECK_BUILTIN_SUPPORT([__builtin_cpu_supports],
   [Runtime SIMD detection will be disabled])
 
+dnl There are some members in struct tcp_info that might not exist on all linux versions
+AC_CHECK_MEMBER([struct tcp_info.tcpi_rwnd_limited],
+		AC_DEFINE([HAVE_TCP_INFO_TCPI_RWND_LIMITED],
+		[1],
+		[Define to 1 if your <linux/tcp.h> header file have the tcpi_rwnd_limited member in struct tcp_info]),
+		[],
+		[#include <linux/tcp.h>])
+
+AC_CHECK_MEMBER([struct tcp_info.tcpi_sndbuf_limited],
+		AC_DEFINE([HAVE_TCP_INFO_TCPI_SNDBUF_LIMITED],
+		[1],
+		[Define to 1 if your <linux/tcp.h> header file have the tcpi_sndbuf_limited member in struct tcp_info]),
+		[],
+		[#include <linux/tcp.h>])
+
+AC_CHECK_MEMBER([struct tcp_info.tcpi_reord_seen],
+		AC_DEFINE([HAVE_TCP_INFO_TCPI_REORD_SEEN],
+		[1],
+		[Define to 1 if your <linux/tcp.h> header file have the tcpi_reord_seen member in struct tcp_info]),
+		[],
+		[#include <linux/tcp.h>])
+
 AC_MSG_RESULT([CFLAGS="$CFLAGS"])
 AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])