summaryrefslogtreecommitdiff
path: root/caputils
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-05-11 12:57:28 -0700
committerGuy Harris <guy@alum.mit.edu>2017-05-11 19:58:15 +0000
commit7321183716f1e6e28584ea356b0782b06f330fe5 (patch)
tree304dbc6154a841e2dc35262735425f481f7d3efb /caputils
parent6f1e6d24c64960bf347c1990fcca8dfdaaf44c68 (diff)
downloadwireshark-7321183716f1e6e28584ea356b0782b06f330fe5.tar.gz
Put the HAVE_REMOTE hack into wsutil/wspcap.h, and include that file.
Have a header file that defines HAVE_REMOTE if HAVE_PCAP_REMOTE is defined, and then includes pcap.h. Replace all other includes of pcap.h, and the definition of HAVE_REMOTE, with includes of that file. Check for anything other than wspcap.h including pcap.h in checkAPIs.pl. Change-Id: I3cbee8208944ad6f006f568b3fe3134e10b2a883 Reviewed-on: https://code.wireshark.org/review/21605 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'caputils')
-rw-r--r--caputils/capture-pcap-util-unix.c14
-rw-r--r--caputils/capture-pcap-util.h14
-rw-r--r--caputils/capture_wpcap_packet.c14
3 files changed, 3 insertions, 39 deletions
diff --git a/caputils/capture-pcap-util-unix.c b/caputils/capture-pcap-util-unix.c
index 5d57a02797..7f0df9ec9a 100644
--- a/caputils/capture-pcap-util-unix.c
+++ b/caputils/capture-pcap-util-unix.c
@@ -26,19 +26,7 @@
#ifdef HAVE_LIBPCAP
-#ifdef HAVE_PCAP_REMOTE
-/*
- * Force the WinPcap header files to define things required for remote
- * capture. (Yes, this is q WinPcap bug; if your project has a public
- * header file that checks or otherwise uses a #define that's defined
- * by your project's configuration process, and don't ensure that
- * it's always defined appropriately when that header file is included,
- * before its first use, you have made a mistake.)
- */
-#define HAVE_REMOTE
-#endif
-
-#include <pcap.h>
+#include <wsutil/wspcap.h>
#ifdef __APPLE__
#include <dlfcn.h>
diff --git a/caputils/capture-pcap-util.h b/caputils/capture-pcap-util.h
index 87a05e8283..22fb723cf8 100644
--- a/caputils/capture-pcap-util.h
+++ b/caputils/capture-pcap-util.h
@@ -29,19 +29,7 @@ extern "C" {
#ifdef HAVE_LIBPCAP
-#ifdef HAVE_PCAP_REMOTE
-/*
- * Force the WinPcap header files to define things required for remote
- * capture. (Yes, this is q WinPcap bug; if your project has a public
- * header file that checks or otherwise uses a #define that's defined
- * by your project's configuration process, and don't ensure that
- * it's always defined appropriately when that header file is included,
- * before its first use, you have made a mistake.)
- */
-#define HAVE_REMOTE
-#endif
-
-#include <pcap.h>
+#include <wsutil/wspcap.h>
#include "capture_opts.h"
diff --git a/caputils/capture_wpcap_packet.c b/caputils/capture_wpcap_packet.c
index 6d1b77cb11..eac5ca7c5d 100644
--- a/caputils/capture_wpcap_packet.c
+++ b/caputils/capture_wpcap_packet.c
@@ -30,19 +30,7 @@
#include <glib.h>
#include <gmodule.h>
-#ifdef HAVE_PCAP_REMOTE
-/*
- * Force the WinPcap header files to define things required for remote
- * capture. (Yes, this is q WinPcap bug; if your project has a public
- * header file that checks or otherwise uses a #define that's defined
- * by your project's configuration process, and don't ensure that
- * it's always defined appropriately when that header file is included,
- * before its first use, you have made a mistake.)
- */
-#define HAVE_REMOTE
-#endif
-
-#include <pcap.h>
+#include <wsutil/wspcap.h>
/* XXX - yes, I know, I should move cppmagic.h to a generic location. */
#include "tools/lemon/cppmagic.h"