Commit Graph

23 Commits

Author SHA1 Message Date
Warner Losh
4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Warner Losh
1b5bc3a54b usbdump: style: Sort case statements alphabetically
Switch case statement for getopt args should be sorted alphabetically.

Sponsored by:		Netflix
2021-06-04 16:47:28 -06:00
Hans Petter Selasky
c904e20cc9 Implement own command line option for the frequently used -i usbusX -f Y syntax,
-d ugenX.Y, similar to what usbconfig(8) does.

MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-05-14 17:15:07 +02:00
Hans Petter Selasky
9efd65a9d2 Fix parsing of corrupt data in usbdump(8). Check that the transfer
type array lookup is within bounds to avoid segfault.

PR:		238801
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2019-06-25 13:15:29 +00:00
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Pedro F. Giffuni
c4c510be1e Reuse our roundup2() macro instead of reinventing the wheel.
Obtained from:	DragonflyBSD
2016-04-18 17:30:33 +00:00
Hans Petter Selasky
7cadd9874f Remove nop.
MFC after:	1 week
2014-05-28 12:58:37 +00:00
Hans Petter Selasky
7eff5abf03 Fix for big endian architectures. The "up_address" field is 8-bit and
does not need byte swapping.

MFC after:	1 week
2014-05-28 12:27:41 +00:00
Hans Petter Selasky
0b30fcb60d Add check for "hw.usb.no_pf" sysctl value.
Submitted by:	Warren Block <wblock@wonkity.com>
MFC after:	1 week
2014-01-21 08:24:12 +00:00
Hiroki Sato
739047446d Make usbusN logging pseudo-interface used by usbdump(8) clonable. One is
now created/destroyed automatically by usbdump(8).

Note that "hw.usb.no_pf" loader tunable is now obsolete.

Reviewed by:	hselasky
2012-07-09 07:25:09 +00:00
Hans Petter Selasky
4573cfdb11 Add missing and probably also mandatory -h option.
MFC after:	1 week
2012-04-24 14:06:07 +00:00
Hans Petter Selasky
fa00154522 Improve support for USB packet filtering also when reading dumps, and
allow filtered data to be dumped to a binary file.

MFC after:	1 week
2012-04-24 06:26:14 +00:00
Hans Petter Selasky
9fe1e2282e Create new file header format to simplify the endian and cross platform issues.
This patch does not break binary compatibility with previous versions.

MFC after:	1 week
2012-03-16 17:30:22 +00:00
Hans Petter Selasky
3c27df12e0 Fix cross-platform issue about the file-format in which
usbdump stores data. Until this patch it was not possible
to exchange traces between 32-bit, 64-bit, big- and
little endian platforms. The problem is the dynamic nature
of the BPF timestamp in the header. All other fields are
fixed size and little endian.

MFC after:	5 days
2012-03-16 16:29:21 +00:00
Hans Petter Selasky
79fcfd2e54 Add support for filtering USB devices and USB endpoints to the usbdump utility
when making software USB traces.

MFC after: 1 week
2012-02-16 21:18:36 +00:00
Hans Petter Selasky
6a3b2e7773 Make the usbdump utility work again by using the correct BPF structures.
MFC after:	3 days
2011-10-17 15:54:20 +00:00
Hans Petter Selasky
955c139ed4 Minor usbdump update:
- Use memcpy() instead of bcopy().
- Replace all asserts() by standard error messages.
- Update usage().

MFC after:	7 days
2011-05-07 16:28:23 +00:00
Andrew Thompson
0d736113d2 fix printing of tv_usec 2011-04-04 02:57:19 +00:00
Hans Petter Selasky
31a1169186 - Improvements to USB PF solution
- Add more fields for USB device and host mode
- Add more information to USB PF header so that decoding
  can easily be done by software analyzer tools like
  Wireshark.
- Optimise usbdump to display USB streams in text format
  more efficiently.
- Software using USB PF must be recompiled after
  this commit, due to structure changes.

MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-03 20:03:45 +00:00
Hans Petter Selasky
0ddfc9486b - Remove double semicolon.
- Remove reference to sprintf. Use printf directly. This part of
the code should be optimised further to avoid many small printouts.
Setting a sensible line buffer length could help aswell when printing
out megabytes of data per second.

Approved by:	thompsa (mentor)
2011-01-28 08:00:57 +00:00
Weongyo Jeong
723b2f5af2 Changes the meaning of each characters '<' and '>' that it could be
confused with USB OUT or USB IN packets though it just represents USB
submit or done.  To know the USB packet direction, the endpoint address
should be referred.

Requested by:	jkim
2010-12-03 00:44:07 +00:00
Weongyo Jeong
6d926c73ae As a refection of r215802 it should use BPF interfaces because the
duplication code of USB pf is removed.
2010-11-24 19:15:26 +00:00
Weongyo Jeong
e64ac239f6 Adds usbdump(8) tool that currently it only supports the very basic
feature set.  It's not connected to the build yet.

Reviewed by:	hps
2010-11-22 01:28:29 +00:00