libdraco

package module
v0.0.0-...-0b3e150 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const WgInterfaceDefault = "wt0"

WgInterfaceDefault is a default interface name of libdraco

Variables

View Source
var (

	// todo check after move the WgPort constant to the client
	WgPort = 51820
)

Functions

func Close

func Close() error

Closes the tunnel interface

func CloseWithUserspace

func CloseWithUserspace() error

Closes the User Space tunnel interface

func Configure

func Configure(iface string, privateKey string) error

Configure configures a Wireguard interface The interface must exist before calling this method (e.g. call interface.Create() before)

func Create

func Create(iface string, address string) error

Create Creates a new Wireguard interface, sets a given IP and brings it up. Will reuse an existing one.

func CreateWithKernel

func CreateWithKernel(iface string, address string) error

CreateWithKernel Creates a new Wireguard interface using kernel Wireguard module. Works for Linux and offers much better network performance

func CreateWithUserspace

func CreateWithUserspace(iface string, address string) error

CreateWithUserspace Creates a new Wireguard interface, using wireguard-go userspace implementation

func Exists

func Exists(iface string) (*bool, error)

Exists checks whether specified Wireguard device exists or not

func GetListenPort

func GetListenPort(iface string) (*int, error)

GetListenPort returns the listening port of the Wireguard endpoint

func RemovePeer

func RemovePeer(iface string, peerKey string) error

RemovePeer removes a Wireguard Peer from the interface iface

func UpdatePeer

func UpdatePeer(iface string, peerKey string, allowedIps string, keepAlive time.Duration, endpoint string) error

UpdatePeer updates existing Wireguard Peer or creates a new one if doesn't exist Endpoint is optional

func UpdatePeerEndpoint

func UpdatePeerEndpoint(iface string, peerKey string, newEndpoint string) error

UpdatePeerEndpoint updates a Wireguard interface Peer with the new endpoint Used when NAT hole punching was successful and an update of the remote peer endpoint is required

func WireguardModExists

func WireguardModExists() bool

WireguardModExists returns true if Wireguard kernel module exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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