ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] dissector_add: Multiple registrations to sameTCP/UDP ports;

From: Bill Meier <wmeier@xxxxxxxxxxx>
Date: Mon, 25 Aug 2008 11:12:07 -0400
Anders Broman wrote:
    (On a somewhat separate note: I see that multiple registrations
     happen for udp and tcp port 0.
     I'm still looking at these to understand and to see if OK.)

I think this is used when there is no registered port for the protocol
And no reasonable default port can be given. Register to port zero
Still gives the possibility to do "decode as" and with a preference
The user who needs this protocol can give the port value used in that
environment. Heuristics may not be possible.


For the cases in which there is no actual dissector port preference, it seems to me that dissector_add_handle() (rather than registering to port 0) should be used to allow "decode as".

Am I missing something ?

Bill