USBDUMP(8)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’… 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 -i option. 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 -i and -f options. 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 -i and -f options 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 -r and -f options. lowkey useful πŸ¦‹
  • -i ifname β€” listen on the USB bus interface ifname. like, that's your earpiece bestie πŸ‘‘
  • -r file β€” read the raw packets from file. this option also works with the -f option. replay era 🌈
  • -s snaplen β€” snapshot snaplen bytes 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 to file. this option also works with the -s and -v options. save it for later πŸ“
  • -f filter β€” okay this one's the main character. the filter argument 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 endpoint 0 and one for endpoint 128. if 128 is added to the endpoint number, that means IN direction; else OUT direction is implied. a device unit or endpoint value of -1 means ignore this field. if no filters are specified, all packets are passed through using the default -1,-1 filter. 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 be CTRL, ISOC, BULK or INTR.
  • <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 is xfer->nframes, which means how many frames are acceptable or registered to transfer. if this is a USB done, xfer->aframes is the actual number of frames.
  • <length> β€” total packet size. if this is a USB submit, its value is xfer->sumlen. if this is a USB done, its value is xfer->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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms