models

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// default proxy port
	NmProxyPort = 51722
	// default CIDR for proxy peers
	DefaultCIDR = "127.0.0.1/8"
)

Variables

This section is empty.

Functions

func ConvPeerKeyToHash

func ConvPeerKeyToHash(peerKey string) string

ConvPeerKeyToHash - converts peer key to a md5 hash

func IsPublicIP

func IsPublicIP(ip net.IP) bool

IsPublicIP indicates whether IP is public or not.

Types

type Conn

type Conn struct {
	// Key is a public key of a remote peer
	Key             wgtypes.Key
	IsExtClient     bool
	IsRelayed       bool
	RelayedEndpoint *net.UDPAddr
	Config          Proxy
	StopConn        func()
	ResetConn       func()
	LocalConn       net.Conn
	Mutex           *sync.RWMutex
	NetworkSettings map[string]Settings
	ServerMap       map[string]struct{}
}

Conn is a peer Connection configuration

type HostInfo

type HostInfo struct {
	PublicIp     net.IP
	PrivIp       net.IP
	PubPort      int
	PrivPort     int
	ProxyEnabled bool
}

HostInfo - struct for host information

type PeerConnMap

type PeerConnMap map[string]*Conn

PeerConnMap - type for peer conn config map

type Proxy

type Proxy struct {
	PeerPublicKey  wgtypes.Key
	IsExtClient    bool
	PeerConf       wgtypes.PeerConfig
	PeerEndpoint   *net.UDPAddr
	RemoteConnAddr *net.UDPAddr
	LocalConnAddr  *net.UDPAddr
	ListenPort     int
	ProxyStatus    bool
}

Proxy - struct for proxy config

type RemotePeer

type RemotePeer struct {
	PeerKey     string
	Endpoint    *net.UDPAddr
	IsExtClient bool
	LocalConn   net.Conn
	CancelFunc  context.CancelFunc
	CommChan    chan *net.UDPAddr
}

RemotePeer - struct remote peer data

type Settings

type Settings struct {
	IsRelay          bool
	IsIngressGateway bool
	IsEgressGateway  bool
	IsRelayed        bool
	RelayedTo        *net.UDPAddr
}

Settings - struct for host settings

Jump to

Keyboard shortcuts

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