dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

983 Commits

Author SHA1 Message Date
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
gianluca cf5ea4eeec Added support for PPI. 2007-06-14 22:08:38 +00:00
gianluca 92e7060fb8 Fixed the code that verifies if a PPI packet encapsulates 802.11 frames.
The bug was causing side effects even when the linktype was not PPI.
2007-06-14 20:55:44 +00:00
gianluca ec63ab312c Added more code in the compilation for the PPI linktype: now we generate
code that discards non-802.11 packets.
A couple of mods to remove some compilation warnings with VC6.
2007-06-14 18:49:30 +00:00
gianluca 9c308a3a48 Added some initial support for PPI filter generation. 2007-06-14 18:14:06 +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 8b2ec43589 Allocate DLT_ for 802.15.4 without any header munging, for Mikko
Saarnivala.

Fix a comment.
2007-06-05 18:02:29 +00:00
guy a8f23f719a Tests for the transport-layer protocol differ based on whether the
network-layer protocol is IPv4 or IPv6, regardless of the link-layer
protocol.  Therefore, we have to check for IPv4 and IPv6, even for
DLT_RAW - do so by checking the version field in the header.
2007-05-30 18:05:21 +00:00
hannes 666dd96733 add support for DLT_JUNIPER_ISM 2007-05-24 23:57:36 +00:00
guy b9641d7aed Header for 802.16 MAC Common Part Sublayer plus a radiotap radio header;
requested by Charles Clancy.
2007-05-04 09:46:55 +00:00
guy d88c8e4d8e It's LINKTYPE_PPI, not SAVEFILE_PPI. 2007-04-19 18:33:53 +00:00
guy 71ebfa7d04 Add a blank line to minimize differences between this and the x.9 branch
pcap-bpf.h.
2007-04-19 18:17:25 +00:00
guy 08a7beca55 Reserved a DLT_ and SAVEFILE_ value for PPI (Per Packet Info)
encapsulated packets. Requested by Gianluca Varenni.
2007-04-19 18:15:03 +00:00
gianluca 355a195db7 Reserved a DLT_ and SAVEFILE_ value for PPI (Per Packet Info)
encapsulated packets. Requested by Gianluca Varenni.
2007-04-19 17:37:54 +00:00
guy 472810539c Define DLT_LOOP as 12 on OpenBSD, for compatibility with its definition.
(LINKTYPE_LOOP is still 108 on all platforms.)
2007-04-05 18:43:49 +00:00
guy 6080a4b2bf Linktype for IEEE 802.15.4, with address fields padded as done by Linux
drivers; requested by  Juergen Schimmer.
2007-04-03 07:18:27 +00:00
guy 42fe978417 Add RCS IDs. 2007-04-01 21:43:55 +00:00
guy 266d42352f Work around a bug in some older versions of libpcap, where the snapshot
length value in the file header is 14 less than the actual maximum
packet length.
2007-04-01 17:06:47 +00:00
guy 83a6a8ab27 From Jung-uk Kim: add support for new FreeBSD BIOCSDIRECTION ioctl. 2007-03-26 01:38:25 +00:00
guy deed686cc8 On NetBSD, include <sys/param.h>; we need it to declare
__NetBSD_Version__.
2007-03-11 21:44:12 +00:00
guy 885670183d From Sepherosa Ziehau: additional filter operations for 802.11 frame
types.  Modified to add ieee80211.h from FreeBSD, rather than depending
on the OS supplying the header, and to support all 802.11 radio header
types.

Clean up some link-layer type checks and the messages for failing those
checks.
2007-03-11 04:35:23 +00:00
gianluca 04203b96b6 Fixed a bug in pcap_open_live(). The return value of PacketSetHwFilter was
not checked. This was the culprit of WinPcap failing to capture on wireless
adapters when in promiscuous mode. Most of the wireless adapters drivers
do not support the promiscuous hardware, and fail the HW filter OID request.
This failure was not detected by pcap_open_live(), and resulted in no packets
being captured as no hw filter was actually set at the driver level (no hw filter
means "reject all").
2007-02-19 18:35:06 +00:00
guy d02424cd4c From Florent Drouin: a Link Status Signal Unit is called an LSSU, not an
LSU.  (Leave "lsu" as an alias for backwards compatibility.)
2007-02-08 07:15:27 +00:00
guy a247db420a From Stephen Donnelly: change to handle some name changes in the DAG
library resulting from Endace switching to libtool.
2007-02-08 06:02:42 +00:00
guy 62bf880d23 From Florent Drouin: don't crash if the open of the USB bus directory
fails.
2007-02-01 03:17:20 +00:00
guy d5e7848c1e From Florent Drouin: clean up resources when an open fails.
In addition, clean up the allocation and freeing of the temporary
pathname string buffer.

