Evgeny
e765d62e43
etcp_route_send: add force parameter to bypass send_q limit for control messages
...
CLOSE/ERROR/CONNECT and routing messages use force=1 to never be
dropped by backpressure. Regular DATA uses force=0 (default).
4 months ago
Evgeny
fceec1aea6
fix: move debug logs before async operations (queue_put, timer_set, resume) for meaningful log ordering
4 months ago
Evgeny
1f4fe37fe5
proxy: rename + simplify + backpressure
...
- tcp_proxy/remote_proxy → tcp_proxy_client/tcp_proxy_server
- Все proxy файлы перенесены в src/proxy/
- Конфиг: [tcp_proxy]→[tcp_proxy_client], [remote_proxy]→[tcp_proxy_server]
- Убран subcmd CONNECTED (0x02) — клиент шлёт DATA сразу после CONNECT
- Backpressure: etcp_router_waiter_register/cancel через ll_queue threshold waiter
- Клиент: recv_cb send fail → tx_buf+waiter, не tcp_recved() (окно lwIP=0)
- Сервер: read_cb send fail → pause_buf+waiter, пауза read_id
- CLOSE/ERROR отправляется только после drain всех очередей
- Fail: conn не найден/closed → send ERROR вместо CLOSE/silent drop
- PROTOCOL.md: полная архитектура с диаграммами состояний и потоков
4 months ago
Evgeny
f691c01b45
перевод комментариев tcp/udp/icmp proxy на русский
4 months ago
Evgeny
a02c474b94
fix use-after-free in queue_entry_free/dgram_free ordering + add tcp_proxy stress test + proxy diagnostics logging
...
- Fix queue_entry_free before queue_dgram_free in all proxy files (UAF bug causing segfault)
- Add PROXY/RP prefixed diagnostic logs for transparent proxy flow tracking
- Add tcp_proxy integration test: real utun instances, ETCP, remote_proxy, DNAT routing
- 7 test scenarios: basic_1mb, concurrent_5, concurrent_20, half_close, idle, conn_refused, stress (10 threads x 20 iterations)
- stress_client.py with --verbose per-thread phase timing (connect/send/recv)
4 months ago
Evgeny
3258a64df4
add periodic cleanup timers for ICMP pending requests and UDP flows
5 months ago
Evgeny
c396b91fde
fix missing IP checksum in icmp/udp deliver_reply, fix udp output_queue->input_queue
5 months ago
Evgeny
889f6d5c3a
fix icmp_proxy: write reply to input_queue (not output_queue) to reach TUN device
5 months ago
Evgeny
13d469d866
add orig_src_ip to ICMP proxy protocol, fix deliver_reply dst_ip (was wrong tun_ip_addr)
5 months ago
Evgeny
02c7153822
add icmp_proxy diagnostic logging on all reply path stages
5 months ago
Evgeny
07540b7ff8
fix icmp: use SOCK_RAW for FreeBSD compat, add socket diagnostic logging
5 months ago
Evgeny
edeb83ce89
replace fake ICMP echo reply with test_loopback flag, honest error when no raw socket
5 months ago
Evgeny
c05e1c9991
replace uIP with adapted lwIP TCP stack (lwip_tcp)
...
- Replace uIP (src/uip/) with adapted lwIP 2.1.x TCP module
- Remove original src/lwip/ (replaced by src/lwip_tcp/)
- New src/lwip_tcp/ module: lwip_pbuf, lwip_tcp core/in/out
- Full TCP state machine, sliding window, congestion control
- Fast retransmit/recovery, Van Jacobson RTT estimation
- Nagle algorithm (TF_NODELAY), delayed ACK
- OOSEQ reassembly, TIME-WAIT handling
- Memory: memory_pool for PCB, listen PCB, tcp_seg
- Timers: uasync periodic timer drives fast/slow timers
- Output: callback-based IP packet output (TUN/raw-fd)
- Error codes: LERR_ prefix to avoid conflicts
- pbuf: simplified PBUF_RAM with proper header space reservation
- Integrate into tcp_proxy.c/h with per-pcb callbacks
- Active connection API: struct proxy_conn* instead of int conn_idx
- Makefile: remove uip, add lwip_tcp files
- test_tcp_proxy updated for new API; test_tcp_proxy_remote disabled
- Known: test_tcp_proxy data transfer needs flow tuning (WIP)
5 months ago
Evgeny
a6311a17d0
add UDP/ICMP proxy, refactor tcp_proxy via_node to instance-level
...
- UDP proxy: datagram relay client↔exit over ETCP
- ICMP proxy: echo ping relay client↔exit over ETCP
- Move via_node_id from per-forward-mapping to global tcp_proxy setting
- Support multiple concurrent tcp_proxy instances (no singleton g_tcp_proxy)
- Cap handshake padding to stay within 1472+overhead
- Handle non-TCP packets (UDP/ICMP) in tcp_proxy raw/tun input paths
- Add utun_instance_create_from_str() for test config creation
5 months ago