Eth Message Factory Module

class mtf.network_port.eth_message_factory.EthMessageFactory

This class is used to inject an incorrect ethernet message in the traffic.

eth_messages_factory
classmethod get_eth_msg(protocol: EthProtocolType)

Get an Ethernet message constructor class based on Ethernet protocol type.

Args:

protocol (EthProtocolType): Enum value representing the Ethernet protocol type.

Returns:

Class representing the Ethernet message constructor for the given protocol type.

static ip_to_int(ip: str)

Converts an IPv4 address to an integer

Args:

ip (str): IP address in string format

Returns:

int: Integer representation of the IP address

convert_to_ethernet_type(value: int)

The method attempts to convert the integer value into an instance of the EtherType enum Args:

value (int)

Return:

EtherType: instence of class EtherType