dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

479 Commits

Author SHA1 Message Date
guy 52866495a0 From Gisle Vanem <giva@bgnett.no>: treat CR as white space in
expressions.
2003-02-08 19:27:00 +00:00
guy 6efec806a4 For DLT_ATM_RFC1483, the network-layer header starts 8 bytes from the
beginning of the packet if the packet has an 802.2+SNAP header (3 bytes
802.2, 5 bytes SNAP), and 3 bytes from the beginning of the packet if it
has only an 802.2 header, just as is the case for DLT_ATM_CLIP, so go
back to handling them both with the same case.

Restore some comments asking whether we need to check the SSAP when
testing the 802.2 header for protocol types.

Clean up white space.

RFC 1188, RFC 1042, and RFCs 1483 and 2225 specify that SNAP
encapsulation is used for IP, not LLC encapsulation with LLCSAP_IP and,
in fact, that's what most if not all IP traffic over FDDI, 802 networks,
and LLC-encapsulated ATM use; go back to treating those link-layer types
the same way other link-layer types are handled.
2003-02-05 01:53:29 +00:00
guy 8b31d709a2 If we have bufmod, allocate a buffer big enough to hold the size of
chunk we ask bufmod to send upstream.

Yes, uint_t is always 32 bits, at least as I read the Solaris 8 code.

The chunk size is 8192, not 0, by default.

Don't do the chunk size stuff if we don't have bufmod.
2003-02-05 01:46:58 +00:00
risso c6c36989f7 Added a const modifier to the first argument of pcap_lookupnet() for Win32. Without it, libpcap didn't compile under Cygwin. 2003-02-04 09:51:38 +00:00
guy 2256aabb91 As per suggestions from the anonymous SourceForge user who submitted bug
673958, make two changes on Solaris:

	don't set SB_NO_DROPS - doing so means that bufmod doesn't drop
	packets, so it can't report the number of drops, but packets
	probably still get dropped *somewhere*, if for no other reason
	than that the system refuses to allocate more mblks/dblks, even
	if it doesn't discard messages that arrive at the stream head if
	it's full;

	set the chunk size to 65536, as otherwise packets are dropped
	too easily.

