wireguard

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package wireguard - constants and helper methods for Wireguard remote mechanism

Index

Constants

View Source
const (
	// MECHANISM type string
	MECHANISM = "WIREGUARD"

	// BasePort - Wireguard base port
	BasePort = 51820

	// SrcIP - source IP
	SrcIP = common.SrcIP
	// DstIP - destitiona IP
	DstIP = common.DstIP
	// SrcOriginalIP - original src IP
	SrcOriginalIP = "orig_src_ip"
	// DstExternalIP - external destination ip
	DstExternalIP = "ext_src_ip"
	// SrcPort - Source interface listening port
	SrcPort = "src_port"
	// DstPort - Destination interface listening port
	DstPort = "dst_port"
	// SrcPublicKey - Source public key
	SrcPublicKey = "src_public_key"
	// SrcPrivateKey - Source private key
	SrcPrivateKey = "src_private_key"
	// DstPublicKey - Destination public key
	DstPublicKey = "dst_public_key"
	// DstPrivateKey - Source private key
	DstPrivateKey = "dst_private_key"

	// MTUOverhead - maximum transmission unit overhead for Wireguard encapsulation
	MTUOverhead = 75 // TODO: verify (https://lists.zx2c4.com/pipermail/wireguard/2019-July/004289.html)
)

Variables

This section is empty.

Functions

func AssignPort

func AssignPort(connID string) string

AssignPort - generate unique port by connection ID for wireguard connection

Types

type Mechanism

type Mechanism interface {
	// SrcIP -  src ip
	SrcIP() (string, error)
	// DstIP - dst ip
	DstIP() (string, error)
	// SrcPublicKey - source public key
	SrcPublicKey() (string, error)
	// DstPublicKey - destination public key
	DstPublicKey() (string, error)
	// SrcPrivateKey - source private key
	SrcPrivateKey() (string, error)
	// dstPrivateKey - destination private key
	DstPrivateKey() (string, error)
	// SrcPort - Source interface listening port
	SrcPort() (int, error)
	// SrcPort - Destination interface listening port
	DstPort() (int, error)
}

Mechanism - a wireguard mechanism utility wrapper

func ToMechanism

func ToMechanism(m *connection.Mechanism) Mechanism

ToMechanism - convert unified mechanism to useful wrapper

Jump to

Keyboard shortcuts

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