scapy.layers.dot15d4 module

Wireless MAC according to IEEE 802.15.4.

class scapy.layers.dot15d4.Dot15d4

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.dot15d4.Dot15d4'>, <class 'scapy.packet.Packet'>]
answers(other)

DEV: true if self is an answer from other

fields_desc = [<Field (Dot15d4,Dot15d4FCS).fcf_reserved_1>, <Field (Dot15d4,Dot15d4FCS).fcf_panidcompress>, <Field (Dot15d4,Dot15d4FCS).fcf_ackreq>, <Field (Dot15d4,Dot15d4FCS).fcf_pending>, <Field (Dot15d4,Dot15d4FCS).fcf_security>, <scapy.fields.Emph object>, <Field (Dot15d4,Dot15d4FCS).fcf_srcaddrmode>, <Field (Dot15d4,Dot15d4FCS).fcf_framever>, <Field (Dot15d4,Dot15d4FCS).fcf_destaddrmode>, <Field (Dot15d4,Dot15d4FCS).fcf_reserved_2>, <scapy.fields.Emph object>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

payload_guess = [({'fcf_frametype': 0}, <class 'scapy.layers.dot15d4.Dot15d4Beacon'>), ({'fcf_frametype': 1}, <class 'scapy.layers.dot15d4.Dot15d4Data'>), ({'fcf_frametype': 2}, <class 'scapy.layers.dot15d4.Dot15d4Ack'>), ({'fcf_frametype': 3}, <class 'scapy.layers.dot15d4.Dot15d4Cmd'>)]
post_build(p, pay)

DEV: called right after the current layer is build.

Parameters:
  • pkt (str) – the current packet (build by self_buil function)
  • pay (str) – the packet payload (build by do_build_payload function)
Returns:

a string of the packet with the payload

class scapy.layers.dot15d4.Dot15d4Ack

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.dot15d4.Dot15d4Ack'>, <class 'scapy.packet.Packet'>]
fields_desc = []
class scapy.layers.dot15d4.Dot15d4AuxSecurityHeader

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.dot15d4.Dot15d4AuxSecurityHeader'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (Dot15d4AuxSecurityHeader).sec_sc_reserved>, <Field (Dot15d4AuxSecurityHeader).sec_sc_keyidmode>, <Field (Dot15d4AuxSecurityHeader).sec_sc_seclevel>, <Field (Dot15d4AuxSecurityHeader).sec_framecounter>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>]
class scapy.layers.dot15d4.Dot15d4Beacon

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.dot15d4.Dot15d4Beacon'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (Dot15d4Beacon).src_panid>, <Field (Dot15d4Beacon).src_addr>, <scapy.fields.ConditionalField object>, <Field (Dot15d4Beacon).sf_sforder>, <Field (Dot15d4Beacon).sf_beaconorder>, <Field (Dot15d4Beacon).sf_assocpermit>, <Field (Dot15d4Beacon).sf_pancoord>, <Field (Dot15d4Beacon).sf_reserved>, <Field (Dot15d4Beacon).sf_battlifeextend>, <Field (Dot15d4Beacon).sf_finalcapslot>, <Field (Dot15d4Beacon).gts_spec_permit>, <Field (Dot15d4Beacon).gts_spec_reserved>, <Field (Dot15d4Beacon).gts_spec_desccount>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <Field (Dot15d4Beacon).pa_num_short>, <Field (Dot15d4Beacon).pa_reserved_1>, <Field (Dot15d4Beacon).pa_num_long>, <Field (Dot15d4Beacon).pa_reserved_2>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

payload_guess = [({}, <class 'scapy.layers.zigbee.ZigBeeBeacon'>)]
class scapy.layers.dot15d4.Dot15d4Cmd

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.dot15d4.Dot15d4Cmd'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (Dot15d4Cmd).dest_panid>, <Field (Dot15d4Cmd).dest_addr>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <Field (Dot15d4Cmd).cmd_id>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.layers.dot15d4.Dot15d4CmdAssocReq

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.dot15d4.Dot15d4CmdAssocReq'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (Dot15d4CmdAssocReq).allocate_address>, <Field (Dot15d4CmdAssocReq).security_capability>, <Field (Dot15d4CmdAssocReq).reserved2>, <Field (Dot15d4CmdAssocReq).reserved1>, <Field (Dot15d4CmdAssocReq).receiver_on_when_idle>, <Field (Dot15d4CmdAssocReq).power_source>, <Field (Dot15d4CmdAssocReq).device_type>, <Field (Dot15d4CmdAssocReq).alternate_pan_coordinator>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.layers.dot15d4.Dot15d4CmdAssocResp

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.dot15d4.Dot15d4CmdAssocResp'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (Dot15d4CmdAssocResp).short_address>, <Field (Dot15d4CmdAssocResp).association_status>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.layers.dot15d4.Dot15d4CmdCoordRealign

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.dot15d4.Dot15d4CmdCoordRealign'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (Dot15d4CmdCoordRealign).panid>, <Field (Dot15d4CmdCoordRealign).coord_address>, <Field (Dot15d4CmdCoordRealign).channel>, <Field (Dot15d4CmdCoordRealign).dev_address>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.layers.dot15d4.Dot15d4CmdDisassociation

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.dot15d4.Dot15d4CmdDisassociation'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (Dot15d4CmdDisassociation).disassociation_reason>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.layers.dot15d4.Dot15d4CmdGTSReq

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.dot15d4.Dot15d4CmdGTSReq'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (Dot15d4CmdGTSReq).reserved>, <Field (Dot15d4CmdGTSReq).charact_type>, <Field (Dot15d4CmdGTSReq).gts_dir>, <Field (Dot15d4CmdGTSReq).gts_len>]
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.layers.dot15d4.Dot15d4Data

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.dot15d4.Dot15d4Data'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (Dot15d4Data).dest_panid>, <Field (Dot15d4Data).dest_addr>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
mysummary()

DEV: can be overloaded to return a string that summarizes the layer. Only one mysummary() is used in a whole packet summary: the one of the upper layer, # noqa: E501 except if a mysummary() also returns (as a couple) a list of layers whose # noqa: E501 mysummary() must be called if they are present.

class scapy.layers.dot15d4.Dot15d4FCS

Bases: scapy.layers.dot15d4.Dot15d4

This class is a drop-in replacement for the Dot15d4 class above, except it expects a FCS/checksum in the input, and produces one in the output. This provides the user flexibility, as many 802.15.4 interfaces will have an AUTO_CRC setting # noqa: E501 that will validate the FCS/CRC in firmware, and add it automatically when transmitting. # noqa: E501

aliastypes = [<class 'scapy.layers.dot15d4.Dot15d4FCS'>, <class 'scapy.layers.dot15d4.Dot15d4'>, <class 'scapy.packet.Packet'>]
compute_fcs(data)
fields_desc = [<Field (Dot15d4,Dot15d4FCS).fcf_reserved_1>, <Field (Dot15d4,Dot15d4FCS).fcf_panidcompress>, <Field (Dot15d4,Dot15d4FCS).fcf_ackreq>, <Field (Dot15d4,Dot15d4FCS).fcf_pending>, <Field (Dot15d4,Dot15d4FCS).fcf_security>, <scapy.fields.Emph object>, <Field (Dot15d4,Dot15d4FCS).fcf_srcaddrmode>, <Field (Dot15d4,Dot15d4FCS).fcf_framever>, <Field (Dot15d4,Dot15d4FCS).fcf_destaddrmode>, <Field (Dot15d4,Dot15d4FCS).fcf_reserved_2>, <scapy.fields.Emph object>, <Field (Dot15d4FCS).fcs>]
match_subclass = True
post_build(p, pay)

DEV: called right after the current layer is build.

Parameters:
  • pkt (str) – the current packet (build by self_buil function)
  • pay (str) – the packet payload (build by do_build_payload function)
Returns:

a string of the packet with the payload

class scapy.layers.dot15d4.dot15d4AddressField(name, default, length_of=None, fmt='<H', adjust=None)

Bases: scapy.fields.Field

addfield(pkt, s, val)

Add an internal value to a string

adjust
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.

i2repr(pkt, x)

Convert internal value to a nice representation

lengthFromAddrMode(pkt, x)
length_of
scapy.layers.dot15d4.util_srcpanid_present(pkt)

A source PAN ID is included if and only if both src addr mode != 0 and PAN ID Compression in FCF == 0