Commit Graph
7 Commits
Author SHA1 Message Date
Evgeny 2611a05d81 revert unnecessary return -1 in void-test ASSERT macros; only test_bgp_route_exchange uses ASSERT in int main() 2026-05-10 00:49:46 +03:00
Evgeny fcb6a59ca9 fix ASSERT macros: return -1 instead of bare return in int main() (FreeBSD -Wreturn-mismatch) 2026-05-10 00:44:59 +03:00
Evgeny 2fadec947b Fix: Split multi-var init and rename s_net/d_net to src_net/dst_net to avoid MSYS2 S_un macro conflict 2026-04-25 01:21:38 +03:00
Evgeny 595d2b177b Refactor: Replace custom tc_hton*/tc_ntoh* with standard htobe16/be16toh/htobe32/be32toh, move htobe16/be16toh to platform_compat.h 2026-04-25 01:16:09 +03:00
Evgeny aafa0cfcab Fix: Add portable tc_htonl/tc_htons/tc_ntohl/tc_ntohs macros, replace winsock2-incompatible hton*/nto* in NAT test files 2026-04-25 00:52:33 +03:00
Evgeny ba30f2adc6 Fix: Remove arpa/inet.h from test_nat_engine.c, use platform_compat.h for byte-order funcs 2026-04-25 00:48:40 +03:00
Evgeny 907ef244c6 NAT: Full Cone (EIM) NAT with ETCP_ID_NAT protocol, per-node routing, and comprehensive test suite
- New ETCP protocol ETCP_ID_NAT (0x02) for NAT traffic between nodes
- eim_nat.c/h: Pure NAT engine (table, port allocation, checksum updates, egress/ingress)
- nat_transport.c/h: Transport layer (NAT TUN, ETCP binding, client/provider roles)
- route_bgp_find_conn_for_node(): shared utility for optimal connection lookup
- tun_init_nat(): dedicated TUN creation for NAT
- Config: [nat] section with tun_ip, port_start/end, nat_via, forward rules
- Fix: csum_update_ip/transport use htonl() halves (correct on LE systems)
- Fix: IP_FRAG_MF_MASK changed to 0x2000 (after ntohs, MF is bit 13)
- Tests: 26 engine unit + 4 transport integration + 7 stress (29 total)
2026-04-25 00:43:25 +03:00