ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] USB Attached SCSI dissector

From: Aidan MacDonald <amachronic@xxxxxxxxxxxxxx>
Date: Tue, 26 Oct 2021 15:29:33 +0000
On Monday, October 25th, 2021 at 3:57 PM, Kennedy, Smith (Wireless & IPP Standards) <smith.kennedy@xxxxxx> wrote:
> The "Universal Serial Bus Common Class Specification"
> (https://usb.org/sites/default/files/usbccs10.pdf)
> discusses matching "drivers" to devices based on the device's or
> interface's class, subclass and protocol.
>
> I would suggest that, for USB, dissector matching for USB could adopt
> elements of this methodology to make it easier or more clear how to add
> support for new subclasses or protocols under a particular class.

I think this is a good idea. I just wanted to avoid doing a refactor
of all the other USB dissectors in order to add one. :)

Is there another protocol in Wireshark that deals with a similar case,
which I could pattern this off of? If not, the obvious approach would
be to have a routine which looks at the interface info (if we have it)
and call the right dissector directly. Or I could indirect it through
dissector_try_uint() by having an enum of all available dissectors.