util

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAvailableUDPPort

func FindAvailableUDPPort(minPort, maxPort uint16) (uint16, error)

find an available UDP port in the range [minPort, maxPort] and also the next port for the wgtester

func FixKey

func FixKey(key string) string

func GetDestPort

func GetDestPort(packet []byte) (uint16, bool)

GetDestPort returns destination port from TCP/UDP packet (fast path)

func GetProtocol

func GetProtocol(packet []byte) (uint8, bool)

GetProtocol returns protocol number from IPv4 packet (fast path)

func MapToWireGuardLogLevel

func MapToWireGuardLogLevel(level logger.LogLevel) int

func ParseLogLevel

func ParseLogLevel(level string) logger.LogLevel

func ResolveDomain

func ResolveDomain(domain string) (string, error)

func UnfixKey

func UnfixKey(hexKey string) string

this is the opposite of FixKey

Types

This section is empty.

Jump to

Keyboard shortcuts

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