dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

1440 Commits

Author SHA1 Message Date
guy 8445a15c7c Add support for NetBSD DLT_PPP_SERIAL (PPP in HDLC-like framing, as per
RFC 1662, or Cisco point-to-point with HDLC framing, as per seciont
4.3.1 of RFC 1547; there's always an address and control octet at the
beginning of these packets, but they're not necessarily 0xff 0x03),
which we map to PCAP_ENCAP_PPP_HDLC.
2000-09-18 05:08:02 +00:00
guy 7e461ddcbe There's no longer a rule to make "force", so don't make "depend" depend
on "force".
2000-09-18 05:04:52 +00:00
guy 781fae3571 Introduce a set of PCAP_ENCAP_ codes to specify packet encapsulations.
For those PCAP_ENCAP_ codes corresponding to DLT_ codes that are
(believed to be) the same in all BSDs, the PCAP_ENCAP_ codes have the
same values as the corresponding DLT_ codes.

For those PCAP_ENCAP_ codes corresponding to DLT_ codes that were added
in libpcap 0.5 as "non-kernel" DLT_ codes, or had their values changed
in libpcap 0.5 in order to cope with the fact that those DLT_ codes
have different values in different systems, the PCAP_ENCAP_ codes have
the same values as the corresponding DLT_ codes.

We add some additional PCAP_ENCAP_ codes to handle IEEE 802.11 (which
currently has its link-layer information turned into an Ethernet header
by at least some of the BSDs, but John Hawkinson at MIT wants to add a
DLT_ value for 802.11 and pass up the full link-layer header) and the
Classical IP encapsulation for ATM on Linux (which isn't always the same
as DLT_ATM_RFC1483, from what I can tell, alas).

"pcap-bpf.c" maps DLT_ codes to PCAP_ENCAP_ codes, so as not to supply
to libpcap's callers any DLT_ codes other than the ones that have the
same values on all platforms; it supplies PCAP_ENCAP_ codes for all
others.

In libpcap's "bpf/net/bpf.h", we define the DLT_ values that aren't the
same on all platforms with the new values starting at 100 (to keep them
out of the way of the values various BSDs might assign to them), as we
did in 0.5, but do so only if they're not already defined; platforms
with <net/bpf.h> headers that come with the kernel (e.g., the BSDs)
should define them with the values that they have always had on that
platform, *not* with the values we used in 0.5.

(Code using this version of libpcap should check for the new PCAP_ENCAP_
codes; those are given the values that the corresponding DLT_ values had
in 0.5, so code that checks for them will handle 0.5 libpcap files
correctly even if the platform defines DLT_RAW, say, as something other
than 101.  If that code also checks for DLT_RAW - which means it can't
just use a switch statement, as DLT_RAW might be defined as 101 if the
platform doesn't itself define DLT_RAW with some other value - then it
will also handle old DLT_RAW captures, as long as they were made on the
same platform or on another platform that used the same value for
DLT_RAW.  It can't handle captures from a platform that uses that value
for another DLT_ code, but that's always been the case, and isn't easily
fixable.)

The intent here is to decouple the values that are returned by
"pcap_datalink()" and put into the header of tcpdump/libpcap save files
from the DLT_ values returned by BIOCGDLT in BSD kernels, allowing the
BSDs to assign values to DLT_ codes, in their kernels, as they choose,
without creating more incompatibilities between tcpdump/libpcap save
files from different platforms.
2000-09-17 04:04:36 +00:00
guy 74ab49bec1 Add comments telling people not to gratuitously change the capture file
format (file header or per-packet header format, or interpretation of
any of the fields in those headers) without getting a new magic number
from "tcpdump-workers@tcpdump.org", and to make sure that libpcap can
still read files with the existing magic numbers, not just files with
the new magic number and record formats.

(There have been at least three libpcap changes I know of that have
changed the header formats, or the interpretation of fields in those
headers, without changing the magic number.  I would like not to ever
have any other such changes happen ever again.)
2000-09-14 09:49:28 +00:00
itojun 549c0b2c89 repair argument mismatch to malloc().
From: Uwe Girlich <Uwe.Girlich@philosys.de>
To: Ethereal Development List <ethereal-dev@zing.org>
Subject: [ethereal-dev] libpcap
2000-09-06 07:40:03 +00:00
fenner 9700d14e7b Regenerate. 2000-08-16 20:30:46 +00:00
fenner af62365a17 Add a check for lame lex and fail with an error message recommending flex. 2000-08-16 20:28:52 +00:00
torsten d8d8ac33c8 Changed the indention of pcap-linux.c to match with the other source
files of libpcap.
2000-08-13 21:25:26 +00:00
torsten 6bc711849d Stopped pcap_close from closing stdin. I don't see why somebody would
want to close that file apart from becoming a daemon. Thanks to
Don Talsma for pointing this out.
2000-08-13 10:33:14 +00:00
guy 5c220490cb Change the message issued on HP-UX if we can't find the PPA for a
network device, so that

	1) you can infer from the message whether the program is using
	   the old version of the code to get the PPA (which didn't work
	   all that well) or the newer version, without having to prod a
	   user complaining about tcpdump/Ethereal/whatever not working
	   to tell you which version of libpcap they're using;

	2) programs can perhaps check the error message returned by
	   libpcap and, if it's the old error message, tell the user
	   that the problem may be that they're using an old libpcap.
