vpn

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IPPacketOffset = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MTU               int
	IPv4              string
	IPv6              string
	AllowedIPs        []string
	Peers             []string
	Peermap           *peermap.Peermap
	PrivateKey        string
	OnRoute           func(route Route)
	ModifyDiscoConfig func(cfg *disco.DiscoConfig)
}

type Route added in v0.0.2

type Route struct {
	Device tun.Device
	OldDst []*net.IPNet
	NewDst []*net.IPNet
	Via    net.IP
}

type VPN

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

func New

func New(cfg Config) *VPN

func (*VPN) RunTun

func (vpn *VPN) RunTun(ctx context.Context, tunName string) error

func (*VPN) RunTunFD

func (vpn *VPN) RunTunFD(ctx context.Context, tunFD int) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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