diff options
author | Xin LI <delphij@FreeBSD.org> | 2015-01-06 18:58:31 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2015-01-06 18:58:31 +0000 |
commit | 50224b10fa4e157f09ee1cd03c790c9e61e76c5e (patch) | |
tree | 2a457967e5c853893b53d8dc147937913dcbd8fc /pcap_loop.3pcap | |
parent | 59ed76438047aa730b3a617abd873b84457fc4fd (diff) | |
download | src-test2-vendor/libpcap/1.6.2.tar.gz src-test2-vendor/libpcap/1.6.2.zip |
Diffstat (limited to 'pcap_loop.3pcap')
-rw-r--r-- | pcap_loop.3pcap | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/pcap_loop.3pcap b/pcap_loop.3pcap index 7e0b582baca3..d18dc06c28b8 100644 --- a/pcap_loop.3pcap +++ b/pcap_loop.3pcap @@ -1,5 +1,3 @@ -.\" @(#) $Header: /tcpdump/master/libpcap/pcap_loop.3pcap,v 1.4 2008-12-25 02:01:32 guy Exp $ -.\" .\" Copyright (c) 1994, 1996, 1997 .\" The Regents of the University of California. All rights reserved. .\" @@ -19,7 +17,7 @@ .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. .\" -.TH PCAP_LOOP 3PCAP "24 December 2008" +.TH PCAP_LOOP 3PCAP "13 October 2013" .SH NAME pcap_loop, pcap_dispatch \- process packets from a live capture or savefile .SH SYNOPSIS @@ -115,6 +113,41 @@ and the packet data are not to be freed by the callback routine, and are not guaranteed to be valid after the callback routine returns; if the code needs them to be valid after the callback, it must make a copy of them. +.PP +The bytes of data from the packet begin with a link-layer header. The +format of the link-layer header is indicated by the return value of the +.B pcap_datalink() +routine when handed the +.B pcap_t +value also passed to +.B pcap_loop() +or +.BR pcap_dispatch() . +.I http://www.tcpdump.org/linktypes.html +lists the values +.B pcap_datalink() +can return and describes the packet formats that +correspond to those values. The value it returns will be valid for all +packets received unless and until +.B pcap_set_datalink() +is called; after a successful call to +.BR pcap_set_datalink() , +all subsequent packets will have a link-layer header of the type +specified by the link-layer header type value passed to +.BR pcap_set_datalink() . +.PP +Do +.B NOT +assume that the packets for a given capture or ``savefile`` will have +any given link-layer header type, such as +.B DLT_EN10MB +for Ethernet. For example, the "any" device on Linux will have a +link-layer header type of +.B DLT_LINUX_SLL +even if all devices on the system at the time the "any" device is opened +have some other data link type, such as +.B DLT_EN10MB +for Ethernet. .SH RETURN VALUE .B pcap_loop() returns 0 if @@ -155,4 +188,5 @@ may be called with .I p as an argument to fetch or display the error text. .SH SEE ALSO -pcap(3PCAP), pcap_geterr(3PCAP), pcap_breakloop(3PCAP) +pcap(3PCAP), pcap_geterr(3PCAP), pcap_breakloop(3PCAP), +pcap_datalink(3PCAP) |