Documentation ¶
Index ¶
- Variables
- func AddIPToRange(ip net.IP, ipRanges []flv1.IPRange) []flv1.IPRange
- func CheckIPRangesConflict(ranges1, ranges2 []flv1.IPRange) error
- func CheckNetworkConflict(cidr1, cidr2 string) error
- func GetAvailableIP(cidr string, ipRanges []flv1.IPRange, usedIPs []flv1.IPRange) (net.IP, error)
- func GetDefaultGateway(CIDR string) (net.IP, error)
- func IPDecrease(ip net.IP)
- func IPInNetwork(ip net.IP, network *net.IPNet) bool
- func IPInRanges(ip net.IP, ipRanges []flv1.IPRange) bool
- func IPIncrease(ip net.IP)
- func IsAvailableIP(ip net.IP, network *net.IPNet) bool
- func IsBroadCast(ip net.IP, network *net.IPNet) bool
- func IsNetwork(ip net.IP, network *net.IPNet) bool
- func MaskXOR(mask net.IPMask) net.IPMask
- func RemoveIPFromRange(ip net.IP, ipRanges []flv1.IPRange) []flv1.IPRange
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AddIPToRange ¶
AddIPToRange adds an IP address to IPRange.
func CheckIPRangesConflict ¶
func CheckNetworkConflict ¶
func GetAvailableIP ¶
func GetAvailableIP( cidr string, ipRanges []flv1.IPRange, usedIPs []flv1.IPRange, ) (net.IP, error)
GetAvailableIP gets a **16bytes length** IP address by CIDR and IPRange. ErrNoAvailableIP error will be returned if no IP address resource available.
func GetDefaultGateway ¶
GetDefaultGateway returns **16 bytes** IP address by CIDR.
Example:
CIDR `192.168.1.0/24` -> return `192.168.1.1`.
func IPInRanges ¶
IPInRanges checks whether the address is in the IPRange.
func IsAvailableIP ¶
IsAvailableIP returns true if the provided IP address is not a broadcast and not a network address.
func IsBroadCast ¶
IsBroadCast checks if the IP address is the broadcast address of the network.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.