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
,NetworkInterface
Methods
Set the interface down
generate_name
get_ip_address
get_link
get_mac_address
Determines the next node this interface connects to (if any).
get_node
get_physical_name
get_prefix
get_subnet_mask
get_subnet_prefix_length
get_system_name
get_tap_info
get_tap_name
- returns:
True iff this interface has an IP address assigned
is_mirror_port
is_physical
is_tap_port
is_virtual
Update the ip address of this interface
set_mirror_port
start
Creates a dictionary for synchronization with a RemoteNetworkEntity.
Set the interface up
Attributes
class_id
entity_id
id
interface_id
The hardware name of the interface
ip_address
is_management
link
mac_address
node
subnet_prefix_length
config
- __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