vpn

package
v0.0.0-...-129f1c8 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MagicMACOctet0 = 0x44
	MagicMACOctet1 = 0x58
)
View Source
const (
	TAPFrameMaxSize = 1500
)

Variables

View Source
var (
	ErrWrongMask    = errors.New("Invalid mask")
	ErrPeerNotFound = errors.NotFound.New("peer not found")
	ErrNoPath       = errors.CannotSendData.New("there's no established path, yet")
	ErrPartialWrite = errors.New("partial write")
	ErrEmptyPayload = errors.New("empty payload")
)

Functions

func GenerateHomenetMAC

func GenerateHomenetMAC(peerIntAlias uint32) (r mac)

func New

func New(subnet net.IPNet, homenet *network.Network, opts ...Option) (r *vpn, err error)

func OptSetLoggerDump

func OptSetLoggerDump(logger Logger) optSetLoggerDump

Types

type Logger

type Logger interface {
	Printf(fmt string, args ...interface{})
}

type Mac

type Mac interface {
	String() string
	Bytes() []byte
	Get(idx int) byte
	GetFrom(idx int) []byte
	IsHomenet() bool
	IsBroadcast() bool
	GetPeerIntAlias() uint32

	IsMAC() bool
}

type Option

type Option interface {
	HomenetVPNOptionMethod()
}

type Options

type Options []Option

Jump to

Keyboard shortcuts

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