scapy.contrib.modbus

class scapy.contrib.modbus.ModbusADURequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusADURequest fields

transId

XShortField

0

protoId

XShortField

0

len

ShortField

None

unitId

XByteField

255

guess_payload_class(payload)
post_build(p, pay)
class scapy.contrib.modbus.ModbusADUResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusADUResponse fields

transId

XShortField

0

protoId

XShortField

0

len

ShortField

None

unitId

XByteField

255

guess_payload_class(payload)
post_build(p, pay)
class scapy.contrib.modbus.ModbusByteEnumField(name, default, enum, defEnum)

Bases: scapy.fields.EnumField

E
d
defEnum
e
f
i2repr_one(pkt, x)
m
n
u
class scapy.contrib.modbus.ModbusObjectId

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusObjectId fields

id

ByteEnumField

0

length

BitFieldLenField (8 bits)

None

value

StrLenField

b''

guess_payload_class(payload)
class scapy.contrib.modbus.ModbusPDU01ReadCoilsError

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU01ReadCoilsError fields

funcCode

XByteField

129

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU01ReadCoilsRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU01ReadCoilsRequest fields

funcCode

XByteField

1

startAddr

XShortField

0

quantity

XShortField

1

class scapy.contrib.modbus.ModbusPDU01ReadCoilsResponse

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU01ReadCoilsResponse fields

funcCode

XByteField

1

byteCount

BitFieldLenField (8 bits)

None

coilStatus

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU02ReadDiscreteInputsError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU02ReadDiscreteInputsError fields

funcCode

XByteField

130

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU02ReadDiscreteInputsRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU02ReadDiscreteInputsRequest fields

funcCode

XByteField

2

startAddr

XShortField

0

quantity

XShortField

1

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
fields_desc
ModbusPDU02ReadDiscreteInputsResponse fields

funcCode

XByteField

2

byteCount

BitFieldLenField (8 bits)

None

inputStatus

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU03ReadHoldingRegistersError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU03ReadHoldingRegistersError fields

funcCode

XByteField

131

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU03ReadHoldingRegistersRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU03ReadHoldingRegistersRequest fields

funcCode

XByteField

3

startAddr

XShortField

0

quantity

XShortField

1

class scapy.contrib.modbus.ModbusPDU03ReadHoldingRegistersResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU03ReadHoldingRegistersResponse fields

funcCode

XByteField

3

byteCount

BitFieldLenField (8 bits)

None

registerVal

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU04ReadInputRegistersError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU04ReadInputRegistersError fields

funcCode

XByteField

132

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU04ReadInputRegistersRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU04ReadInputRegistersRequest fields

funcCode

XByteField

4

startAddr

XShortField

0

quantity

XShortField

1

class scapy.contrib.modbus.ModbusPDU04ReadInputRegistersResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU04ReadInputRegistersResponse fields

funcCode

XByteField

4

byteCount

BitFieldLenField (8 bits)

None

registerVal

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU05WriteSingleCoilError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU05WriteSingleCoilError fields

funcCode

XByteField

133

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU05WriteSingleCoilRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU05WriteSingleCoilRequest fields

funcCode

XByteField

5

outputAddr

XShortField

0

outputValue

XShortField

0

class scapy.contrib.modbus.ModbusPDU05WriteSingleCoilResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU05WriteSingleCoilResponse fields

funcCode

XByteField

5

outputAddr

XShortField

0

outputValue

XShortField

0

class scapy.contrib.modbus.ModbusPDU06WriteSingleRegisterError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU06WriteSingleRegisterError fields

funcCode

XByteField

134

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU06WriteSingleRegisterRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU06WriteSingleRegisterRequest fields

funcCode

XByteField

6

registerAddr

XShortField

0

registerValue

XShortField

0

class scapy.contrib.modbus.ModbusPDU06WriteSingleRegisterResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU06WriteSingleRegisterResponse fields

funcCode

XByteField

6

registerAddr

XShortField

0

registerValue

XShortField

0

class scapy.contrib.modbus.ModbusPDU07ReadExceptionStatusError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU07ReadExceptionStatusError fields

funcCode

XByteField

135

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU07ReadExceptionStatusRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU07ReadExceptionStatusRequest fields

funcCode

XByteField

7

class scapy.contrib.modbus.ModbusPDU07ReadExceptionStatusResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU07ReadExceptionStatusResponse fields

funcCode

XByteField

7

startAddr

XByteField

0

class scapy.contrib.modbus.ModbusPDU08DiagnosticsError

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU08DiagnosticsError fields

funcCode

XByteField

136

exceptionCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU08DiagnosticsRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU08DiagnosticsRequest fields

funcCode

XByteField

8

subFunc

XShortEnumField

0

data

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU08DiagnosticsResponse

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU08DiagnosticsResponse fields

funcCode

