USBDUMP(8)
π USBDUMP(8) π
okay so bestie, this one's a System Manager's Manual page and it's literally about peeking at USB traffic on your host controller. it's giving wiretap but make it fashion. let me walk you through it π«Ά
β¨ NAME β¨
usbdump β dump traffic on USB host controller
πΈ SYNOPSIS πΈ
usbdump [-d [ugen]B] [-d [ugen]B.D] [-d [ugen]B.D.E] [-i ifname]
[-r file] [-s snaplen] [-u] [-v] [-w file] [-f filter] [-b file]
[-h]
π DESCRIPTION π
The usbdump utility is your little backstage pass β it provides a way to dump USB packets on host controllers. no cap, that's the whole vibe. π₯
The following options are accepted:
π the flags, bestie π
-d [ugen]busβ this is a shortcut for the-ioption. the argument may be prefixed by"ugen". you can specify this option multiple times, but heads up: the bus specified must be the same. no mixing busses, that's messy π-d [ugen]bus.deviceβ shortcut for the-iand-foptions. the argument may be prefixed by"ugen". may be specified multiple times, but again, the bus specified must be the same. consistency is the moment β¨-d [ugen]bus.device.endpointβ shortcut for the-iand-foptions too. argument may be prefixed by"ugen". can be specified multiple times, and yep β the bus specified must be the same. we love a rule π-b fileβ stores the data part of the USB trace in binary format to the given file. this option also works with the-rand-foptions. lowkey useful π¦-i ifnameβ listen on the USB bus interfaceifname. like, that's your earpiece bestie π-r fileβ read the raw packets fromfile. this option also works with the-foption. replay era π-s snaplenβ snapshotsnaplenbytes from each packet. crop the pic, basically π-uβ unbuffered output. no waiting around π-vβ enable debugging messages. when defined multiple times, the verbosity level increases. more-v, more talking, and honestly same π-w fileβ write the raw packets tofile. this option also works with the-sand-voptions. save it for later π-f filterβ okay this one's the main character. thefilterargument consists of either one or two numbers separated by a dot. the first indicates the device unit number which should be traced. the second number, which is optional, indicates the endpoint which should be traced. to get all traffic for the control endpoint, two filters should be created β one for endpoint0and one for endpoint128. if128is added to the endpoint number, that means IN direction; else OUT direction is implied. a device unit or endpoint value of-1means ignore this field. if no filters are specified, all packets are passed through using the default-1,-1filter. this option can be specified multiple times. periodt. β-hβ this option displays a summary of the command line options. the lil helper π§
π₯ EXAMPLES π₯
Capture the USB raw packets on usbus2:
usbdump -i usbus2 -s 256 -v
Dump the USB raw packets of usbus2 into the file without packet size limit:
usbdump -i usbus2 -s 0 -w /tmp/dump_pkts
Dump the USB raw packets of usbus2, but only the control endpoint traffic of device unit number 3:
usbdump -i usbus2 -s 0 -f 3.0 -f 3.128 -w /tmp/dump_pkts
Read and display the USB raw packets from previous file:
usbdump -r /tmp/dump_pkts -v
π OUTPUT FORMAT π
The output format of usbdump is as follows:
<time> <bus>.<addr> <ep> <xfertype> <S/D> (<frames>/<length>)
<...>
The meaning of the output format elements is as follows β decoding the group chat for you bestie π
<time>β a timestamp preceding all output lines. the timestamp has the format"hh:mm:ss.frac"and is as accurate as the kernel's clock. clock said what it said β°<bus>β the USB host controller's bus unit number.<addr>β the unique number of the USB device as allocated by the host controller driver.<ep>β the USB endpoint address that indicates whether the address is OUT or IN.<xfertype>β the USB transfer type. can beCTRL,ISOC,BULKorINTR.<S/D>β'S'indicates a USB submit.'D'indicates a USB transfer done.<frames>β numbers of frames in this packets. if this is a USB submit, its value isxfer->nframes, which means how many frames are acceptable or registered to transfer. if this is a USB done,xfer->aframesis the actual number of frames.<length>β total packet size. if this is a USB submit, its value isxfer->sumlen. if this is a USB done, its value isxfer->actlen.<...>β optional field used for printing an error string if the packet is from USB done. the lil bonus panel π
π¦ SEE ALSO π¦
usbconfig(8) β go say hi, they're friends
π AUTHORS π
Weongyo Jeong <weongyo@FreeBSD.org> β an icon, honestly π
ngl bestie, that's the whole page. every flag, every field, nothing skipped. you're welcome π
πΈ β¨ π and that's a wrap β this page came from the Debian fam, dated May 14, 2021, and it's filed under USBDUMP(8). slay, go dump some packets π β¨ πΈ
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 2010 Weongyo Jeong
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms