vpndriver

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPSK     = "openyurt-raven"
	DefaultVPNPort = "4500"
)

Variables

This section is empty.

Functions

func DefaultMTU added in v0.2.0

func DefaultMTU() (int, error)

func EnableCreateEdgeConnection added in v0.4.1

func EnableCreateEdgeConnection(localEndpoint *types.Endpoint, remoteEndpoint *types.Endpoint) bool

EnableCreateEdgeConnection determine whether VPN tunnels can be established between edges.

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