scapy.contrib.enipTCP module

class scapy.contrib.enipTCP.BaseSendPacket

Bases: scapy.packet.Packet

Abstract Class

aliastypes = [<class 'scapy.contrib.enipTCP.BaseSendPacket'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (BaseSendPacket,ENIPSendUnitData,ENIPSendRRData).interfaceHandle>, <Field (BaseSendPacket,ENIPSendUnitData,ENIPSendRRData).timeout>, <Field (BaseSendPacket,ENIPSendUnitData,ENIPSendRRData).encapsulatedPacket>]
class scapy.contrib.enipTCP.CommandSpecificData

Bases: scapy.packet.Packet

Command Specific Data Field Default

aliastypes = [<class 'scapy.contrib.enipTCP.CommandSpecificData'>, <class 'scapy.packet.Packet'>]
class scapy.contrib.enipTCP.ENIPListIdentityReply

Bases: scapy.packet.Packet

List Identity Command Field

aliastypes = [<class 'scapy.contrib.enipTCP.ENIPListIdentityReply'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ENIPListIdentityReply).itemCount>, <Field (ENIPListIdentityReply).identityItems>]
class scapy.contrib.enipTCP.ENIPListIdentityReplyItems

Bases: scapy.packet.Packet

List Identity Items Field

aliastypes = [<class 'scapy.contrib.enipTCP.ENIPListIdentityReplyItems'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ENIPListIdentityReplyItems).itemTypeCode>, <Field (ENIPListIdentityReplyItems).itemLength>, <Field (ENIPListIdentityReplyItems).itemData>]
class scapy.contrib.enipTCP.ENIPListInterfacesReply

Bases: scapy.packet.Packet

List Interfaces Command Field

aliastypes = [<class 'scapy.contrib.enipTCP.ENIPListInterfacesReply'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ENIPListInterfacesReply).itemCount>, <Field (ENIPListInterfacesReply).identityItems>]
class scapy.contrib.enipTCP.ENIPListInterfacesReplyItems

Bases: scapy.packet.Packet

List Interfaces Items Field

aliastypes = [<class 'scapy.contrib.enipTCP.ENIPListInterfacesReplyItems'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ENIPListInterfacesReplyItems).itemTypeCode>, <Field (ENIPListInterfacesReplyItems).itemLength>, <Field (ENIPListInterfacesReplyItems).itemData>]
class scapy.contrib.enipTCP.ENIPListServicesReply

Bases: scapy.packet.Packet

List Services Command Field

aliastypes = [<class 'scapy.contrib.enipTCP.ENIPListServicesReply'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ENIPListServicesReply).itemCount>, <Field (ENIPListServicesReply).targetItems>]
class scapy.contrib.enipTCP.ENIPListServicesReplyItems

Bases: scapy.packet.Packet

List Services Items Field

aliastypes = [<class 'scapy.contrib.enipTCP.ENIPListServicesReplyItems'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ENIPListServicesReplyItems).itemTypeCode>, <Field (ENIPListServicesReplyItems).itemLength>, <Field (ENIPListServicesReplyItems).version>, <Field (ENIPListServicesReplyItems).flag>, <Field (ENIPListServicesReplyItems).serviceName>]
class scapy.contrib.enipTCP.ENIPRegisterSession

Bases: scapy.contrib.enipTCP.CommandSpecificData

Register Session Command Field

aliastypes = [<class 'scapy.contrib.enipTCP.ENIPRegisterSession'>, <class 'scapy.contrib.enipTCP.CommandSpecificData'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ENIPRegisterSession).protocolVersion>, <Field (ENIPRegisterSession).options>]
class scapy.contrib.enipTCP.ENIPSendRRData

Bases: scapy.contrib.enipTCP.BaseSendPacket

Send RR Data Command Field

aliastypes = [<class 'scapy.contrib.enipTCP.ENIPSendRRData'>, <class 'scapy.contrib.enipTCP.BaseSendPacket'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (BaseSendPacket,ENIPSendUnitData,ENIPSendRRData).interfaceHandle>, <Field (BaseSendPacket,ENIPSendUnitData,ENIPSendRRData).timeout>, <Field (BaseSendPacket,ENIPSendUnitData,ENIPSendRRData).encapsulatedPacket>]
class scapy.contrib.enipTCP.ENIPSendUnitData

Bases: scapy.contrib.enipTCP.BaseSendPacket

Send Unit Data Command Field

aliastypes = [<class 'scapy.contrib.enipTCP.ENIPSendUnitData'>, <class 'scapy.contrib.enipTCP.BaseSendPacket'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (BaseSendPacket,ENIPSendUnitData,ENIPSendRRData).interfaceHandle>, <Field (BaseSendPacket,ENIPSendUnitData,ENIPSendRRData).timeout>, <Field (BaseSendPacket,ENIPSendUnitData,ENIPSendRRData).encapsulatedPacket>]
class scapy.contrib.enipTCP.ENIPTCP

Bases: scapy.packet.Packet

Ethernet/IP packet over TCP

aliastypes = [<class 'scapy.contrib.enipTCP.ENIPTCP'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ENIPTCP).commandId>, <Field (ENIPTCP).length>, <Field (ENIPTCP).session>, <Field (ENIPTCP).status>, <Field (ENIPTCP).senderContext>, <Field (ENIPTCP).options>, <scapy.fields.MultipleTypeField object>]
post_build(pkt, pay)

DEV: called right after the current layer is build.

Parameters:
  • pkt (str) – the current packet (build by self_buil function)
  • pay (str) – the packet payload (build by do_build_payload function)
Returns:

a string of the packet with the payload

class scapy.contrib.enipTCP.EncapsulatedPacket

Bases: scapy.packet.Packet

Encapsulated Packet

aliastypes = [<class 'scapy.contrib.enipTCP.EncapsulatedPacket'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (EncapsulatedPacket).itemCount>, <Field (EncapsulatedPacket).item>]
class scapy.contrib.enipTCP.ItemData

Bases: scapy.packet.Packet

Common Packet Format

aliastypes = [<class 'scapy.contrib.enipTCP.ItemData'>, <class 'scapy.packet.Packet'>]
extract_padding(s)

DEV: to be overloaded to extract current layer’s padding.

Parameters:s (str) – the current layer
Returns:a couple of strings (actual layer, padding)
fields_desc = [<Field (ItemData).typeId>, <Field (ItemData).length>, <Field (ItemData).data>]