dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

911 Commits

Author SHA1 Message Date
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
risso 8106848e48 Added a check against a NULL pointer in pcap_inject_win32.
Added an explicit cast in pcap_inject_win32 to avoid a compilation warning
under Visual C.
2004-06-07 13:27:46 +00:00
guy b7875f7aec As noted by Rob Deker, we weren't checking the "i"th member of the DLT
list against DLT_EN10MB, we were comparing the list pointer against it.
2004-06-05 00:42:13 +00:00
guy 1610cc5db7 Fix the comment for DLT_NULL to reflect reality, as per FreeBSD PR 62272
(the change for which has been checked into FreeBSD's <net/bpf.h>).
2004-06-04 22:19:47 +00:00
guy e80b63b73e "sbh_drops" is cumulative, so we can't add it to the packet receive
count; instead, we add the cumulative drop count to the cumulative
receive count in the statistics we're returning.
2004-05-21 09:45:31 +00:00
guy dc95138209 Add the dropped packet count to the received packet count, so that the
counts work similarly to the way they work in BPF and 2.4 and later
Linux (and so that we don't run the risk of the dropped packet count
being bigger than the received packet count, which can result in dropped
packet percentages > 100).
2004-05-21 09:22:16 +00:00
risso e00313a3db Fixed a memory leak in pcap_lookupdev under Win32. 2004-04-30 09:13:51 +00:00
risso 3787448b64 Fixed a bug in pcap_findalldevs on Win32 that not initialized *alldevsp to NULL
if no adapters are present.
2004-04-30 09:12:42 +00:00
risso 5f53d2308e Modified pcap_findalldevs on Win32, so that it is able to properly handle an
indefinite number of adapters.
Before the buffer passed to PacketGetAdapterNames was limited to 8kB.
2004-04-30 08:58:52 +00:00
guy 076135f7df On non-HP-UX systems, if we fail to open "/dev/{if}" or "/dev/{if}N"
because neither of them exist, just report that there was no DLPI device
found for "{if}N", so people don't think that they need to fix libpcap
(or the program using it) to look somewhere else for the device - the
problem is probably that they're trying to capture on a loopback device
and the lack of any DLPI device is just a symptom of the fact that the
loopback device, at least on Solaris, appears not to support DLPI and
thus isn't supported by libpcap....
2004-04-23 05:19:04 +00:00
guy c4e76ddd83 Note that not all the addresses in the list of addresses are
necessarily IPv4 or IPv6 addresses, and that you must check the address
family before interpreting the address.
2004-04-20 20:42:36 +00:00
guy 60268b4b61 Add a note indicating that there are platforms where the source address
in the link-layer header is, on packets sent with "pcap_inject()",
changed to the address of the interface on which the packet is sent.
2004-04-09 21:16:44 +00:00
guy 1cd8c13e62 From Brian Ginsbach: squelch some compiler warnings. 2004-04-07 18:43:29 +00:00
guy 3a35ed338c From Brian Ginsbach: "dlt_list" is assigned a "u_int *" value, so make
it a "u_int *".
2004-04-07 18:41:00 +00:00
guy ffe68c0ab5 From Brian Ginsbach:
handle 65535-byte packets from the UNICOS/mp loopback interface;

	add a missing variable to "pcap_inject_snoop()".
2004-04-07 18:33:29 +00:00
guy 841b1f7f77 As per Mark Pizzolato, "sendto()" isn't necessary for sending packets,
at least on 2.2 and later kernels; the socket is bound (except for
sending on the "any" device, which we don't support), so a destination
address isn't necessary.

Generate the right error string for attempts to send on the "any"
device, and also disallow sends if we're in cooked mode.
2004-04-07 08:03:32 +00:00
guy 5b0754b7de Having gone through the trouble of creating "dl_doattach()", we might as
well use it....
2004-04-07 07:56:05 +00:00