Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] enum preferences vs Go Fish

Date: Fri, 3 Apr 2015 21:30:32 -0400
I may have gone a little overboard, but I tried to remove all enumerated preferences that really should be Decode As.  There were enough nuances to each situation, that I made them all separate patches.
 
Users of these various dissectors can certainly weigh in on their usefulness, but I was trying for "GUI consistency in behavior".  It has been made easier by the fact that adding Decode As functionality doesn't require writing GUI code anymore.
 
 
-----Original Message-----
From: mmann78 <mmann78@xxxxxxxxxxxx>
To: wireshark-dev <wireshark-dev@xxxxxxxxxxxxx>
Sent: Mon, Mar 16, 2015 4:19 pm
Subject: enum preferences vs Go Fish

The SocketCan dissector has an enumerated preference to pick its subdissector, manually finding all enumerated options through find_dissector().  This doesn't work well for plugins and they are not going to modify enum preference source as the whole point is to not have to modify Wireshark source to get a plugin to work.
 
So I feel I have a few choices:
1. Change enumeration to "string" preference to have user put it dissector by name.  I think this requires too much intimate knowledge of Wireshark and results in "Go Fish" (either to get the dissector name right or incorrectly trying to dissect protocols that don't run over CAN)
2. I'd like a dissector table with for the dissectors to register with dissector_add_for_decode_as (there is no "value" that distinguishes subdissectors), but that either leaves the enum preference "useless" or it just gets in the way of Decode As (which seems like the proper place for this all along).  And I can't seem to figure out how I would populate a enum list with the dissectors in time to register the preference.
 
Is there a best/preferred solution for this?  I'm leaning towards just removing the enum preference in favor of strictly using Decode As (and using User Specific Decodes as any notion of a "saved" preference)