scapy.contrib.mqtt

class scapy.contrib.mqtt.MQTT

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTT fields

type

BitEnumField (4 bits)

1

DUP

BitEnumField (1 bit)

0

QOS

BitEnumField (2 bits)

0

RETAIN

BitEnumField (1 bit)

0

len

VariableFieldLenField

None

payload_guess

Possible sublayers: MQTTConnack, MQTTConnect, MQTTPuback, MQTTPubcomp, MQTTPublish, MQTTPubrec, MQTTPubrel, MQTTSuback, MQTTSubscribe, MQTTUnsuback, MQTTUnsubscribe

class scapy.contrib.mqtt.MQTTConnack

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTConnack fields

sessPresentFlag

ByteField

0

retcode

ByteEnumField

0

payload_guess

Possible sublayers: MQTT

class scapy.contrib.mqtt.MQTTConnect

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTConnect fields

length

FieldLenField

None

protoname

StrLenField

b''

protolevel

ByteEnumField

5

usernameflag

BitEnumField (1 bit)

0

passwordflag

BitEnumField (1 bit)

0

willretainflag

BitEnumField (1 bit)

0

willQOSflag

BitEnumField (2 bits)

0

willflag

BitEnumField (1 bit)

0

cleansess

BitEnumField (1 bit)

0

reserved

BitEnumField (1 bit)

0

klive

ShortField

0

clientIdlen

FieldLenField

None

clientId

StrLenField

b''

wtoplen

FieldLenField (Cond)

None

willtopic

StrLenField (Cond)

b''

wmsglen

FieldLenField (Cond)

None

willmsg

StrLenField (Cond)

b''

userlen

FieldLenField (Cond)

None

username

StrLenField (Cond)

b''

passlen

FieldLenField (Cond)

None

password

StrLenField (Cond)

b''

payload_guess

Possible sublayers: MQTT

class scapy.contrib.mqtt.MQTTPuback

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTPuback fields

msgid

ShortField

None

payload_guess

Possible sublayers: MQTT

class scapy.contrib.mqtt.MQTTPubcomp

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTPubcomp fields

msgid

ShortField

None

payload_guess

Possible sublayers: MQTT

class scapy.contrib.mqtt.MQTTPublish

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTPublish fields

length

FieldLenField

None

topic

StrLenField

b''

msgid

ShortField (Cond)

None

value

StrLenField

b''

payload_guess

Possible sublayers: MQTT

class scapy.contrib.mqtt.MQTTPubrec

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTPubrec fields

msgid

ShortField

None

payload_guess

Possible sublayers: MQTT

class scapy.contrib.mqtt.MQTTPubrel

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTPubrel fields

msgid

ShortField

None

payload_guess

Possible sublayers: MQTT

class scapy.contrib.mqtt.MQTTSuback

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSuback fields

msgid

ShortField

None

retcode

ByteEnumField

None

payload_guess

Possible sublayers: MQTT

class scapy.contrib.mqtt.MQTTSubscribe

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSubscribe fields

msgid

ShortField

None

length

FieldLenField

None

topic

StrLenField

b''

QOS

ByteEnumField

0

payload_guess

Possible sublayers: MQTT

class scapy.contrib.mqtt.MQTTTopic

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTTopic fields

len

FieldLenField

None

topic

StrLenField

b''

guess_payload_class(payload)
class scapy.contrib.mqtt.MQTTUnsuback

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTUnsuback fields

msgid

ShortField

None

payload_guess

Possible sublayers: MQTT

class scapy.contrib.mqtt.MQTTUnsubscribe

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTUnsubscribe fields

msgid

ShortField

None

topics

PacketListField

[]

payload_guess

Possible sublayers: MQTT

class scapy.contrib.mqtt.RandVariableFieldLen

Bases: scapy.volatile.RandNum

class scapy.contrib.mqtt.VariableFieldLenField(name, default, length_of=None, fmt='H', count_of=None, adjust=<function FieldLenField.<lambda>>, fld=None)

Bases: scapy.fields.FieldLenField

addfield(pkt, s, val)
getfield(pkt, s)
randval()
scapy.contrib.mqtt.cb_topic(pkt, lst, cur, remain)

Decode the remaining bytes as a MQTT topic