WattsonNetworkInterface#
- class wattson.cosimulation.simulators.network.components.wattson_network_interface.WattsonNetworkInterface(*, id: Optional[str] = None, system_name: Optional[str] = None, display_name: Optional[str] = None, network_emulator: Optional[ForwardRef('NetworkEmulator')] = None, emulation_instance: Optional[Any] = None, segment: str = 'main', config: dict = <factory>, _is_started: bool = False, logger: Optional[logging.Logger] = None, mac_address: Optional[str] = None, ip_address: Optional[ipaddress.IPv4Address] = None, subnet_prefix_length: Optional[int] = None, node: Optional[ForwardRef('WattsonNetworkNode')] = None, link: Optional[ForwardRef('WattsonNetworkLink')] = None, is_management: bool = False)#
Bases:
WattsonNetworkEntity,NetworkInterfaceMethods
Set the interface down
generate_nameget_ip_addressget_linkget_mac_addressDetermines the next node this interface connects to (if any).
get_nodeget_physical_nameget_prefixget_subnet_maskget_subnet_prefix_lengthget_system_nameget_tap_infoget_tap_name- returns:
True iff this interface has an IP address assigned
is_mirror_portis_physicalis_tap_portis_virtualUpdate the ip address of this interface
set_mirror_portstartCreates a dictionary for synchronization with a RemoteNetworkEntity.
Set the interface up
Attributes
class_identity_ididinterface_idThe hardware name of the interface
ip_addressis_managementlinkmac_addressnodesubnet_prefix_lengthconfig- __init__(*, id: str | None = None, system_name: str | None = None, display_name: str | None = None, network_emulator: NetworkEmulator | None = None, emulation_instance: ~typing.Any | None = None, segment: str = 'main', config: dict = <factory>, _is_started: bool = False, logger: ~logging.Logger | None = None, mac_address: str | None = None, ip_address: ~ipaddress.IPv4Address | None = None, subnet_prefix_length: int | None = None, node: WattsonNetworkNode | None = None, link: WattsonNetworkLink | None = None, is_management: bool = False) None#
- down()#
Set the interface down
- get_next_node() WattsonNetworkNode | None#
Determines the next node this interface connects to (if any). I.e., this-interface <-> link <-> other-interface <-> returned-node
- Returns:
The next network node if any
- Return type:
Optional[‘WattsonNetworkNode’]
- has_ip() bool#
- Returns:
True iff this interface has an IP address assigned
- Return type:
bool
- property interface_name: str#
The hardware name of the interface
- set_ip_address(ip_address: IPv4Address | None = None) bool#
Update the ip address of this interface
- Parameters:
ip_address (Optional[ipaddress.IPv4Address]) – The ip to use or None
- to_remote_representation(force_state_synchronization: bool = True) RemoteNetworkEntityRepresentation#
Creates a dictionary for synchronization with a RemoteNetworkEntity.
- Parameters:
force_state_synchronization (bool, optional) – Whether to force a synchronization of the internal state with the actual state (Default value = True)
- Returns:
A dictionary representation of this WattsonNetworkEntity for synchronization with a RemoteNetworkEntity.
- Return type:
- up()#
Set the interface up