Documentation
¶
Index ¶
- func AddToIP(ip net.IP, offset *big.Int) net.IP
- func IPDiff(x net.IP, y net.IP) *big.Int
- func IPIter(start net.IP, end net.IP, callback func(net.IP) error) error
- func IsCanonicalIP(ip net.IP) bool
- func IsNegative(item *big.Int) bool
- func MustParseIP(x string) net.IP
- func RawIncr(ip net.IP) (res net.IP, overflow bool)
- func ValidateSameFamily(ips ...net.IP) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToIP ¶
AddToIP adds an arbitrary integer to an IP and returns the empty IP if the result would be negative.
func IsCanonicalIP ¶
IsCanonicalIP returns true if the underlying IP object is 16 bytes long.
Internally, net.IP can be 4 bytes or it can be 16 bytes long. IPv4 addresses also have a 16 byte representation with a specific prefix.
func IsNegative ¶
func MustParseIP ¶
MustParseIP parses an IP address and panics if it's invalid.
func RawIncr ¶
RawIncr takes an IP address and increments it in an abstraction-breaking way. It doesn't respect submasks, for example.
func ValidateSameFamily ¶
ValidateSameFamily verifies that a series of IP addresses.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.