dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

26 Commits

Author SHA1 Message Date
guy bdb178648a Add a little more information to a comment. 2005-04-04 08:42:18 +00:00
guy f8a76d1d76 From Gisle Vanem: MS-DOS support. 2004-12-18 08:52:08 +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 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 30e89f192a Add _U_ to "rcsid[]" definitions, to eliminate "unused variable"
warnings from newer versions of GCC.
2003-11-15 23:23:57 +00:00
guy 78da480204 From clodder@acm.org, via OpenBSD: add checks for memory allocation
failure.
2003-03-08 08:26: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
itojun 5918c491c1 whitespace cleanup 2002-06-11 17:04:44 +00:00
itojun f1183c9b15 tches #454 from yamt@mwd.biglobe.ne.jp
- avoid optimization involving subtract operations
- correct optimization of bitwise operations

TODO: re-introduce subtract optimization
2002-06-11 05:30:39 +00:00
guy fdaba9c2a6 <pcap.h> includes <sys/types.h> and <sys/time.h>; there's no need to
include it in these files, as they either include "pcap-int.h", which
includes <pcap.h>, or they include <pcap.h> directly.
2002-03-24 23:21:51 +00:00
fenner 5795b0ba56 Eliminate duplicate prototypes. 2001-11-12 22:04:23 +00:00
fenner cae054001c Optimize out "jset #0" (always false) and "jset #ffffffff" (always true). 2001-11-12 22:02:50 +00:00
fenner 98181e94fc Don't optimize away "sub #0" as it may be required to recognize
the code that is generated for e.g. 'icmp[0] > 0'.
2001-11-12 21:57:06 +00:00
fenner 26f0ba1e04 Add some optimizer debugging (not compiled by default) 2001-10-13 04:23:28 +00:00
itojun 20784fd22c netbsd 1.5 -> 1.6
Fix a hairy optimizer bug that causes the expression:
'ip and ((icmp and dst host 1.1.1.1 and not host 2.2.2.2) or (host 1.1.1.1 and src host 3.3.3.3))'
to compile incorrectly.  Details about to be mailed to LBL.
2000-11-19 13:37:20 +00:00
guy 8c16ead778 Fix from Jefferson Ogata <jogata@nodc.noaa.gov> - "count_stmts()" wasn't
counting any extra jumps required by a flowgraph node (the conditional
jump instructions have an 8-bit offset; if the target is more than 256
instructions away, we generate a nearby "jump always" to the target, and
jump to that instead).
2000-10-28 01:22:52 +00:00
guy 82547471f7 When attaching a "bpf_program" to a "pcap_t" to use as a userland
filter, always attach a copy, as "pcap-linux.c" does; that way, after a
program uses "pcap_setfilter()", it can safely use "pcap_freecode()" to
free up the BPF instructions allocated by "pcap_compile()".  Also,
always free it up when the "pcap_t" is closed.

Get rid of the "pcap_t *" argument to "pcap_freecode()", as it's not
necessary.

Document "pcap_freecode()", for the benefit of programs that might
repeatedly compile filter programs and attach them, so that they can
free them up after attaching them and avoid leaking memory for them.
2000-10-28 00:01:26 +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
assar 0e2f8c8892 add config.h, remove gnuc.h. remove __dead 2000-07-11 00:37:04 +00:00
itojun 20d9e08cde do not use sprintf(). always use snprintf().
from NetBSD/OpenBSD src/lib/libpcap.

use freeifaddrs() if exists.
2000-04-27 09:11:11 +00:00
itojun 7fe3c1111a IPv6 packet filtering code.
./configure --enable-ipv6 (requires getaddrinfo(3) and getnameinfo(3)).

TODO: make it work even without getaddrinfo(3) or getnameinfo(3)
(or, tcpdump/configure.in should provide alternative version by
AC_REPLACE_FUNCS)
TODO: make IPv6 filtering code work by default
TODO: make "protochain" friendly with optimization
1999-10-19 15:18:28 +00:00
mcr b11ddf8a9b Initial revision 1999-10-07 23:46:40 +00:00