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] Unused dissector headers

From: Peter Wu <peter@xxxxxxxxxxxxx>
Date: Sat, 22 Sep 2018 11:34:30 +0200
On Fri, Sep 21, 2018 at 08:21:56PM +0200, Pascal Quantin wrote:
> Hi Gerald,
> 
> Le ven. 21 sept. 2018 � 20:13, Gerald Combs <gerald@xxxxxxxxxxxxx> a �crit :
> 
> > We have a bunch of header files in epan/dissectors that are only used
> > once. Is there any reason we shouldn't move the contents of most of them to
> > their corresponding .c files?
> >
> > file-file.h 20 lines
> > packet-dcc.h 390 lines
> > packet-dcerpc-browser.h 28 lines
> > packet-dcerpc-dcom.h 68 lines
> > packet-dcerpc-frsapi.h 28 lines
> > packet-dcerpc-pnp.h 93 lines
> > packet-dcerpc-rras.h 64 lines
> > packet-dcerpc-spoolss.h 560 lines
> > packet-dcerpc-svcctl.h 60 lines
> > packet-dcerpc-tapi.h 19 lines
> > packet-edonkey.h 403 lines
> > packet-epmd.h 12 lines
> > packet-f5ethtrailer.h 215 lines
> > packet-fcbls.h 63 lines
> > packet-fcfcs.h 242 lines
> > packet-fcfzs.h 107 lines
> > packet-fcp.h 18 lines
> > packet-fcsb3.h 60 lines
> > packet-ff.h 720 lines
> > packet-gnutella.h 72 lines
> > packet-h223.h 18 lines
> > packet-ipsec.h 25 lines
> > packet-klm.h 20 lines
> > packet-mac-nr.h 122 lines
> >
> 
> This one will be used by the catapult DCT2000 dissector at some point. It
> also provide defines for the UDP framing protocol.
> 
> > packet-mbim.h 54 lines
> 
> This one is used by plugins to register hooks for proprietary MBIM
> extensions.
> 
> > packet-mount.h 27 lines
> > packet-mpeg-pmt.h 17 lines
> > packet-ndps.h 1839 lines
> > packet-nisplus.h 50 lines
> > packet-nlm.h 46 lines
> > packet-opensafety.h 504 lines
> > packet-pcnfsd.h 17 lines
> > packet-pktc.h 17 lines
> > packet-portmap.h 48 lines
> > packet-protobuf.h 47 lines
> > packet-ptpip.h 499 lines
> > packet-reload.h 18 lines
> > packet-rmi.h 55 lines
> > packet-rquota.h 22 lines
> > packet-spice.h 1206 lines

packet-spice.h is automatically generated, it would be easier to update
if it remains separate.

> > packet-stat-notify.h 20 lines
> > packet-stat.h 24 lines
> > packet-tacacs.h 430 lines
> > packet-tftp.h 21 lines
> > packet-thrift.h 75 lines
> > packet-ua.h 18 lines
> > packet-wtls.h 26 lines
> > packet-wtp.h 49 lines
> > packet-x11-keysymdef.h 2049 lines

This looks like an adaption of /usr/include/X11/keysymdef.h. Again, to
make updating easier I would keep this separate.

> > packet-ypbind.h 20 lines
> > packet-yppasswd.h 18 lines
> > packet-ypserv.h 29 lines
> > packet-ypxfr.h 19 lines

For files with just a few declarations and macros that were manually
written, I think it is fine to merge it into the corresponding .c file.
The larger files should probably remain separate. Many .c files are
already quite large, if any we should try to shrink them and not
increase it further.
-- 
Kind regards,
Peter Wu
https://lekensteyn.nl