network module
Classes for network operations.
Main classes
- class ctlbase.network.NetworkManager(commandExecutor)
A manager for the local network.
It requires an
ipbinary on the host machine. On Debian-based syetems, it can be installed withsudo apt install iproute2.In future releases, the implementation might switch to psutil.
- __init__(commandExecutor)
Creates an network manager with a specific configuration.
- Parameters:
commandExecutor¶ (CommandExecutor) – The command executor to use for network-related commands like
ip.
- async getLocalIp(interface=None)
Determines the IPv4 and IPv6 address(es) of the localhost.
- async getLocalIp4(interface=None)
Determines the IPv4 address(es) of the localhost.
- async getLocalIp6(interface=None)
Determines the IPv6 address(es) of the localhost.
- async isLocalIp(ipAddress, interface=None)
Checks whether a specific IP address belongs to the localhost.
- Parameters:
- Returns:
True if the given IP address(es) belong to the localhost, i.e. the host on which the process is running. False otherwise.
- Return type: