evgeny
38c9f229bc
stcp: ed25519 pubkey exchange in handshake, fix instance destroy segfault, fix chat_tcp_test
...
- u_async.c: process immediate_queue BEFORE epoll_wait in uasync_poll
- stcp_link.c: defensive NULL etcp_conn/etcp_link in stcp_link_close
- utun_instance.c: move stcp_server_list_destroy_all to Phase J (before ETCP),
add deferred drain in both Phase J and L
- stcp.h/c: STCP_HS_ENC_CLIENT 6→38, STCP_HS_ENC_SERVER 7→39,
exchange ed25519_pubkey in both handshake directions
- etcp_connections.c: copy peer_ed25519 from STCP to ETCP_CONN in
etcp_link_enter_ready_tcp; guard link->etcp in tcp_link_close_cb
- chat_sync.c: fix lk->conn NULL dereference for TCP links
- test_stcp.c: update stcp_server_create/stcp_client_connect callsites
- tools/chat_tcp_test: change transport udp→tcp
2 months ago
evgeny
d773f1724a
refactor: STCP connections as ETCP links (is_tcp)
...
- Add is_tcp, tcp_link, tcp_reconnect_* fields to ETCP_LINK
- Remove transport_link from ETCP_CONN, add tcp_link_count
- stcp_link: replace embedded etcp_conn with pointer; add etcp_link backpointer
- stcp_link: link_rx_cb routes ETCP data to etcp_conn_input
- stcp_link: call on_close_cb in close
- New TCP functions: etcp_link_enter_ready_tcp, etcp_tcp_link_start_connect,
etcp_tcp_link_start_reconnect, tcp_link_close_cb, etcp_tcp_send
- etcp_link_new: handle NULL conn for TCP links; skip enter_init for TCP
- etcp_link_close: close stcp_link for TCP
- etcp_encrypt_send: redirect TCP to etcp_tcp_send (skips AES-CCM)
- tcp_server_on_link: create ETCP_LINK(is_tcp=1) + enter_ready_tcp
- etcp_connect: TCP addrs -> etcp_tcp_link_start_connect
- Remove ctx->tcp_link/tcp_ready
- test_stcp_traffic: find stcp_link via links->is_tcp instead of transport_link
- 66/68 tests pass; 2 STCP tests expected to fail (integration not complete)
2 months ago
Evgeny
fcf3fb7f51
refactor: move transport (etcp/stcp/normalizer) to transport_layer/, routing (bgp/pings/topo*) to routing_layer/
2 months ago
Evgeny
3ddfb79338
Backup before replacing all printf with DEBUG_ macros in tests
8 months ago
Evgeny
1bafe6a681
Backup before fixing etcp_connections list addition
8 months ago
Evgeny
64489fa194
Add comprehensive ETCP traffic flow debugging tests
...
Implemented multiple levels of ETCP traffic debugging tests:
1. test_etcp_minimal.c - Basic packet analysis and section parsing:
- Single section payload packets
- Multi-section packets (TIMESTAMP, ACK, PAYLOAD)
- Connection establishment packets (INIT_REQUEST, INIT_RESPONSE)
- Detailed section-by-section analysis with timing
2. test_etcp_simple_traffic.c - TUN-less traffic simulation:
- Direct packet injection and analysis
- Connection state simulation
- Traffic generation and processing
- Comprehensive packet capture and analysis
3. test_etcp_traffic_flow.c - Full instance simulation:
- Two-instance setup with traffic analysis
- Packet capture hooks in ETCP pipeline
- Traffic analyzer with detailed metrics
- Connection establishment debugging
Key debugging features added:
- Section-by-section packet parsing and validation
- Packet ID tracking and sequence analysis
- ACK processing with timestamp correlation
- Connection handshake simulation
- Retransmission request handling
- Multi-section packet composition analysis
- Traffic flow metrics and timing analysis
All tests use comprehensive DEBUG_* output for detailed traffic flow tracing:
- Packet type identification
- Section length validation
- Payload content analysis
- Connection state tracking
- Timing and sequence verification
This enables thorough debugging of ETCP protocol traffic flow, packet processing,
and connection establishment without requiring TUN devices or network setup.
8 months ago