tuntap

package
v0.0.0-...-e7d7f47 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tun

type Tun struct {
	*tun.NativeTun
	Name     string
	MTU      int
	Gateway4 [4]byte
	Gateway6 [16]byte
}

func CreateTun

func CreateTun(name string, mtu int) (adapter *Tun, err error)

func NewTun

func NewTun(name string) (*Tun, error)

func NewTunWithMTU

func NewTunWithMTU(name string, mtu int) (*Tun, error)

func (*Tun) AddRouteEntry

func (a *Tun) AddRouteEntry(cidr []string) error

198.18.0.0/16 8.8.8.8/32

func (*Tun) DeviceType

func (a *Tun) DeviceType() string

func (*Tun) GetMTU

func (a *Tun) GetMTU() int

func (*Tun) SetInterfaceAddress

func (a *Tun) SetInterfaceAddress(addr string) error

192.168.1.11/24 fe80:08ef:ae86:68ef::11/64

Jump to

Keyboard shortcuts

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