Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MemoryPipe ¶
MemoryPipe is used to join two endpoints together, allowing them to communicate.
Types ¶
type Endpoint ¶
Endpoint is a wrapper around a channel.Endpoint that implements the io.Reader and io.Writer interfaces.
func WrapChannel ¶
WrapChannel wraps the provided netstack channel-based Endpoint and returns a wrapper that implements io.Reader and io.Writer on the channel. This allows callers to read and write packets as raw []byte directly to the channel.
type HTTPOverTCPForwarder ¶
HTTPOverTCPForwarder is a proof-of-concept for a TCP forwarder that only handles HTTP requests and forwards them to a local HTTP server.
func (*HTTPOverTCPForwarder) Handle ¶
func (f *HTTPOverTCPForwarder) Handle(r *tcp.ForwarderRequest)
type TCPForwarder ¶
TCPForwarder knows how to forward TCP traffic from the userspace network Stack to the host's network Stack. TCP dialing requests from the userspace network Stack are done by the host's network Stack which allows userspace traffic to exit the userspace Stack.
func (*TCPForwarder) Handle ¶
func (f *TCPForwarder) Handle(r *tcp.ForwarderRequest)
type TestStack ¶
type TestStack struct { Stack *stack.Stack Endpoint *channel.Endpoint // contains filtered or unexported fields }
func NewTestStack ¶
func NewTestStack(logger *zap.Logger, nic string, routes []string, forwarding bool) (*TestStack, error)
NewTestStack creates a new netstack for testing with a single nic, and with the provided routes. The routes are expected to be CIDR blocks that this Stack is allowed to route to.
type UDPForwarder ¶
UDPForwarder knows how to forward UDP traffic from the userspace network Stack through the host networking Stack.
func (*UDPForwarder) Handle ¶
func (u *UDPForwarder) Handle(r *udp.ForwarderRequest)