Wireshark-dev: Re: [Wireshark-dev] how to remove/unregister a dissector?

From: Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>
Date: Wed, 27 Apr 2011 12:39:33 +0200
On Wed, Apr 27, 2011 at 12:20:43PM +0200, Anders Broman wrote:
> On Tue, Apr 26, 2011 at 06:57:07PM +0000, Chris Maynard wrote:
> > In most cases, to remove unwanted protocol dissectors from the build, 
> > delete the relevant packet-*.c files from epan/dissectors/Makefile.common's DISSECTOR_SRC.
> 
> I've always wanted to configure DISSECTOR_SRC using some user-friendly tool, maybe something like make *config from Linux kernel.
> 
> Config tree might looks like:
> 
> -TCP dissectors [X]
>  |- 23: Telnet                [X]
>  |- 25: Simple Mail Transfer Protocol [X]
>  |- 110: Post Office Protocol [X]
>  |- 9418: Git Smart Protocol  [ ]
>  |- ....
>  |
>  - SSL dissectors [X]
>   |- 465: Simple Mail Transfer Protocol [X]
>   |- 995: Post Office Protocol [X]
>   |- ...
> 
> - UDP dissectors [ ]
> - ...
> 
> Perhaps the menu Internal->dissector tables could be used for something like that.

Yeah initial version might use it, but it won't solve all problems, for example:
pop3s should force (at least compiling) of pop3 dissector.

It'd work with #ifdef-ing whole file (which I think is the most portable way of implementing it) with:
#if defined(CONFIG_POP3) || defined(CONFIG_POP3_SSL) 

But I think it's good idea to show user that this dissector is forced by another dependency (in menuconfig it's shown as -*-),
and in future it'll be required to don't compile empty files.

Another problem is with generating register.c, cause dissector files are not preprocessered (or they are?).