Documentation
¶
Index ¶
- func FindAvailableUDPPort(minPort, maxPort uint16) (uint16, error)
- func FixKey(key string) string
- func GetDestPort(packet []byte) (uint16, bool)
- func GetProtocol(packet []byte) (uint8, bool)
- func MapToWireGuardLogLevel(level logger.LogLevel) int
- func ParseLogLevel(level string) logger.LogLevel
- func ResolveDomain(domain string) (string, error)
- func ResolveDomainAll(domain string) ([]string, error)
- func ResolveDomainAllUpstream(domain string, publicDNS []string) ([]string, error)
- func ResolveDomainUpstream(domain string, publicDNS []string) (string, error)
- func UnfixKey(hexKey string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindAvailableUDPPort ¶
find an available UDP port in the range [minPort, maxPort] and also the next port for the wgtester
func GetDestPort ¶
GetDestPort returns destination port from TCP/UDP packet (fast path)
func GetProtocol ¶
GetProtocol returns protocol number from IPv4 packet (fast path)
func MapToWireGuardLogLevel ¶
func ParseLogLevel ¶
func ResolveDomain ¶
func ResolveDomainAll ¶ added in v1.18.0
ResolveDomainAll is ResolveDomainAllUpstream using only the system/platform resolver (no explicit upstream DNS servers).
func ResolveDomainAllUpstream ¶ added in v1.18.0
ResolveDomainAllUpstream resolves domain to every candidate address (all families, deduplicated), each formatted as "ip:port" (or bare ip if domain had no port). Unlike ResolveDomainUpstream, which collapses to a single IPv4-preferred address, this lets a caller that can try more than one candidate (e.g. UDP hole punching) reach the destination over whichever address family the local network path actually has a route for, instead of always preferring an IPv4 address that may be completely unreachable (e.g. on an IPv6-only/NAT64 network). See https://github.com/fosrl/olm/issues/108.
func ResolveDomainUpstream ¶ added in v1.10.3
Types ¶
This section is empty.