package netiputil
import "github.com/dotcloud/docker/libnetwork/internal/netiputil"
Index ¶
- func HostID(addr netip.Addr, bits uint) uint64
- func SubnetRange(network, subnet netip.Prefix) (start, end uint64)
- func ToIPNet(p netip.Prefix) *net.IPNet
- func ToPrefix(n *net.IPNet) (netip.Prefix, bool)
Functions ¶
func HostID ¶
HostID masks out the 'bits' most-significant bits of addr. The result is undefined if bits > addr.BitLen().
func SubnetRange ¶
SubnetRange returns the amount to add to network.Addr() in order to yield the first and last addresses in subnet, respectively.
func ToIPNet ¶
ToIPNet converts p into a *net.IPNet, returning nil if p is not valid.
func ToPrefix ¶
ToPrefix converts n into a netip.Prefix. If n is not a valid IPv4 or IPV6 address, ToPrefix returns netip.Prefix{}, false.
Source Files ¶
- Version
- v25.0.4+incompatible
- Published
- Mar 6, 2024
- Platform
- js/wasm
- Imports
- 3 packages
- Last checked
- 13 minutes ago –
Tools for package owners.