vpn

package
v0.0.0-...-b0038d1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenVPN

type OpenVPN struct {
	StateChannel  chan *VPNStateEvent
	ClientChannel chan *VPNClientEvent
	// contains filtered or unexported fields
}

func StartOpenVPN

func StartOpenVPN(socketPath, config string, cert, key []byte, network net.IPNet) (*OpenVPN, error)

func (*OpenVPN) ExecCommand

func (m *OpenVPN) ExecCommand(command string, expectResponse bool) error

func (*OpenVPN) Shutdown

func (m *OpenVPN) Shutdown()

type VPNClientEvent

type VPNClientEvent struct {
	Type        string // CONNECT,REAUTH,ESTABLISHED,DISCONNECT,ADDRESS
	ClientId    uint64
	KeyId       uint64            // only for CONNECT and REAUTH
	Primary     bool              // only for ADDRESS
	Address     net.IPNet         // only for ADDRESS
	Environment map[string]string // nil for ADDRESS
}

type VPNManager

type VPNManager struct {
	Server   *OpenVPN
	Firewall *fw.Firewall
	// contains filtered or unexported fields
}

func BootVPN

func BootVPN(conf config.ConfigurationBackend, root string) (rv *VPNManager, err error)

func (*VPNManager) DisconnectUser

func (m *VPNManager) DisconnectUser(user string) error

func (*VPNManager) Shutdown

func (m *VPNManager) Shutdown()

type VPNStateEvent

type VPNStateEvent struct {
	Time          int64
	State         string
	Description   string
	IPv4          net.IP
	RemoteAddress net.IP
	RemotePort    int
	LocalAddress  net.IP
	LocalPort     int
	IPv6          net.IP
}

Jump to

Keyboard shortcuts

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