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] Change in wireshark[master]: Remove unneeded #includes from

From: Bill Meier <wmeier@xxxxxxxxxxx>
Date: Fri, 19 Dec 2014 16:19:00 -0500
On 12/19/2014 12:05 PM, Martin Mathieson (Code Review) wrote:

Change subject: Remove unneeded #includes from epan/dissectors
......................................................................

Remove unneeded #includes from epan/dissectors


Martin:

Obviously, #includes usage in dissectors is a bit of a mish-mosh

There's one thing I would think worthwhile to do to try to keep the #includes a bit under control and somewhat consistent before going through the dissectors to remove unneeded #includes.

That is, I would change the dissectors as needed to
have '#include <epan/packet.h>' as the first #include (after config.h and any "system" includes).

If this is done, the #includes (direct and indirect) in packet.h can then be immediately removed from the dissectors.


Of the ~1130 non-generated .c files in epan/dissectors, there's about 350 which don't have '#include <epan/packet.h>' at all and maybe another 50 which don't have the include as the first wireshark include.


If you and others are Ok with this suggestion, I'd be happy to do that work (altho it might take me a day or three).

Bill