scapy.contrib.modbus

class scapy.contrib.modbus.ModbusADURequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusADURequest字段

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字段

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字段

id

ByteEnumField

0

length

BitFieldLenField (8位)

None

value

StrLenField

b''

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

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU01ReadCoilsError字段

funcCode

XByteField

129

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU01ReadCoilsRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU01ReadCoilsRequest字段

funcCode

XByteField

1

startAddr

XShortField

0

quantity

XShortField

1

class scapy.contrib.modbus.ModbusPDU01ReadCoilsResponse

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU01ReadCoilsResponse字段

funcCode

XByteField

1

byteCount

BitFieldLenField (8位)

None

coilStatus

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU02ReadDiscreteInputsError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU02ReadDiscreteInputsError字段

funcCode

XByteField

130

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU02ReadDiscreteInputsRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU02ReadDiscreteInputsRequest字段

funcCode

XByteField

2

startAddr

XShortField

0

quantity

XShortField

1

class scapy.contrib.modbus.ModbusPDU02ReadDiscreteInputsResponse

Bases: scapy.packet.Packet

inputStatus:结果以字节表示,用0填充以具有整数个字节. 该字段不会解析此结果,而是直接显示字节

aliastypes
fields_desc
ModbusPDU02ReadDiscreteInputsResponse字段

funcCode

XByteField

2

byteCount

BitFieldLenField (8位)

None

inputStatus

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU03ReadHoldingRegistersError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU03ReadHoldingRegistersError字段

funcCode

XByteField

131

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU03ReadHoldingRegistersRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU03ReadHoldingRegistersRequest字段

funcCode

XByteField

3

startAddr

XShortField

0

quantity

XShortField

1

class scapy.contrib.modbus.ModbusPDU03ReadHoldingRegistersResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU03ReadHoldingRegistersResponse字段

funcCode

XByteField

3

byteCount

BitFieldLenField (8位)

None

registerVal

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU04ReadInputRegistersError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU04ReadInputRegistersError字段

funcCode

XByteField

132

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU04ReadInputRegistersRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU04ReadInputRegistersRequest字段

funcCode

XByteField

4

startAddr

XShortField

0

quantity

XShortField

1

class scapy.contrib.modbus.ModbusPDU04ReadInputRegistersResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU04ReadInputRegistersResponse字段

funcCode

XByteField

4

byteCount

BitFieldLenField (8位)

None

registerVal

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU05WriteSingleCoilError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU05WriteSingleCoilError字段

funcCode

XByteField

133

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU05WriteSingleCoilRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU05WriteSingleCoilRequest字段

funcCode

XByteField

5

outputAddr

XShortField

0

outputValue

XShortField

0

class scapy.contrib.modbus.ModbusPDU05WriteSingleCoilResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU05WriteSingleCoilResponse字段

funcCode

XByteField

5

outputAddr

XShortField

0

outputValue

XShortField

0

class scapy.contrib.modbus.ModbusPDU06WriteSingleRegisterError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU06WriteSingleRegisterError字段

funcCode

XByteField

134

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU06WriteSingleRegisterRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU06WriteSingleRegisterRequest字段

funcCode

XByteField

6

registerAddr

XShortField

0

registerValue

XShortField

0

class scapy.contrib.modbus.ModbusPDU06WriteSingleRegisterResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU06WriteSingleRegisterResponse字段

funcCode

XByteField

6

registerAddr

XShortField

0

registerValue

XShortField

0

class scapy.contrib.modbus.ModbusPDU07ReadExceptionStatusError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU07ReadExceptionStatusError字段

funcCode

XByteField

135

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU07ReadExceptionStatusRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU07ReadExceptionStatusRequest字段

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字段

funcCode

XByteField

136

exceptionCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU08DiagnosticsRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU08DiagnosticsRequest字段

funcCode

XByteField

8

subFunc

XShortEnumField

0

data

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU08DiagnosticsResponse

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU08DiagnosticsResponse字段

funcCode

XByteField

8

subFunc

XShortEnumField

0

data

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU0BGetCommEventCounterError

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU0BGetCommEventCounterError字段

funcCode

XByteField

139

exceptionCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU0BGetCommEventCounterRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU0BGetCommEventCounterRequest字段

funcCode

XByteField

11

class scapy.contrib.modbus.ModbusPDU0BGetCommEventCounterResponse

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU0BGetCommEventCounterResponse字段

funcCode

XByteField

11

status

XShortField

0

eventCount

XShortField

65535

class scapy.contrib.modbus.ModbusPDU0CGetCommEventLogError

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU0CGetCommEventLogError字段

funcCode

XByteField

140

exceptionCode

XByteField

1

class scapy.contrib.modbus.ModbusPDU0CGetCommEventLogRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU0CGetCommEventLogRequest字段

funcCode

XByteField

12

class scapy.contrib.modbus.ModbusPDU0CGetCommEventLogResponse

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU0CGetCommEventLogResponse字段

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字段

funcCode

XByteField

143

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU0FWriteMultipleCoilsRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU0FWriteMultipleCoilsRequest字段

funcCode

XByteField

15

startAddr

XShortField

0

quantityOutput

XShortField

1

byteCount

BitFieldLenField (8位)

None

outputsValue

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU0FWriteMultipleCoilsResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU0FWriteMultipleCoilsResponse字段

funcCode

XByteField

15

startAddr

XShortField

0

quantityOutput

XShortField

1

class scapy.contrib.modbus.ModbusPDU10WriteMultipleRegistersError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU10WriteMultipleRegistersError字段

