dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

962 Commits

Author SHA1 Message Date
guy 6ba97bc41c From RCB-ISIS on SourceForge: handle LynxOS, which has AF_PACKET but
puts the if_packet.h header in a different directory from Linux.
2007-09-14 00:45:17 +00:00
ken 7f5ecfb5b5 Update with todays patches 2007-09-12 22:40:04 +00:00
guy 9956c795c2 From OpenBSD: use calloc() to avoid malloc(n * m) overflows. 2007-09-12 21:29:45 +00:00
guy 9ebf35efbf 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:17:24 +00:00
ken a7456c13e9 Prep for 0.9.8 release 2007-09-11 00:00:20 +00:00
guy b100e9be81 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:57:49 +00:00
guy 7ec38476e3 New DLT value for packets captured from u10 Networks boards; requested
by Phil Mulholland of u10.
2007-08-13 16:52:34 +00:00
guy 9f68ed52a1 DLT_ERF, for encapsulating Endace ERF records and packet data for
various link-layer types.
2007-08-07 23:54:15 +00:00
mcr 5689611abe working releasetar target. 2007-07-24 02:35:15 +00:00
mcr ecf11603e5 0.9.7 changelog. 2007-07-24 02:27:32 +00:00
guy 9c78ee4ef1 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:20:53 +00:00
guy 245aeeded0 So far, two people have submitted patches to "fix" the "memory leak" in
icode_to_fcode() by having it free the bpf_insn array before returning a
pointer to it.  Add a comment to icode_to_fcode() explaining why this is
not a leak in icode_to_fcode(), it's a leak in their program, and
indicating how to fix the leak.
2007-07-15 19:55:04 +00:00
guy 03dc37ff02 From Stephen Donnelly of Endace:
This patch introduces support for the DAG ERF type
	TYPE_COLOR_MC_HDLC_POS.

	The patch also allows appropriate DAG cards (DAG 3.7T, DAG 7.1S)
	to optionally produce DLT_MTP2_WITH_PHDR (139) traces when
	capturing from channelised HDLC links, as an alternative to
	DLT_MTP2 (140).  When using the new DLT, the 'DAG channel' is
	recorded in the pcap record pseudo header as the 'link_number'.

	Basic BPF filtering support for DLT_MTP2_WITH_PHDR is also
	added.

Fix some warnings.

Update the version numbers.

Rename SWAP_TS() to SWAPLL() and move it to pcap-int.h, to make the x.9
code more closely match the top-of-tree code.
2007-06-22 06:43:58 +00:00
guy 0d7c34943d 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:57:26 +00:00
gianluca 1fb816445e Added support for PPI. 2007-06-14 22:07:14 +00:00
gianluca 88cba4849d 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:54:12 +00:00
gianluca f6f11bf248 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:42:43 +00:00
gianluca e04b1dfbd6 Added some initial support for PPI filter generation. 2007-06-13 22:51:07 +00:00
guy a15db77b4f 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 09:52:04 +00:00
guy 07da703f35 Allocate DLT_ for 802.15.4 without any header munging, for Mikko
Saarnivala.

Fix a comment.

Also, propagate

  revision 1.156
  date: 2007-05-24 23:57:36 +0000;  author: hannes;  state: Exp;  lines: +13 -1
  add support for DLT_JUNIPER_ISM

to the x.9 branch.
2007-06-05 18:07:03 +00:00
guy 7e4cec85ca 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:06:38 +00:00
guy e82ab208e3 Header for 802.16 MAC Common Part Sublayer plus a radiotap radio header;
requested by Charles Clancy.
2007-05-04 09:47:45 +00:00
ken 3911494f20 Prep for 0.9.6 release 2007-04-23 21:22:17 +00:00
guy dbfecbdf7e It's LINKTYPE_PPI, not SAVEFILE_PPI. 2007-04-19 18:34:26 +00:00
gianluca cd8eee070f Reserved a DLT_ and SAVEFILE_ value for PPI (Per Packet Info)
encapsulated packets. Requested by Gianluca Varenni.
2007-04-19 17:36:41 +00:00
guy edb359133b Define DLT_LOOP as 12 on OpenBSD, for compatibility with its definition.
(LINKTYPE_LOOP is still 108 on all platforms.)
2007-04-05 18:44:18 +00:00
guy ed7d7d935e Linktype for IEEE 802.15.4, with address fields padded as done by Linux
drivers; requested by Juergen Schimmer.

