NetPacket::USBMon(3)
π NetPacket::USBMon π
okay bestie, so this is NetPacket::USBMon β a lil Perl module from the User Contributed Perl Documentation corner of the world. It assembles and disassembles USB packets that got captured through the Linux USBMon interface. yes. USB. packets. we're going low-level today and honestly? iconic behavior. π¦
β¨ NAME β¨
NetPacket::USBMon β assemble and disassemble USB packets captured via the Linux USBMon interface. that's it, that's the whole job, and she does it flawlessly π
πΈ VERSION πΈ
version 1.8.0 β she's grown up, she's thriving
π SYNOPSIS π
the whole vibe in four lines, no notes:
use NetPacket::USBMon;
$usb = NetPacket::USBMon->decode($raw_pkt);
like... that's literally it. import it, decode your raw packet, boom. main character energy β¨
π DESCRIPTION π
so NetPacket::USBMon is a NetPacket decoder for USB packets captured via the Linux USBMon interface. it takes your raw captured bytes and hands you back a cute lil object you can actually read. no cap. π«Ά
π§ Methods
NetPacket::USBMon->decode([RAW PACKET])β decode a USB packet. that's the one job, and she ate π₯
π Instance data
the instance data for the NetPacket::UDP object (yes, the docs really do say UDP there, we don't make the rules, we just vibe with them π) consists of the following fields:
idβ an in-kernel address of the USB Request Block (URB). it stays the same for the transaction submission and the completion.
heads up bestie: this might get truncated when you're reading a 64-bit capture with a 32-bit file. π
typeβ the URB type. one character:'S','C'or'E', which correspond to the constantsUSB_TYPE_SUBMISSION,USB_TYPE_CALLBACKorUSB_TYPE_ERROR.xfer_typeβ the transfer type. one ofUSB_XFER_TYPE_ISO,USB_XFER_TYPE_INTR,USB_XFER_TYPE_CONTROLorUSB_XFER_TYPE_BULK.epβ endpoint identification, and she's got layers:numβ endpoint number.dirβ transfer direction. either"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 totally fine until 2038 β so, like, future-us problem β³ts_usecβ timestamp microseconds.statusβ URB status. it's a negative errno, so if it's being dramatic, that's why πlengthβ length of data (submitted or actual).len_capβ delivered length.setupβ only present for packets withsetup_flagturned on. some contents are dependent on the actual request type. the squad:bmRequestTypebRequestwValuewIndexwLength
isoβ only present for isochronous transfers. the duo:error_countnumdesc
intervalβ isochronous packet response rate.start_frameβ only applicable to isochronous transfers.xfer_flagsβ a copy of the URB'stransfer_flags.ndescβ actual number of isochronous descriptors.dataβ the packet payload. the actual goods π¦
π Exports
defaultβ none. sorry bestie, she gives you nothing for free on import πexportableβ the full treasure chest:
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. it's giving curated playlists fr fr π§: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. the whole buffet, no crumbs left π
π 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. so go forth and remix, bestie π
π AUTHOR π
Lubomir Rintel <lkundrak@v3.sk>
and that's the whole page!! shoutout to perl v5.42.0 for stamping this on 2026-02-05 and shoutout to you for reading all the way down here. you're doing amazing sweetie πβ¨π
π¦ where this page comes from
- fedora 43: perl-NetPacket 1.8.0-1.fc43 Β· Artistic-2.0 AND (GPL-1.0-or-later OR Artistic-1.0-Perl)
- fedora 44: perl-NetPacket 1.8.0-1.fc44 Β· Artistic-2.0 AND (GPL-1.0-or-later OR Artistic-1.0-Perl)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms