Documentation ¶
Index ¶
- func CheckConnect(peerIP string, tryCount int) bool
- func FlushAddr(iface string) error
- func GetAllowedIP(ip string) (*net.IPNet, error)
- func GetAllowedIPAsStr(ip string) (string, error)
- func GetAllowedIPs(ips string) ([]net.IPNet, error)
- func GetAllowedIPsAsStr(cidrIPs string) (string, error)
- func GetAvailableIP(ips []string, cidr string) (string, *net.IPNet, error)
- func GetEndpoint(endpoint string) *net.UDPAddr
- func GetIpCidrString(ip string, cidr string) (string, error)
- func GetPeerIP(peerCidrIP string, myCidrIP string) string
- func GetSubnetFirstIP(ip string) string
- func IpStringToPrefix(ip string) []netip.Prefix
- func IterIP(ip net.IP) net.IP
- func ParseCidrIP(cidrIP string) (net.IP, *net.IPNet, error)
- func PingAddr(addr string) error
- func PingOnce(peerIP string) bool
- type IpFunc
- type Pinger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckConnect ¶
func GetAllowedIP ¶
The allowed IPv4 for clients to be added to the server may only be a /32, but wgctrl expects a list. This function returns the list with a single entry from an IP string. ip=192.0.2.0 ip=192.0.2.0/24
func GetAllowedIPAsStr ¶
ip=192.0.2.0/24 ip=192.0.2.0 maybe just return the same value as input, so we can call this is a validation func
func GetAllowedIPs ¶
ips=192.0.2.0/24,10.0.0.1/24 ips=192.0.2.0,10.0.0.1/24 ips=192.0.2.0,10.0.0.1
func GetAllowedIPsAsStr ¶
cidrIPs=192.0.2.0/24,10.0.0.1/24 maybe just return the same value as input, so we can call this is a validation func
func GetAvailableIP ¶
This function accepts a list of strings and returns the next IP not in this list. If we overflow the server CIDR, an error is returned.
func GetIpCidrString ¶
Accepts an IP and a CIDR as strings and returns a string merging the two.