Also, there's no need to set "md.device" (it's only used on Linux, and
even then used only with the old SOCK_PACKET sockets, where you have to
turn promiscuous mode off explicitly rather than having it turn off
automatically when you close the socket) or "md.timeout".
2007-02-01 02:58:39 +00:00
guy b4c382fd7e From Paolo Abeni:
The USB pseudo-header in DLT_USB_LINUX captures is in the host
	byte order for the machine on which the capture was done.  When
	reading a capture file, convert the pseudo-header to the host
	byte order of the host on which the file is being read.

	There's a 64-bit quantity in that pseudo-header; move the 64-bit
	byte-swap macro from the DAG code to pcap-int.h for use by other
	code.
2007-01-29 20:08:06 +00:00
guy 6db2ddb56a From Paolo Abeni:
The attached patch cleans up usb_platform_finddevs(), removing
	the dependency on debugfs.  There are also some other minor
	cleanups in the pcap-usb-linux.c file (unused variables removed
	and indentation fix).
2007-01-17 19:31:00 +00:00
guy 22f1fd3407 From Paolo Abeni: fix a printf. 2007-01-14 21:33:55 +00:00
guy 349ffb7d20 For wltN devices, open the corresponding enN device, so that, for
example, if you don't have permission to open BPF devices, you don't end
up with a list of devices that includes the wltN devices but nothing
else.
2006-12-30 09:54:57 +00:00
guy 660cb8b1ce On Mac OS X, assume any device whose name begins with "wlt" can be
captured on, without trying to open it - if "enN" is an AirPort device,
opening "wltN" is like opening "enN", except that the device is put into
monitor mode, which, for many devices, causes the device to deassociate
from the network with which it's associated.
2006-12-29 19:33:36 +00:00
guy 7589e0abc3 From Florent Drouin: add support for filtering on MTP2 frame types. 2006-12-21 19:44:06 +00:00
guy 7bf28e7fd2 Indicate which headers go with which DLT_ values. 2006-12-21 18:56:21 +00:00
guy 31d7c82a44 Use DLT_USB_LINUX as the link-layer type, as we now supply the Linux
header.
2006-12-20 08:21:10 +00:00
guy eda5020549 Handle DLT_USB_LINUX the same way we handle DLT_USB (i.e., punt and only
support link[N:M]).
2006-12-20 08:20:27 +00:00
guy 1a2be25931 Add an item to work with autoconf 2.60. 2006-12-20 08:19:37 +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 8a391f392c From Paolo Abeni: don't treate an EAFNOSUPPORT error when trying to open
a Bluetooth socket as an error - it just means there's no Bluetooth
support in the kernel, and thus there are no Bluetooth devices.

Clean up error messages a bit, including indications that these are from
the Bluetooth code.
2006-12-05 20:08:58 +00:00
guy 6915e7e906 Capitalize "Bluetooth". 2006-12-04 23:03:33 +00:00
guy ed2b2e24ef Capitalize "USB". 2006-12-04 23:01:25 +00:00
guy 78ca8b4d49 Add a LINKTYPE_ value corresponding to DLT_IEEE802_16_MAC_CPS. 2006-11-27 18:36:57 +00:00
guy fb91ad681f DLT for IEEE 802.16 (WiMAX) MAC Common Part Sublayer; requested by Maria
Cruz (<cruz_petagay@bah.com>).
2006-11-27 18:04:29 +00:00
guy 24f60579bc From Paolo Abeni:
The attached patch fix an off by one in current usb sniffing
	code.  It also substitute the kernel-provided timestamp with
	gettimeofday.  The kernel provided timestamp use 32 bits to
	represent a struct timeval (8 bits for tv_sec and 24 for
	tv_usec), so it's content is quite misleading.
2006-10-15 18:20:26 +00:00
guy 455aff8ba9 Move the Linux Bluetooth and USB declarations to a header file.
Clean up some comments.

Protect all references to the USB stuff from the common Linux code with
PCAP_SUPPORT_USB, just as references to the Bluetooth code are protected
with PCAP_SUPPORT_BT.
2006-10-13 17:46:45 +00:00
guy 50ce2663e8 From Paolo Abeni: Bluetooth support. 2006-10-13 17:34:53 +00:00
guy 6fa38c09d7 From Paolo Abeni:
avoid lookupnet to mess with ioctl for usb interface
	and simply return an 0.0.0.0 net and a 0.0.0.0 netmask.
2006-10-13 09:06:05 +00:00
guy 8c2a49b75c DLT_ value added for the Bluetooth HCI UART transport layer for Paolo
Abeni.

Added DLT/DLT name table mappings and linktype values and DLT/linktype
mappings for USB and for the Bluetooth NCI UART transport layer.

Fix up indentation.
2006-10-13 08:46:23 +00:00
guy 5ec4105685 Squelch another valgrind complaint. 2006-10-12 17:26:06 +00:00
guy 08f2f1703b From Paolo Abeni:
The attached patch fix the parsing of setup data fields in current
implementation of usb_read_data.

Currently the "setup header is present" field is not marked so the
relevant fields are ignored from caller.

The patch contains also a little indentation fix, always in the same
function.
2006-10-12 08:04:08 +00:00
guy 33c151f1e9 Clarify that the structure that pcap_stats() fills in is pointed to by
the second argument, in the hopes that people will be less likely to
expect the routine to do something other than crash if passed a null
pointer as the second argument.
2006-10-12 07:59:54 +00:00