2000-08-13 06:56:05 +00:00
torsten 64c7184aa6 Fixed the BPF compiler for Linux. The BPF code used to truncate the
packets after the snaplen. On Linux this hinders us from inquiring
the original packet size so I removed that feature for Linux builds.
2000-08-06 01:22:39 +00:00
torsten c2c579d32b Updated the comment on the MSG_TRUNC problem in connection with the Linux
packet filter. Work around to come.
2000-08-04 18:35:48 +00:00
assar 407e3aaf67 regenerated from configure.in 2000-07-30 10:50:22 +00:00
assar c972305a1f bring a little bit more uptodate 2000-07-30 06:01:22 +00:00
assar e5db17becd use common names for directories
use INSTALL_PROGRAM/INSTALL_DATA
2000-07-30 05:56:49 +00:00
guy ef67d43d46 Change my address to my mail-forwarding address; "any problem in
computer science can be solved by adding a layer of indirection".
2000-07-30 05:28:24 +00:00
guy 763e372b7e Fix the names in the entries in the credits for Alexey Kuznetsov and
Fulvio Risso.
2000-07-30 05:20:13 +00:00
assar ccd074109a try fetch names from CVS logs and adding here 2000-07-29 10:16:08 +00:00
assar 6dc5bf2601 replace bzero with memset 2000-07-29 08:03:56 +00:00
assar 6019517c9b ISLOOPBACK_IFA: add
(pcap_lookupdev): handle device names without numbers.  based on a
patch from Rafal Maszkowski <rzm@icm.edu.pl>
2000-07-29 07:42:48 +00:00
guy 84f822f4d8 Pick up, from the FreeBSD libpcap, changes to surround all declarations with
#ifdef __cplusplus
	extern "C" {
	#endif

		...

	#ifdef __cplusplus
	}
	#endif

so that C++ code can include these header files and correctly call the
C-language routines they declare.
2000-07-29 07:36:41 +00:00
assar 84f2cb311c remove owner/group from installs 2000-07-29 07:20:24 +00:00
assar 662b2c32d8 (install): install everything
(uninstall): add
(force): remove
2000-07-29 07:05:20 +00:00
guy 099d57bfe9 Give it an SCCS/RCS ID.
Update the date.

Fix a couple of typos.
2000-07-25 06:20:37 +00:00
guy c8c2e7e65b Token Ring support, from various patches. Also add "tr" as an alias for
"ether", "fddi", "link", etc..
2000-07-25 05:50:08 +00:00
guy 884ed98aed Add support for reading capture files from programs using Alexey
Kuznetzov's patched version of libpcap; we ignore the additional fields
it adds to the per-packet header.  Red Hat Linux 6.2 uses that patched
version, and some other Linux distributions might do so as well.

(This won't handle an early version of his patch, which changed the
per-packet header but didn't change the magic number; that early version
appears in Red Hat Linux 6.1.

Doing that requires a heuristic test, wherein we assume the file is
standard libpcap and try to read the first and second records, and, if
the header of the second record looks like garbage, assume that the file
came from that early version, and that we're therefore reading random
packet data when we think we're reading the header of the second packet.

As we don't then want to seek back to the first packet, because we want
to continue to allow libpcap-based programs such as tcpdump to read from
pipes, we'd have to buffer data from the file so that we can go back and
re-read it.  I leave this for later.)
2000-07-18 03:43:47 +00:00
guy 9862176baf Add CREDITS and README.aix to the list of files in the tarball.
Don't put the entire SUNOS4 directory into the tarball, as that may drag
in the CVS directories; instead, put in the files that actually belong
there.

