scapy.contrib.modbus module

class scapy.contrib.modbus.ModbusADURequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusADURequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusADURequest).transId>, <Field (ModbusADURequest).protoId>, <Field (ModbusADURequest).len>, <Field (ModbusADURequest).unitId>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
post_build(p, 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.modbus.ModbusADUResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusADUResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusADUResponse).transId>, <Field (ModbusADUResponse).protoId>, <Field (ModbusADUResponse).len>, <Field (ModbusADUResponse).unitId>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
post_build(p, 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.modbus.ModbusByteEnumField(name, default, enum, defEnum)

Bases: scapy.fields.EnumField

defEnum
i2repr_one(pkt, x)
class scapy.contrib.modbus.ModbusObjectId

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusObjectId'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusObjectId).id>, <Field (ModbusObjectId).length>, <Field (ModbusObjectId).value>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.modbus.ModbusPDU01ReadCoilsError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU01ReadCoilsError'>, <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 (ModbusPDU01ReadCoilsError).funcCode>, <Field (ModbusPDU01ReadCoilsError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU01ReadCoilsRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU01ReadCoilsRequest'>, <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 (ModbusPDU01ReadCoilsRequest).funcCode>, <Field (ModbusPDU01ReadCoilsRequest).startAddr>, <Field (ModbusPDU01ReadCoilsRequest).quantity>]
class scapy.contrib.modbus.ModbusPDU01ReadCoilsResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU01ReadCoilsResponse'>, <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 (ModbusPDU01ReadCoilsResponse).funcCode>, <Field (ModbusPDU01ReadCoilsResponse).byteCount>, <Field (ModbusPDU01ReadCoilsResponse).coilStatus>]
class scapy.contrib.modbus.ModbusPDU02ReadDiscreteInputsError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU02ReadDiscreteInputsError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU02ReadDiscreteInputsError).funcCode>, <Field (ModbusPDU02ReadDiscreteInputsError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU02ReadDiscreteInputsRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU02ReadDiscreteInputsRequest'>, <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 (ModbusPDU02ReadDiscreteInputsRequest).funcCode>, <Field (ModbusPDU02ReadDiscreteInputsRequest).startAddr>, <Field (ModbusPDU02ReadDiscreteInputsRequest).quantity>]
class scapy.contrib.modbus.ModbusPDU02ReadDiscreteInputsResponse

Bases: scapy.packet.Packet

inputStatus: result is represented as bytes, padded with 0 to have a integer number of bytes. The field does not parse this result and present the bytes directly

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU02ReadDiscreteInputsResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU02ReadDiscreteInputsResponse).funcCode>, <Field (ModbusPDU02ReadDiscreteInputsResponse).byteCount>, <Field (ModbusPDU02ReadDiscreteInputsResponse).inputStatus>]
class scapy.contrib.modbus.ModbusPDU03ReadHoldingRegistersError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU03ReadHoldingRegistersError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU03ReadHoldingRegistersError).funcCode>, <Field (ModbusPDU03ReadHoldingRegistersError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU03ReadHoldingRegistersRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU03ReadHoldingRegistersRequest'>, <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 (ModbusPDU03ReadHoldingRegistersRequest).funcCode>, <Field (ModbusPDU03ReadHoldingRegistersRequest).startAddr>, <Field (ModbusPDU03ReadHoldingRegistersRequest).quantity>]
class scapy.contrib.modbus.ModbusPDU03ReadHoldingRegistersResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU03ReadHoldingRegistersResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU03ReadHoldingRegistersResponse).funcCode>, <Field (ModbusPDU03ReadHoldingRegistersResponse).byteCount>, <Field (ModbusPDU03ReadHoldingRegistersResponse).registerVal>]
class scapy.contrib.modbus.ModbusPDU04ReadInputRegistersError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU04ReadInputRegistersError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU04ReadInputRegistersError).funcCode>, <Field (ModbusPDU04ReadInputRegistersError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU04ReadInputRegistersRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU04ReadInputRegistersRequest'>, <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 (ModbusPDU04ReadInputRegistersRequest).funcCode>, <Field (ModbusPDU04ReadInputRegistersRequest).startAddr>, <Field (ModbusPDU04ReadInputRegistersRequest).quantity>]
class scapy.contrib.modbus.ModbusPDU04ReadInputRegistersResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU04ReadInputRegistersResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU04ReadInputRegistersResponse).funcCode>, <Field (ModbusPDU04ReadInputRegistersResponse).byteCount>, <Field (ModbusPDU04ReadInputRegistersResponse).registerVal>]
class scapy.contrib.modbus.ModbusPDU05WriteSingleCoilError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU05WriteSingleCoilError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU05WriteSingleCoilError).funcCode>, <Field (ModbusPDU05WriteSingleCoilError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU05WriteSingleCoilRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU05WriteSingleCoilRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU05WriteSingleCoilRequest).funcCode>, <Field (ModbusPDU05WriteSingleCoilRequest).outputAddr>, <Field (ModbusPDU05WriteSingleCoilRequest).outputValue>]
class scapy.contrib.modbus.ModbusPDU05WriteSingleCoilResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU05WriteSingleCoilResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU05WriteSingleCoilResponse).funcCode>, <Field (ModbusPDU05WriteSingleCoilResponse).outputAddr>, <Field (ModbusPDU05WriteSingleCoilResponse).outputValue>]
class scapy.contrib.modbus.ModbusPDU06WriteSingleRegisterError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU06WriteSingleRegisterError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU06WriteSingleRegisterError).funcCode>, <Field (ModbusPDU06WriteSingleRegisterError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU06WriteSingleRegisterRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU06WriteSingleRegisterRequest'>, <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 (ModbusPDU06WriteSingleRegisterRequest).funcCode>, <Field (ModbusPDU06WriteSingleRegisterRequest).registerAddr>, <Field (ModbusPDU06WriteSingleRegisterRequest).registerValue>]
class scapy.contrib.modbus.ModbusPDU06WriteSingleRegisterResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU06WriteSingleRegisterResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU06WriteSingleRegisterResponse).funcCode>, <Field (ModbusPDU06WriteSingleRegisterResponse).registerAddr>, <Field (ModbusPDU06WriteSingleRegisterResponse).registerValue>]
class scapy.contrib.modbus.ModbusPDU07ReadExceptionStatusError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU07ReadExceptionStatusError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU07ReadExceptionStatusError).funcCode>, <Field (ModbusPDU07ReadExceptionStatusError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU07ReadExceptionStatusRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU07ReadExceptionStatusRequest'>, <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 (ModbusPDU07ReadExceptionStatusRequest).funcCode>]
class scapy.contrib.modbus.ModbusPDU07ReadExceptionStatusResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU07ReadExceptionStatusResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU07ReadExceptionStatusResponse).funcCode>, <Field (ModbusPDU07ReadExceptionStatusResponse).startAddr>]
class scapy.contrib.modbus.ModbusPDU0FWriteMultipleCoilsError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU0FWriteMultipleCoilsError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU0FWriteMultipleCoilsError).funcCode>, <Field (ModbusPDU0FWriteMultipleCoilsError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU0FWriteMultipleCoilsRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU0FWriteMultipleCoilsRequest'>, <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 (ModbusPDU0FWriteMultipleCoilsRequest).funcCode>, <Field (ModbusPDU0FWriteMultipleCoilsRequest).startAddr>, <Field (ModbusPDU0FWriteMultipleCoilsRequest).quantityOutput>, <Field (ModbusPDU0FWriteMultipleCoilsRequest).byteCount>, <Field (ModbusPDU0FWriteMultipleCoilsRequest).outputsValue>]
class scapy.contrib.modbus.ModbusPDU0FWriteMultipleCoilsResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU0FWriteMultipleCoilsResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU0FWriteMultipleCoilsResponse).funcCode>, <Field (ModbusPDU0FWriteMultipleCoilsResponse).startAddr>, <Field (ModbusPDU0FWriteMultipleCoilsResponse).quantityOutput>]
class scapy.contrib.modbus.ModbusPDU10WriteMultipleRegistersError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU10WriteMultipleRegistersError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU10WriteMultipleRegistersError).funcCode>, <Field (ModbusPDU10WriteMultipleRegistersError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU10WriteMultipleRegistersRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU10WriteMultipleRegistersRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU10WriteMultipleRegistersRequest).funcCode>, <Field (ModbusPDU10WriteMultipleRegistersRequest).startAddr>, <Field (ModbusPDU10WriteMultipleRegistersRequest).quantityRegisters>, <Field (ModbusPDU10WriteMultipleRegistersRequest).byteCount>, <Field (ModbusPDU10WriteMultipleRegistersRequest).outputsValue>]
class scapy.contrib.modbus.ModbusPDU10WriteMultipleRegistersResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU10WriteMultipleRegistersResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU10WriteMultipleRegistersResponse).funcCode>, <Field (ModbusPDU10WriteMultipleRegistersResponse).startAddr>, <Field (ModbusPDU10WriteMultipleRegistersResponse).quantityRegisters>]
class scapy.contrib.modbus.ModbusPDU11ReportSlaveIdError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU11ReportSlaveIdError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU11ReportSlaveIdError).funcCode>, <Field (ModbusPDU11ReportSlaveIdError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU11ReportSlaveIdRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU11ReportSlaveIdRequest'>, <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 (ModbusPDU11ReportSlaveIdRequest).funcCode>]
class scapy.contrib.modbus.ModbusPDU11ReportSlaveIdResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU11ReportSlaveIdResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU11ReportSlaveIdResponse).funcCode>, <Field (ModbusPDU11ReportSlaveIdResponse).byteCount>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>]
class scapy.contrib.modbus.ModbusPDU14ReadFileRecordError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU14ReadFileRecordError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU14ReadFileRecordError).funcCode>, <Field (ModbusPDU14ReadFileRecordError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU14ReadFileRecordRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU14ReadFileRecordRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU14ReadFileRecordRequest).funcCode>, <Field (ModbusPDU14ReadFileRecordRequest).byteCount>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
post_build(p, 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.modbus.ModbusPDU14ReadFileRecordResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU14ReadFileRecordResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU14ReadFileRecordResponse).funcCode>, <Field (ModbusPDU14ReadFileRecordResponse).dataLength>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
post_build(p, 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.modbus.ModbusPDU15WriteFileRecordError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU15WriteFileRecordError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU15WriteFileRecordError).funcCode>, <Field (ModbusPDU15WriteFileRecordError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU15WriteFileRecordRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU15WriteFileRecordRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU15WriteFileRecordRequest,ModbusPDU15WriteFileRecordResponse).funcCode>, <Field (ModbusPDU15WriteFileRecordRequest,ModbusPDU15WriteFileRecordResponse).dataLength>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
post_build(p, 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.modbus.ModbusPDU15WriteFileRecordResponse

Bases: scapy.contrib.modbus.ModbusPDU15WriteFileRecordRequest

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU15WriteFileRecordResponse'>, <class 'scapy.contrib.modbus.ModbusPDU15WriteFileRecordRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU15WriteFileRecordRequest,ModbusPDU15WriteFileRecordResponse).funcCode>, <Field (ModbusPDU15WriteFileRecordRequest,ModbusPDU15WriteFileRecordResponse).dataLength>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.modbus.ModbusPDU16MaskWriteRegisterError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU16MaskWriteRegisterError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU16MaskWriteRegisterError).funcCode>, <Field (ModbusPDU16MaskWriteRegisterError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU16MaskWriteRegisterRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU16MaskWriteRegisterRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU16MaskWriteRegisterRequest).funcCode>, <Field (ModbusPDU16MaskWriteRegisterRequest).refAddr>, <Field (ModbusPDU16MaskWriteRegisterRequest).andMask>, <Field (ModbusPDU16MaskWriteRegisterRequest).orMask>]
class scapy.contrib.modbus.ModbusPDU16MaskWriteRegisterResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU16MaskWriteRegisterResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU16MaskWriteRegisterResponse).funcCode>, <Field (ModbusPDU16MaskWriteRegisterResponse).refAddr>, <Field (ModbusPDU16MaskWriteRegisterResponse).andMask>, <Field (ModbusPDU16MaskWriteRegisterResponse).orMask>]
class scapy.contrib.modbus.ModbusPDU17ReadWriteMultipleRegistersError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU17ReadWriteMultipleRegistersError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU17ReadWriteMultipleRegistersError).funcCode>, <Field (ModbusPDU17ReadWriteMultipleRegistersError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU17ReadWriteMultipleRegistersRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU17ReadWriteMultipleRegistersRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU17ReadWriteMultipleRegistersRequest).funcCode>, <Field (ModbusPDU17ReadWriteMultipleRegistersRequest).readStartingAddr>, <Field (ModbusPDU17ReadWriteMultipleRegistersRequest).readQuantityRegisters>, <Field (ModbusPDU17ReadWriteMultipleRegistersRequest).writeStartingAddr>, <Field (ModbusPDU17ReadWriteMultipleRegistersRequest).writeQuantityRegisters>, <Field (ModbusPDU17ReadWriteMultipleRegistersRequest).byteCount>, <Field (ModbusPDU17ReadWriteMultipleRegistersRequest).writeRegistersValue>]
class scapy.contrib.modbus.ModbusPDU17ReadWriteMultipleRegistersResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU17ReadWriteMultipleRegistersResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU17ReadWriteMultipleRegistersResponse).funcCode>, <Field (ModbusPDU17ReadWriteMultipleRegistersResponse).byteCount>, <Field (ModbusPDU17ReadWriteMultipleRegistersResponse).registerVal>]
class scapy.contrib.modbus.ModbusPDU18ReadFIFOQueueError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU18ReadFIFOQueueError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU18ReadFIFOQueueError).funcCode>, <Field (ModbusPDU18ReadFIFOQueueError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU18ReadFIFOQueueRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU18ReadFIFOQueueRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU18ReadFIFOQueueRequest).funcCode>, <Field (ModbusPDU18ReadFIFOQueueRequest).FIFOPointerAddr>]
class scapy.contrib.modbus.ModbusPDU18ReadFIFOQueueResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU18ReadFIFOQueueResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU18ReadFIFOQueueResponse).funcCode>, <Field (ModbusPDU18ReadFIFOQueueResponse).byteCount>, <Field (ModbusPDU18ReadFIFOQueueResponse).FIFOCount>, <Field (ModbusPDU18ReadFIFOQueueResponse).FIFOVal>]
class scapy.contrib.modbus.ModbusPDU2B0EReadDeviceIdentificationError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU2B0EReadDeviceIdentificationError'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU2B0EReadDeviceIdentificationError).funcCode>, <Field (ModbusPDU2B0EReadDeviceIdentificationError).exceptCode>]
class scapy.contrib.modbus.ModbusPDU2B0EReadDeviceIdentificationRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU2B0EReadDeviceIdentificationRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU2B0EReadDeviceIdentificationRequest).funcCode>, <Field (ModbusPDU2B0EReadDeviceIdentificationRequest).MEIType>, <Field (ModbusPDU2B0EReadDeviceIdentificationRequest).readCode>, <Field (ModbusPDU2B0EReadDeviceIdentificationRequest).objectId>]
class scapy.contrib.modbus.ModbusPDU2B0EReadDeviceIdentificationResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDU2B0EReadDeviceIdentificationResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusPDU2B0EReadDeviceIdentificationResponse).funcCode>, <Field (ModbusPDU2B0EReadDeviceIdentificationResponse).MEIType>, <Field (ModbusPDU2B0EReadDeviceIdentificationResponse).readCode>, <Field (ModbusPDU2B0EReadDeviceIdentificationResponse).conformityLevel>, <Field (ModbusPDU2B0EReadDeviceIdentificationResponse).more>, <Field (ModbusPDU2B0EReadDeviceIdentificationResponse).nextObjId>, <Field (ModbusPDU2B0EReadDeviceIdentificationResponse).objCount>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.modbus.ModbusPDUReservedFunctionCodeError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDUReservedFunctionCodeError'>, <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 (ModbusPDUReservedFunctionCodeError).funcCode>, <Field (ModbusPDUReservedFunctionCodeError).payload>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.contrib.modbus.ModbusPDUReservedFunctionCodeRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDUReservedFunctionCodeRequest'>, <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 (ModbusPDUReservedFunctionCodeRequest).funcCode>, <Field (ModbusPDUReservedFunctionCodeRequest).payload>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.contrib.modbus.ModbusPDUReservedFunctionCodeResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDUReservedFunctionCodeResponse'>, <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 (ModbusPDUReservedFunctionCodeResponse).funcCode>, <Field (ModbusPDUReservedFunctionCodeResponse).payload>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.contrib.modbus.ModbusPDUUserDefinedFunctionCodeError

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDUUserDefinedFunctionCodeError'>, <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 (ModbusPDUUserDefinedFunctionCodeError).funcCode>, <Field (ModbusPDUUserDefinedFunctionCodeError).payload>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.contrib.modbus.ModbusPDUUserDefinedFunctionCodeRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDUUserDefinedFunctionCodeRequest'>, <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 (ModbusPDUUserDefinedFunctionCodeRequest).funcCode>, <Field (ModbusPDUUserDefinedFunctionCodeRequest).payload>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.contrib.modbus.ModbusPDUUserDefinedFunctionCodeResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusPDUUserDefinedFunctionCodeResponse'>, <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 (ModbusPDUUserDefinedFunctionCodeResponse).funcCode>, <Field (ModbusPDUUserDefinedFunctionCodeResponse).payload>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.contrib.modbus.ModbusReadFileSubRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusReadFileSubRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusReadFileSubRequest).refType>, <Field (ModbusReadFileSubRequest).fileNumber>, <Field (ModbusReadFileSubRequest).recordNumber>, <Field (ModbusReadFileSubRequest).recordLength>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.modbus.ModbusReadFileSubResponse

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusReadFileSubResponse'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusReadFileSubResponse).respLength>, <Field (ModbusReadFileSubResponse).refType>, <Field (ModbusReadFileSubResponse).recData>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.modbus.ModbusWriteFileSubRequest

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.modbus.ModbusWriteFileSubRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusWriteFileSubRequest,ModbusWriteFileSubResponse).refType>, <Field (ModbusWriteFileSubRequest,ModbusWriteFileSubResponse).fileNumber>, <Field (ModbusWriteFileSubRequest,ModbusWriteFileSubResponse).recordNumber>, <Field (ModbusWriteFileSubRequest,ModbusWriteFileSubResponse).recordLength>, <Field (ModbusWriteFileSubRequest,ModbusWriteFileSubResponse).recordData>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.modbus.ModbusWriteFileSubResponse

Bases: scapy.contrib.modbus.ModbusWriteFileSubRequest

aliastypes = [<class 'scapy.contrib.modbus.ModbusWriteFileSubResponse'>, <class 'scapy.contrib.modbus.ModbusWriteFileSubRequest'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ModbusWriteFileSubRequest,ModbusWriteFileSubResponse).refType>, <Field (ModbusWriteFileSubRequest,ModbusWriteFileSubResponse).fileNumber>, <Field (ModbusWriteFileSubRequest,ModbusWriteFileSubResponse).recordNumber>, <Field (ModbusWriteFileSubRequest,ModbusWriteFileSubResponse).recordLength>, <Field (ModbusWriteFileSubRequest,ModbusWriteFileSubResponse).recordData>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class