connection

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyClientReasons     = errors.New("empty client reason")
	ErrInvalidMessage         = errors.New("message invalid")
	ErrParseErrorClientReason = errors.New("unable to parse client reason from message")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Reason            string
	IPAddr            string
	IPPort            string
	VPNAddress        string
	CommonName        string
	SessionID         string
	SessionState      string
	IvSSO             string
	KID               uint64
	CID               uint64
	UsernameIsDefined int
}

func NewClient

func NewClient(conf config.Config, message string) (Client, error)

NewClient parses a multi-line message from the OpenVPN management interface and returns the extracted information. The message contains several `>CLIENT:` records separated by CRLF. Each line is inspected to collect the connection reason with its CID/KID and to read environment variables such as untrusted IP address, port and session identifiers. Unsupported or empty environment lines are ignored. If no valid reason line is found, ErrParseErrorClientReason is returned.

Jump to

Keyboard shortcuts

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