Also, propagate some changes fromt he main branch, so the x.9 branch has
all the DLT_ and LINKTYPE_ values that the main branch does (so if any
OSes pick up any future x.9-branch releases, people with those OSes will
see the full list, and, if they miss the comments saying "ask
tcpdump-workers if you want a DLT_ value", will perhaps be less likely
to pick their own values and reuse a value we've already assigned).
2007-04-03 07:27:56 +00:00
guy 1c4f1782c7 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:08:02 +00:00
guy 0645b2eb1f From Jung-uk Kim: add support for new FreeBSD BIOCSDIRECTION ioctl. 2007-03-26 01:38:46 +00:00
guy 3f4d2d894c On NetBSD, include <sys/param.h>; we need it to declare
__NetBSD_Version__.
2007-03-11 21:44:51 +00:00
gianluca 9e9f5dde21 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:33:37 +00:00
guy 27d074264e 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:17:25 +00:00
guy 89b8910808 From Stephen Donnelly: change to handle some name changes in the DAG
library resulting from Endace switching to libtool.
2007-02-08 06:03:32 +00:00
guy 9881f0b8ab 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:59:34 +00:00
guy 00d3e1577c 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:16 +00:00
guy 9fd59c7b0c 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:34:48 +00:00
guy c6310f208b From Florent Drouin: add support for filtering on MTP2 frame types. 2006-12-21 19:45:03 +00:00
guy 490c0b84d9 Add a LINKTYPE_ value corresponding to DLT_IEEE802_16_MAC_CPS. 2006-11-27 18:37:25 +00:00
guy e7b50163ff DLT for IEEE 802.16 (WiMAX) MAC Common Part Sublayer; requested by Maria
Cruz (<cruz_petagay@bah.com>).
2006-11-27 18:05:03 +00:00
hannes 359518fa54 backout last commit - wrong tree 2006-10-24 17:00:48 +00:00
hannes c06c4156e6 adding a proper prototype for gen_slarp() 2006-10-24 16:50:55 +00:00
guy 6467c24c30 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.

Copy some stuff for DLT_JUNIPER_VP and DLT_USB from the top of the main
branch.
2006-10-13 08:56:07 +00:00
guy 1f4888f3f0 Squelch another valgrind complaint. 2006-10-12 17:26:58 +00:00
guy d5f79d312b 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 08:01:16 +00:00
guy 9b6208f7bd In "add_or_find_if()", first check whether we already have an entry in
the list for the interface, and try to open the interface only if we
don't already have an interface, so if you have multiple addresses for
an interface, you don't open the interface for each of them.  (See
Wireshark bug 1151:

	http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1151

for the reason to do this; pcap_findalldevs() spent a *lot* of time and
energy opening en0 over and over again for all 64K-128K(!) addresses.)
2006-10-10 07:09:40 +00:00
guy 79da35307d No, that's not the right fix for the Linux kernel interface; the right
fix is to discard unread packets when changing the filter, as that fixes
not only the problem with the *first* filter you set, it fixes the
problem you get when *changing* the filter.  That fix is now in the code.
2006-10-04 18:17:07 +00:00
guy fdc4e7eb6c Add a link-layer type for USB. 2006-10-03 00:12:57 +00:00
guy 55bdf7f287 Squelch a valgrind warning. 2006-09-28 07:35:19 +00:00
guy 5a366e16d5 From Stephen Donnelly: add support for new DAG ERF types. 2006-09-25 18:18:30 +00:00
guy fcf9f2f3c6 Clean up indentation.
From Stephen Donnelly: add DLT_MTP2 to the table of DLT choices.
2006-09-25 18:17:26 +00:00