scapy.contrib.mqttsn

class scapy.contrib.mqttsn.MQTTSN

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSN字段

len

VariableFieldLenField

None

type

XByteEnumField

0

payload_guess

可能的子层: MQTTSNAdvertiseMQTTSNConnackMQTTSNConnectMQTTSNDisconnectMQTTSNEncapsMQTTSNGwInfoMQTTSNPingReqMQTTSNPingRespMQTTSNPubackMQTTSNPubcompMQTTSNPublishMQTTSNPubrecMQTTSNPubrelMQTTSNRegackMQTTSNRegisterMQTTSNSearchGWMQTTSNSubackMQTTSNSubscribeMQTTSNUnsubackMQTTSNUnsubscribeMQTTSNWillMsgReqMQTTSNWillMsgRespMQTTSNWillMsgUpdMQTTSNWillMsgMQTTSNWillTopicReqMQTTSNWillTopicRespMQTTSNWillTopicUpdMQTTSNWillTopic

class scapy.contrib.mqttsn.MQTTSNAdvertise

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSN广告字段

gw_id

ByteField

0

duration

ShortField

0

class scapy.contrib.mqttsn.MQTTSNConnack

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNConnack字段

return_code

ByteEnumField

0

class scapy.contrib.mqttsn.MQTTSNConnect

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNConnect字段

dup

BitField (1位)

0

qos

BitEnumField (2位)

0

retain

BitField (1位)

0

will

BitField (1位)

0

cleansess

BitField (1位)

0

tid_type

BitEnumField (2位)

0

prot_id

ByteField

1

duration

ShortField

0

client_id

StrLenField

b''

class scapy.contrib.mqttsn.MQTTSNDisconnect

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNDisconnect字段

duration

ShortField (Cond)

None

class scapy.contrib.mqttsn.MQTTSNEncaps

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNEncaps fields

resvd

BitField (6位)

0

radius

BitField (2位)

0

w_node_id

StrLenField

b''

payload_guess

可能的子层: MQTTSN

class scapy.contrib.mqttsn.MQTTSNGwInfo

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNGwInfo字段

gw_id

ByteField

0

gw_addr

StrLenField

b''

class scapy.contrib.mqttsn.MQTTSNPingReq

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNPingReq字段

client_id

StrLenField

b''

class scapy.contrib.mqttsn.MQTTSNPingResp

Bases: scapy.packet.Packet

aliastypes
class scapy.contrib.mqttsn.MQTTSNPuback

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNPuback字段

tid

ShortField

0

mid

ShortField

0

return_code

ByteEnumField

0

class scapy.contrib.mqttsn.MQTTSNPubcomp

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNPubcomp字段

mid

ShortField

0

class scapy.contrib.mqttsn.MQTTSNPublish

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNPublish字段

dup

BitField (1位)

0

qos

BitEnumField (2位)

0

retain

BitField (1位)

0

will

BitField (1位)

0

cleansess

BitField (1位)

0

tid_type

BitEnumField (2位)

0

tid

ShortField

0

mid

ShortField

0

data

StrLenField

b''

class scapy.contrib.mqttsn.MQTTSNPubrec

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNPubrec字段

mid

ShortField

0

class scapy.contrib.mqttsn.MQTTSNPubrel

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNPubrel字段

mid

ShortField

0

class scapy.contrib.mqttsn.MQTTSNRegack

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNRegack字段

tid

ShortField

0

mid

ShortField

0

return_code

ByteEnumField

0

class scapy.contrib.mqttsn.MQTTSNRegister

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNRegister字段

tid

ShortField

0

mid

ShortField

0

topic_name

StrLenField

b''

class scapy.contrib.mqttsn.MQTTSNSearchGW

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNSearchGW字段

radius

ByteField

0

class scapy.contrib.mqttsn.MQTTSNSuback

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNSuback字段

dup

BitField (1位)

0

qos

BitEnumField (2位)

0

retain

BitField (1位)

0

will

BitField (1位)

0

cleansess

BitField (1位)

0

tid_type

BitEnumField (2位)

0

tid

ShortField

0

mid

ShortField

0

return_code

ByteEnumField

0

class scapy.contrib.mqttsn.MQTTSNSubscribe

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNSubscribe字段

dup

BitField (1位)

0

qos

BitEnumField (2位)

0

retain

BitField (1位)

0

will

BitField (1位)

0

cleansess

BitField (1位)

0

tid_type

BitEnumField (2位)

0

mid

ShortField

0

tid

ShortField (Cond)

None

short_topic

StrFixedLenField (Cond)

None

topic_name

StrLenField (Cond)

None

class scapy.contrib.mqttsn.MQTTSNUnsuback

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNUnsuback字段

mid

ShortField

0

class scapy.contrib.mqttsn.MQTTSNUnsubscribe

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSN退订字段

dup

BitField (1位)

0

qos

BitEnumField (2位)

0

retain

BitField (1位)

0

will

BitField (1位)

0

cleansess

BitField (1位)

0

tid_type

BitEnumField (2位)

0

mid

ShortField

0

tid

ShortField (Cond)

None

short_topic

StrFixedLenField (Cond)

None

topic_name

StrLenField (Cond)

None

class scapy.contrib.mqttsn.MQTTSNWillMsg

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNWillMsg字段

will_msg

StrLenField

b''

class scapy.contrib.mqttsn.MQTTSNWillMsgReq

Bases: scapy.packet.Packet

aliastypes
class scapy.contrib.mqttsn.MQTTSNWillMsgResp

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNWillMsgResp字段

return_code

ByteEnumField

0

class scapy.contrib.mqttsn.MQTTSNWillMsgUpd

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNWillMsgUpd字段

will_msg

StrLenField

b''

class scapy.contrib.mqttsn.MQTTSNWillTopic

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNWillTopic字段

dup

BitField (1位)

0

qos

BitEnumField (2位)

0

retain

BitField (1位)

0

will

BitField (1位)

0

cleansess

BitField (1位)

0

tid_type

BitEnumField (2位)

0

will_topic

StrLenField

b''

class scapy.contrib.mqttsn.MQTTSNWillTopicReq

Bases: scapy.packet.Packet

aliastypes
class scapy.contrib.mqttsn.MQTTSNWillTopicResp

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNWillTopicResp字段

return_code

ByteEnumField

0

class scapy.contrib.mqttsn.MQTTSNWillTopicUpd

Bases: scapy.packet.Packet

aliastypes
fields_desc
MQTTSNWillTopicUpd字段

dup

BitField (1位)

0

qos

BitEnumField (2位)

0

retain

BitField (1位)

0

will

BitField (1位)

0

cleansess

BitField (1位)

0

tid_type

BitEnumField (2位)

0

will_topic

StrLenField

b''

class scapy.contrib.mqttsn.RandVariableFieldLen

Bases: scapy.volatile.RandNum

class scapy.contrib.mqttsn.VariableFieldLenField(*args, **kwargs)

Bases: scapy.fields.FieldLenField

MQTT-SN长度字段对于值[0x02,0xff]具有1个字节,对于值[0x0100,0xffff]具有3个字节. 如果第一个字节为0x01,则长度值在接下来的2个字节中按网络字节顺序排列. MQTT-SN数据包的长度至少为2个字节(长度字段+类型字段).

addfield(pkt, s, val)
getfield(pkt, s)
randval()