Skip to main content

Module inbound_relay

Module inbound_relay 

Source
Expand description

Inbound port forwarding via L2 frame injection.

Instead of using utun + kernel routing, we inject crafted L2 Ethernet frames directly into the guest FD (socketpair) so that host-side TCP/UDP listeners can reach services inside the guest VM.

§Architecture

External client (host:8080)
    │
    ▼
InboundListenerManager (TcpListener / UdpSocket per rule)
    │ accept / recv
    ▼
InboundCommand channel  ──►  NetworkDatapath select! arm
    │
    ▼
InboundRelay
    └─ UDP: inject datagram → guest reply → forward to client
    │
    ▼
reply_tx ──► datapath ──► guest_fd (socketpair) ──► Guest VM

Structs§

InboundListenerManager
Manages host-side listeners that accept incoming connections / datagrams and send InboundCommand messages to the datapath.

Enums§

InboundCommand
Command sent from InboundListenerManager listener tasks to the datapath.
InboundProtocol
Protocol for port forwarding rules.