Home | History | Annotate | only in /external/libpcap
Up to higher level directory
NameDateSize
acconfig.h31-Jul-2010303
aclocal.m431-Jul-201024.6K
Android.mk31-Jul-2010442
arcnet.h31-Jul-20102.5K
atmuni31.h31-Jul-20103.9K
bpf/31-Jul-2010
bpf_dump.c31-Jul-20102K
bpf_image.c31-Jul-20104.9K
CHANGES31-Jul-201017.8K
ChmodBPF/31-Jul-2010
CleanSpec.mk31-Jul-20102.2K
config.guess31-Jul-201041.9K
config.h31-Jul-20105.2K
config.h.in31-Jul-20104.8K
config.sub31-Jul-201030.1K
configure31-Jul-2010238.7K
configure.in31-Jul-201021.5K
CREDITS31-Jul-20104K
doc/31-Jul-2010
etherent.c31-Jul-20103.3K
ethertype.h31-Jul-20103.4K
fad-getad.c31-Jul-20108.3K
fad-gifc.c31-Jul-201016.3K
fad-glifc.c31-Jul-201010.3K
fad-null.c31-Jul-20102.6K
fad-win32.c31-Jul-20107.9K
ffs.h31-Jul-2010416
FILES31-Jul-20101.8K
gencode.c31-Jul-2010168.2K
gencode.h31-Jul-20109.4K
grammar.c31-Jul-201083.6K
grammar.y31-Jul-201013.1K
inet.c31-Jul-201019.5K
install-sh31-Jul-20105.5K
INSTALL.txt31-Jul-201016.1K
lbl/31-Jul-2010
LICENSE31-Jul-2010873
llc.h31-Jul-20102K
Makefile.in31-Jul-20107.2K
missing/31-Jul-2010
mkdep31-Jul-20102.3K
MODULE_LICENSE_BSD31-Jul-20100
nametoaddr.c31-Jul-201010.1K
nlpid.h31-Jul-20101.8K
NOTICE31-Jul-2010873
optimize.c31-Jul-201048.3K
packaging/31-Jul-2010
pcap-bpf.c31-Jul-201030.1K
pcap-bpf.h31-Jul-201025.4K
pcap-dag.c31-Jul-201025.8K
pcap-dag.h31-Jul-2010603
pcap-dlpi.c31-Jul-201046.7K
pcap-dos.c31-Jul-201034.3K
pcap-dos.h31-Jul-20106.8K
pcap-enet.c31-Jul-20104.9K
pcap-int.h31-Jul-201010.6K
pcap-linux.c31-Jul-201061.2K
pcap-namedb.h31-Jul-20103.3K
pcap-nit.c31-Jul-20108.8K
pcap-nit.h31-Jul-2010970
pcap-null.c31-Jul-20101.8K
pcap-pf.c31-Jul-201016.4K
pcap-pf.h31-Jul-2010969
pcap-septel.c31-Jul-20107.8K
pcap-septel.h31-Jul-2010573
pcap-snit.c31-Jul-201010.8K
pcap-snoop.c31-Jul-201011.7K
pcap-stdinc.h31-Jul-20102.2K
pcap-win32.c31-Jul-201018.9K
pcap.331-Jul-201035.3K
pcap.c31-Jul-201025.2K
pcap.h31-Jul-201010.8K
pcap1.h31-Jul-20109.3K
ppp.h31-Jul-20102.7K
README31-Jul-20103.7K
README.linux31-Jul-20103.7K
savefile.c31-Jul-201042.7K
scanner.c31-Jul-2010169.2K
scanner.l31-Jul-201010.2K
sll.h31-Jul-20105.4K
sunatmpos.h31-Jul-20102.2K
TODO31-Jul-20101.5K
tokdefs.h31-Jul-20105.3K
VERSION31-Jul-20106
version.c31-Jul-201031
version.h31-Jul-201067
wlan_filtering.patch31-Jul-201010.3K

