| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
(We really shouldn't have the Packet.dll routines know about different
networking adapter types, now that libpcap/WinPcap has its own
per-adapter ops vector.)
|
| |
|
| |
|
|
|
|
|
| |
PacketGetStats() doesn't fill in the ps_ifdrop field, so don't copy it
over.
|
| |
|
| |
|
|
|
|
|
| |
Don't declare it twice on Win32; remove the declaration in the
"WinPcap-only" list.
|
|
|
|
|
|
| |
Consistently avoid unnecessary parentheses in return statements.
(If somebody prefers them, feel free to consistently use them.)
|
|
|
|
|
| |
That was there through sloppy copy-and-pasting; there's nothing NDIS
OID-related there.
|
|
|
|
|
|
| |
It's now "exported" through the pcap_t ops vector, rather than being
directly called from pcap-win32.c, so make it static again and remove it
from pcap-tc.h.
|
|
|
|
|
| |
Set it for pcap-win32.c. Fix the name, and set it (and bring
TcSetUserBuffer() back from the dead), for pcap-tc.c.
|
| |
|
|
|
|
|
| |
Since TcGetReceiveWaitHandle() is already in pcap-tc.h (cannot be static here).
I dropped TcSetUserBuffer() since set_userbuffer_op is missing.
|
|
|
|
|
| |
"md.use_bpf" is now "filtering_in_kernel", but we always do the
filtering in our module, so there's no need to record that fact.
|
|
|
|
|
|
| |
It's treated the same way we treat other "add-on" pcap modules; we no
longer have the "native OS capture mechanism" modules check for other
capture device types.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We probably shouldn't be exporting something called wsockinit() at all,
as it's too likely to collide with routines in code that calls us. I
don't know whether Wine implemented it in order to run Windows programs
that call it, or if there actually *are* such programs, but we'll leave
it around for now.
Call pcap_wsockinit() in pcap_compile(), and don't bother declaring it;
rely on it being declared in pcap-int.h, so we run less of a risk of the
declaration and definition getting out of sync (not that we're likely to
change its signature, but...).
In the definitions of it and wsockinit(), explicitly note that they take
no arguments.
|
| |
|
|
|
|
|
|
|
| |
Allow the directory containing the TurboCap include and lib directories
to be specified.
Clean up the help for various --with arguments, while we're at it.
|
|
|
|
|
|
| |
Make them more like each other, clean up the error messages, handle both
the "I want an XXX-only libpcap" case and the "I explicitly request XXX
support" case.
|
|
|
|
|
| |
That makes it more like the other API checks; the only way the check can
be true is if we actually checked for the DAG API stuff.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Those checks made sense when particular system pcap modules did checks
for particular third-party devices, so if your system's appropriate pcap
module didn't check for it, there's no point in asking for it.
Now, those checks come from a table in pcap.c, so they could be done on
any system. Either we find the API headers and libraries or we don't.
If we do, we might as well assume there's an implementation for them on
the platform for which we're building. If we don't, the configure
script will fail because of that, regardless of the platform.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) It's also apparently supported on Linux.
2) This cleans it up to match the way we're currently dealing with pcap
modules.
3) This cleans it up to the way we're handling the Win32 extensions.
Fix the configure script so that, if a pcap module that is supported
only if the relevant support software is available is being configured
in, we *add* its source to the list of source files to compile, rather
than making it *the* source file to compile, in case there's more than
one of them.
Fix a typo in a comment.
Add a comment about TurboCap using DLT_PPI for Ethernet.
Move the struct pcap_stat used for pcap_stats_ex() into the pcap
structure on Windows, as it's used by multiple modules.
Remove the stuff that handles TurboCap from pcap-win32.c, as the
routines that did that are now just module ops, so we call the TurboCap
versions for TurboCap devices.
Remove the stuff that handles remote captures from there as well; that
will eventually be handles by modules (plural) for the remote capture
protocols (plural).
Make all of the fields added to struct pcap_stat dependent on _WIN32 and
HAVE_REMOTE being defined. We don't want any of them for UN*X, as that
would potentially break binary compatibility; we make them all dependent
on HAVE_REMOTE being defined because that's what WinPcap currently does
(yes, that's a bad idea, but we'll be fixing this by deprecating that
structure as well as pcap_stats() and pcap_stats_ex() in favor of
something a bit more pcapng-like, which would be more extensible).
|
|
|
|
|
|
|
| |
handlep->mondevice is null because strdup() failed; don't pass it to
del_mon_if(), pass what we tried to duplicate.
Fixes Coverity issue 1322848.
|
|
|
|
|
|
| |
They're not platform-dependent, except perhaps to the extent that the
only platform on which it's used is WinPcap, so they're inside "#ifdef
_WIN32".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
That way, all pcap_t types can handle them in Win32, even if they just
reject the op because they don't support it.
Fill those ops in as appropriate.
Get rid of the now-unused "get adapter" op.
Nobody needs to use pcap_not_initialized() outside pcap.c -
pcap_create() initializes most of the ops to point to it - so make it
static.
Have pcap_get_airpcap_handle() supply an error string of "that's not an
AirPcap device" if the op returns NULL.
|
| |
|
|
|
|
|
|
|
| |
The new name better reflects what it now does - take an error code and
convert it to a string.
Fix a couple of incorrect calls to it while we're at it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pick up the "Win32 extension" routines, and declare them in <pcap/pcap.h>
if we're building for Win32, so Win32-Extensions.[ch] are no longer
necessary.
Make pcap_win32strerror() take a Win32 error code and a buffer pointer
as arguments, and fill in the buffer, assumed to be of size
PCAP_ERRBUF_SIZE+1. That way, we're not filling in a static buffer, so
error reporting isn't a problem in multi-threaded code. (No guarantees
that you can act on the *same* pcap_t in different threads, but, in most
cases, you should be able to act on *different* pcap_t's in different
threads.)
Add pcap_oid_get_request() and pcap_oid_set_request() to do OID
accesses; this removes the primary reason why callers would need to get
the ADAPTER structure for a pcap_t, so we just get rid of
pcap_get_adapter().
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes build failures like:
./pcap-linux.c: In function ‘is_bonding_device’:
./pcap-linux.c:962: error: ‘ifbond’ undeclared (first use in this function)
./pcap-linux.c:962: error: (Each undeclared identifier is reported only once
./pcap-linux.c:962: error: for each function it appears in.)
./pcap-linux.c:962: error: expected ‘;’ before ‘ifb’
./pcap-linux.c:966: error: ‘ifb’ undeclared (first use in this function)
|
|
|
|
| |
noMMU Linux (uClinux) is also Linux
|
| |
|
|
|
|
|
| |
(It's also declared in a number of other places in WinPcap; this is a
mess.)
|
|
|
|
|
|
| |
Declare pcap_get_adapter() only if it's been included, as it depends on
a data type defined in Packet32.h. (If you're going to use it, you're
going to have to include <Packet32.h> first.)
|
|
|
|
|
|
|
| |
I thought I'd fixed that one before checking in, but I guess I only
fixed WIN32_DEFAULT_USER_BUFFER_SIZE.
Fix a comment while we're at it.
|
|
|
|
|
|
|
| |
This is a bit of a mess - current WinPcap puts all of those members
under HAVE_REMOTE, but that fails if you try to build without
HAVE_REMOTE, as pcap_stats_ex() will try to fill ps_capt in, but it
won't exist.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We might be called from a program compiled with an older version of
WinPcap in which the structure doesn't have a ps_capt member, in which
case filling that member in will overwrite whatever is after that
structure, so don't do that.
Don't worry about the packet count we maintain - pcap_stats() ignored
it, just returning whatever PacketGetStats() returned, and
pcap_stats_ex() overwrote it with whatever PacketGetStatsEx().
Fix a parenthesis error while we're at it.
|
|
|
|
| |
This is a mess and needs to be cleaned up.
|
|
|
|
|
| |
Fix some issues with pcap_stats_win32(), and put pcap_stats_ex() here,
so it can use the now-private pcap_stat structure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Have a pcap_stat structure in the private data structure, and use that
to count received packets, for the benefit of adapter types (such as DAG
cards on Windows) that don't provide that count.
Don't play structure pointer casting games; that's fragile, and might
get in the way of using PacketGetStatsEx() in the future.
(We really need to redo the statistics handling so that it supplies a
structure similar to a pcapng Interface Statistics block; that'd let us
1) indicate which statistics are actually being supplied, rather
than supplying fake values of 0 for statistics not being
supplied;
2) supply additional types of statistics (and more clearly
indicate what type of received-packet-count is being
supplied);
3) handle statistics that have counters bigger than 32 bits;
and then implement pcap_stats() atop that underlying API.)
|
|
|
|
| |
Fix type name.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's _WIN32, with a leading underscore, not WIN32. See, for example:
https://sourceforge.net/p/predef/wiki/OperatingSystems/
and
https://msdn.microsoft.com/en-us/library/b0084kay.aspx
*Some* environments may also define WIN32, but we shouldn't depend on
that.
|
|
|
|
|
|
| |
In addition to ETHERTYPE_8021Q (0x8100) and ETHERTYPE_8021QINQ (0x9100),
recognize also ETHERTYPE_8021AD (0x88a8) as a VLAN tag. This is defined
as S-Tag (Service tag) by 802.1ad.
|
|
|
|
|
|
| |
"protocol" isn't a keyword, "proto" is; you don't, for example, say "tr
protocol arp", you say "tr proto arp", just as you say "ether proto
arp".
|
| |
|