dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

50 Commits

Author SHA1 Message Date
Guy Harris fa4435e65c Add support for setting the time stamp type for a capture.
Based on a patch from Scott Mcmillan <scott.a.mcmillan@intel.com>.

(Second part of the commit.)
2010-08-22 17:36:27 -07:00
Christian Bell e1539bdbcb Add Myricom SNF API support as a new pcap device.
This patch adds support for our NICs when run in a specialized capture mode.
It is diffed against the current master.

The Myricom Sniffer10G software uses Myri-10G programmable Network Interface
Cards (NICs), a firmware extension, a specialized driver and a user-level
library (libsnf) to enable sustained capture of 10-Gigabit Ethernet traffic.
Small-packet coalescing and an efficient zero-copy path to host memory allow
Sniffer10G to capture streams at line rate for all Ethernet packet sizes.

Optionally, libpcap can be used concurrently by multiple processes on a single
NIC port to partition the incoming traffic across processes.  While the Linux
kernel enables this through multiple receive queues, the difference is that the
myri_snf driver cooperates with libsnf to set up multiple queues that are each
independently accessible through user-space.

More information here: http://www.myri.com/scs/SNF/doc

Signed-off-by: Guy Harris <guy@alum.mit.edu>
2010-01-26 11:58:37 -08:00
Guy Harris 2fd233b16d On Linux, always at least try to scan /proc/net/dev.
If we fail to open it, we just drive on, so it's not a fatal error; yes,
it'll slow us down a little, but it's probably not much, and most Linux
kernels probably have it in any case.
2010-01-10 00:32:13 -08:00
Felix Obenhuber 1c1816f670 Add support for CANbus capture.
Signed-off-by: Guy Harris <guy@alum.mit.edu>
2009-12-29 01:04:20 -08:00
Guy Harris 43acbb77a8 Work around an annoying Snow Leopard BPF bug that causes sub-second
timeouts not to work in 64-bit userland code (Snow Leopard's GCC builds
64-bit by default on 64-bit machines).
2009-10-11 11:05:46 -07:00
Guy Harris 2723ec4198 Check for the intN_t and u_intN_t types the same way we do for tcpdump;
that works better on Tru64 UNIX.

Include the relevant headers for those types in savefile.c, for the same
reason.
2009-07-08 01:10:18 -07:00
Guy Harris bbd8be8360 Older Linux kernels have different member names for "struct
usbdevfs_ctrltransfer"; check for that and handle it.

Don't declare variables in the middle of a block; some versions of GCC
appear to warn about that.
2009-07-04 15:04:59 -07:00
Guy Harris c7eb141fff Add a comment to the AC_DEFINE call for const; that eliminates the last
AC_DEFINEd value with no comment, and thus eliminates the need for
acconfig.h, so get rid of it.

Get rid of AC_LBL_LIBPCAP - we don't need it, this *is* libpcap.

Get rid of AC_LBL_TYPE_SIGNAL - we don't use it.

Update comments for AC_LBL_SOCKADDR_SA_LEN and AC_LBL_CHECK_LIB to match
tcpdump's versions.
2009-07-02 19:21:21 -07:00
Guy Harris 9f59acab41 To put mac80211 devices in monitor mode, create a "monN" device for the
underlying adapter, bring it up, and capture on that.

This means libpcap nees to be linked with -lnl.
2009-05-22 05:50:15 -07:00
guy 5e3edce42f From Jon Smirl: when we start capturing, send GET DESCRIPTOR requests to
all devices on the bus, so we know what's out there already.  Cleaned up
a bit to directly include <linux/usbdevice_fs.h> and *not* to require
the USB library just to supply a header with USB definitions.
2008-12-23 20:49:26 +00:00
guy 73e8fef161 Zero-copy BPF support, from Christian Peron. 2008-09-16 00:20:23 +00:00
guy b1a458c84e Check whether the tpacket_auxdata structure has a tp_vlan_tci member
before using that member.

