libcloud.utils.networking module
- libcloud.utils.networking.increment_ipv4_segments(segments)[source]
Increment an ip address given in quad segments based on ipv4 rules
- Parameters:
segments (
list
ortuple
) – IPv4 segments to increment.- Returns:
Incremented segments.
- Return type:
list
- libcloud.utils.networking.is_private_subnet(ip)[source]
Utility function to check if an IP address is inside a private subnet.
- Parameters:
ip (
str
) – IP address to check- Returns:
bool
if the specified IP address is private.
- libcloud.utils.networking.is_public_subnet(ip)[source]
Utility function to check if an IP address is inside a public subnet.
- Parameters:
ip (
str
) – IP address to check- Returns:
bool
if the specified IP address is public.
- libcloud.utils.networking.is_valid_ip_address(address, family=AddressFamily.AF_INET)[source]
Check if the provided address is valid IPv4 or IPv6 address.
- Parameters:
address (
str
) – IPv4 or IPv6 address to check.family (
int
) – Address family (socket.AF_INTET / socket.AF_INET6).
- Returns:
bool
True if the provided address is valid.