vif

package
v2.13.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLogger added in v2.7.2

func InitLogger(ctx context.Context)

func NewStack added in v2.7.2

func NewStack(ctx context.Context, dev stack.LinkEndpoint, streamCreator tunnel.StreamCreator) (*stack.Stack, error)

Types

type Device

type Device interface {
	stack.LinkEndpoint
	io.Closer
	Index() int32
	Name() string
	AddSubnet(context.Context, *net.IPNet) error
	RemoveSubnet(context.Context, *net.IPNet) error
	SetDNS(context.Context, string, net.IP, []string) (err error)
}

func OpenTun

func OpenTun(ctx context.Context) (Device, error)

OpenTun creates a new TUN device and ensures that it is up and running.

type Router added in v2.13.0

type Router struct {
	// contains filtered or unexported fields
}

func NewRouter added in v2.13.0

func NewRouter(device Device) *Router

func (*Router) Close added in v2.13.0

func (rt *Router) Close(ctx context.Context)

func (*Router) GetRoutedSubnets added in v2.13.0

func (rt *Router) GetRoutedSubnets() []*net.IPNet

func (*Router) UpdateRoutes added in v2.13.0

func (rt *Router) UpdateRoutes(ctx context.Context, plaseProxy, dontProxy []*net.IPNet) (err error)

type TunnelingDevice added in v2.13.0

type TunnelingDevice struct {
	Device Device
	Router *Router
	// contains filtered or unexported fields
}

func NewTunnelingDevice added in v2.13.0

func NewTunnelingDevice(ctx context.Context, tunnelStreamCreator tunnel.StreamCreator) (*TunnelingDevice, error)

func (*TunnelingDevice) Close added in v2.13.0

func (vif *TunnelingDevice) Close(ctx context.Context) error

func (*TunnelingDevice) Run added in v2.13.0

func (vif *TunnelingDevice) Run(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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