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] [Wireshark-commits] rev 22094: /trunk/ /trunk/epan/dissector

From: Gerald Combs <gerald@xxxxxxxxxxxxx>
Date: Wed, 13 Jun 2007 22:26:45 -0700
Stephen Fisher wrote:
> Gerald,
> 
> The check-in below broke the Unix builds with a few warnings treated as 
> errors.  A few are simple fixes, but the inclusion of a wiretap header 
> in non-wiretap dissector code is getting a bit tricky.  The compiler's 
> complaints are:
> 
> cc1: warnings being treated as errors
> In file included from packet-ppi.c:56:
> ../../wiretap/wtap-capture.h:31: warning: 'struct pcap_pkthdr' declared 
> inside parameter list
> ../../wiretap/wtap-capture.h:31: warning: its scope is only this 
> definition or declaration, which is probably not what you want
> packet-ppi.c: In function 'capture_ppi':
> packet-ppi.c:360: warning: unused parameter 'pd'
> packet-ppi.c: In function 'dissect_80211n_mac':
> packet-ppi.c:493: warning: unused parameter 'pinfo'
> packet-ppi.c: In function 'dissect_ppi':
> packet-ppi.c:631: warning: unused variable 'gen_tvb'
> packet-ppi.c: In function 'proto_register_ppi':
> packet-ppi.c:862: warning: unused variable 'channel_freq_rs'
> make[4]: *** [libcleandissectors_la-packet-ppi.lo] Error 1
> 
> The first two warning messages are solved within the wiretap code by 
> including the system's pcap.h file.  However, this should be wrapped 
> inside an #ifdef HAVE_PCAP_H.  (and apparently sys/types.h, if 
> available, according to wiretap/libpcap.c).  The problem is that that 
> define is only available in wiretap/config.h and not the base config.h, 
> so you would need to include both config.h files in the packet-ppi.c 
> dissector code.  This would cause conflicts between the common 
> declarations inside the config.h files...

I've checked in a fix.  As the comment before the include indicates, the
PPI dissector needs wtap_pcap_encap_to_wtap_encap().  Is there any
reason the declaration shouldn't go into wtap.h, or all of the
encap-related stuff be put into wtap-encap.h?