Commit b05019b
committed
feat(tunnel): phase 1 — ipstack datapath + forwarder
Wire the WireGuard transport to a real network. `WgDevice` is a zero-alloc
AsyncRead+AsyncWrite packet device: it owns the UDP socket and WgTunnel and
does decapsulate/encapsulate inline against a reused buffer in poll_read/
poll_write (no channels, no Arc<Mutex>, no per-packet allocation). The endpoint
drives ipstack over the device and forwards each guest flow to a real socket —
TCP via copy_bidirectional, UDP via a datagram relay; the forward destination
is the stream's peer_addr (confirmed = dst_addr from ipstack source).
- Add tokio `net` feature, ipstack 1.0 dependency, etherparse (dev)
- Document the datapath decisions in TUNNEL.md
Tests: 90 lib total (+1). A loopback integration test stands up the real
WgDevice + ipstack over two localhost UDP sockets, drives an actual WireGuard
handshake from a bare guest tunnel, sends an etherparse-built IPv4/UDP packet,
and asserts ipstack surfaces a stream addressed to the packet's destination —
validating the whole receive datapath without a container.1 parent 429c434 commit b05019b
5 files changed
Lines changed: 498 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
0 commit comments