Commit Graph

120 Commits

Author SHA1 Message Date
dyoung 0ee313689a Fix bpf_open so that we can run tcpdump without write-access to
any of the /dev/bpf* device nodes.  In bpf_open, first try to open
each /dev/bpf* read-write; if that fails, try to open each read-only.
2005-06-10 19:00:09 +00:00
simonb 3cebd9325e White space nit- don't put a space before/after increment/decrement
operators.
2005-02-11 06:21:21 +00:00
lukem 7157011597 Only compile in IPv6 support if ${USE_INET6} != "no"
MKINET6 is for providing IPv6 infrastructure.
USE_INET6 is for compiling IPv6 support into the programs (needs MKINET6).
2005-01-10 02:58:58 +00:00
dyoung 81e590905d Bump minor version for libpcap 0.8.3 import.
Thanks Julian Coleman for pointing out my oversight.
2005-01-09 11:57:34 +00:00
christos 8d79e1b130 Use /dev/bpf. 2004-12-02 00:05:02 +00:00
he 1aba91b7c0 Move the conditional definition of offsetof() till after all the
headers have been included.  Fixes compile problem for vax.
2004-10-01 20:46:15 +00:00
wiz ab8bec093c Another formatting fix. 2004-09-28 09:36:14 +00:00
wiz 4f07b22d09 Some formatting fixes, and s/OpenBSD/.Ox/ s/FreeBSD/.Fx/. 2004-09-28 09:33:53 +00:00
wiz 867837f34d Remove trailing whitespace. 2004-09-28 09:31:13 +00:00
dyoung 4776f99384 Make newchunk() prototype match definition. 2004-09-28 06:35:38 +00:00
dyoung 9a9445f102 Commit stragglers. 2004-09-27 23:03:15 +00:00
dyoung c14b894413 Resolve conflicts in libpcap-0.8.3 import.
Remove some extraneous files.
2004-09-27 23:02:53 +00:00
dyoung 6c7d5c9634 Process the new files in libpcap 0.8.3.
Match the end-of-line after file extensions, so that *.[ch] files
with version numbers in their pathnames (e.g., libpcap-0.8.3/gencode.c)
do not match the manual-page regular expression.
2004-09-22 19:35:47 +00:00
dyoung 5c852952b0 Import libpcap 0.8.3 from tcpdump.org---getting it right this time, I hope. 2004-09-19 21:57:48 +00:00
dyoung 7e3909436f Import libpcap 0.8.3 from tcpdump.org 2004-09-19 21:31:39 +00:00
jrf 190b2e4c51 Replaced strncpy with strlcpy. Thanks to Peter Postma who
pointed them our in PR #25762. Approved by christos@NetBSD.org.
2004-09-07 13:20:39 +00:00
itojun 7a97c46b28 support format for if_pflog.c (new format only/old format not supported)
Peter Postma
2004-06-25 12:22:23 +00:00
jonathan f0d1f46d5b Do runtime dynamic binary-search for maximum obtainable bpf capture
size (via BIOCSBLEN). Obtained from FreeBSD 4.x; originally from
http://www.tcpdump.org's version of libpcap.

Taken verbatim from the FreeBSD 4.9 version, lint and all, other than
increasing the maximum size from 32Kibyte to an extremely generous
4Mibytes.  We assume root will configure the in-kernel maximum value
sensibly on small-memory machines.
2004-01-20 23:31:20 +00:00
christos 6f8e24d360 prevent double free. From OpenBSD 2003-11-24 21:49:12 +00:00
lukem a93ea220fc Rework how dependency generation is performed:
* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
  This is a change of behaviour.  If a Makefile wants the clean semantics
  it must specifically append to CLEANFILES.
  Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
  that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d  depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
2003-08-01 17:03:41 +00:00
wiz 472351e13d Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
2003-04-16 13:34:34 +00:00
perry 1f4ad37fe3 "Utilize" has exactly the same meaning as "use," but it is more
difficult to read and understand. Most manuals of English style
therefore say that you should use "use".
2003-02-05 00:02:24 +00:00
pooka 9659091d7a Take descriptions for pcap_file() and pcap_fileno() from libpcap-current
man page. The previous descriptions were horribly wrong.
2003-01-07 16:51:20 +00:00
pooka 77c102d728 add missing " 2003-01-03 12:50:44 +00:00
pooka 606c1fd1c5 pcap_next() returns a const u_char* 2003-01-02 15:43:15 +00:00
hannken 9417652b46 Add support for VLAN (IEEE 802.1Q) frames.
Built after libpcap-0.7 from tcpdump-3.7.1.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
2002-12-19 16:33:47 +00:00
thorpej 6ac6a2a09f Open the BPF file descriptor as read-write. Some pcap-using programs
(notably, simulators) expect to be able to send packets on the descriptor,
as well as receive.
2002-10-19 22:03:44 +00:00
wiz 57a4de98d0 New sentence, new line. From Robert Elz. 2002-10-01 19:26:58 +00:00
wiz 0dcd30151d Fix two typos, and bump Dd for recent additions. 2002-09-25 00:30:24 +00:00
thorpej bfd8b5c80d * Add support for DLT_IEEE802_11.
* When opening a live pcap, obtain the list of supported DLTs from
  the BPF.
