tun

package
v0.0.0-...-8e6527b Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	// NativeTun is ...
	*tun.NativeTun
	// Namt is ...
	Name string
	// MTU is ...
	MTU int
	// Conf4 is ...
	Conf4 struct {
		// Addr is ...
		Addr [4]byte
		// Mask is ...
		Mask [4]byte
		// Gateway is ...
		Gateway [4]byte
	}
	// Conf6 is ...
	Conf6 struct {
		// Addr is ...
		Addr [16]byte
		// Mask is ...
		Mask [16]byte
		// Gateway is ...
		Gateway [16]byte
	}
}

Device is ...

func CreateTUN

func CreateTUN(name string, mtu int) (dev *Device, err error)

CreateTUN is ...

func NewDevice

func NewDevice(name string) (*Device, error)

NewDevice is ...

func NewDeviceWithMTU

func NewDeviceWithMTU(name string, mtu int) (*Device, error)

NewDeviceWithMTU is ...

func NewUnmonitoredDeviceFromFD

func NewUnmonitoredDeviceFromFD(fd int, mtu int) (dev *Device, err error)

NewUnmonitoredDeviceFromFD is ...

func (*Device) Activate

func (d *Device) Activate() error

Activate is ...

func (*Device) AddRouteEntry

func (d *Device) AddRouteEntry(cidr []string) error

AddRouteEntry is ... 198.18.0.0/16 8.8.8.8/32

func (*Device) DeviceType

func (d *Device) DeviceType() string

DeviceType is ...

func (*Device) SetInterfaceAddress

func (d *Device) SetInterfaceAddress(address string) error

SetInterfaceAddress is ... 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