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

Wireshark-dev: [Wireshark-dev] R: Problems encountered on Windows building from a "source tarba

From: "Davide Schiera" <davide.schiera@xxxxxxxxx>
Date: Sat, 30 Dec 2006 10:16:50 +0100
Hi Guy,

DS>-----Messaggio originale-----
DS>Da: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-
DS>bounces@xxxxxxxxxxxxx] Per conto di Guy Harris
DS>Inviato: sabato 30 dicembre 2006 8.57
DS>A: Developer support list for Wireshark
DS>Oggetto: Re: [Wireshark-dev] Problems encountered on Windows building
DS>from a "source tarball"
DS>
DS>Gerald Combs wrote:
DS>
DS>> I'm in the process of moving the contents of airpdcap to epan/crypt.
DS>> Once that's done I'll add it to the distribution.
DS>
DS>Some warnings from my build on OS X 10.4:
DS>
DS>	In file included from airpdcap.c:5:
DS>	airpdcap_int.h:62: warning: malformed '#pragma pack' - ignored
DS>	airpdcap_int.h:109: warning: malformed '#pragma pack' - ignored
DS>	airpdcap.c:1045: warning: comparison of unsigned expression < 0 is
DS>always false
Actually the test
   if (len<AIRPDCAP_WPA_SSID_MIN_LEN || len>AIRPDCAP_WPA_SSID_MAX_LEN) {
is
   if (len<0 || len>32) {
and so the first part is unuseful (at least for 802.11i-2004)

DS>	In file included from airpdcap_ccmp.c:5:
DS>	airpdcap_int.h:62: warning: malformed '#pragma pack' - ignored
DS>	airpdcap_int.h:109: warning: malformed '#pragma pack' - ignored
DS>	In file included from airpdcap_md5.c:5:
DS>	airpdcap_int.h:62: warning: malformed '#pragma pack' - ignored
DS>	airpdcap_int.h:109: warning: malformed '#pragma pack' - ignored
DS>	In file included from airpdcap_tkip.c:5:
DS>	airpdcap_int.h:62: warning: malformed '#pragma pack' - ignored
DS>	airpdcap_int.h:109: warning: malformed '#pragma pack' - ignored
DS>	In file included from airpdcap_wep.c:5:
DS>	airpdcap_int.h:62: warning: malformed '#pragma pack' - ignored
DS>	airpdcap_int.h:109: warning: malformed '#pragma pack' - ignored
DS>
DS>Do those structures need "#pragma pack"?  If so, could the code be
DS>changed not to require that?  Not all C compilers support "#pragma
DS>pack", as far as I know, and even those that do apparently don't support
DS>it in the same way, for example:
DS>
DS>	$ gcc --version
DS>	powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 20041026 (Apple
DS>Computer,
DS>Inc. build 4061)
DS>
DS>doesn't like those "#pragma pack" items.
The structures are used to wrap the header of a 802.11 packet.
The base format of these structures are
	UCHAR	fc[2];
	UCHAR	dur[2];
	UCHAR	addr1[AIRPDCAP_MAC_LEN];	// addr1[6]
	UCHAR	addr2[AIRPDCAP_MAC_LEN];
	UCHAR	addr3[AIRPDCAP_MAC_LEN];
	UCHAR	seq[2];
If any compiler align each field at the desired position (fc:0, dur:2,
addr1:4, ...) the #pragma pack is definitely unneeded. If not, there is
another way to do the same thing?

DS>
DS>In addition:
DS>
DS>	1) Should all the crypt-XXX.[ch] files in the epan directory be
DS>moved
DS>to the epan/crypt directory?
DS>
DS>	2) Can any code be shared between epan/crypt-md5.[ch] and
DS>epan/crypt/airpdcap_md5.[ch]?
The code in airpdcap_md5.c comes from the RCF1321 and RFC2104, as the code
in crypt_md5.c. Hopefully without much modifications only one of these to
codes could be used.

Ciao,


Davide