Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLocalIP = errors.New("local ip is invalid") ErrInvalidRemoteIP = errors.New("remote ip is invalid") )
Error variables for invalid IP addresses
Functions ¶
func IsBogon ¶
IsBogon returns true if dialing the address would fail due to gonet restrictions. A bogon address is a packet routed on the public internet that claims to originate from an area of the IP address space reserved or not yet allocated. This function checks against known bogon conditions including loopback, link-local, and other special addresses. Additional conditions can be specified through the extra parameter.
func IsLinkLocal ¶
IsLinkLocal determines if the provided IP address is a link-local address. Link-local addresses are used in a single network segment and not routable on the larger internet. This function checks if the IP belongs to the IPv4 link-local range (169.254.0.0/16) or the IPv6 link-local range (fe80::/64).
func IsLoopback ¶
IsLoopback determines if the IP is either the standard IPv6 loopback (::1) or within the IPv4 loopback range.
func IsPrivateNetwork ¶
IsPrivateNetwork returns true if the address belongs to a private network. This function checks against standard private IPv4 ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and the IPv6 unique local address range (fd00::/8).
Types ¶
This section is empty.