openvpn

package
v0.0.0-...-ebde92b Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package openvpn provides OpenVPN technology.

Index

Constants

View Source
const (
	InterfaceName = "nordtun"
)

Variables

View Source
var (
	ErrServerVersion = errors.New("invalid openvpn server version")
)

Functions

This section is empty.

Types

type OpenVPN

type OpenVPN struct {

	// sync.RWMutex is used all over the place due to how OpenVPN
	// is managed over the management interface.
	// Simple Lock(); defer Unlock() results in deadlocks, since
	// substates updates get stuck waiting for Mutex.
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(fwmark uint32, eventsPublisher *vpn.Events) *OpenVPN

func (*OpenVPN) GetConnectionParameters

func (ovpn *OpenVPN) GetConnectionParameters() (vpn.ServerData, bool)

func (*OpenVPN) IsActive

func (ovpn *OpenVPN) IsActive() bool

IsActive checks if openvpn process is running

func (*OpenVPN) NetworkChanged

func (ovpn *OpenVPN) NetworkChanged() error

func (*OpenVPN) Start

func (ovpn *OpenVPN) Start(
	ctx context.Context,
	creds vpn.Credentials,
	serverData vpn.ServerData,
) error

Start starts openvpn process

func (*OpenVPN) State

func (ovpn *OpenVPN) State() vpn.State

func (*OpenVPN) Stop

func (ovpn *OpenVPN) Stop() error

Stop stops openvpn process

func (*OpenVPN) Tun

func (ovpn *OpenVPN) Tun() tunnel.T

Jump to

Keyboard shortcuts

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