socket_monitor: extract socket monitoring from etcp_connections, add per-instance context

- New files: transport_layer/socket_monitor.c/h — socket state monitoring with per-instance ctx
- etcp_api: expose get_latency/1s_pkt_count measuring, add etcp_hashrnd for tests
- utun_instance: store socket_monitor per instance, add is_socket_ok check
- topo_node: detect IPv4 addresses with port from listening sockets
- topo_group: use node_name for display in routes
- Makefile.am: add socket_monitor.c to build
This commit is contained in:
evgeny committed 2026-08-02 12:16:42 +03:00
1 parent 14d1673f06
commit f5efaa495b
10 files changed
+420

No files matched your search

+5
View File
@@ -19,6 +19,7 @@
#include "stcp_server.h"
#include "control_server.h"
#include "transport_layer/node_conn_direct.h"
#include "transport_layer/socket_monitor.h"
#include "../lib/u_async.h"
#include "../lib/debug_config.h"
@@ -218,6 +219,8 @@ static int instance_init_common(struct UTUN_INSTANCE* instance, struct UASYNC* u
instance->topo_groups = NULL;
}
socket_monitor_init(instance);
// conn_mgr initialized inside topo_group_create (via topo_groups_init)
// Initialize firewall
@@ -430,6 +433,8 @@ void utun_instance_destroy(struct UTUN_INSTANCE *instance) {
}
instance->config_conn_handles = NULL;
socket_monitor_destroy(instance);
// Cleanup BGP module BEFORE sockets (needs live conn_mgr for recovery cleanup)
if (instance->topo_groups) {
DEBUG_INFO(DEBUG_CATEGORY_BGP, "Destroying BGP module");