vpnstatus

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package vpnstatus contains the VPN status.

Index

Constants

View Source
const (
	TrafPolStateUnknown = iota
	TrafPolStateInactive
	TrafPolStateActive
	TrafPolStateDisabled
)

TrafPolState states.

View Source
const (
	TNDStateUnknown = iota
	TNDStateInactive
	TNDStateActive
)

TNDState states.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionState

type ConnectionState uint32

ConnectionState is the current connection state.

const (
	ConnectionStateUnknown ConnectionState = iota
	ConnectionStateDisconnected
	ConnectionStateConnecting
	ConnectionStateConnected
	ConnectionStateDisconnecting
)

ConnectionState states.

func (ConnectionState) Connected

func (c ConnectionState) Connected() bool

Connected returns whether ConnectionState is state "connected".

func (ConnectionState) String

func (c ConnectionState) String() string

String returns ConnectionState as string.

type OCRunning

type OCRunning uint32

OCRunning is the current state of the openconnect client.

const (
	OCRunningUnknown OCRunning = iota
	OCRunningNotRunning
	OCRunningRunning
)

OCRunning states.

func (OCRunning) Running

func (o OCRunning) Running() bool

Running returns whether OCRunning is in state "running".

func (OCRunning) String

func (o OCRunning) String() string

String returns OCRunning as string.

type Status

type Status struct {
	TrustedNetwork  TrustedNetwork
	ConnectionState ConnectionState
	IP              string
	Device          string
	Server          string
	ServerIP        string
	ConnectedAt     int64
	Servers         []string
	OCRunning       OCRunning
	OCPID           uint32
	TrafPolState    TrafPolState
	AllowedHosts    []string
	TNDState        TNDState
	TNDServers      []string
	VPNConfig       *vpnconfig.Config
}

Status is a VPN status.

func New

func New() *Status

New returns a new Status.

func NewFromJSON

func NewFromJSON(b []byte) (*Status, error)

NewFromJSON parses and returns the Status in b.

func (*Status) Copy

func (s *Status) Copy() *Status

Copy returns a copy of Status.

func (*Status) JSON

func (s *Status) JSON() ([]byte, error)

JSON returns the Status as JSON.

type TNDState added in v1.2.0

type TNDState uint32

TNDState is the current TND state.

func (TNDState) String added in v1.2.0

func (t TNDState) String() string

String resturns TNDState as string.

type TrafPolState added in v1.2.0

type TrafPolState uint32

TrafPolState is the current TrafPol state.

func (TrafPolState) String added in v1.2.0

func (t TrafPolState) String() string

String resturns TrafPolState as string.

type TrustedNetwork

type TrustedNetwork uint32

TrustedNetwork is the current trusted network state.

const (
	TrustedNetworkUnknown TrustedNetwork = iota
	TrustedNetworkNotTrusted
	TrustedNetworkTrusted
)

TrustedNetwork states

func (TrustedNetwork) String

func (t TrustedNetwork) String() string

String returns t as string.

func (TrustedNetwork) Trusted

func (t TrustedNetwork) Trusted() bool

Trusted returns whether TrustedNetwork is state "trusted".

Jump to

Keyboard shortcuts

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