EthMessageFactory

class mtf.network_port.eth_message_factory.EthMessageFactory

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

eth_messages_factory = {144115188075855872: <bound method 'create_dhcp_message'>, <mtf_eth_protocol_type.ARP: 262144>: <bound method 'create_arp_message'>, <mtf_eth_protocol_type.DOIP: 288230376151711744>: <bound method 'create_doip_message'>, <mtf_eth_protocol_type.NM: 281474976710656>: <bound method 'create_udp_nm_message'>, <mtf_eth_protocol_type.PTP: 64>: <bound method 'create_ptp_message'>, <mtf_eth_protocol_type.SOME_IP: 2251799813685248>: <bound method 'create_someip_message'>, <mtf_eth_protocol_type.SOME_IP_SD: 4503599627370496>: <bound method 'create_someip_sd_message'>, <mtf_eth_protocol_type.UDP: 8589934592>: <bound method 'create_udp_message'>}
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)
convert_to_ethernet_type(value: int)