Don't define variables if we aren't going to use them.

If we have an unknown tpacket version (this "can't happen"), return an
error.
2008-08-06 08:29:07 +00:00
guy d9b420231a From Paolo Abeni and me: split pcap_open_live() into a "get a pcap_t
handle" routine, an 'activate a pcap_t handle" routine, and some "set
the properties of the pcap_t handle" routines, so that, for example, the
buffer size can be set on a BPF device before the device is bound to an
interface.

Add additional routines to set monitor mode, and make at least an
initial attempt at supporting that on Linux, *BSD, and Mac OS X 10.4 and
10.5.  (Very much "initial" for Linux, which is a twisty little maze of
wireless drivers, many different.)

Have a "timeout" member of the pcap_md structure on all platforms, use
that on Windows instead of the "timeout" member of the pcap_t structure,
and get rid of the "timeout" member of that structure.
2008-04-04 19:37:44 +00:00
guy 9e26c39a2e AC_DEFINE now requires a comment for the #define. 2008-03-14 09:12:49 +00:00
guy 45191202aa From Kris Katterjohn: explicitly check for socklen_t, don't just assume
glibc is the only Linux libc that defines socklen_t.
2008-03-14 09:09:13 +00:00
guy cb44cb0520 Support for libdlpi, and for enabling "passive mode" on Solaris systems
that support it, from Sagun Shakya.
2008-03-13 18:13:57 +00:00
guy a9b98caa0d Use AC_SYS_LARGEFILE and AC_FUNC_FSEEKO to try to get large file support. 2008-01-01 03:49:11 +00:00
guy 9070702bd0 Check for u_int64_t and define it as "unsigned long long" if we don't
have it; we use it in the USB pseudo-header.
2007-12-31 03:00:47 +00:00
guy 70727eb8d2 Add some additional PF actions, from OpenBSD - but do so only if they're
defined on the platform on which we're compiling.
2007-11-14 00:54:35 +00:00
guy bb9a52d915 SITA ACN support, from Fulko Hew. 2007-10-20 01:15:14 +00:00
guy 05e4b27b14 From Stephen Donnelly:
* Improved error checking in dag_read().
     * More efficient dag_platform_finddevs().
     * Support for new DAG API function dag_get_stream_erf_types().
2007-10-04 23:06:25 +00:00
guy b52473e046 From Max Laier: check whether the system has <net/pfvar.h> and:
if it does, use that for the pf definitions;

	if it doesn't, don't compile in pf support;

as both OpenBSD and FreeBSD have changed the pf definitions and header
format without changing the DLT value, so you can't reliably read
pflog-format libpcap files on a machine running an OS version other than
the one on which the file was generated.
2007-09-12 19:09:49 +00:00
guy 4f278d5429 Check for "/dev/bpf"; if we find it, use BPF as the capture mechanism,
and assume it's a cloning device.
2007-06-15 17:55:50 +00:00
guy a6186fa56d Pick up changes from NetBSD:
several files:

	date: 2006/02/27 15:53:24;  author: drochner;  state: Exp;
	avoid shadowing globals, for WARNS=2

	date: 2006/02/27 15:55:30;  author: drochner;  state: Exp;
	minor constification, good for WARNS=3 now

	date: 2006/02/27 15:57:17;  author: drochner;  state: Exp;
	NetBSD adaption:

		...

	-const pcap_strerror() for consistency


    gencode.c:

	date: 2006/04/26 09:24:33;  author: tron;  state: Exp;
	Add missing "const" keywords to match declarations in "pcap.h".

	date: 2006/10/15 19:27:21;  author: christos;  state: Exp;
	add a volatile variable to prevent vfork/longjmp clobbering.

    optimize.c:

	date: 2006/05/17 17:48:36;  author: drochner;  state: Exp;
	Make the optimizer use unsigned numbers as the kernel does.
	While it is not agreed on that purely unsigned arithmetics is nice,
	different behaviour of optimized and unoptimized code is less desirable.

    pcap-bpf.c:

	date: 2006/02/27 15:51:38;  author: drochner;  state: Exp;
	pull in from NetBSD's libpcap: use cloning bpf device on NetBSD

