Documentation ¶
Index ¶
- func AddrPortFromNet(addr net.Addr) netip.AddrPort
- func HostID(addr netip.Addr, bits uint) uint64
- func LastAddr(p netip.Prefix) netip.Addr
- func PrefixAfter(prev netip.Prefix, sz int) netip.Prefix
- func PrefixCompare(a, b netip.Prefix) int
- func SubnetRange(network, subnet netip.Prefix) (start, end uint64)
- func ToIPNet(p netip.Prefix) *net.IPNet
- func ToPrefix(n *net.IPNet) (netip.Prefix, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddrPortFromNet ¶
AddrPortFromNet converts a net.Addr into a netip.AddrPort.
func HostID ¶
HostID masks out the 'bits' most-significant bits of addr. The result is undefined if bits > addr.BitLen().
func PrefixAfter ¶
PrefixAfter returns the prefix of size 'sz' right after 'prev'.
func PrefixCompare ¶
PrefixCompare two prefixes and return a negative, 0, or a positive integer as required by slices.SortFunc. When two prefixes with the same address is provided, the shortest one will be sorted first.
func SubnetRange ¶
SubnetRange returns the amount to add to network.Addr() in order to yield the first and last addresses in subnet, respectively.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.