commons

package
v1.69.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPrefix4 = netip.MustParsePrefix("198.18.0.1/16")
	DefaultPrefix6 = netip.MustParsePrefix("6663:6b71:7569:726b::1/64")
)

Functions

func ConfigInterfaceAddress

func ConfigInterfaceAddress(dev device.Device, addr4, addr6 netip.Prefix, _ int, autoRoute bool) error

func GetAutoDetectInterface

func GetAutoDetectInterface() (string, error)

func GetFirstAvailableIP added in v1.69.0

func GetFirstAvailableIP(p netip.Prefix) netip.Addr

func RelayDnsPacket

func RelayDnsPacket(payload []byte) ([]byte, error)

func SetTunChangeCallback

func SetTunChangeCallback(callback C.TUNChangeCallback)

func SetTunStatus

func SetTunStatus(status C.TUNState)

func ShouldHijackDns

func ShouldHijackDns(dnsHijack []C.DNSUrl, targetAddr netip.AddrPort, network string) bool

func StartDefaultInterfaceChangeMonitor

func StartDefaultInterfaceChangeMonitor()

func StopDefaultInterfaceChangeMonitor

func StopDefaultInterfaceChangeMonitor()

func UpdateWireGuardBind

func UpdateWireGuardBind()

Types

type DefaultInterface

type DefaultInterface struct {
	Name    string
	Index   int
	IP      netip.Addr
	Gateway netip.Addr
}

Jump to

Keyboard shortcuts

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