dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

65 Commits

Author SHA1 Message Date
Guy Harris d32a10c10d Put in a comment to clarify that PCAP_VERSION_MAJOR/PCAP_VERSION_MINOR
are *NOT* the library version number.
2009-12-27 12:10:25 -08:00
Guy Harris 117cb5eb2e Add a #define for 0xffffffff as PCAP_NETMASK_UNKNOWN, for use when you
don't know the netmask.  (It also lets you test, at compile time,
whether you can rely on "ip broadcast" failing to compile when you pass
0xffffffff to pcap_compile().)
2009-12-01 19:23:21 -08:00
Guy Harris 05b4572af9 Get rid of redundant definition of DLT_IPNET.
Don't define DLT_IPOIB with the same value as one of the DLT_USERn
definitions - it's not used, and we don't want to make anybody think
that value belongs to any particular link-layer type.
2009-11-25 11:50:11 -08:00
Darren Reed bdc25fca79 To compile libpcap on OpenSolaris (or Solaris Express Community Edition)
build 125 and later to use the native BPF with both IPNET and traditional
MAC (ethernet, etc) packet sniffing, the attached patches are required.

The attached patches represent what's in our internal build tree for libpcap.
2009-11-24 21:40:44 -05:00
Guy Harris 86ed15cc8b Add DLT_CAN_SOCKETCAN, for capturing on the Controller Area Network with
Linux SocketCAN.
2009-10-11 10:16:21 -07:00
Guy Harris 2032d35228 From Dustin Spicuzza: support ps_ifdrop on Linux, using /proc/net/dev.
Fix the title of the pcap_stats man page, and give more detail - and a
lot of caveats.
2009-09-07 16:23:15 -07:00
Guy Harris e29e700736 Note that what follows the ipnet pseudo-header is an IPv4 or IPv6
datagram.
2009-07-27 12:04:39 -07:00
Guy Harris a685965f2f DLT for Solaris ipnet, requested by Darren Reed. 2009-07-27 12:02:34 -07:00
Guy Harris 11934bbcf0 Add another Fibre Channel link-layer type value; this one is for frames
that include an encoding of the frame delimiters.
2009-07-23 12:24:14 -07:00
Guy Harris 32e1c4bab0 Add a link-layer type value for Fibre Channel FC-2 frames, as requested
by Kahou Leu.

Clean up a comment.
2009-07-03 17:09:22 -07:00
Guy Harris 6a39db3ab2 Add a link-layer type value for Wireless HART. 2009-06-26 15:29:43 -07:00
Michael Richardson 7f3508098b provided DLT_AOS to eric.lidwa-1@nasa.gov 2009-05-12 10:05:31 -04:00
Guy Harris 2b2d78a031 Add a linktype for DECT packets, requested by Matthias Wenzel. 2009-04-19 15:52:03 -07:00
guy b908482137 Update CHANGES for USB fixes.
Update CREDITS to give Jon Smirl credit for some of the USB fixes.

Rename DLT_USB_LINUX_MMAP to DLT_USB_LINUX_MMAPPED, and declare a
structure for the header of packets in DLT_USB_LINUX_MMAPPED captures.
2008-12-23 20:13:29 +00:00
guy fb218e8ff5 Add missing left parenthesis. 2008-12-23 18:12:46 +00:00
guy 87d0db882e From Jon Smirl:
try scanning the sysfs USB directory first and, if that
	directory doesn't exist, try the procfs USB directory, to handle
	newer kernels where the relevant director is in sysfs;

	use the data length, not the URB length, as the amount of data
	in the packet (the URB length is the amount of space *available*
	for the data, not the actual amount of data).

For the memory-mapped interface, include the padding after the URB and
setup header in the packet lengths, and return a different link-layer
type so that code reading the packets knows that padding is there.
2008-12-23 18:03:22 +00:00
guy 8a49a4d47b New DLT_MPLS link-layer type, for MPLS packets with an MPLS label as the
link-layer header.
2008-12-21 19:28:56 +00:00
guy c89dab565e Link-layer types for GSM Um and Abis interfaces. 2008-11-27 19:47:54 +00:00
guy b77695d2ec Propagate from the git tree:
Author: Michael Richardson <mcr@sandelman.ca>
Date:   Thu Nov 13 11:42:19 2008 -0500

    added DLT_LINUX_EVDEV for David Gibson <david@gibson.dropbear.id.au>

