dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

1517 Commits

Author SHA1 Message Date
Guy Harris fc03e2cbb6 Squelch some (valid) compiler warnings. 2010-01-09 18:25:22 -08:00
Guy Harris ed73055294 Mention that we can read some pcap-ng files. 2010-01-09 17:06:10 -08:00
Guy Harris b4b664817b Add limited support for reading pcap-ng files.
All sections of the file must have the same byte order, so that the
result of pcap_is_swapped() is the same throughout the file; all
interfaces in the file must have the same link-layer type and snapshot
length, so that pcap_datalink() and pcap_snapshot() can return a single
value for the entire file; and all interfaces must have the same time
resolution and offset.
2010-01-09 16:58:15 -08:00
Guy Harris 753c9432ab Fix pcap_lookupnet().
From NetBSD; to quote the checkin comment:

	Fix pcap_lookupnet(): reset ifr before SIOCGIFNETMASK. Without
	it we get back a bogus netmask.

Presumably some stuff left over in ifr from the previous ioctl confuses
the next ioctl.
2010-01-09 12:51:15 -08:00
Guy Harris ffd6b10d87 Add Christian Bell to the CREDITS file. 2010-01-08 12:39:54 -08:00
Christian Bell df6ab8d1a6 Minor VPATH build fixes in top-level Makefile.
Signed-off-by: Guy Harris <guy@alum.mit.edu>
2010-01-08 12:38:56 -08:00
Guy Harris 25b78e4fe3 Update config.guess and config.sub to the latest versions. 2010-01-08 10:37:10 -08:00
Guy Harris 2d78729d0f Add a pcap/ipnet.h file with IPNET definitions; use the right AF_ values. 2010-01-05 20:35:25 -08:00
Guy Harris add31c2e28 Add DLT_IPV4 and DLT_IPV6.
DLT_IPV4 and DLT_IPV6 are like DLT_RAW, except that you know the version
of IP.

Also, get rid of some duplicate stuff for DLT_IPNET in savefile.c.
2010-01-04 12:06:40 -08:00
Guy Harris ded813e278 When removing conftest*, use "-r", to clean up OS X .dSYM turds. 2010-01-02 15:58:15 -08:00
Guy Harris 9662c40522 Split off the shared-library tests into a separate macro.
Split off the shared-library tests into a separate AC_LBL_SHLIBS_INIT
macro, so the libpcap and tcpdump versions of AC_LBL_C_INIT can be the
same.  While we're at it, clean up some of the AC_PREREQ and AC_BEFORE
stuff.
2010-01-02 15:08:06 -08:00
Guy Harris cef4d17b1d Fix a comment. 2010-01-02 14:20:28 -08:00
Guy Harris d1a3a92fab Fix some problems that show up in autoconf 2.64 and later. 2010-01-02 14:15:46 -08:00
Guy Harris 1daef06321 Fix some problems pointed out by compiler warnings.
Include <arpa/inet.h> to declare htons().  Get rid of unused variables.
Fix an intended ioctl() call.
2009-12-31 15:10:02 -08:00
Felix Obenhuber 03238ec05d Check for <linux/can.h> rather than <linux/can/version.h>.
Not all Linux kernels that can support SocketCAN sniffing have
<linux/can/version.h>, and we don't include it directly.  We *do*
include <linux/can.h>, so check for that.

Patch changed not to bother checking for the existence of <sys/socket.h>
- we already assume it exists on all platforms that support packet
capture, including Linux.  I also changed the Bluetooth "not supported
on this OS" message to look like the one for CANbus, giving the host OS.

Signed-off-by: Guy Harris <guy@alum.mit.edu>
2009-12-30 17:14:20 -08:00
Guy Harris 72f5572c50 Capitalize "Bluetooth" and "CAN" in help messages and comments. 2009-12-29 11:56:57 -08:00
Guy Harris b0c5f4c658 Un-split a line. 2009-12-29 11:53:32 -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 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
Ken Bantoft 8b907b6cd1 Update CHANGES for 1.0.2 release 2009-12-21 21:01:02 -05:00
Guy Harris b02e7c185e One include of <fcntl.h> suffices. 2009-12-18 14:33:09 -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 74b2de364f When generating code for "ip broadcast", treat a netmask of 0xffffffff
(255.255.255.255) be an indication that the netmask is unknown, and
return an error.  Document that as the way to tell pcap_compile() that
the netmask is unknown.  Have filtertest default to that as the netmask,
and add a -m flag to let you specify the netmask.
2009-12-01 19:07:11 -08:00
Guy Harris 8b52a90cd9 Get rid of some unused variables.
Get rid of an unnecessary #ifdef.
2009-11-25 12:03:06 -08:00
Guy Harris b8c57c9529 Don't check for DLT_IPNET if it's not defined - in pcap-bpf.c, the bpf.h
we're using is the OS's, not libpcap's, so it's not necessarily defined.

