feat: PING/PONG RTT exchange + burst sender + TCP server; fix INIT peer_id offset

- etcp_connections: add flags byte to PING/PONG wire format (WANT_RTT/SEND_RTT)
- etcp_connections: add etcp_link_burst_start/check for BDP measurement
- etcp_connections: add tcp_server_on_link for STCP→ETCP bridge
- topo_node: add ping_request_cbk/ping_update_rtt for live RTT tracking
- topo_node: add last_ping_time field in connectivity
- topo_node_sqlite: extend DB schema for RTT data
- fix: INIT path read peer_id from offset 1 (not 2), PING offset stays 2
This commit is contained in:
Evgeny committed 2026-07-21 20:50:14 +03:00
1 parent 542694a0e9
commit ad42f66df5
10 files changed
+226 -35

No files matched your search

+7
View File
@@ -31,6 +31,7 @@ extern "C" {
#include "secure_channel.h"
struct TOPO_GROUP;
struct TOPO_GROUPS;
struct ETCP_SOCKET;
struct UTUN_INSTANCE;
@@ -100,9 +101,12 @@ struct TOPO_CONNECTIVITY {
uint64_t nat_probe_time;
uint64_t real_probe_time;
uint64_t ping_req_time;
uint64_t last_ping_time; // время последнего успешного пинга (0.1ms timebase)
void* probe_list;
};
#define PING_TTL_TB (86400ULL * 10000ULL) // 1 день в 0.1ms units
// =======================================================================
// Протокольные структуры (wire-format, packed, без next)
// =======================================================================
@@ -270,6 +274,9 @@ int topo_group_update_my_nodeinfo(struct UTUN_INSTANCE* instance, struct TOPO_GR
void topo_node_dump_all(struct TOPO_GROUP* group);
int topo_node_format_all(struct TOPO_GROUP* group, char* buf, size_t buf_size);
int topo_node_ping_request_cbk(struct TOPO_GROUPS* groups, uint64_t node_id);
void topo_node_ping_update_rtt(struct TOPO_GROUPS* groups, uint64_t node_id, uint16_t rtt);
#ifdef __cplusplus
}
#endif