XByteField

8

subFunc

XShortEnumField

0

data

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU0BGetCommEventCounterError

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU0BGetCommEventCounterError fields

funcCode

XByteField

139

exceptionCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU0BGetCommEventCounterRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU0BGetCommEventCounterRequest fields

funcCode

XByteField

11

class scapy.contrib.modbus.ModbusPDU0BGetCommEventCounterResponse

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU0BGetCommEventCounterResponse fields

funcCode

XByteField

11

status

XShortField

0

eventCount

XShortField

65535

class scapy.contrib.modbus.ModbusPDU0CGetCommEventLogError

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU0CGetCommEventLogError fields

funcCode

XByteField

140

exceptionCode

XByteField

1

class scapy.contrib.modbus.ModbusPDU0CGetCommEventLogRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU0CGetCommEventLogRequest fields

funcCode

XByteField

12

class scapy.contrib.modbus.ModbusPDU0CGetCommEventLogResponse

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU0CGetCommEventLogResponse fields

funcCode

XByteField

12

byteCount

ByteField

8

status

XShortField

0

eventCount

XShortField

264

messageCount

XShortField

289

event

FieldListField

[32, 0]

class scapy.contrib.modbus.ModbusPDU0FWriteMultipleCoilsError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU0FWriteMultipleCoilsError fields

funcCode

XByteField

143

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU0FWriteMultipleCoilsRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU0FWriteMultipleCoilsRequest fields

funcCode

XByteField

15

startAddr

XShortField

0

quantityOutput

XShortField

1

byteCount

BitFieldLenField (8 bits)

None

outputsValue

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU0FWriteMultipleCoilsResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU0FWriteMultipleCoilsResponse fields

funcCode

XByteField

15

startAddr

XShortField

0

quantityOutput

XShortField

1

class scapy.contrib.modbus.ModbusPDU10WriteMultipleRegistersError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU10WriteMultipleRegistersError fields

funcCode

XByteField

144

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU10WriteMultipleRegistersRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU10WriteMultipleRegistersRequest fields

funcCode

XByteField

16

startAddr

XShortField

0

quantityRegisters

BitFieldLenField (16 bits)

None

byteCount

BitFieldLenField (8 bits)

None

outputsValue

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU10WriteMultipleRegistersResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU10WriteMultipleRegistersResponse fields

funcCode

XByteField

16

startAddr

XShortField

0

quantityRegisters

XShortField

1

class scapy.contrib.modbus.ModbusPDU11ReportSlaveIdError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU11ReportSlaveIdError fields

funcCode

XByteField

145

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU11ReportSlaveIdRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU11ReportSlaveIdRequest fields

funcCode

XByteField

17

class scapy.contrib.modbus.ModbusPDU11ReportSlaveIdResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU11ReportSlaveIdResponse fields

funcCode

XByteField

17

byteCount

BitFieldLenField (8 bits)

None

slaveId

StrLenField (Cond)

b''

runIdicatorStatus

XByteField (Cond)

0

class scapy.contrib.modbus.ModbusPDU14ReadFileRecordError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU14ReadFileRecordError fields

funcCode

XByteField

148

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU14ReadFileRecordRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU14ReadFileRecordRequest fields

funcCode

XByteField

20

byteCount

ByteField

None

guess_payload_class(payload)
post_build(p, pay)
class scapy.contrib.modbus.ModbusPDU14ReadFileRecordResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU14ReadFileRecordResponse fields

funcCode

XByteField

20

dataLength

ByteField

None

guess_payload_class(payload)
post_build(p, pay)
class scapy.contrib.modbus.ModbusPDU15WriteFileRecordError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU15WriteFileRecordError fields

funcCode

XByteField

149

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU15WriteFileRecordRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU15WriteFileRecordRequest fields

funcCode

XByteField

21

dataLength

ByteField

None

guess_payload_class(payload)
post_build(p, pay)
class scapy.contrib.modbus.ModbusPDU15WriteFileRecordResponse

Bases: scapy.contrib.modbus.ModbusPDU15WriteFileRecordRequest

aliastypes
fields_desc
ModbusPDU15WriteFileRecordResponse fields

funcCode

XByteField

21

dataLength

ByteField

None

guess_payload_class(payload)
class scapy.contrib.modbus.ModbusPDU16MaskWriteRegisterError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU16MaskWriteRegisterError fields

funcCode

XByteField

150

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU16MaskWriteRegisterRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU16MaskWriteRegisterRequest fields

funcCode

XByteField

22

refAddr

XShortField

0

andMask

XShortField

65535

orMask

XShortField

0

class scapy.contrib.modbus.ModbusPDU16MaskWriteRegisterResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU16MaskWriteRegisterResponse fields

funcCode

XByteField

22

refAddr

XShortField

0

andMask

XShortField

65535

