tun

package
v0.0.0-...-d773db1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupLink(deviceName string, tunAddr net.IP, subnet *net.IPNet, mtu uint16, opts ...func(*linkOptInfo)) (*water.Interface, error)

func WithCheck

func WithCheck() func(info *linkOptInfo)

func WithPersist

func WithPersist() func(info *linkOptInfo)

func WithUidGid

func WithUidGid(uid uint, gid uint) func(info *linkOptInfo)

Types

type Link struct {
	chanreader.Publisher
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, deviceName string, tunAddr net.IP, subnet *net.IPNet, mtu uint16) (*Link, error)

New returns a link.Link connected to a newly created Linux tun/tap device.

func (*Link) MTU

func (l *Link) MTU() uint16

func (*Link) SendPacket

func (l *Link) SendPacket(packet []byte) error

Jump to

Keyboard shortcuts

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