tunmgr

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 7 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 interface {
	CreateTUN() (*water.Interface, error)
	SetTUNIP(iName string, localAddr net.IP, addr *net.IPNet, debug bool) error
	SetTUNStatus(iName string, up bool, debug bool) error
}

Tun interface declares methods related to setting tun network interface

func GetInstance

func GetInstance() Tun

GetInstance returns Tun interface instance

type TunImpl

type TunImpl struct{}

TunImpl is a struct for Tun related methods

func (TunImpl) CreateTUN

func (TunImpl) CreateTUN() (*water.Interface, error)

CreateTUN creates a virtual tun interface

func (TunImpl) SetTUNIP

func (TunImpl) SetTUNIP(iName string, localAddr net.IP, addr *net.IPNet, debug bool) error

SetTUNIP sets an IP to the interface

func (TunImpl) SetTUNStatus

func (TunImpl) SetTUNStatus(iName string, up bool, debug bool) error

SetTUNStatus starts/stops an interface

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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