tunnel

package
v0.0.0-...-4cf4c4f Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeTunFile

func MakeTunFile(fd int) (*os.File, error)

MakeTunFile returns an os.File object from a TUN file descriptor `fd`. The returned os.File holds a separate reference to the underlying file, so the file will not be closed until both `fd` and the os.File are separately closed. (UNIX only.)

func ProcessInputPackets

func ProcessInputPackets(tunnel Tunnel, tun *os.File)

ProcessInputPackets reads packets from a TUN device `tun` and writes them to `tunnel`.

Types

type Tunnel

type Tunnel interface {
	// IsConnected indicates whether the tunnel is in a connected state.
	IsConnected() bool
	// Disconnect disconnects the tunnel.
	Disconnect()
	// Write writes input data to the TUN interface.
	Write(data []byte) (int, error)
}

Tunnel represents a session on a TUN device.

func NewTunnel

func NewTunnel(tunWriter io.WriteCloser, lwipStack core.LWIPStack) Tunnel

Jump to

Keyboard shortcuts

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