tun

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package tun interfaces with the linux kernel to provide access to net tuns.

Index

Constants

View Source
const (
	// IfaceNameMaxLen is the maximum allowed length of tun interface names in bytes (not runes).
	IfaceNameMaxLen = 16
)

Variables

View Source
var (
	// ErrMTU indicates that a packet is too large for the tun MTU.
	ErrMTU = errors.New("packet too large for MTU")
)

Functions

This section is empty.

Types

type Tun

type Tun struct {
	io.ReadWriteCloser
	// contains filtered or unexported fields
}

Tun is a handle for a linux Tun device that allows reading an writing frames.

func New

func New(ifaceName string) (*Tun, error)

New creates a new tun handle for the tun named by ifaceName.

func (*Tun) MTU

func (t *Tun) MTU() int

MTU returns the current MTU size of the interface in bytes.

Jump to

Keyboard shortcuts

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