summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* The pcap_win pointer in pcap_activate_win32() is only used for DAG cards.libpcap-1.7Guy Harris2015-09-111-0/+2
| | | | | | (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.)
* Enable the prototype for TcSetUserBuffer().Gisle Vanem2015-09-111-1/+1
|
* Get rid of unused variable.Guy Harris2015-09-111-1/+0
|
* Work around a WinPcap bug.Guy Harris2015-09-111-0/+9
| | | | | PacketGetStats() doesn't fill in the ps_ifdrop field, so don't copy it over.
* Avoid collision between local variable and argument.Guy Harris2015-09-111-3/+3
|
* More compile fixes.Gisle Vanem2015-09-111-2/+3
|
* pcap_offline_filter() isn't a WinPcap extension.Guy Harris2015-09-111-2/+0
| | | | | Don't declare it twice on Win32; remove the declaration in the "WinPcap-only" list.
* Style cleanup.Guy Harris2015-09-111-21/+21
| | | | | | Consistently avoid unnecessary parentheses in return statements. (If somebody prefers them, feel free to consistently use them.)
* Remove "Oid" from "TcOidSendqueueTransmit()".Guy Harris2015-09-111-3/+3
| | | | | That was there through sloppy copy-and-pasting; there's nothing NDIS OID-related there.
* Don't export TcGetReceiveWaitHandle().Guy Harris2015-09-112-4/+2
| | | | | | 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 setuserbuffer_op in WinPcap.Guy Harris2015-09-112-3/+2
| | | | | Set it for pcap-win32.c. Fix the name, and set it (and bring TcSetUserBuffer() back from the dead), for pcap-tc.c.
* Fix more compile errors.Gisle Vanem2015-09-111-3/+3
|
* Fix compile errors.Gisle Vanem2015-09-111-15/+15
| | | | | Since TcGetReceiveWaitHandle() is already in pcap-tc.h (cannot be static here). I dropped TcSetUserBuffer() since set_userbuffer_op is missing.
* There's no "md" substructure; the timeout is now in opt.timeout.Guy Harris2015-09-111-5/+3
| | | | | "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.
* TurboCap is now decoupled from pcap-win32.c.Guy Harris2015-09-111-2/+0
| | | | | | 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.
* Get rid of unused local variable.Guy Harris2015-09-111-1/+0
|
* Fix warnings as "C++ style comments are not allowed in ISO C90"Francois-Xavier Le Bail2015-09-054-16/+17
|
* Declare pcap_wsockinit() in pcap-int.h.Guy Harris2015-09-053-4/+5
| | | | | | | | | | | | | | | | 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.
* Just use #ifdef.Guy Harris2015-09-051-1/+1
|
* Support --with-turbocap=DIR.Guy Harris2015-09-052-23/+46
| | | | | | | 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.
* Clean up the "third party API" checks.Guy Harris2015-09-053-179/+235
| | | | | | 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.
* Put one DAG API check inside an if.Guy Harris2015-09-052-52/+54
| | | | | 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.
* Remove platform checks for various sniffing hardware APIs.Guy Harris2015-09-052-132/+2
| | | | | | | | | | | | 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.
* Add TurboCap support from WinPcap.Guy Harris2015-09-0512-41/+1524
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* Don't dereference a known-to-be-null pointer.Guy Harris2015-09-051-1/+1
| | | | | | | 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.
* Move the remaining send queue routines to pcap.cGuy Harris2015-09-052-49/+49
| | | | | | 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".
* Add the remaining WinPcap-only ops to the ops vector.Guy Harris2015-09-054-236/+457
| | | | | | | | | | | | | | | | 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.
* Update CHANGES in case we release a 1.7.5.Francois-Xavier Le Bail2015-09-031-1/+2
|
* Rename pcap_win32strerror() to pcap_win32_err_to_str().Guy Harris2015-09-035-16/+17
| | | | | | | 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 extensions", and add some new ones.Guy Harris2015-09-035-49/+307
| | | | | | | | | | | | | | | | | | | 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().
* Update CHANGES in case we release a 1.7.5.Guy Harris2015-09-031-0/+8
|
* Travis: Install 'libnl-genl-3-dev' libraryFrancois-Xavier Le Bail2015-09-031-1/+1
|
* Fix some compile errors.Guy Harris2015-09-031-1/+6
|
* Regenerate configure script.Guy Harris2015-09-021-1/+1
|
* Don't use struct ifbond when there's no if_binding.hBaruch Siach2015-09-021-2/+4
| | | | | | | | | | | 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)
* configure.in: fix detect of if_bonding.h on uclinuxBaruch Siach2015-09-021-1/+1
| | | | noMMU Linux (uClinux) is also Linux
* Fix warnings as "ISO C90 forbids mixed declarations and code"Francois-Xavier Le Bail2015-09-021-2/+6
|
* struct bpf_hdr is declared in <Packet32.h>; don't declare it here.Guy Harris2015-09-021-12/+0
| | | | | (It's also declared in a number of other places in WinPcap; this is a mess.)
* Work around the need for Packet32.h.Guy Harris2015-09-021-0/+25
| | | | | | 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.)
* Fix a #define name.Guy Harris2015-09-021-3/+3
| | | | | | | 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.
* Make it a bit more like the WinPcap structure on Win32.Guy Harris2015-09-021-1/+5
| | | | | | | 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.
* Don't write past the end of an old pcap_stat structure in pcap_stats().Guy Harris2015-09-021-35/+12
| | | | | | | | | | | | | 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.
* Copy over bs_capt in pcap_stat(), even though it doesn't get filled in.Guy Harris2015-09-021-7/+17
| | | | This is a mess and needs to be cleaned up.
* Further stats cleanup.Guy Harris2015-09-022-8/+65
| | | | | Fix some issues with pcap_stats_win32(), and put pcap_stats_ex() here, so it can use the now-private pcap_stat structure.
* Fix up the statistics handling in WinPcap.Guy Harris2015-09-021-3/+35
| | | | | | | | | | | | | | | | | | | | | | | | 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.)
* Packet.dll defines ADAPTER, not Adapter.Guy Harris2015-09-024-6/+6
| | | | Fix type name.
* The official #define for 32-bit and 64-bit Windows is _WIN32.Guy Harris2015-09-0224-118/+118
| | | | | | | | | | | | | 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.
* Recognize 802.1ad nested VLAN tag in vlan filter.Michal Kubecek2015-09-022-0/+6
| | | | | | 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.
* Fix error in filter expressions.Guy Harris2015-09-021-3/+3
| | | | | | "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".
* Fix errors introduced by my previous change.Bill Parker2015-09-021-2/+2
|