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

__init__

down

Set the interface down

generate_name

get_ip_address

get_link

get_mac_address

get_next_node

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

has_ip

returns:

True iff this interface has an IP address assigned

is_mirror_port

is_physical

is_tap_port

is_virtual

set_ip_address

Update the ip address of this interface

set_mirror_port

start

to_remote_representation

Creates a dictionary for synchronization with a RemoteNetworkEntity.

up

Set the interface up

Attributes

class_id

entity_id

id

interface_id

interface_name

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:

RemoteNetworkEntityRepresentation

up()#

Set the interface up