README

      1 @(#) $Header: /tcpdump/master/libpcap/README,v 1.30 2004/10/12 02:02:28 guy Exp $ (LBL)
      2 
      3 LIBPCAP 0.9
      4 Now maintained by "The Tcpdump Group"
      5 See 		www.tcpdump.org
      6 
      7 Please send inquiries/comments/reports to 	tcpdump-workers (a] tcpdump.org
      8 
      9 Anonymous CVS is available via:
     10 	cvs -d :pserver:tcpdump (a] cvs.tcpdump.org:/tcpdump/master login
     11 	(password "anoncvs")
     12 	cvs -d :pserver:tcpdump (a] cvs.tcpdump.org:/tcpdump/master checkout libpcap
     13 
     14 Version 0.9 of LIBPCAP can be retrieved with the CVS tag "libpcap_0_9rel1":
     15 	cvs -d :pserver:tcpdump (a] cvs.tcpdump.org:/tcpdump/master checkout -r libpcap_0_9rel1 libpcap
     16 
     17 Please send patches against the master copy to patches (a] tcpdump.org.
     18 
     19 formerly from 	Lawrence Berkeley National Laboratory
     20 		Network Research Group <libpcap (a] ee.lbl.gov>
     21 		ftp://ftp.ee.lbl.gov/libpcap.tar.Z (0.4)
     22 
     23 This directory contains source code for libpcap, a system-independent
     24 interface for user-level packet capture.  libpcap provides a portable
     25 framework for low-level network monitoring.  Applications include
     26 network statistics collection, security monitoring, network debugging,
     27 etc.  Since almost every system vendor provides a different interface
     28 for packet capture, and since we've developed several tools that
     29 require this functionality, we've created this system-independent API
     30 to ease in porting and to alleviate the need for several
     31 system-dependent packet capture modules in each application.
     32 
     33 Note well: this interface is new and is likely to change.
     34 
     35 For some platforms there are README.{system} files that discuss issues
     36 with the OS's interface for packet capture on those platforms, such as
     37 how to enable support for that interface in the OS, if it's not built in
     38 by default.
     39 
     40 The libpcap interface supports a filtering mechanism based on the
     41 architecture in the BSD packet filter.  BPF is described in the 1993
     42 Winter Usenix paper ``The BSD Packet Filter: A New Architecture for
     43 User-level Packet Capture''.  A compressed PostScript version can be
     44 found at
     45 
     46 	ftp://ftp.ee.lbl.gov/papers/bpf-usenix93.ps.Z
     47 
     48 or
     49 
     50 	http://www.tcpdump.org/papers/bpf-usenix93.ps.Z
     51 
     52 and a gzipped version can be found at
     53 
     54 	http://www.tcpdump.org/papers/bpf-usenix93.ps.gz
     55 
     56 A PDF version can be found at
     57 
     58 	http://www.tcpdump.org/papers/bpf-usenix93.pdf
     59 
     60 Although most packet capture interfaces support in-kernel filtering,
     61 libpcap utilizes in-kernel filtering only for the BPF interface.
     62 On systems that don't have BPF, all packets are read into user-space
     63 and the BPF filters are evaluated in the libpcap library, incurring
     64 added overhead (especially, for selective filters).  Ideally, libpcap
     65 would translate BPF filters into a filter program that is compatible
     66 with the underlying kernel subsystem, but this is not yet implemented.
     67 
     68 BPF is standard in 4.4BSD, BSD/OS, NetBSD, FreeBSD, and OpenBSD.  DEC
     69 OSF/1/Digital UNIX/Tru64 UNIX uses the packetfilter interface but has
     70 been extended to accept BPF filters (which libpcap utilizes).  Also, you
     71 can add BPF filter support to Ultrix using the kernel source and/or
     72 object patches available in:
     73 
     74 	ftp://gatekeeper.dec.com/pub/DEC/net/bpfext42.tar.Z.
     75 
     76 Linux, in the 2.2 kernel and later kernels, has a "Socket Filter"
     77 mechanism that accepts BPF filters; see the README.linux file for
     78 information on configuring that option.
     79 
     80 Problems, bugs, questions, desirable enhancements, etc. should be sent
     81 to the address "tcpdump-workers (a] tcpdump.org".  Bugs, support requests,
     82 and feature requests may also be submitted on the SourceForge site for
     83 libpcap at
     84 
     85 	http://sourceforge.net/projects/libpcap/
     86 
     87 Source code contributions, etc. should be sent to the email address
     88 "patches (a] tcpdump.org", or submitted as patches on the SourceForge site
     89 for libpcap.
     90 
     91 Current versions can be found at www.tcpdump.org, or the SourceForge
     92 site for libpcap.
     93 
     94  - The TCPdump team
     95 

README.linux

      1 In order for libpcap to be able to capture packets on a Linux system,
      2 the "packet" protocol must be supported by your kernel.  If it is not,
      3 you may get error messages such as
      4 
      5 	modprobe: can't locate module net-pf-17
      6 
      7 in "/var/adm/messages", or may get messages such as
      8 
      9 	socket: Address family not supported by protocol
     10 
     11 from applications using libpcap.
     12 
     13 You must configure the kernel with the CONFIG_PACKET option for this
     14 protocol; the following note is from the Linux "Configure.help" file for
     15 the 2.0[.x] kernel:
     16 
     17 	Packet socket
     18 	CONFIG_PACKET
     19 	  The Packet protocol is used by applications which communicate
     20 	  directly with network devices without an intermediate network
     21 	  protocol implemented in the kernel, e.g. tcpdump. If you want them
     22 	  to work, choose Y. 
     23 
     24 	  This driver is also available as a module called af_packet.o ( =
     25 	  code which can be inserted in and removed from the running kernel
     26 	  whenever you want). If you want to compile it as a module, say M
     27 	  here and read Documentation/modules.txt; if you use modprobe or
     28 	  kmod, you may also want to add "alias net-pf-17 af_packet" to 
     29 	  /etc/modules.conf.
     30 
     31 and the note for the 2.2[.x] kernel says:
     32 
     33 	Packet socket
     34 	CONFIG_PACKET
     35 	  The Packet protocol is used by applications which communicate
     36 	  directly with network devices without an intermediate network
     37 	  protocol implemented in the kernel, e.g. tcpdump. If you want them
     38 	  to work, choose Y. This driver is also available as a module called
     39 	  af_packet.o ( = code which can be inserted in and removed from the
     40 	  running kernel whenever you want). If you want to compile it as a
     41 	  module, say M here and read Documentation/modules.txt.  You will
     42 	  need to add 'alias net-pf-17 af_packet' to your /etc/conf.modules
     43 	  file for the module version to function automatically.  If unsure,
     44 	  say Y.
     45 
     46 In addition, there is an option that, in 2.2 and later kernels, will
     47 allow packet capture filters specified to programs such as tcpdump to be
     48 executed in the kernel, so that packets that don't pass the filter won't
     49 be copied from the kernel to the program, rather than having all packets
     50 copied to the program and libpcap doing the filtering in user mode. 
     51 
     52 Copying packets from the kernel to the program consumes a significant
     53 amount of CPU, so filtering in the kernel can reduce the overhead of
     54 capturing packets if a filter has been specified that discards a
     55 significant number of packets.  (If no filter is specified, it makes no
     56 difference whether the filtering isn't performed in the kernel or isn't
     57 performed in user mode. :-))
     58 
     59 The option for this is the CONFIG_FILTER option; the "Configure.help"
     60 file says:
     61 
     62 	Socket filtering
     63 	CONFIG_FILTER
     64 	  The Linux Socket Filter is derived from the Berkeley Packet Filter.
     65 	  If you say Y here, user-space programs can attach a filter to any
     66 	  socket and thereby tell the kernel that it should allow or disallow
     67 	  certain types of data to get through the socket. Linux Socket
     68 	  Filtering works on all socket types except TCP for now. See the text
     69 	  file linux/Documentation/networking/filter.txt for more information.
     70 	  If unsure, say N.
     71 
     72 
     73 Statistics:
     74 Statistics reported by pcap are platform specific.  The statistics
     75 reported by pcap_stats on Linux are as follows:
     76 
     77 2.2.x
     78 =====
     79 ps_recv   Number of packets that were accepted by the pcap filter
     80 ps_drops  Always 0, this statistic is not gatherd on this platform
     81 
     82 2.4.x
     83 =====
     84 ps_rec    Number of packets that were accepted by the pcap filter
     85 ps_drops  Number of packets that had passed filtering but were not
     86           passed on to pcap due to things like buffer shortage, etc.
     87 			 This is useful because these are packets you are interested in
     88 			 but won't be reported by, for example, tcpdump output.
     89