Documentation ¶
Index ¶
- func HostBig(base netip.Prefix, num *big.Int) (netip.Addr, error)
- func NextSubnet(network netip.Prefix, prefixLen int) (netip.Prefix, bool)
- func PreviousSubnet(network netip.Prefix, prefixLen int) (netip.Prefix, bool)
- func SubnetBig(base netip.Prefix, newBits int, num *big.Int) (netip.Prefix, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HostBig ¶
HostBig takes a parent CIDR range and turns it into a host IP address with the given host number. It differs from Host in that it takes a *big.Int for the num, instead of an int.
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 Prefix provided. If the IP space rolls over then the second return value is true
func SubnetBig ¶
SubnetBig takes a parent CIDR range and creates a subnet within it with the given number of additional prefix bits and the given network number. It differs from Subnet in that it takes a *big.Int for the num, instead of an int.
For example, 10.3.0.0/16, extended by 8 bits, with a network number of 5, becomes 10.3.5.0/24 .
Types ¶
This section is empty.