Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
Add adds a non-negative offset to an address. ok is false on invalid input or family overflow.
func ParseAddr ¶
ParseAddr parses an IPv4 or IPv6 address. IPv4-mapped IPv6 representations are rejected so callers cannot accidentally change address families through netip.Addr.Unmap.
func PrefixAddressCount ¶
PrefixAddressCount returns the number of IP addresses in a prefix.
Types ¶
type IPRange ¶
IPRange is the internal representation of a contiguous IPv4 or IPv6 address range. Start and End must always belong to the same address family.
func ExcludeRanges ¶
ExcludeRanges returns all sub-ranges of parent that are not covered by any range in allocated.
func MergeRanges ¶
MergeRanges merges overlapping/adjacent IP ranges into a minimal set. Mixed families remain separate.
func RangeFromPrefix ¶
RangeFromPrefix returns the inclusive address range covered by prefix.
func SortRanges ¶
SortRanges returns a copy of the ranges sorted by family, start address, then end address.
func SubtractRange ¶
SubtractRange returns ranges with sub removed, splitting any overlapping range around it.