aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2021-12-06 16:31:02 +0100
committerlaforge <laforge@osmocom.org>2021-12-23 14:52:15 +0000
commitb1ef8f5f691db8d245428568e4934795943f39fd (patch)
tree8c0fd434e03b7d209da1f03325786cfba644f100 /include/osmocom
parent9fe1f9fb0b3197cdecaa55017d3afd7355e59c36 (diff)
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
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/core/stats_tcp.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/osmocom/core/stats_tcp.h b/include/osmocom/core/stats_tcp.h
new file mode 100644
index 00000000..6b9657a8
--- /dev/null
+++ b/include/osmocom/core/stats_tcp.h
@@ -0,0 +1,16 @@
+#pragma once
+
+#define TCP_STATS_DEFAULT_INTERVAL 0 /* secs */
+#define TCP_STATS_DEFAULT_BATCH_SIZE 1 /* sockets per interval */
+
+struct osmo_tcp_stats_config {
+ /* poll interval in seconds, use osmo_stats_tcp_set_interval() to manipulate this value */
+ int interval;
+ /* specify how many sockets are processed when the interval timer expires */
+ int batch_size;
+};
+extern struct osmo_tcp_stats_config *osmo_tcp_stats_config;
+
+int osmo_stats_tcp_osmo_fd_register(const struct osmo_fd *fd, const char *name);
+int osmo_stats_tcp_osmo_fd_unregister(const struct osmo_fd *fd);
+int osmo_stats_tcp_set_interval(int interval);