orMask

XShortField

0

class scapy.contrib.modbus.ModbusPDU17ReadWriteMultipleRegistersError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU17ReadWriteMultipleRegistersError fields

funcCode

XByteField

151

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU17ReadWriteMultipleRegistersRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU17ReadWriteMultipleRegistersRequest fields

funcCode

XByteField

23

readStartingAddr

XShortField

0

readQuantityRegisters

XShortField

1

writeStartingAddr

XShortField

0

writeQuantityRegisters

BitFieldLenField (16 bits)

None

byteCount

BitFieldLenField (8 bits)

None

writeRegistersValue

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU17ReadWriteMultipleRegistersResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU17ReadWriteMultipleRegistersResponse fields

funcCode

XByteField

23

byteCount

BitFieldLenField (8 bits)

None

registerVal

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU18ReadFIFOQueueError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU18ReadFIFOQueueError fields

funcCode

XByteField

152

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU18ReadFIFOQueueRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU18ReadFIFOQueueRequest fields

funcCode

XByteField

24

FIFOPointerAddr

XShortField

0

class scapy.contrib.modbus.ModbusPDU18ReadFIFOQueueResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU18ReadFIFOQueueResponse fields

funcCode

XByteField

24

byteCount

BitFieldLenField (16 bits)

None

FIFOCount

BitFieldLenField (16 bits)

None

FIFOVal

FieldListField

[]

class scapy.contrib.modbus.ModbusPDU2B0EReadDeviceIdentificationError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU2B0EReadDeviceIdentificationError fields

funcCode

XByteField

171

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU2B0EReadDeviceIdentificationRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU2B0EReadDeviceIdentificationRequest fields

funcCode

XByteField

43

MEIType

XByteField

14

readCode

ByteEnumField

1

objectId

ByteEnumField

0

class scapy.contrib.modbus.ModbusPDU2B0EReadDeviceIdentificationResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU2B0EReadDeviceIdentificationResponse fields

funcCode

XByteField

43

MEIType

XByteField

14

readCode

ByteEnumField

4

conformityLevel

ByteEnumField

1

more

ByteEnumField

0

nextObjId

ByteEnumField

0

objCount

ByteField

0

guess_payload_class(payload)
class scapy.contrib.modbus.ModbusPDUReservedFunctionCodeError

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDUReservedFunctionCodeError fields

funcCode

ByteEnumField

0

payload

StrFixedLenField

b''

mysummary()
class scapy.contrib.modbus.ModbusPDUReservedFunctionCodeRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDUReservedFunctionCodeRequest fields

funcCode

ByteEnumField

0

payload

StrFixedLenField

b''

mysummary()
class scapy.contrib.modbus.ModbusPDUReservedFunctionCodeResponse

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDUReservedFunctionCodeResponse fields

funcCode

ByteEnumField

0

payload

StrFixedLenField

b''

mysummary()
class scapy.contrib.modbus.ModbusPDUUserDefinedFunctionCodeError

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDUUserDefinedFunctionCodeError fields

funcCode

ModbusByteEnumField

0

payload

StrFixedLenField

b''

mysummary()
class scapy.contrib.modbus.ModbusPDUUserDefinedFunctionCodeRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDUUserDefinedFunctionCodeRequest fields

funcCode

ModbusByteEnumField

0

payload

StrFixedLenField

b''

mysummary()
class scapy.contrib.modbus.ModbusPDUUserDefinedFunctionCodeResponse

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDUUserDefinedFunctionCodeResponse fields

funcCode

ModbusByteEnumField

0

payload

StrFixedLenField

b''

mysummary()
class scapy.contrib.modbus.ModbusReadFileSubRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusReadFileSubRequest fields

refType

ByteField

6

fileNumber

ShortField

1

recordNumber

ShortField

0

recordLength

ShortField

1

guess_payload_class(payload)
class scapy.contrib.modbus.ModbusReadFileSubResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusReadFileSubResponse fields

respLength

BitFieldLenField (8 bits)

None

refType

ByteField

6

recData

FieldListField

[0]

guess_payload_class(payload)
class scapy.contrib.modbus.ModbusWriteFileSubRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusWriteFileSubRequest fields

refType

ByteField

6

fileNumber

ShortField

1

recordNumber

ShortField

0

recordLength

BitFieldLenField (16 bits)

None

recordData

FieldListField

[0]

guess_payload_class(payload)
class scapy.contrib.modbus.ModbusWriteFileSubResponse

Bases: scapy.contrib.modbus.ModbusWriteFileSubRequest

aliastypes
fields_desc
ModbusWriteFileSubResponse fields

refType

ByteField

6

fileNumber

ShortField

1

recordNumber

ShortField

0

recordLength

BitFieldLenField (16 bits)

None

recordData

FieldListField

[0]

guess_payload_class(payload)