Documentation
¶
Index ¶
- func AddressCount(network *net.IPNet) uint64
- func AddressRange(network *net.IPNet) (net.IP, net.IP)
- func Dec(IP net.IP) net.IP
- func Host(base *net.IPNet, num int) (net.IP, error)
- func Inc(IP net.IP) net.IP
- func LoopForEachAddressInCIDR(ipnet *net.IPNet, f func(ip net.IP) bool)
- func NextSubnet(network *net.IPNet, prefixLen int) (*net.IPNet, bool)
- func PreviousSubnet(network *net.IPNet, prefixLen int) (*net.IPNet, bool)
- func Subnet(base *net.IPNet, newBits int, num int) (*net.IPNet, error)
- func VerifyNoOverlap(subnets []*net.IPNet, CIDRBlock *net.IPNet) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddressCount ¶
AddressCount returns the number of distinct host addresses within the given CIDR range.
Since the result is a uint64, this function returns meaningful information only for IPv4 ranges and IPv6 ranges with a prefix size of at least 65.
func AddressRange ¶
AddressRange returns the first and last addresses in the given CIDR range.
func Host ¶
Host takes a parent CIDR range and turns it into a host IP address with the given host number.
For example, 10.3.0.0/16 with a host number of 2 gives 10.3.0.2.
func NextSubnet ¶
NextSubnet returns the next available subnet of the desired mask size starting for the maximum IP of the offset subnet If the IP exceeds the maxium IP then the second return value is true
func PreviousSubnet ¶
PreviousSubnet returns the subnet of the desired mask in the IP space just lower than the start of IPNet provided. If the IP space rolls over then the second return value is true
Types ¶
This section is empty.