Put "config.h.in" into the list in sort order.
2000-07-16 19:46:02 +00:00
guy 869687bc29 Include "config.h.in" in "FILES", as it needs to be a part of the source
tarball.
2000-07-16 19:18:01 +00:00
guy 3c3e2686ab Remove "lbl/gnuc.h" from the list of files in "FILES", as it's no longer
part of the libpcap source.
2000-07-16 19:10:07 +00:00
guy 28d89246f2 As "make tar" runs tar with a list of files to include in the tarball,
the classic BSD "F" flag, which tells it to *exclude* certain files, is
unnecessary; furthermore, some versions of tar may not support it, and
GNU tar, as appears in FreeBSD and perhaps other BSDs, and in Linux,
interprets the "F" flag as meaning "run, at the end of each archive
volume, the script whose name is given as an argument to the flag", so
it's not even syntactically compatible with the classic "F" flag.

The latter problem causes "make tar" to fail; we remove the "F" flags to
fix the problem.
2000-07-16 19:08:29 +00:00
guy 1ee8ddb3d4 Only turn BIOCIMMEDIATE mode on in AIX, not on other OSes with BPF such
as the various BSDs, and put in a comment explaining this.
2000-07-14 06:25:49 +00:00
guy ef8aca6eb3 Pick up the v0.5 changelog items, and delete the equivalent time-stamped
items.

Add some time-stamped items (more to come).
2000-07-14 02:35:03 +00:00
guy ab1c0634f4 libpcap doesn't use <sys/ioccom.h>, but the test program in
"AC_LBL_FIXINCLUDES" does, so we have to check for it, otherwise the
configure script fails on, among other platforms, Solaris.
2000-07-14 02:12:36 +00:00
guy 0d0297bdd1 Older versions of Flex (e.g., 2.5.2, which at least one user had) dump
core if the YY_FLUSH_BUFFER macro is called when there's no current
buffer (e.g., before any scanning has been done).

So, instead, when using Flex, we use "yy_scan_string()" to specify that
the scanner should read from the filter expression string, rather than
defining our own YY_INPUT macro, and we add a "lex_cleanup()" routine,
called after parsing is complete, to delete the buffer allocated by
"yy_scan_string()", which arranges that, when we next hand the scanner a
string, it doesn't then return to the parser cruft left over from the
previous parse.
2000-07-13 06:51:56 +00:00
guy e7039d24f4 Merge in changes from the libpcap 0.5 branch:
Update to note that non-patch mail should be sent to
	"tcpdump-workers@tcpdump.org", and that patches should be sent to
	"patches@tcpdump.org".
2000-07-13 06:24:14 +00:00
assar f4ab57be13 (pcap_open_live): rewrite BIOCSBLEN loop as a for(). from Guy Harris <gharris@flashcom.net> 2000-07-11 23:02:51 +00:00
assar b113d4f386 (pcap_open_live): repair BIOCSBLEN loop. from Guy Harris <gharris@flashcom.net> 2000-07-11 23:00:05 +00:00
assar 855d5eab07 conditionalize on USHRT_MAX and SOL_PACKET. From Love
<lha@stacken.kth.se>
2000-07-11 01:09:16 +00:00
assar b59cd6dc3c (MSG_TRUNC): define if it's not defined. From Love
<lha@stacken.kth.se>
2000-07-11 01:06:27 +00:00
assar 916c01aa0a not used any longer 2000-07-11 00:42:43 +00:00
assar d501922cfa regen 2000-07-11 00:38:47 +00:00
assar f1eb21451b add config.h. remove gnuc.h, use AC_DEFINE/3 to get strings into config.h.in 2000-07-11 00:38:19 +00:00
assar 0e2f8c8892 add config.h, remove gnuc.h. remove __dead 2000-07-11 00:37:04 +00:00
assar ca9f99af45 use AC_DEFINE/3 to get defines into config.h.in 2000-07-11 00:36:07 +00:00
assar 028f9db367 clarify error message
loop until buffer size is acceptable
BIOCIMMEDIATE: set if exists

based on patches from Darren Reed <darrenr@reed.wattle.id.au>
2000-07-10 04:50:05 +00:00
assar 26b4c53bde re-generated 2000-07-06 01:51:37 +00:00
assar cac15b82a8 add code for handling find the correct dlpi device on HP-UX 11.0
From: Guy Harris <gharris@flashcom.net>
2000-07-06 01:50:36 +00:00
assar be5b659ebf use snprintf instead of sprintf. From Juergen Schoenwaelder
<schoenw@ibr.cs.tu-bs.de>
2000-07-04 12:24:01 +00:00
itojun acc7a22687 re-correct fallback strlcpy(). do not choke on z == 0. 2000-07-04 00:22:03 +00:00
itojun 8cb4bb315b correct fallback strlcpy() macro. 2000-07-04 00:10:47 +00:00