VERSION
version 1.6.0SYNOPSIS
use NetPacket::USBMon;
$usb = NetPacket::USBMon->decode($raw_pkt);
DESCRIPTION
"NetPacket::USBMon" is a NetPacket decoder of USB packets captured via Linux USBMon interface.Methods
- "NetPacket::USBMon->decode([RAW PACKET])"
- Decode a USB packet.
Instance data
The instance data for the "NetPacket::UDP" object consists of the following fields.- id
-
An in-kernel address of the USB Request Block (URB). Stays the same for the
transaction submission and completion.
Might be truncatted when reading a 64-bit capture with 32-bit file.
- type
- URB type. Character 'S', 'C' or 'E', for constants USB_TYPE_SUBMISSION, USB_TYPE_CALLBACK or USB_TYPE_ERROR.
- xfer_type
- Transfer type. USB_XFER_TYPE_ISO, USB_XFER_TYPE_INTR, USB_XFER_TYPE_CONTROL or USB_XFER_TYPE_BULK.
- ep
-
Endpoint identification.
-
- num
- Endpoint number.
- dir
- Transfer direction. ``IN'' or ``OUT''.
-
- devnum
- Device address.
- busnum
- Bus number.
- flag_setup
- Indicates whether setup is present and makes sense.
- flag_data
- Indicates whether data is present and makes sense.
- ts_sec
- Timestamp seconds since epoch. Subject to truncation with 32-bit Perl, which should be fine until 2038.
- ts_usec
- Timestamp microseconds.
- status
- URB status. Negative errno.
- length
- Length of data (submitted or actual).
- len_cap
- Delivered length
- setup
-
Only present for packets with setup_flag turned on.
Some contents are dependent on actual request type.
-
- bmRequestType
- bRequest
- wValue
- wIndex
- wLength
-
- iso
-
Only present for isochronous transfers.
-
- error_count
- numdesc
-
- interval
- Isochronous packet response rate.
- start_frame
- Only applicable to isochronous transfers.
- xfer_flags
- A copy of URB's transfer_flags.
- ndesc
- Actual number of isochronous descriptors.
- data
- Packet payload.
Exports
- default
- none
- exportable
- USB_TYPE_SUBMISSION, USB_TYPE_CALLBACK, USB_TYPE_ERROR, USB_XFER_TYPE_ISO, USB_XFER_TYPE_INTR, USB_XFER_TYPE_CONTROL, USB_XFER_TYPE_BULK, USB_FLAG_SETUP_IRRELEVANT, USB_FLAG_SETUP_RELEVANT, USB_FLAG_DATA_ERROR, USB_FLAG_DATA_INCOMING, USB_FLAG_DATA_OUTGOING, USB_FLAG_DATA_PRESENT, USB_TYPE_VENDOR
- tags
-
The following tags group together related exportable items.
-
- ":types"
- USB_TYPE_SUBMISSION, USB_TYPE_CALLBACK, USB_TYPE_ERROR
- ":xfer_types"
- USB_XFER_TYPE_ISO, USB_XFER_TYPE_INTR, USB_XFER_TYPE_CONTROL, USB_XFER_TYPE_BULK
- ":setup_flags"
- USB_FLAG_SETUP_IRRELEVANT, USB_FLAG_SETUP_RELEVANT
- ":data_flags"
- USB_FLAG_DATA_ERROR, USB_FLAG_DATA_INCOMING, USB_FLAG_DATA_OUTGOING, USB_FLAG_DATA_PRESENT
- ":setup_types"
- USB_TYPE_VENDOR
- ":ALL"
- All the above exportable items.
-
COPYRIGHT
Copyright (c) 2013 Lubomir Rintel.This module is free software. You can redistribute it and/or modify it under the same terms as Perl itself.