vif

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 37 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)
	WaitForDevice()
}

func OpenTun

func OpenTun(ctx context.Context, routingTable routing.Table) (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, table routing.Table) *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, pleaseProxy, dontProxy []*net.IPNet) error

func (*Router) UpdateWhitelist added in v2.14.0

func (rt *Router) UpdateWhitelist(whitelist []*net.IPNet)

func (*Router) ValidateRoutes added in v2.14.0

func (rt *Router) ValidateRoutes(ctx context.Context, routes []*net.IPNet) 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