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] Airpcap patches

From: Gisle Vanem <giva@xxxxxxxxx>
Date: Tue, 02 Jan 2007 13:21:18 +0100
Here are some patches needed to build using HAVE_AIRPCAP
on MingW:

* airpcap.h needs 'WEP_KEY_MAX_SIZE' from <epan/crypt/wep-wpadefs.h>.

* airpcap_loader.h needs <epan/crypt/airpdcap_user.h> and definition of
 'decryption_key_t'.

* epan/crypt/airpdcap_interop.h defines 'ntohs()' before <winsock2.h>
 gets included. Thus creating a parse error later on.

Attached.

--gv
diff -u3 -Hb -r SVN-Latest\airpcap.h .\airpcap.h
--- SVN-Latest\airpcap.h	Thu Dec 28 17:39:24 2006
+++ .\airpcap.h	Tue Jan 02 12:48:30 2007
@@ -22,6 +22,8 @@
#if !defined(AIRPCAP_H__EAE405F5_0171_9592_B3C2_C19EC426AD34__INCLUDED_)
#define AIRPCAP_H__EAE405F5_0171_9592_B3C2_C19EC426AD34__INCLUDED_

+#include <epan/crypt/wep-wpadefs.h>  /* WEP_KEY_MAX_SIZE */
+
/* This disables a VS warning for zero-sized arrays. All the compilers we support have that feature */
#pragma warning( disable : 4200)

diff -u3 -Hb -r SVN-Latest\airpcap_loader.h .\airpcap_loader.h
--- SVN-Latest\airpcap_loader.h	Thu Dec 28 17:39:24 2006
+++ .\airpcap_loader.h	Tue Jan 02 11:34:44 2007
@@ -28,6 +28,8 @@
#ifndef __AIRPCAP_LOADER_H__
#define __AIRPCAP_LOADER_H__

+#include <epan/crypt/airpdcap_user.h>
+
/* Error values from "get_airpcap_interface_list()". */
#define	CANT_GET_AIRPCAP_INTERFACE_LIST	0	/* error getting list */
#define	NO_AIRPCAP_INTERFACES_FOUND	1	/* list is empty */
diff -u3 -Hb -r SVN-Latest\epan\crypt\airpdcap_interop.h .\epan\crypt\airpdcap_interop.h
--- SVN-Latest\epan\crypt\airpdcap_interop.h	Tue Jan 02 10:15:35 2007
+++ .\epan\crypt\airpdcap_interop.h	Tue Jan 02 13:03:40 2007
@@ -2,7 +2,7 @@
#define	_AIRPDCAP_INTEROP_H

/**
- * Cast data types commonly used in Windows (e.g. UINT16) to theirf
+ * Cast data types commonly used (e.g. UINT16) to their
 * GLib equivalents.
 */

@@ -57,7 +57,12 @@
typedef	gsize	size_t;
#endif

+#ifdef WIN32
+#include <winsock2.h>  /* ntohs() */
+#endif
+
#ifndef	ntohs
+#undef     ntohs
#define	ntohs(value)	g_ntohs(value)
#endif