openvpn

package module
v0.0.0-...-6b5181a Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2015 License: MIT Imports: 10 Imported by: 0

README

openvpn

GoDoc

Library for various openvpn tasks. Currently the only supported use is to parse the openvpn status file.

Documentation

Overview

Package openvpn provides various methods for parsing and interacting with the OpenVPN server.

Index

Constants

This section is empty.

Variables

View Source
var EOF = errors.New("EOF reached")

EOF is returned when the end of the file is reached in parseLine

Functions

This section is empty.

Types

type Addr

type Addr struct {
	IP   net.IP
	Port int
}

Represents an INET address with an IP and port

type Client

type Client struct {
	CommonName    string
	RealAddress   Addr
	BytesReceived uint64
	BytesSent     uint64
	Since         time.Time
}

Represents a OpenVPN client

type Route

type Route struct {
	VirtualAddress RouteAddr
	CommonName     string
	RealAddress    Addr
	LastRef        time.Time
}

Represents a OpenVPN route

type RouteAddr

type RouteAddr struct {
	net.IPNet

	// Remote means it was learned via the remote host
	// The server is forwarding this route to that host
	Remote bool
}

Represents an route address with an IP and mask

type Status

type Status struct {
	Updated  time.Time
	Clients  []Client
	Routes   []Route
	MaxQueue uint64
	// contains filtered or unexported fields
}

Represents the OpenVPN status at a point in time

func Parse

func Parse(r io.Reader) (*Status, error)

Parses an io.Reader into a Status

func ParseFile

func ParseFile(path string) (*Status, error)

Helper that reads a file into Parse

Jump to

Keyboard shortcuts

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