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
c869ccf174
Major refactoring: Tasks 1-4 complete
...
Task 1: Migrate to GNU Autotools
- Add configure.ac, Makefile.am files (root, src, u_async, tests)
- Add autogen.sh bootstrap script
- Create INSTALL.autotools guide
- Update .gitignore for autotools
- Old Makefile backed up as Makefile.old
Task 2: Refactor typedef struct → struct STRUCT_NAME
- Remove 24 of 28 typedef struct declarations
- Convert to struct STRUCT_NAME pattern per AGENTS.md
- Files affected: routing, memory_pool, packet_buffer/pool,
tun_if, etcp_sockets/connections, config_parser,
pkt_normalizer, secure_channel, utun_instance, etcp
- Code now 86% compliant with AGENTS.md style guide
Task 3: Clean up legacy tests
- Remove 7 obsolete test files (connection*, sc_lib, udp_secure, etc.)
- Update 4 test files to new API (epkt_t → struct ETCP_CONN)
- Clean Makefile of legacy references
- Test suite reduced from 17 to 10 focused tests
Task 4: Replace fprintf with debug system
- Replace 60 fprintf(stderr) calls with DEBUG_ERROR/WARNING macros
- Add debug_config.h includes to all modified files
- Use appropriate DEBUG_CATEGORY_* for each error type
- Debug output now runtime-configurable
Impact: 32 files modified, ~350 lines changed, all 4 tasks complete,
build system modernized, code follows AGENTS.md, debugging improved.
9 months ago