snoop also appears not to set SB_NO_DROPS and also appears to set the
chunk size to 65536, so that's probably the right thing to do.
2003-02-04 05:42:03 +00:00
guy 04672f261b Put in break statements after every case in the switch on the NDIS
medium type.
2003-01-23 09:40:09 +00:00
guy 2d1ac3b4d5 From Peter Fales <peter@fales-lorenz.net>: support for Linux ARCNET,
which supplies different headers from BSD ARCNET, and fixes to the
ARCNET code generator (the protocol ID field is 1 byte, so the values
for it shouldn't be byte-swapped).

Whitespace cleanups.

The "NetBSD-style" ARCNET headers are used in other BSDs as well, so
just call them "BSD-style".
2003-01-23 07:24:51 +00:00
guy 4c88bf1f3e Add DLT_ARCNET_LINUX and LINKTYPE_ARCNET_LINUX; the link-layer headers
supplied by Linux's ARCNET code aren't the same as the ones supplied by
NetBSD's ARCNET code.

Fix up some LINKTYPE_ values to match the corresponding DLT_ values.
(There is no released version of libpcap/tcpdump that supports their
previous values.)
2003-01-21 04:39:05 +00:00
guy 5b474ef2bb Move the freeing of "p->dlt_list" to the proper place. 2003-01-16 07:44:27 +00:00
guy a41135fcd3 From NetBSD, as checked in by Antti Kantee <pooka@netbsd.org>: fix the
documentation for "pcap_next()" to indicate that it returns a "const
u_char *", not just a "u_char *".
2003-01-16 07:43:24 +00:00
guy 1445ed8be1 From NetBSD, as checked in by Antti Kantee <pooka@netbsd.org>: fix the
documentation for "pcap_next()" to indicate that it returns a "const
u_char *", not just a "u_char *".
2003-01-16 07:29:15 +00:00
guy 5060f872d8 Oops - fix a typo. 2003-01-10 09:15:18 +00:00
guy d4e32467f8 Test both for "sparc" and "__sparc__" in the case where LBL_ALIGN isn't
defined - Debian bug 171210 says that "sparc" isn't defined by GCC,
which presumably means "with the compiler we're using on Debian" as
there are versions of GCC that *do* define "sparc" on SPARC.
2003-01-10 09:14:07 +00:00
guy 3150af88f7 Squelch compiler warnings from Sun C. 2003-01-03 08:34:46 +00:00
guy a8d3536171 Make "split_dname()" take a "char *" as an argument and return a "char
*", and arrange never to pass it the argument to "pcap_open_live()" -
copy the device name to a buffer before doing anything else to it.
2003-01-03 08:33:54 +00:00
guy 123b602037 Put in a comment noting that you probably should Not Worry and just Be
Happy even with the warnings about passing a "const char *" to
"pfopen()".
2003-01-03 08:33:24 +00:00
guy 2b3d687c1e Constify the device argument to "pcap_open_live()", as was done for
other pcap-xxx.c files, and constify the argument to and return value
from "split_dname()" as well, to match.
2002-12-28 01:07:10 +00:00
guy 6f70bcdf95 "device" in the "pcap_md" structure is a copy of a string, and needn't
be "const" - not should it be, as that causes compiler whining for calls
that free the copy.
2002-12-28 00:44:04 +00:00
hannes 79c4d5bc62 from Chris Waters chris.waters[AT]networkchemistry.com:
reserve DLT and LINKTYPE for the Tazmen Sniffer
Protocol (TZSP).
2002-12-26 08:53:07 +00:00
guy dc9d85f819 Make "pcap_dump_flush()" return a success-vs-failure indication;
unfortunately, we can't fix "pcap_dump()" and "pcap_dump_close()" to do
that, as any application that tests the return value would fail to work
correctly if linked at runtime with an older libpcap, but we should
perhaps introduce "pcap_dump_ex()" and "pcap_dump_close_ex()" routines
that do return a success-vs-vailure indication.
2002-12-22 23:05:52 +00:00
guy 8cd68a0fa4 From Yoann Vandoorselaere <yoann@prelude-ids.org>: make the "device"
argument to "pcap_open_live()" a "const" pointer.

Constify some additional device name arguments, and update the man page
to reflect some arguments that were already consts.
2002-12-22 02:36:48 +00:00
guy eca5a61ef1 From Andrew Brown <atatat@atatdot.net>: add a "pcap_dump_flush()" call,
to flush the standard I/O buffer for a "pcap_dumper_t" and force all
packets written with "pcap_dump()" to the savefile.
2002-12-21 23:38:51 +00:00
guy 482fa426bc NetBSD support for multiple data link types on an interface, from David
Young <dyoung@ojctech.com>, with some minor changes by Jason R.  Thorpe
<thorpej@netbsd.org>, and further changes by me to support it on BPF
systems lacking BIOCGDLTLIST and other platforms lacking an equivalent
feature.

Update Jason Thorpe's e-mail address (Zembu is going away, if it hasn't
done so already).

Add APIs to map DLT names to DLT values and vice versa.
2002-12-19 09:05:45 +00:00
guy 1e574aa6fd Indicate when "pcap_next()" returns NULL, and that, unfortunately, you
don't know whether that happens because of an error or because no
packets were available at the time.
2002-12-17 07:32:55 +00:00
guy 656dd0eafa Add gencode support for DLT_IEEE802_11_RADIO. 2002-12-12 07:04:17 +00:00
guy cb1f8ef14d Add new DLT_ type for AVS's WLAN header. 2002-12-11 22:43:31 +00:00
hannes bd4881668c add BPF_ filters for misc. IS-IS PDU Types 2002-12-06 00:01:33 +00:00
hannes 531a7bbb14 fixed BPF generation of OSI over {CHDLC and ATM-LLC} frames 2002-12-04 21:40:13 +00:00
guy 215669fbe8 As per Ayamura Kikuchi, on some UNIXes, such as IRIX, "sa_len" is
apparently defined in such a way that you can't use it as a variable
name; use "sa_length" instead.
2002-11-13 06:46:16 +00:00
risso b323d42b7a Added support for raw ARCNET (878.1) under Win32. 2002-11-11 10:34:06 +00:00
risso 8b5f7cc99e There was a bug in pcap_open_offline: in case of error, the returned pointer was freed but the open file was not closed. Thus, a handle on the opened file was kept and could not be released as the returned pointer was null. 2002-10-24 08:09:42 +00:00
guy de4c0d816c From Kazushi Sugyo: address pointers in entries returned by
"getifaddrs()" can be null, so make "SA_LEN()" return 0 if the argument
is null, rather than dereferencing the argument and crashing if it's
null.
2002-10-19 02:25:40 +00:00
guy d1d0fe1d98 Add support for RFC 2625 IP-over-Fibre Channel, mapping all the Linux
ARPHRD_FC* types to it.
2002-10-18 08:46:13 +00:00
guy f8a3b72cd9 Add LINKTYPE_ values and mapping table entries for the new DLT_ values
added for Kent Dahlgren.
2002-10-09 19:02:56 +00:00
hannes bc70a87fce Reserved as per request from Kent Dahlgren <kent@praesum.com> for private use 2002-10-09 13:28:27 +00:00
guy 45ba69f093 Split the README items into "using BPF" and "using DLPI" items; if you
can use BPF, you don't need to have the latest DLPI driver or make sure
it's loaded (and maybe we're finally at the point where you can use
BPF).

