scapy.layers.usb module

Default USB frames & Basic implementation

class scapy.layers.usb.USBpcap

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.usb.USBpcap'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (USBpcap).headerLen>, <Field (USBpcap).res>, <Field (USBpcap).irpId>, <Field (USBpcap).usbd_status>, <Field (USBpcap).function>, <Field (USBpcap).info>, <Field (USBpcap).bus>, <Field (USBpcap).device>, <Field (USBpcap).endpoint>, <Field (USBpcap).transfer>, <Field (USBpcap).dataLength>]
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
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.usb.USBpcapTransferControl

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.usb.USBpcapTransferControl'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (USBpcapTransferControl).stage>]
class scapy.layers.usb.USBpcapTransferInterrupt

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.usb.USBpcapTransferInterrupt'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (USBpcapTransferInterrupt).startFrame>, <Field (USBpcapTransferInterrupt).numberOfPackets>, <Field (USBpcapTransferInterrupt).errorCount>]
class scapy.layers.usb.USBpcapTransferIsochronous

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.layers.usb.USBpcapTransferIsochronous'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (USBpcapTransferIsochronous).offset>, <Field (USBpcapTransferIsochronous).length>, <Field (USBpcapTransferIsochronous).usbd_status>]