Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGTunnel ¶
func NewGTunnel(pctx context.Context, fd, mtu int, hdl netstack.GConnHandler) (t *gtunnel, rev netstack.GConnHandler, err error)
fd must be non-blocking.
Types ¶
type Tunnel ¶
type Tunnel interface { Mtu() int32 // IsConnected indicates whether the tunnel is in a connected state. IsConnected() bool // Disconnect disconnects the tunnel. Disconnect() // Enabled checks if the tunnel is up and running. Enabled() bool // Write writes input data to the TUN interface. Write(data []byte) (int, error) // Close connections CloseConns(activecsv string) (closedcsv string) // Creates a new link using fd (tun device) and mtu. SetLink(fd, mtu int) error // Unsets existing link and closes the fd (tun device). Unlink() error // Creates the link and updates the routes SetLinkAndRoutes(fd, mtu, engine int) error // New route SetRoute(engine int) error // Set or unset the pcap sink SetPcap(fpcap string) error // NIC, IP, TCP, UDP, and ICMP stats. Stat() (*x.NetStat, error) }
Tunnel represents a session on a TUN device.
Click to show internal directories.
Click to hide internal directories.