netstack

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ICMPConn

type ICMPConn struct {
	// contains filtered or unexported fields
}

func (*ICMPConn) Close

func (c *ICMPConn) Close() error

func (*ICMPConn) LocalAddr

func (c *ICMPConn) LocalAddr() net.Addr

func (*ICMPConn) Read

func (c *ICMPConn) Read(b []byte) (int, error)

func (*ICMPConn) ReadFrom

func (c *ICMPConn) ReadFrom(b []byte) (int, net.Addr, error)

func (*ICMPConn) RemoteAddr

func (c *ICMPConn) RemoteAddr() net.Addr

func (*ICMPConn) SetDeadline

func (c *ICMPConn) SetDeadline(when time.Time) error

func (*ICMPConn) SetHopLimit

func (c *ICMPConn) SetHopLimit(limit int) error

func (*ICMPConn) SetReadDeadline

func (c *ICMPConn) SetReadDeadline(when time.Time) error

func (*ICMPConn) SetTTL

func (c *ICMPConn) SetTTL(ttl int) error

func (*ICMPConn) SetWriteDeadline

func (c *ICMPConn) SetWriteDeadline(when time.Time) error

func (*ICMPConn) Write

func (c *ICMPConn) Write(b []byte) (int, error)

func (*ICMPConn) WriteTo

func (c *ICMPConn) WriteTo(b []byte, address net.Addr) (int, error)

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

Stack is a gVisor network stack connected to a VPN packet device.

func New

func New(addresses []netip.Prefix, mtu uint32, device packetDevice) (*Stack, error)

func (*Stack) AddAddress

func (s *Stack) AddAddress(prefix netip.Prefix) error

AddAddress adds an address that can receive packets in the userspace stack. It does not change host networking.

func (*Stack) Addresses

func (s *Stack) Addresses() []netip.Prefix

func (*Stack) Close

func (s *Stack) Close() error

func (*Stack) DialContext

func (s *Stack) DialContext(ctx context.Context, network, address string) (net.Conn, error)

func (*Stack) DialICMPContext

func (s *Stack) DialICMPContext(ctx context.Context, network, address string) (*ICMPConn, error)

func (*Stack) Done

func (s *Stack) Done() <-chan struct{}

func (*Stack) Listen

func (s *Stack) Listen(network, address string) (net.Listener, error)

func (*Stack) ListenICMP

func (s *Stack) ListenICMP(network, address string) (*ICMPConn, error)

func (*Stack) ListenPacket

func (s *Stack) ListenPacket(network, address string) (net.PacketConn, error)

func (*Stack) RemoveAddress

func (s *Stack) RemoveAddress(prefix netip.Prefix) error

RemoveAddress removes an address previously added to the userspace stack. It does not change host networking.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL