dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

877 Commits

Author SHA1 Message Date
guy 63f52c6dce If we don't have any support for packet capturing, don't bother
supplying a non-stub version of "pcap_findalldevs()", as a list of
devices won't do any good for a capture program.

Don't bother checking for "ifaddrs.h" unless we have "getifaddrs()" -
and if we have "getifaddrs()" but don't have a usable "ifaddrs.h",
report an error, rather than leaving the error for the compile stage.
2004-12-16 22:22:20 +00:00
guy b9974ec51a We don't call "getifaddrs()" in inet.c, so we don't need to include
<ifaddrs.h> in it.
2004-12-16 22:07:28 +00:00
guy efca1c6d92 Report short reads on the file header (as opposed to errors on it)
correctly.
2004-12-15 09:00:11 +00:00
guy 3573dfdacc Put the FDDI padding (if any) into the pcap_t structure on platforms
that require it, and make pcap_fddipad private to the code generator, as
that's the only place that needs it (ideally, all *its* state should be
local as well).  This makes opening an FDDI device, on platforms where
the padding is supplied as part of the packet, and opening other types
of devices or opening savefiles in the same program work better, as you
don't have to be sure you compile the filter for a given pcap_t before
opening the next pcap_t.
2004-12-15 00:25:08 +00:00
guy eec5cdca82 The BPF code is generated using pcap_fddipad, so if we have to evaluate
it in userland, we should do so *before* skipping the padding.
2004-12-15 00:05:48 +00:00
guy 16aa6d8892 Don't skip the FDDI padding before running a filter in userland - the
filter code was generated assuming that the packet would be preceded by
FDDI padding, if any.
2004-12-14 23:55:30 +00:00
guy 8a3038c58e Strip off the FDDI padding on NetBSD before processing the packet. 2004-12-14 23:33:57 +00:00
guy 84819baa2b Add new DLT_ values and LINKTYPE_ values for G.7041/Y.1303 Generic
Framing Procedure, as per Dumas Hwang (dumas.hwang@navtelcom.com).
2004-12-09 19:03:36 +00:00
guy 1e5f231e7b New link-layer header type for raw GPRS LLC frames, as per a request by
Marc Hermstein <mhermstein@yahoo.com>.
2004-12-07 17:27:45 +00:00
guy 0b2386c1f1 Add some notes based on comments from Rick Jones. 2004-12-02 21:31:46 +00:00
guy 6dc4f10b78 From Dug Song <dugsong@monkey.org>: don't fetch the filter code until
we're about to apply the filter, so that if it's changed by a callback
routine, we get the current filter, rather than the one in effect when
we started the loop.
2004-11-30 10:51:41 +00:00
guy 43dd00e859 Expand some comments. 2004-11-14 03:10:33 +00:00
guy 987ca50c71 Shuffle comments around a bit. 2004-11-14 00:28:18 +00:00
guy 02017c865c Add some additional comments, and beef up some existing comments. 2004-11-13 22:32:42 +00:00
guy 597103eedc From Koryn Grant:
correctly detect a rare error condition and return a sensible
	error message instead of blindly continuing;

	clean up some endian-specific code.
2004-11-10 09:28:25 +00:00
guy cd5084b6f0 Regenerate. 2004-11-10 09:21:46 +00:00
guy 60d9468f45 From Koryn Grant: correctly detect and configure libpcap for both
2.4.x-series and and 2.5.x-series DAG software releases.
2004-11-09 18:32:22 +00:00
guy e67d61b9b3 Add a few comments, and shuffle the definition of NOP to keep the
definitions for register atoms together.

A conditional jump uses the X register as well as the A register if it's
comparing the A register against the X register rather than a constant;
handle that case when computing the set of registers used by a block.
2004-11-09 01:20:18 +00:00
guy 379d3179ed There are a bunch of optimizations we can only do in blocks that end
with jeq #x and that don't have a subsequent block that uses the value
the block leaves in the A register; make sure we only do them if the
last operation is a jeq with a constant operand and if nothing uses this
block's A register value.  (Some were being done with jeq x, and some
were done regardless of the branch that terminated the block and
regardless of whether the block's A register value is being used.)
2004-11-08 09:03:37 +00:00
guy 1e238b3877 If a block loads a value into the index register with a value different
from what it had on entry, we can't eliminate it, even if we don't use
the index register value.
2004-11-07 22:43:01 +00:00
guy cccbf10006 From Chris Lightfoot <cwrl@users.sourceforge.net>: add
"pcap_dump_fopen()" to open a pcap_t given a FILE *, and add
"pcap_dump_fopen()" to open a pcap_dumper_t given a FILE *.

On Windows, if we're opening the standard input, put it in binary mode.

Check for errors from "sf_write_header()" and return an error if we get
an error.
2004-11-07 21:40:48 +00:00
guy 1ab36e08d7 Fix a comment.
Clean up white space.
2004-11-06 22:57:28 +00:00
guy a1e08cec1e Move the code to generate code to check for a particular linktype in the
Linux cooked header into a routine of its own.
2004-11-06 22:45:17 +00:00
guy f9b1d9732a From Dean Gaudet <dean@arctic.org>: handle AF_PACKET addresses on OSes
that have them (Linux).
2004-11-04 07:26:04 +00:00
guy efaa1dd30a Update a comment about the AVS header.
Note that the previous checkin should have had the comment

The radiotap header isn't BSD-specific - it's also used by the madwifi
Atheros driver on Linux.
2004-10-29 02:15:08 +00:00
guy 4e3b0fdeba Have the usual three separate buffers for "format_text()", so that it
can be used multiple times in a single formatting call.
2004-10-29 02:00:59 +00:00
hannes 00384d8605 allocate DLT_ and LINKTYPE_ 167,168 for Juniper Networks, Inc. 2004-10-20 14:28:49 +00:00
hannes 3bcf07168c add support for DLT_JUNIPER_ATM1 (137) and DLT_JUNIPER_ATM2 (135) 2004-10-19 15:55:28 +00:00
guy e5aebee6d8 Add a "pcap_close_common()" routine which can be used as the close
routine for some pcap-XXX.c files and can be called by the close routine
in other pcap-XXX.c files.
2004-10-19 07:06:11 +00:00
guy 4b1ac36c83 Add an OS X startup item to set the permissions and/or ownership of the
BPF devices, and add a README.macosx file to explain how to install and
use that startup item.
2004-10-18 09:51:02 +00:00
guy 59f566ecfb Another update for the new version number. 2004-10-12 02:02:28 +00:00
guy 31ed797de2 Go with 0.9, not 1.0, for the next release. 2004-10-12 01:55:47 +00:00
guy 142bdc23c5 <strings.h> doesn't seem to be necessary on OS X, either, and, at least
from a look at the code, it's probably not necessary on any UN*X (and if
some header is needed, it should be the ANSI C <string.h>, not
<strings.h>).
2004-10-07 16:54:54 +00:00
risso 7fb5bd595f Added an #ifndef WIN32 around #include <strings.h> since this include file is
neither present nor necessary under MSVC6 (and cygwin).
2004-10-07 09:06:56 +00:00
guy cb55faad8f Rather than not turning the "use complete headers" flag on OS X, we
catch the error you get from unpatched OS X when you turn that flag on,
and, if we get that error, turn the flag off and try again.  This adapts
to systems that have been patched to make that flag work, and would also
adapt to Apple fixing that bug.
2004-10-05 07:23:39 +00:00
guy e49ca1f08b If we get an error trying to open a capture file, don't close the
capture file if the standard I/O stream is stdin (i.e., if the file name
was "-").  Thanks to Joshua Blanton <jblanton@masaka.cs.ohiou.edu> for
catching this one.
2004-09-28 01:09:52 +00:00
guy 82281a6f1e From Matthew Luckie <mjl@luckie.org.nz>: FreeBSD version numbers from
"uname()" end with "-RELEASE" (or "-CURRENT" or "-STABLE" or...), so
check the first 4 characters of the release number string for the
version number followed by "-".
2004-09-15 08:01:21 +00:00
guy c56022ef76 Not all Linuxes define ARPHRD_IRDA; define it if it's not defined. 2004-09-06 01:23:17 +00:00
guy 2ae5a9fc8c From Nicolas Dade <ndade@nsd.dyndns.org>: the VLAN tag is in the lower
12 bits of the VLAN field - check only those bits, not the priority or
CFI flag.
2004-08-27 07:37:10 +00:00
hannes 4017783b36 add support for another PPP variant as per request from Karsten Keil <kkeil@suse.de>
the first byte (0xff) of the PPP header (0xff03) is tweaked to accomodate
the direction 0x00 = IN, 0x01 = OUT

the DLT_ supports the libpcap tokens "inbound" and "outbound"
2004-08-18 14:25:01 +00:00
guy 3f7430de17 Add in another magic number, reserved for Francisco Mesquita
<francisco.mesquita@radiomovel.pt>.

Rename the Kuznetzov magic to note what it is, and add and expand some
comments.
2004-08-17 17:50:33 +00:00
guy 980745815d Do some error checking when extracting the unit number from a device
name.
2004-07-22 20:18:38 +00:00
guy a9a1d85832 (Try to) squelch some compiler warnings on HP-UX. 2004-07-20 21:18:56 +00:00
guy 481a4015c4 From Rick Jones:
fix a comment;

	fix references to the send-side file descriptor in
	"pcap_open_live()";

	"dlrawdatareq()"s caller reports the error - we just return what
	"putmsg()" returns, so the caller knows whether there was an
	error.
2004-07-20 21:10:57 +00:00
guy fa90431b10 Catch the case in "gen_mpls()" where "orig_nl" isn't -1, meaning
somebody's already used "vlan" or "mpls".
2004-07-15 00:08:06 +00:00
risso 1d57bb05f8 Corrected the definition of IN_EXPERIMENTAL (0xfxxxxxxx is the experimental space) 2004-07-06 23:45:29 +00:00
risso 6ec634f388 Fixed a memory leak in pcap_close_win32: p->Packet was not freed when
the adapter is closed.
2004-06-16 15:51:46 +00:00
hannes 4ce3baf349 bugfix: MPLS compare all (masked)32bits instead of just 16 2004-06-16 08:29:33 +00:00
hannes 405ab1a931 add baseline support for MPLS protocol and per-label filtering 2004-06-16 08:20:28 +00:00
guy 93306079a3 Add a DLT_ value and LINKTYPE_ value for BACnet MS/TP.
Clean up some white space.
2004-06-07 20:00:08 +00:00