funcCode

XByteField

144

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU10WriteMultipleRegistersRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU10WriteMultipleRegistersRequest字段

funcCode

XByteField

16

startAddr

XShortField

0

quantityRegisters

BitFieldLenField (16位)

None

byteCount

BitFieldLenField (8位)

None

outputsValue

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU10WriteMultipleRegistersResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU10WriteMultipleRegistersResponse字段

funcCode

XByteField

16

startAddr

XShortField

0

quantityRegisters

XShortField

1

class scapy.contrib.modbus.ModbusPDU11ReportSlaveIdError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU11ReportSlaveIdError字段

funcCode

XByteField

145

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU11ReportSlaveIdRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDU11ReportSlaveIdRequest字段

funcCode

XByteField

17

class scapy.contrib.modbus.ModbusPDU11ReportSlaveIdResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU11ReportSlaveIdResponse字段

funcCode

XByteField

17

byteCount

BitFieldLenField (8位)

None

slaveId

StrLenField (Cond)

b''

runIdicatorStatus

XByteField (Cond)

0

class scapy.contrib.modbus.ModbusPDU14ReadFileRecordError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU14ReadFileRecordError字段

funcCode

XByteField

148

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU14ReadFileRecordRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU14ReadFileRecordRequest字段

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字段

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字段

funcCode

XByteField

149

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU15WriteFileRecordRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU15WriteFileRecordRequest字段

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字段

funcCode

XByteField

21

dataLength

ByteField

None

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

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU16MaskWriteRegisterError字段

funcCode

XByteField

150

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU16MaskWriteRegisterRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU16MaskWriteRegisterRequest字段

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字段

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字段

funcCode

XByteField

151

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU17ReadWriteMultipleRegistersRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU17ReadWriteMultipleRegistersRequest字段

funcCode

XByteField

23

readStartingAddr

XShortField

0

readQuantityRegisters

XShortField

1

writeStartingAddr

XShortField

0

writeQuantityRegisters

BitFieldLenField (16位)

None

byteCount

BitFieldLenField (8位)

None

writeRegistersValue

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU17ReadWriteMultipleRegistersResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU17ReadWriteMultipleRegistersResponse字段

funcCode

XByteField

23

byteCount

BitFieldLenField (8位)

None

registerVal

FieldListField

[0]

class scapy.contrib.modbus.ModbusPDU18ReadFIFOQueueError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU18ReadFIFOQueueError字段

funcCode

XByteField

152

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU18ReadFIFOQueueRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU18ReadFIFOQueueRequest字段

funcCode

XByteField

24

FIFOPointerAddr

XShortField

0

class scapy.contrib.modbus.ModbusPDU18ReadFIFOQueueResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU18ReadFIFOQueueResponse字段

funcCode

XByteField

24

byteCount

BitFieldLenField (16位)

None

FIFOCount

BitFieldLenField (16位)

None

FIFOVal

FieldListField

[]

class scapy.contrib.modbus.ModbusPDU2B0EReadDeviceIdentificationError

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU2B0EReadDeviceIdentificationError字段

funcCode

XByteField

171

exceptCode

ByteEnumField

1

class scapy.contrib.modbus.ModbusPDU2B0EReadDeviceIdentificationRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusPDU2B0EReadDeviceIdentificationRequest字段

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字段

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字段

funcCode

ByteEnumField

0

payload

StrFixedLenField

b''

mysummary()
class scapy.contrib.modbus.ModbusPDUReservedFunctionCodeRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDUReservedFunctionCodeRequest字段

funcCode

ByteEnumField

0

payload

StrFixedLenField

b''

mysummary()
class scapy.contrib.modbus.ModbusPDUReservedFunctionCodeResponse

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDUReservedFunctionCodeResponse字段

funcCode

ByteEnumField

0

payload

StrFixedLenField

b''

mysummary()
class scapy.contrib.modbus.ModbusPDUUserDefinedFunctionCodeError

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDUUserDefinedFunctionCodeError字段

funcCode

ModbusByteEnumField

0

payload

StrFixedLenField

b''

mysummary()
class scapy.contrib.modbus.ModbusPDUUserDefinedFunctionCodeRequest

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDUUserDefinedFunctionCodeRequest字段

funcCode

ModbusByteEnumField

0

payload

StrFixedLenField

b''

mysummary()
class scapy.contrib.modbus.ModbusPDUUserDefinedFunctionCodeResponse

Bases: scapy.contrib.modbus._ModbusPDUNoPayload

aliastypes
fields_desc
ModbusPDUUserDefinedFunctionCodeResponse字段

funcCode

ModbusByteEnumField

0

payload

StrFixedLenField

b''

mysummary()
class scapy.contrib.modbus.ModbusReadFileSubRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusReadFileSubRequest字段

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字段

respLength

BitFieldLenField (8位)

None

refType

ByteField

6

recData

FieldListField

[0]

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

Bases: scapy.packet.Packet

aliastypes
fields_desc
ModbusWriteFileSubRequest字段

refType

ByteField

6

fileNumber

ShortField

1

recordNumber

ShortField

0

recordLength

BitFieldLenField (16位)

None

recordData

FieldListField

[0]

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

Bases: scapy.contrib.modbus.ModbusWriteFileSubRequest

aliastypes
fields_desc
ModbusWriteFileSubResponse字段

refType

ByteField

6

fileNumber

ShortField

1

recordNumber

ShortField

0

recordLength

BitFieldLenField (16位)

None

recordData

FieldListField

[0]

guess_payload_class(payload)