chat: user-friendly INFO logs for invite/connect flow
- chat_sync.c: invite entry, JOINED/TIMEOUT messages - conn_mgr_core.c: invite start (addrs+udp+tcp), NCD UP/DOWN/TIMEOUT, TCP connect/ready/close, membership check send/receive/confirm/deny, overall timeout - node_conn_direct.c: NCD event names instead of numbers
This commit is contained in:
1 parent
c35135cb52
commit
c2191aad3b
34 files changed
+597
-230
No files matched your search
@@ -66,6 +66,10 @@ struct UTUN_INSTANCE;
|
||||
#define CONN_TYPE_INDIRECT 3
|
||||
#define CONN_MGR_MAX_INTERMEDIARIES 3
|
||||
|
||||
#define NCONN_DIRECT (1 << 0) // прямое ETCP подключение
|
||||
#define NCONN_INDIRECT (1 << 1) // через посредника
|
||||
#define NCONN_BGP (1 << 2) // узел виден в топологии (BGP)
|
||||
|
||||
#define TOPO_FLAG_SEND_SUBNETS 0x01
|
||||
#define TOPO_GROUP_UTUN 0x8000000000000000ULL
|
||||
#define TOPO_GROUP_TYPE_UTUN 1
|
||||
@@ -151,15 +155,14 @@ struct TOPO_GROUP_NODE {
|
||||
struct ll_entry ll; // queue entry, хеш-ключ 8 байт → node_id
|
||||
uint64_t node_id; // идентификатор узла в этой группе
|
||||
struct TOPO_NODESUBNETS* subnets; // подсети узла (v4/v6), для route_insert()
|
||||
uint64_t* hop_list; // путь от нас к узлу (массив node_id)
|
||||
uint8_t hop_count; // длина hop_list
|
||||
uint16_t cumulative_rtt; // накопленный RTT от нас до узла
|
||||
struct ll_queue* paths; // TOPO_NODEPATH{conn,hop_count,rtt} — маршруты
|
||||
uint8_t last_ver; // последняя версия NODEINFO (защита от stale, BGP)
|
||||
uint8_t conn_mgr_type; // CONN_TYPE_DIRECT/REVERSE/INDIRECT/NONE
|
||||
uint64_t conn_mgr_intermediaries[CONN_MGR_MAX_INTERMEDIARIES]; // посредники для INDIRECT
|
||||
uint8_t conn_mgr_intermediariy_count; // количество посредников
|
||||
struct TOPO_CONNECTIVITY connectivity; // результаты ping-проб (interface/nat/real)
|
||||
uint8_t conn_presence; // NODE_CONN_* — какие подключения есть в принципе
|
||||
uint8_t conn_up; // NODE_CONN_* — какие из них подняты
|
||||
struct CONN_MGR_HANDLE* handle; // активный хендл соединения к узлу
|
||||
};
|
||||
|
||||
@@ -179,6 +182,7 @@ int topo_node_serialize(struct TOPO_NODE* ni, struct TOPO_GROUP_NODE* nq, uint8_
|
||||
int topo_node_deserialize(struct TOPO_GROUP* group, const uint8_t* data, size_t len, struct TOPO_NODE** out_ni, struct TOPO_NODESUBNETS** out_subnets,
|
||||
uint64_t** out_hop_list, uint8_t* out_hop_count,
|
||||
uint16_t* out_cumulative_rtt);
|
||||
uint64_t* topo_node_best_hop_list(struct TOPO_GROUP_NODE* nq, uint8_t* out_count, uint16_t* out_rtt);
|
||||
|
||||
int topo_group_update_my_nodeinfo(struct UTUN_INSTANCE* instance, struct TOPO_GROUP* group);
|
||||
void topo_node_update_my_addresses(struct UTUN_INSTANCE* instance);
|
||||
@@ -187,6 +191,9 @@ 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);
|
||||
uint16_t node_best_rtt(struct TOPO_GROUP_NODE* nq);
|
||||
#define NODE_RTT_TYPE(v) ((v) >> 14)
|
||||
#define NODE_RTT_VALUE(v) ((v) & 0x3FFF)
|
||||
|
||||
static inline const struct TOPO_SOCKMETA4* topo_v4_sock_meta(const struct TOPO_NODE* ni) { return ni->v4_sock_meta; }
|
||||
static inline const struct TOPO_ADDR4* topo_v4_addrs(const struct TOPO_NODE* ni) { return ni->v4_addrs; }
|
||||
|
||||
Reference in new issue
Block a user