scapy.contrib.mqttsn module

class scapy.contrib.mqttsn.MQTTSN

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSN'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSN).len>, <Field (MQTTSN).type>]
payload_guess = [({'type': 0}, <class 'scapy.contrib.mqttsn.MQTTSNAdvertise'>), ({'type': 1}, <class 'scapy.contrib.mqttsn.MQTTSNSearchGW'>), ({'type': 2}, <class 'scapy.contrib.mqttsn.MQTTSNGwInfo'>), ({'type': 4}, <class 'scapy.contrib.mqttsn.MQTTSNConnect'>), ({'type': 5}, <class 'scapy.contrib.mqttsn.MQTTSNConnack'>), ({'type': 6}, <class 'scapy.contrib.mqttsn.MQTTSNWillTopicReq'>), ({'type': 7}, <class 'scapy.contrib.mqttsn.MQTTSNWillTopic'>), ({'type': 8}, <class 'scapy.contrib.mqttsn.MQTTSNWillMsgReq'>), ({'type': 9}, <class 'scapy.contrib.mqttsn.MQTTSNWillMsg'>), ({'type': 10}, <class 'scapy.contrib.mqttsn.MQTTSNRegister'>), ({'type': 11}, <class 'scapy.contrib.mqttsn.MQTTSNRegack'>), ({'type': 12}, <class 'scapy.contrib.mqttsn.MQTTSNPublish'>), ({'type': 13}, <class 'scapy.contrib.mqttsn.MQTTSNPuback'>), ({'type': 14}, <class 'scapy.contrib.mqttsn.MQTTSNPubcomp'>), ({'type': 15}, <class 'scapy.contrib.mqttsn.MQTTSNPubrec'>), ({'type': 16}, <class 'scapy.contrib.mqttsn.MQTTSNPubrel'>), ({'type': 18}, <class 'scapy.contrib.mqttsn.MQTTSNSubscribe'>), ({'type': 19}, <class 'scapy.contrib.mqttsn.MQTTSNSuback'>), ({'type': 20}, <class 'scapy.contrib.mqttsn.MQTTSNUnsubscribe'>), ({'type': 21}, <class 'scapy.contrib.mqttsn.MQTTSNUnsuback'>), ({'type': 22}, <class 'scapy.contrib.mqttsn.MQTTSNPingReq'>), ({'type': 23}, <class 'scapy.contrib.mqttsn.MQTTSNPingResp'>), ({'type': 24}, <class 'scapy.contrib.mqttsn.MQTTSNDisconnect'>), ({'type': 26}, <class 'scapy.contrib.mqttsn.MQTTSNWillTopicUpd'>), ({'type': 27}, <class 'scapy.contrib.mqttsn.MQTTSNWillTopicResp'>), ({'type': 28}, <class 'scapy.contrib.mqttsn.MQTTSNWillMsgUpd'>), ({'type': 29}, <class 'scapy.contrib.mqttsn.MQTTSNWillMsgResp'>), ({'type': 254}, <class 'scapy.contrib.mqttsn.MQTTSNEncaps'>)]
class scapy.contrib.mqttsn.MQTTSNAdvertise

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNAdvertise'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNAdvertise).gw_id>, <Field (MQTTSNAdvertise).duration>]
class scapy.contrib.mqttsn.MQTTSNConnack

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNConnack'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNConnack).return_code>]
class scapy.contrib.mqttsn.MQTTSNConnect

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNConnect'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).dup>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).qos>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).retain>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).will>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).cleansess>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).tid_type>, <Field (MQTTSNConnect).prot_id>, <Field (MQTTSNConnect).duration>, <Field (MQTTSNConnect).client_id>]
class scapy.contrib.mqttsn.MQTTSNDisconnect

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNDisconnect'>, <class 'scapy.packet.Packet'>]
fields_desc = [<scapy.fields.ConditionalField object>]
class scapy.contrib.mqttsn.MQTTSNEncaps

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNEncaps'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNEncaps).resvd>, <Field (MQTTSNEncaps).radius>, <Field (MQTTSNEncaps).w_node_id>]
payload_guess = [({}, <class 'scapy.contrib.mqttsn.MQTTSN'>)]
class scapy.contrib.mqttsn.MQTTSNGwInfo

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNGwInfo'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNGwInfo).gw_id>, <Field (MQTTSNGwInfo).gw_addr>]
class scapy.contrib.mqttsn.MQTTSNPingReq

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNPingReq'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNPingReq).client_id>]
class scapy.contrib.mqttsn.MQTTSNPingResp

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNPingResp'>, <class 'scapy.packet.Packet'>]
class scapy.contrib.mqttsn.MQTTSNPuback

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNPuback'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNPuback).tid>, <Field (MQTTSNPuback).mid>, <Field (MQTTSNPuback).return_code>]
class scapy.contrib.mqttsn.MQTTSNPubcomp

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNPubcomp'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNPubcomp).mid>]
class scapy.contrib.mqttsn.MQTTSNPublish

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNPublish'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).dup>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).qos>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).retain>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).will>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).cleansess>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).tid_type>, <Field (MQTTSNPublish).tid>, <Field (MQTTSNPublish).mid>, <Field (MQTTSNPublish).data>]
class scapy.contrib.mqttsn.MQTTSNPubrec

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNPubrec'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNPubrec).mid>]
class scapy.contrib.mqttsn.MQTTSNPubrel

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNPubrel'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNPubrel).mid>]
class scapy.contrib.mqttsn.MQTTSNRegack

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNRegack'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNRegack).tid>, <Field (MQTTSNRegack).mid>, <Field (MQTTSNRegack).return_code>]
class scapy.contrib.mqttsn.MQTTSNRegister

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNRegister'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNRegister).tid>, <Field (MQTTSNRegister).mid>, <Field (MQTTSNRegister).topic_name>]
class scapy.contrib.mqttsn.MQTTSNSearchGW

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNSearchGW'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNSearchGW).radius>]
class scapy.contrib.mqttsn.MQTTSNSuback

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNSuback'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).dup>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).qos>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).retain>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).will>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).cleansess>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).tid_type>, <Field (MQTTSNSuback).tid>, <Field (MQTTSNSuback).mid>, <Field (MQTTSNSuback).return_code>]
class scapy.contrib.mqttsn.MQTTSNSubscribe

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNSubscribe'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).dup>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).qos>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).retain>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).will>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).cleansess>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).tid_type>, <Field (MQTTSNSubscribe).mid>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>]
class scapy.contrib.mqttsn.MQTTSNUnsuback

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNUnsuback'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNUnsuback).mid>]
class scapy.contrib.mqttsn.MQTTSNUnsubscribe

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNUnsubscribe'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).dup>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).qos>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).retain>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).will>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).cleansess>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).tid_type>, <Field (MQTTSNUnsubscribe).mid>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>]
class scapy.contrib.mqttsn.MQTTSNWillMsg

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNWillMsg'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNWillMsg).will_msg>]
class scapy.contrib.mqttsn.MQTTSNWillMsgReq

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNWillMsgReq'>, <class 'scapy.packet.Packet'>]
class scapy.contrib.mqttsn.MQTTSNWillMsgResp

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNWillMsgResp'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNWillMsgResp).return_code>]
class scapy.contrib.mqttsn.MQTTSNWillMsgUpd

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNWillMsgUpd'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNWillMsgUpd).will_msg>]
class scapy.contrib.mqttsn.MQTTSNWillTopic

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNWillTopic'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).dup>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).qos>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).retain>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).will>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).cleansess>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).tid_type>, <Field (MQTTSNWillTopic).will_topic>]
class scapy.contrib.mqttsn.MQTTSNWillTopicReq

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNWillTopicReq'>, <class 'scapy.packet.Packet'>]
class scapy.contrib.mqttsn.MQTTSNWillTopicResp

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNWillTopicResp'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNWillTopicResp).return_code>]
class scapy.contrib.mqttsn.MQTTSNWillTopicUpd

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mqttsn.MQTTSNWillTopicUpd'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).dup>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).qos>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).retain>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).will>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).cleansess>, <Field (MQTTSNConnect,MQTTSNWillTopic,MQTTSNPublish,MQTTSNSubscribe,MQTTSNSuback,MQTTSNUnsubscribe,MQTTSNWillTopicUpd).tid_type>, <Field (MQTTSNWillTopicUpd).will_topic>]
class scapy.contrib.mqttsn.RandVariableFieldLen

Bases: scapy.volatile.RandNum

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

Bases: scapy.fields.FieldLenField

MQTT-SN length field either has 1 byte for values [0x02, 0xff] or 3 bytes for values [0x0100, 0xffff]. If the first byte is 0x01 the length value comes in network byte-order in the next 2 bytes. MQTT-SN packets are at least 2 bytes long (length field + type field).

addfield(pkt, s, val)

Add an internal value to a string

Copy the network representation of field val (belonging to layer pkt) to the raw string packet s, and return the new string packet.

getfield(pkt, s)

Extract an internal value from a string

Extract from the raw packet s the field value belonging to layer pkt.

Returns a two-element list, first the raw packet string after having removed the extracted field, second the extracted field itself in internal representation.

randval()

Return a volatile object whose value is both random and suitable for this field