wireguard

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Overview

Package wireguard - constants and helper methods for Wireguard remote mechanism

Index

Constants

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

	// SrcIP - source IP
	SrcIP = common.SrcIP
	// DstIP - destination IP
	DstIP = common.DstIP
	// SrcPort - Source interface listening port
	SrcPort = common.SrcPort
	// DstPort - Destination interface listening port
	DstPort = common.DstPort
	// SrcPublicKey - Source public key
	SrcPublicKey = "src_public_key"
	// DstPublicKey - Destination public key
	DstPublicKey = "dst_public_key"

	// MTU - maximum transmission unit
	MTU = common.MTU
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mechanism

type Mechanism struct {
	*networkservice.Mechanism
}

Mechanism is a wireguard mechanism helper

func ToMechanism

func ToMechanism(m *networkservice.Mechanism) *Mechanism

ToMechanism - convert unified mechanism to useful wrapper

func (*Mechanism) DstIP

func (m *Mechanism) DstIP() net.IP

DstIP returns destination ip

func (*Mechanism) DstPort

func (m *Mechanism) DstPort() uint16

DstPort - Destination interface listening port

func (*Mechanism) DstPublicKey

func (m *Mechanism) DstPublicKey() string

DstPublicKey returns the DstPublicKey parameter of the Mechanism

func (*Mechanism) MTU

func (m *Mechanism) MTU() uint32

MTU - return MTU value - 0 if unset

func (*Mechanism) SetDstIP

func (m *Mechanism) SetDstIP(ip net.IP) *Mechanism

SetDstIP sets destination ip

func (*Mechanism) SetDstPort

func (m *Mechanism) SetDstPort(port uint16) *Mechanism

SetDstPort sets destination udp port

func (*Mechanism) SetDstPublicKey

func (m *Mechanism) SetDstPublicKey(key string) *Mechanism

SetDstPublicKey sets new destination public key

func (*Mechanism) SetMTU

func (m *Mechanism) SetMTU(mtu uint32) *Mechanism

SetMTU - set the MTU value

func (*Mechanism) SetSrcIP

func (m *Mechanism) SetSrcIP(ip net.IP) *Mechanism

SetSrcIP sets source ip

func (*Mechanism) SetSrcPort

func (m *Mechanism) SetSrcPort(port uint16) *Mechanism

SetSrcPort sets source udp port

func (*Mechanism) SetSrcPublicKey

func (m *Mechanism) SetSrcPublicKey(key string) *Mechanism

SetSrcPublicKey sets new source public key

func (*Mechanism) SrcIP

func (m *Mechanism) SrcIP() net.IP

SrcIP returns source ip

func (*Mechanism) SrcPort

func (m *Mechanism) SrcPort() uint16

SrcPort - Source interface listening port

func (*Mechanism) SrcPublicKey

func (m *Mechanism) SrcPublicKey() string

SrcPublicKey returns the SrcPublicKey parameter of the Mechanism

Jump to

Keyboard shortcuts

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