Documentation ¶
Index ¶
- Variables
- func ChildCIDRs(parent *net.IPNet) (*net.IPNet, *net.IPNet, error)
- func ContainsCIDR(parentCIDR *net.IPNet, childCIDR *net.IPNet) bool
- func ContainsExistingCIDR(currentCIDR *net.IPNet, usedCIDRs []*net.IPNet) bool
- func EqualCIDRs(x *net.IPNet, y *net.IPNet) bool
- func EqualMask(x *net.IPMask, y *net.IPMask) bool
- func FindAvailableCIDR(rootCIDR *net.IPNet, desiredMask *net.IPMask, usedCIDRs []*net.IPNet) (*net.IPNet, error)
- func MatchesExistingCIDR(currentCIDR *net.IPNet, usedCIDRs []*net.IPNet) bool
- func SmallerMask(smaller *net.IPMask, larger *net.IPMask) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoAvailableCidr = errors.New("unable to find available CIDR range") ErrInvalidInputRanges = errors.New("input ranges invalid") )
Functions ¶
func ChildCIDRs ¶
ChildCIDRs will return the two child CIDRs from extending the mask 1 bit
func ContainsCIDR ¶
ContainsCIDR returns true if the childCIDR is contained within parentCIDR, and false otherwise. Comparison checking is inclusive, so identical CIDRs will return true.
func ContainsExistingCIDR ¶
ContainsExistingCIDR returns true if any of the usedCIDRs are contained within the currentCIDR, and false otherwise.
func FindAvailableCIDR ¶
func FindAvailableCIDR(rootCIDR *net.IPNet, desiredMask *net.IPMask, usedCIDRs []*net.IPNet) (*net.IPNet, error)
FindAvailableCIDR will find a CIDR range of specified desiredMask size within the rootCIDR given a list of already existing usedCIDRs.
func MatchesExistingCIDR ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.