Have the configure script check for paths.h, so that we can include it
only if we have it, and use the cloning BPF device only if we're on
NetBSD *and* _PATH_BPF is defined (hopefully this will keep us from
using it on versions of NetBSD that don't have a cloning BPF device; if,
in the future, other OSes with BPF get cloning BPF devices, we can make
this work for them as well).
2007-06-11 10:04:24 +00:00
guy d959f6403d From Paolo Abeni: add support for the binary USB sniffing interface in
Linux.  The USB sniffing code for Linux now supplies a per-packet header
based on the one supplied by the Linux binary sniffing interface, so we
add a new DLT_ value and use that.

Fix his e-mail address, and add him to the credits.
2006-12-20 03:30:32 +00:00
guy 50ce2663e8 From Paolo Abeni: Bluetooth support. 2006-10-13 17:34:53 +00:00
guy b0b2b0de78 Regenerate. 2006-10-04 16:47:12 +00:00
hannes dc03d28d88 from Paolo Abeni <paolo.abeni@email.com>: USB capturing support on linux 2006-10-04 15:50:26 +00:00
guy b64aff479f From Stephen Donnelly:
If the DAG API supports asking a card for the set of ERF types
	it supports, use that capability, to handle cards that support
	multiple ERF types.  This is to support channelised/fractional
	T1/E1.

	Don't set the snapshot length - some DAG cards support multiple
	capture streams, but the snapshot length is global, so it'd
	affect other captures.

	Update README.dag.
2006-04-07 07:07:25 +00:00
guy 7f34968ee3 From Stephen Donnelly: updates to the DAG support, to support their
updated API if available.
2005-07-07 06:55:19 +00:00
guy a0a4852137 From Gilbert Hoyek <gil_hoyek@hotmail.com>: support for capturing SS7
traffic on Intel Septel cards, and for filtering on SS7 MTP3 fields.

Clean up indentation.
2005-06-20 21:27:07 +00:00
guy eeaf96fb94 Some systems (*cough*Irix*cough) not only don't declare
"ether_hostton()" but don't even declare "struct ether_addr"; on those
systems, declare "struct ether_addr".
2005-04-20 11:12:36 +00:00
guy 1b34dd0bbd Rename HAVE_HPUX10_20 to HAVE_HPUX10_20_OR_LATER, because it's also
defined for 11.x.
2005-04-08 02:15:49 +00:00
guy 822f0efb5f If we don't get a declaration of ether_hostton() by including
<netinet/if_ether.h>, try <netinet/ether.h>.
2005-03-27 02:45:03 +00:00
guy d3bc29242e If we have ether_hostton(), check whether we have <netinet/if_ether.h>
and if including it declares ether_hostton(), and define
HAVE_DECL_ETHER_HOSTTON appropriately, and use that to determine whether
to define it ourselves, rather than having a set of OSes that don't need
it, as that set can change over time.

Make the default declaration of "ether_hostton()" declare its first
argument as "const char *", as that's what it's *supposed* to be
(although it's not declared as such in some OSes, so we still have to
cast a "const char *" when passed as the first argument).
2005-03-26 23:07:50 +00:00
guy 529f98f94f Use "version.h" if autoconf is being used (as that assumes a
UN*Xy-enough platform that the Makefile.in rules to generate "version.h"
work), and use the stuff from "version.h" iff HAVE_VERSION_H is defined,
so we can use it even with WinPcap.
2004-12-17 23:25:36 +00:00
guy 63f52c6dce If we don't have any support for packet capturing, don't bother
supplying a non-stub version of "pcap_findalldevs()", as a list of
devices won't do any good for a capture program.

