vpndriver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPSK string = "openyurt-raven"
)

Variables

This section is empty.

Functions

func DefaultMTU added in v0.2.0

func DefaultMTU() (int, error)

func FindCentralGwFn added in v0.2.0

func FindCentralGwFn(network *types.Network) *types.Endpoint

FindCentralGwFn tries to find a central gateway from the given network. Returns nil if no central gateway found. A central gateway is used to forward traffic between gateway under nat network, in which the gateways can not establish ipsec connection directly.

func GetPSK added in v0.2.0

func GetPSK() string

func RegisterDriver

func RegisterDriver(name string, factory Factory)

Types

type Connection added in v0.2.0

type Connection struct {
	LocalEndpoint  *types.Endpoint
	RemoteEndpoint *types.Endpoint

	LocalSubnet  string
	RemoteSubnet string
}

Connection is the struct for VPN connection.

type Driver

type Driver interface {
	// Init inits the driver. If return an error, raven agent will exit.
	Init() error
	// Apply applies the given network to the cluster, which represents the desired state of the cluster.
	// If return an error, the caller is expected to retry again later.
	// Usually, the implementation should compare the current network state with the given desired state,
	// and make changes to reach the desired state.
	// This method should be idempotent.
	Apply(network *types.Network, routeDriverMTU func(*types.Network) (int, error)) error
	// MTU return Minimal MTU in vpn driver
	MTU() (int, error)
	// Cleanup performs the necessary uninstallation.
	Cleanup() error
}

Driver is the interface for VPN implementation.

func New

func New(name string, cfg *config.Config) (Driver, error)

type Factory

type Factory func(cfg *config.Config) (Driver, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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