* Add pcap_list_datalinks() to obtain a list of supported DLTs
  supported by the interface associated with the pcap descriptor.
* Add pcap_set_datalink() to set the current DLT of the pcap.
* Bump shlib 1.2 -> 1.3; new functions added.

From David Young <dyoung@ojctech.com>, with some minor changes by me.
2002-09-22 16:13:01 +00:00
thorpej d1f71ac3e2 Don't override the definition of LEX. 2002-09-14 14:59:30 +00:00
yamt d3538cc488 sync partly with tcpdump.org. ok'ed by itojun
patches #454 from yamt@mwd.biglobe.ne.jp
- avoid optimization involving subtract operations
- correct optimization of bitwise operations

TODO: re-introduce subtract optimization
2002-08-26 11:21:18 +00:00
lukem ebb6fc9eb8 Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc).
(Reduces make output by ~ 20%)
2002-08-19 09:41:27 +00:00
itojun 53ca62040c calloc() arg mistake. it's (nelem, size). from openbsd
sync w/tcpdump.org
2002-08-12 02:39:22 +00:00
wiz 9e98569eee Space before comment after #endif. 2002-05-16 19:57:22 +00:00
ross 814f296b77 Generate <>& symbolically. 2002-02-07 07:00:09 +00:00
lukem c1b95c0073 explicitly set to WARNS?=1 2001-11-05 15:22:23 +00:00
wiz b6d001fb58 Use .Dq for quoting, and fix a (double) typo and duplicate words.
Slight format improvement for errbuf.
2001-10-03 21:57:58 +00:00
wiz 331a133d4b Remove two unnecessary .Pps, and fix a xref. 2001-10-03 21:39:04 +00:00
gmcgarry 645f8fe35b mdoc'ify pcap.3 2001-10-03 20:58:31 +00:00
itojun 317eb9acd4 compile without INET6. PR 13080 2001-06-01 15:49:53 +00:00
martin c155aeac5f Adapt to (temporary) DLT_PPP_ETHER useage by the pppoe code in tree
now. This needs to be fixed when a generic PPP sheme is implemented.
2001-04-29 10:25:50 +00:00
itojun 4a7fa50e38 always write out and read in files using 32bit timeval.
(if you have files written by 64bit arch, sorry, we can't read
those... there's no magic number or anything like that)
sync with tcpdump.org change.
2001-02-07 17:35:56 +00:00
kleink 4b543c30e7 Add VRRP support. 2001-01-19 09:02:40 +00:00
christos f637fa6fd0 remove redundant declarations. 2001-01-06 02:11:18 +00:00
thorpej e9c2ed11fe Add names for some ICMP and TCP protocol header offsets:
- icmptype (offset of ICMP type field)
	- icmpcode (offset of ICMP code field)
	- tcpflags (offset of TCP flags field)
and field values:
	- icmp-echoreply, icmp-unreach, icmp-sourcequench,
	  icmp-redirect, icmp-echo, icmp-routeradvert,
	  icmp-routersolicit, icmp-timxceed, icmp-paramprob,
	  icmp-tstamp, icmp-tstampreply, icmp-ireq, icmp-ireqreply,
	  icmp-maskreq, icmp-maskreply
	- tcp-fin, tcp-syn, tcp-rst, tcp-push, tcp-ack, tcp-urg

This allows expressions like the following:

	icmp[0] = 3
	(tcp[13] & 0x02) != 0

to be written as:

	icmp[icmptype] = icmp-unreach
	(tcp[tcpflags] & tcp-syn) != 0

which is a bit more user-friendly for e.g. writing packet filter rules.
2000-12-28 22:12:07 +00:00
thorpej f3b5a7d293 Add support for the DLT_RAWAF() data link type. 2000-12-28 22:04:22 +00:00
itojun 4f72111370 re-introduce netbsd fix 1.5 -> 1.6, which was mistakenly removed.
pointed by Gui Harris.

---
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:18:03 +00:00
is e999d8013c Format string cleanups by sommerfeld. 2000-10-10 19:12:48 +00:00
itojun ffc3a749e5 we already have all fixes toward 0.4 (v0.4 Sat Jul 25 12:40:09 PDT 1998 -
note that there are MULTIPLE 0.4), so update version identification.
2000-10-08 14:28:05 +00:00