3 * Wrapper around libpcap/WinPcap's pcap.h.
5 * If HAVE_PCAP_REMOTE is defined, it forces the WinPcap header files to
6 * define things required for remote capture, by defining HAVE_REMOTE.
8 * With all versions of the WinPcap SDK, if:
10 * 1) you are building with any current WinPcap SDK;
11 * 2) you do not define HAVE_REMOTE before including pcap.h (or
13 * 3) you define a struct pcap_stat and pass it to a call to
15 * 4) the system you're running on has WinPcap, rather than Npcap,
18 * whatever is in memory after the struct pcap_stat may get overwritten,
19 * with unpredictable results, because the pcap_stats() implementation for
20 * WinPcap will assume that the structure has the additional members that
21 * are added if and only if HAVE_REMOTE is defined, and will fill them in,
22 * even if they're not there.
24 * Yes, this is q WinPcap bug; if your project has a public header file
25 * that checks or otherwise uses a #define that's defined by your project's
26 * configuration process, and don't ensure that it's always defined
27 * appropriately when that header file is included, before its first use,
28 * you have made a mistake.
30 * In libpcap 1.7.0 and later, the pcap_stats() implementation for WinPcap
31 * will not fill those fields in; however, no WinPcap implementation was
32 * based on that recent a libpcap release, so they all have the bug.
34 * Npcap was originally based on libpcap 1.8.0, and later releases are
35 * based on later releases of libpcap, so they will not overwrite memory
36 * past the end of the structure.
38 * The header file bug is fixed in libpcap 1.9.0 or later - the fields
39 * are present on Windows, regardless of whether HAVE_REMOTE is defined
40 * or not when the header is included (and are not present on UN*X), so
41 * if you build with an SDK with libpcap 1.9.0 or later headers, you
42 * do not need to define HAVE_REMOTE before including pcap.h (including it
43 * will make no difference).
45 * No version of the WinPcap SDK provided libpcap 1.9.0-or-later headers.
46 * The Npcap SDK, as of SDK version 1.04, provides them, so this is
47 * only necessary for building with the WinPcap SDK.
49 * Wireshark - Network traffic analyzer
50 * By Gerald Combs <gerald@wireshark.org>
51 * Copyright 2007 Gerald Combs
53 * SPDX-License-Identifier: GPL-2.0-or-later
59 #ifdef HAVE_PCAP_REMOTE
65 #endif /* __WSPCAP_H__ */