Don't bother checking for "ifaddrs.h" unless we have "getifaddrs()" -
and if we have "getifaddrs()" but don't have a usable "ifaddrs.h",
report an error, rather than leaving the error for the compile stage.
2004-12-16 22:22:20 +00:00
guy 5d2a9d1922 Regenerate with autoconf 2.57. 2004-01-14 03:01:25 +00:00
guy fcadc89577 From Albert Chin <china@thewrittenword.com>: on platforms that lack
"snprintf()", include one in libpcap with the name "pcap_snprintf()", so
applications don't have to supply their own "snprintf()" on those
platforms in order to use libpcap.
2003-12-15 01:35:03 +00:00
guy 77cade932c From Jesper Peterson <jesper@endace.com>: support for capturing from
Endace DAG devices.
2003-07-23 05:29:19 +00:00
guy 2dcac1bb6b Put the different implementations of "pcap_findalldevs()" into separate
source files, rather than having a pile of #ifdefs in "inet.c".  Add
code to the configure script to determine which implementation to use on
the platform for which libpcap is being built.

Add a "pcap_findalldevs()" implementation for Solaris 8 and later that
handles IPv6 addresses.
2002-07-27 18:45:34 +00:00
guy f6bcb3d546 Some versions of the HP C compiler can handle inlines, but not if they
return a structure pointer.  Check whether the C compiler can handle
inline functions that return a structure pointer, not whether they can
handle inline functions that return an int, as at least some versions of
autoconf's AC_C_INLINE do.
2002-06-28 10:34:35 +00:00
fenner e935ae5425 Regenerate. 2001-11-12 22:19:15 +00:00
guy 519b0b5a59 If we have "/proc/net/dev", and don't have <ifaddrs.h> (i.e., don't have
"getifaddrs()"), after processing the list returned by SIOCGIFCONF, scan
"/proc/net/dev" for interface names, and add to the list of interfaces
entries for those interfaces, with no associated addresses (if the
interfaces were already added, with addresses, from the list returned by
SIOCGIFCONF, they won't get added again).

Clean up the error handling a bit.
2001-10-09 05:43:19 +00:00
guy 5a85948f80 We don't actually use HAVE_FREEIFADDRS, so there's no point in checking
whether we have "freeifaddrs()" (we don't check whether we have
"getifaddrs()", and if we have "getifaddrs()" but not "freeifaddrs()",
we're stuck with leaking memory).

Give the "any" device an instance number of INT_MAX, so it shows up
after all other non-loopback devices.

"getifaddrs()" sometimes appears to supply a destination address even
for non-point-to-point interfaces (it did so on a FreeBSD 4.1 system);
don't use the broadcast address it supplies if an interface isn't a
broadcast interface, and don't use the destination address it supplies
if an interface isn't a point-to-point interface.

If we had an error constructing the list of interfaces, don't attempt to
add the "any" device to the list.
2001-10-09 03:53:38 +00:00
guy 380a3dbf49 From Scott Barron <sb125499@ohiou.edu>: use the
SOL_PACKET/PACKET_STATISTICS "getsockopt()" call, on Linux kernels that
support it, to get packet statistics, so that we can report the number
of dropped packets, and always use <linux/if_packet.h> to get
definitions for PF_PACKET sockets, so that we don't depend on glibc's
header files having been updated to support all the latest shiniest
kernel features (many systems with 2.4[.x] kernels don't have a
<netpacket/packet.h> that defines "struct tpacket_stats", for example,
so we wouldn't have been able to support that kernel feature on those
systems).
2001-07-29 18:25:46 +00:00
guy 8a6db7a7d5 Sigh. Not all systems have <netinet/if_ether.h> - for example, at least
some libc5 Linux systems don't - so we have to check whether it exists,
and include it only if it does.
2001-01-17 18:18:48 +00:00
guy d6752d37e8 Regenerate "config.h.in" and "configure". 2000-12-22 11:42:18 +00:00
assar 407e3aaf67 regenerated from configure.in 2000-07-30 10:50:22 +00:00
assar d501922cfa regen 2000-07-11 00:38:47 +00:00