InterfaceWrapper#
- class wattson.cosimulation.simulators.network.emulators.wattson_network_emulator.wrapper.interface_wrapper.InterfaceWrapper(entity: NetworkEntity, emulator: WattsonNetworkEmulator)#
Bases:
EntityWrapperMethods
Applies the properties specified by the link wrapper to this interface.
cleanConfigures the interface with IP, MAC, and other properties
createSets the interface down
existsFlushes the IP from the interface.
get_additional_namespaceget_namespaceis_tc_enabledMoves the interface from its associated namespace to the main namespace
Pushes the interface from the main namespace to the given or associated namespace
Sets the interface up
update_ip_addressupdate_mac_addressWaits for the interface to exist for the given timeout.
Attributes
interface- __init__(entity: NetworkEntity, emulator: WattsonNetworkEmulator)#
- apply_tc_properties(link_model: NetworkLinkModel) bool#
Applies the properties specified by the link wrapper to this interface. Requires tc.
- Parameters:
link_model (NetworkLinkModel) – The link wrapper to use
- Returns:
Whether the properties could be applied
- Return type:
bool
- configure(wait_timeout: float | None = None) bool#
Configures the interface with IP, MAC, and other properties
- down() bool#
Sets the interface down
- Returns:
Whether the command was successful
- Return type:
bool
- flush_ip() bool#
Flushes the IP from the interface.
- Returns:
Whether the command was successful
- Return type:
bool
- pull_to_main_namespace() bool#
Moves the interface from its associated namespace to the main namespace
- push_to_namespace(namespace: Namespace | None = None) bool#
Pushes the interface from the main namespace to the given or associated namespace
- Parameters:
namespace (Optional[Namespace], optional) – The namespace to put this interface into. If None, the nodes namespace is used. (Default value = None)
- up() bool#
Sets the interface up
- Returns:
Whether the command was successful
- Return type:
bool
- wait_exists(timeout: float = 5) bool#
Waits for the interface to exist for the given timeout. :param timeout: The timeout in seconds to wait for the interface. (Default value = 5)
- Returns:
True if the interface exists, False otherwise.