Explain why we're checking for DLT_IPNET.
2009-11-25 12:02:06 -08:00
Guy Harris 272bbe3dfe Regnerated configure. 2009-11-25 11:56:59 -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 5aa0044891 Hyphenate "link-layer" everywhere.
Fix the description of the link-layer sender address field in the
DLT_LINUX_SLL header.
2009-11-16 12:01:24 -08:00
Guy Harris 62b9af0706 From Márton Németh:
The usbmon text interface was moved from
	/sys/kernel/debug/usbmon to /sys/kernel/debug/usb/usbmon as of
	patch

		http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=f49ce96f11112a84c16ac217490ebd6f8d9a8977 .

	Please add this new directory also into the search list when
	finding USB devices.

Get rid of older address for Gisle Vanem; convert Love's address to
UTF-8 (as it is in the tcpdump CREDITS file).
2009-11-03 14:50:40 -08:00
Guy Harris 6b414c082f Describe all the cases where pcap_fileno() returns a file descriptor and
where it returns -1.  Based on a patch from Fumiyuki Shimizu.
2009-11-03 14:18:11 -08:00
Guy Harris 339d28cefc Give N. Leiten credit for the poll() exceptional condition checks in
pcap-linux.c memory-mapped mode.

Always doing a poll() if there are no packets available allows us to
catch disappearing interfaces in memory-mapped mode, so remove the
caveats about Linux.
2009-10-12 17:21:02 -07:00
Guy Harris 26384d5fc7 Fix typo^Wbraino. 2009-10-12 17:06:11 -07:00
Guy Harris bf7491046a In pcap_read_linux_mmap(), if there are no frames available, call poll()
even if we're in non-blocking mode, to pick up any error indications -
in that case, use a timeout of 0, so poll() doesn't block.

Don't test individual exceptional-condition bits in the poll() return
unless one of them is set, so we just do one test in the typical (no
exceptional condition) case.
2009-10-12 16:24:57 -07:00
Guy Harris 9dd13b012f If bpf_odmcleanup() is being called to clean up after an error, pass it
a null pointer, so that it doesn't overwrite the error string for the
error.  Make it set the error string only if passed a non-null pointer.
2009-10-12 12:58:30 -07:00
Guy Harris 0c8f81c821 Snow Leopard fixes poll() and kqueues to work on BPF devices (and ttys).
Describe what happens with select() and poll() on Linux if the device on
which you're capturing goes away.
2009-10-11 22:44:39 -07:00
Guy Harris e6b89d9420 If we get POLLERR when polling a socket in memory-mapped mode, do a
recv() on the socket to get the error code.
2009-10-11 22:15:24 -07:00
Guy Harris 86ecdb83e0 Fix typo. 2009-10-02 14:07:11 -07:00
Guy Harris e9de4b862e When reading from a BPF device, if we get ENXIO, which means "The device
went down" on at least some OSes, return a message indicating that.

When reading from a Linux PF_PACKET socket, if we get ENETDOWN, which
means "The device went down", return a message indicating that.

When doing a poll() on a PF_PACKET socket, check for various "something
happened on this, but it's not readable" conditions.
2009-10-11 20:12:34 -07: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 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 8c4dcba6d2 From Jean-Louis Charton: clean up in some failure cases on AIX. 2009-10-09 16:10:33 -07:00
Guy Harris e154e275c2 For BPF, raise the default capture buffer size to .5MB; 32K isn't much
for modern machines with more memory and faster networks.
2009-09-22 21:02:43 -07:00
Guy Harris 71dac45765 If an activate routine fails, it needs to clean up the pcap_t, close
anything it's opened, etc..

In addition, the op pointers need to be restored to the un-activated
state; do that in pcap_activate() if the call to the activate op fails.

Also, in the common cleanup code, set the fd's to -1.
2009-09-21 10:45:09 -07:00
Guy Harris 2fbb5a5e31 Copy the right value to the ps_ifdrop statistic. 2009-09-21 10:26:37 -07:00
Darren Lim 420e592e02 Added the dagutil.o object file from the Endace DAG libraries into the
libpcap archive. A dependency has been introduced whereby the dagapi.o
object depends on functions in the dagutil.o as og DAG software release
3.4.1. This change is backwards compatible with older versions of the
DAG libraries.
2009-09-17 15:24:28 +12:00
Guy Harris bb8cce5968 Put in a note about the Snow Leopard bug that requires that you have BPF
devices open for writing in order to capture outgoing traffic.
2009-09-09 17:36:06 -07:00
Guy Harris 2212a58381 To quote
http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemStartup/Articles/StartupItems.html

"Table 1  StartupParameters.plist key-value pairs

Key		Type	Value
Description	String	A short description of the startup item,
			used by administrative tools.

Provides	Array	The names of the services provided by this
			startup item.  Although a startup item can
			potentially provide multiple services, it is
			recommended that you limit your startup items
			to only one service each."

Fix "Provides" to be the name of the service, not a description of the
helpful operations that it provides.
2009-09-09 16:50:36 -07:00
Guy Harris d2ec25429b Note some other ways to get link statistics. 2009-09-07 17:52:55 -07:00
Guy Harris ef9aa50d23 Set ps_ifdrop after ps_drop, so we process the statistics in order. 2009-09-07 16:49:59 -07:00