Documentation ¶
Index ¶
- func CIDROverlap(n1, n2 net.IPNet) bool
- func CIDRToIPv4Range(cidr string) (string, string, fail.Error)
- func CIDRToUInt32Range(cidr string) (uint32, uint32, fail.Error)
- func CheckRemoteTCP(ip string, port int) bool
- func FirstIncludedSubnet(base net.IPNet, maskAddition uint8) (net.IPNet, fail.Error)
- func IPv4StringToUInt32(ip string) uint32
- func IPv4ToUInt32(ip net.IP) uint32
- func IsCIDRRoutable(cidr string) (bool, fail.Error)
- func IsConnectionRefused(err error) bool
- func IsConnectionReset(err error) bool
- func NthIncludedSubnet(base net.IPNet, maskAddition uint8, nth uint) (net.IPNet, fail.Error)
- func UInt32ToIPv4(value uint32) net.IP
- func UInt32ToIPv4String(value uint32) string
- func WhileCommunicationUnsuccessfulDelay1Second(callback func() error, timeout time.Duration) fail.Error
- func WhileUnsuccessfulButRetryable(callback func() error, waiter *retry.Officer, timeout time.Duration, ...) fail.Error
- type CIDRString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CIDROverlap ¶
CIDROverlap VPL: Not used ? duplicate with DoCIDRsIntersect CIDROverlap tells if the 2 CIDR passed as parameter intersect
func CIDRToIPv4Range ¶
CIDRToIPv4Range converts CIDR to IPv4 range
func CIDRToUInt32Range ¶
CIDRToUInt32Range converts CIDR to IPv4 range
func CheckRemoteTCP ¶ added in v21.11.1
CheckRemoteTCP returns true if ip:port is listening, false otherwise
func FirstIncludedSubnet ¶
FirstIncludedSubnet takes a parent CIDR range and gives the first subnet within it with the given number of additional prefix bits 'maskAddition'.
For example, 192.168.0.0/16, extended by 8 bits becomes 192.168.0.0/24.
func IPv4StringToUInt32 ¶
IPv4StringToUInt32 converts IPv4 to uint32
func IsCIDRRoutable ¶
IsCIDRRoutable tells if the network is routable
func IsConnectionRefused ¶
IsConnectionRefused returns true if given err is a "connection refused" error
func IsConnectionReset ¶
IsConnectionReset returns true if given err is a "reset by peer" error
func NthIncludedSubnet ¶
NthIncludedSubnet takes a parent CIDR range and gives the 'nth' subnet within it with the given numver of additional prefix bits 'maskAddition'
For example, 192.168.0.0/16, extended by 8 bits gives as 4th subnet 192.168.4.0/24.
func UInt32ToIPv4String ¶
UInt32ToIPv4String converts uint32 to IP
func WhileCommunicationUnsuccessfulDelay1Second ¶
func WhileCommunicationUnsuccessfulDelay1Second(callback func() error, timeout time.Duration) fail.Error
WhileCommunicationUnsuccessfulDelay1Second executes callback inside a retry loop with tolerance for communication errors (relative to net package), waiting 1 second between each try, with a limit of 'timeout'
func WhileUnsuccessfulButRetryable ¶
func WhileUnsuccessfulButRetryable(callback func() error, waiter *retry.Officer, timeout time.Duration, options ...retry.Option) fail.Error
WhileUnsuccessfulButRetryable executes callback inside a retry loop with tolerance for communication errors (relative to net package), or some fail.Error that are considered retryable: asking "waiter" to wait between each try, with a duration limit of 'timeout'.
Types ¶
type CIDRString ¶
type CIDRString string
CIDRString string representing a CIDR
func (CIDRString) Contains ¶
func (cs CIDRString) Contains(cidr CIDRString) (bool, error)
Contains tells if 'cs' contains 'cidr'
func (CIDRString) IntersectsWith ¶
func (cs CIDRString) IntersectsWith(cidr CIDRString) (bool, error)
IntersectsWith tells if the 2 cidr intersects