Reformat a bit.

Note that the DLPI support has problems with DL_PROMISC_MULTI failing.
2002-10-08 07:27:39 +00:00
guy 6d1a64f8b0 From Jon Lindgren <jonl@yubyub.net>, based on a note from Don Ebright
<Don.Ebright@compuware.com>: ignore EFAULT from a BPF read in AIX.
2002-10-08 07:18:07 +00:00
guy 7a30eb46ce On Solaris, if the "to_ms" argument is zero, we don't do an SBIOCSTIME;
if, as I suspect is the case, that causes no timeout to be set, and if
that's the same as explicitly clearing the timeout with SBIOCCTIME, that
would appear to mean that it'd wait forever for a full chunk's worth of
packets to arrive.
2002-09-18 19:07:57 +00:00
guy 6782a9f4a7 Document that a zero value of the timeout argument to "pcap_open_live()"
can have one of two different behaviors, depending on the OS (it means
"don't return from a read until enough data has arrived" on BSD and
Digital/Tru64 UNIX, and means "return immediately" on Solaris, for
example, at least according to the man pages on Digital/Tru64 UNIX and
Solaris and the code in BSD).
2002-09-18 18:56:57 +00:00
guy ffabca7439 Emphasize that you get only "caplen" bytes of data in the callback from
"pcap_dispatch()" and "pcap_loop()", give more details on the effect of
the "snaplen" argument to "pcap_open_live()", and suggest 65535 as a
value if you want to capture the entire packet.
2002-09-12 19:42:03 +00:00
guy 23bfb470c5 Explain, in more detail, the "netmask" argument to "pcap_compile()"; in
particular, point out that it's only used when checking for IPv4
broadcast addresses, and that if you don't care whether those checks are
done correctly, you can supply 0 if the netmask isn't known or isn't
available.
2002-09-06 21:14:46 +00:00
guy 073fc17a9d Red Hat Linux 7.2 appears to have a <net/raw.h> file, which causes the
configure script to think it's IRIX, so test for
"/usr/include/linux/socket.h" before testing for
"/usr/include/net/raw.h" (which is done before testing for
"/usr/include/sys/dlpi.h"; hopefully no future IRIX release, or future
release of Solaris/HP-UX/AIX/other OS that supports DLPI, will add
"/usr/include/linux/socket.h" as a "helpful" header file for Linux
compatibility).
2002-09-04 20:31:33 +00:00
guy d698d6aed8 From an anonymous Sourceforge user: include <net/if.h> to declare the
IFF_ flags.
2002-08-26 09:50:45 +00:00
guy bf2270da5b From Guillaume Pelat <endymion_@users.sourceforge.net>: properly
null-terminate the interface name when doing an NIOCBIND.
2002-08-25 21:13:52 +00:00
risso ee9e2f0c05 Since the maximum error message size of libpcap is PCAP_ERRBUF_SIZE, this prevents having problems when using printf() to print the buffer, since the buffer will always be zero-terminated. 2002-08-20 15:33:31 +00:00
itojun 36d47557dd correct arg to calloc() - it is (nelem, size), not (size, nelem). from openbsd 2002-08-12 02:38:11 +00:00
guy 2a22d604c4 Make "lane" behave like "vlan", i.e. have it tweak the interpretation
of packet headers so that, in all expressions after it, the tests assume
LANE encapsulation of packets.  (We also assume the emulated LAN is an
Ethernet LAN, rather than a Token Ring LAN.)

Allow ATM tests to be combined with non-ATM tests in expressions, so
that you can do, for example, "lane and icmp".
2002-08-11 18:27:13 +00:00
risso fe62fd54f4 Added a readme that explains how to compile libpcap under win32. 2002-08-09 13:55:12 +00:00
risso 5101a35095 Added the Win32 project files, that allow to compile libpcap and include it in the WinPcap source tree to generate wpcap.dll. 2002-08-09 13:54:19 +00:00
guy 6c3e3a0f27 Redo the code generation for 802.11 MAC address tests to reorder the
tests so that better code is generated.
2002-08-08 11:07:27 +00:00