Fix the name of the devices, and add LINKTYPE_LINUX_EVDEV.
2008-11-18 07:48:56 +00:00
gianluca 854adf5232 Implemented pcap_hopen_offline(). This "internal" function allows us to
support pcap_fopen_offline() on windows platforms (where FILE* handles cannot
be passed on DLL boundaries).
2008-10-06 15:27:32 +00:00
guy f4af9ed692 Link-layer type for 802.15.4 with PHY-level preamble, SFD, and frame
length, as requested by Max Filippov <jcmvbkbc@gmail.com>.
2008-09-22 20:14:19 +00:00
guy e59abf81d3 From Patrick McHardy:
VLAN packets sent over devices supporting VLAN tagging/stripping in
hardware don't have a VLAN header when they are received on packet
sockets. The VLAN TCI is available through the PACKET_AUXDATA cmsg,
reconstruct the entire header when necessary.
2008-08-06 07:45:00 +00:00
guy 34624f128f When activating a device, return PCAP_ERROR_IFACE_NOT_UP if the device
isn't up, so applications can report that differently from a generic
error (the latter could mean there's a bug somewhere in libpcap).

When capturing on a device without mmap on Linux, ignore ENETDOWN, so
that we can continue to capture traffic if the interface goes down and
comes back up again; comments in the kernel indicate that we'll just
block waiting for packets if we try to receive from a socket that
delivered ENETDOWN, and, if we're using a memory-mapped buffer, we won't
even get notified of "network down" events.
2008-07-01 08:02:33 +00:00
guy 757827db5f packaging/pcap.spec is generated from packaging/pcap.spec.in; don't
check in the generated version, and don't put it into the distribution.

Fix a bunch of references to tcpdump-workers@tcpdump.org to refer to the
new address, tcpdump-workers@lists.tcpdump.org.

Fix a reference to the pcap man page from the pcap-filter(4) man page.

Note that patches should be submitted on the SourceForge site, not sent
to the spam-trap patches@tcpdump.org list.
2008-05-30 01:35:33 +00:00
guy d592f692d0 Add pcap_free_datalinks() - on Windows, something allocated in Vegas^Wa
library has to be freed by the library, as an application or other
library using that library might have been built with a different
version of the C runtime library.
2008-05-26 19:58:06 +00:00
guy 1f93b0fda9 Pick up pcap_offline_filter() from WinPcap.
Add pcap_compile() to the SEE ALSO section for pcap_setfilter().
2008-05-13 15:19:56 +00:00
guy c6aa29a8dc Rename pcap_errtostr() to pcap_statustostr(), and have it handle
PCAP_WARNING values as well.
2008-04-09 21:39:21 +00:00
guy a590c21380 Add some PCAP_WARNING return values for "success, but you might want to
know that..."; currently, only pcap_activate() returns them, but we
might want some more warning returns for some other calls, such as the
ones that set filters.  It's a little cleaner than "clear out the error
message buffer and, if it's not empty after a successful return, it has
a warning", and a little cleaner than spewing a warning to the standard
error (as that might not be visible to the user if they're running a GUI
application).
2008-04-09 21:26:12 +00:00
guy 216c64a7ce Add an error for "you don't have permission to open that device", as
that often means "sorry, this platform requires you to run as root or to
somehow tweak the system to give you capture privileges", and
applications might want to explain that in a way that does a better job
of letting the user know what they have to do.

Try to return or PCAP_ERROR_PERM_DENIED for open errors, rather than
just returning PCAP_ERROR, so that the application can, if it chooses,
try to explain the error better (as those two errors are the ones that
don't mean "there's probably some obscure OS or libpcap problem", but
mean, instead, "you made an error" or "you need to get permission to
capture").

Check for monitor mode *after* checking whether the device exists in the
first place; a non-existent device doesn't support monitor mode, but
that's because it doesn't, well, exist, and the latter would be a more
meaningful error.

Have pcap_open_live() supply an error message for return values other
than PCAP_ERROR, PCAP_ERROR_NO_SUCH_DEVICE, and PCAP_ERROR_PERM_DENIED -
those all supply error strings (PCAP_ERROR because it's for various OS
problems that might require debugging, and the other two because there
might be multiple causes).
2008-04-09 19:58:02 +00:00
guy a161340b6e Have a separate pcap_errtostr() routine to turn PCAP_ERROR_ values to
strings; leave pcap_strerror() for UN*X errnos.
2008-04-06 19:55:32 +00:00
guy 9e496cdc75 Add more data types for X2E, requested by Hannes Kaelber. 2008-04-06 18:09:48 +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 b322103696 Fix a typo.
Add some new link-layer types for automotive buses, as requested by
Hannes Kaelber.
2008-02-18 20:21:00 +00:00
guy 0446821e49 Make some arguments const pointers if that makes sense.
Add some additional checks to bpf_validate(), from OpenBSD.

Use bpf_validate() in install_bpf_program(), so we validate programs
even when they're being processed by userland filters; we make
bpf_validate() not reject backward branches, as we use them for the
protochain operator.

For BPF, don't assume that, just because no_optimize was set, we have a
program that we can't hand to the kernel; the user of the application
might have specified no optimization (e.g., tcpdump with -O), or we
might have generated code to handle 802.11 headers (the optimizer can't
handle that code).  Instead, try handing the filter to the kernel and,
if that fails, try it in userland.

Get rid of BPF_MAXINSNS - we don't have a limit on program size in
libpcap.
2008-01-02 04:16:46 +00:00
guy 41995a4191 DLT_ value for IPMB with a Linux-specific pseudo-header,a s requested by
Alexey Neyman.

Add LINKTYPE_ values corresponding to the DLT_ values added earlier.
2007-12-23 04:40:45 +00:00
guy 2fcbb1f5a2 Some more link-layer types, as requested by Will Barker
<w.barker@zen.co.uk>.
2007-12-22 01:19:12 +00:00
guy fc6fdb7bee Add DLT_LAPD, for raw LAPD with no pseudo-header, as per Varuna De
Silva.
2007-10-21 08:39:27 +00:00
guy 9dc28aea3e Add DLT_AX25_KISS, for AX.25 with a KISS header, as per discussions in
the tcpdump-workers mailing list in early April, 2007.

Add Richard Stearn's support for DLT_AX25_KISS.
2007-10-05 01:40:14 +00:00
guy 4877082ac7 From Stephen Donnelly: fix a missing-parenthesis typo. 2007-10-04 23:03:02 +00:00
guy afbb1ce722 Based on work from Florent Drouin, split the 32-bit link-layer type
field in a capture file into:

	a 16-bit link-layer type field (it's 16 bits in pcap-NG, and
	that'll probably be enough for the foreseeable future);

	a 10-bit "class" field, indicating the group of link-layer type
	values to which the link-layer type belongs - class 0 is for
	regular DLT_ values, and class 0x224 grandfathers in the NetBSD
	"raw address family" link-layer types;

	a 6-bit "extension" field, storing information about the
	capture, such an indication of whether the packets include an
	FCS and, if so, how many bytes of FCS are present.
2007-09-29 19:33:29 +00:00
guy e4238ca93c From Paolo Abeni:
Fix the copyright notice.

	Use the new DLT_BLUETOOTH_HCI_H4_WITH_PHDR DLT, and add a
	direction indication.

	Now that we have a direction indication, support
	pcap_setdirection().

Update FILES and INSTALL.txt appropriately, and fix some problems in
INSTALL.txt.
2007-09-22 02:10:17 +00:00
guy 59a4fbc8f7 Add an RCS ID. 2007-09-22 02:06:08 +00:00
guy fe7433245e New DLT for Bluetooth H:4 with pseudo-header giving direction.
Add support for additional link types to gencode.c, so we at least
support "link[N:M]" and an empty expression.

Sort the DLT_CHOICE values in order by the DLT_ value, add missing ones,
and fix some existing descriptions.
2007-09-19 02:40:34 +00:00
guy 7b5c683168 From Paolo Abeni: fix copyrights. 2007-09-14 01:55:49 +00:00
hannes 18341fc1b5 allocate DLT_JUNIPER_ST as per request from Hannes Gredler <hannes@juniper.net> 2007-09-10 20:17:18 +00:00
guy 4427ebae83 Add DLT value for IPMI IPMB packets, beginning with the I2C slave
address, followed by the netFn and LUN, etc..  Requested by Chanthy
Toeung.
2007-08-14 20:56:01 +00:00
guy 564ec53397 New DLT value for packets captured from u10 Networks boards; requested
by Phil Mulholland of u10.
2007-08-13 16:51:41 +00:00
guy c3ced24e7e DLT_ERF, for encapsulating Endace ERF records and packet data for
various link-layer types.
2007-08-07 23:51:53 +00:00
guy 16a4196dcf Various link-layer types, with a pseudo-header, for SITA
(http://www.sita.aero/); requested by Fulko Hew (fulko.hew@gmail.com).
2007-07-19 06:19:54 +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