summaryrefslogtreecommitdiff
path: root/pcap_loop.3pcap
diff options
context:
space:
mode:
Diffstat (limited to 'pcap_loop.3pcap')
-rw-r--r--pcap_loop.3pcap39
1 files changed, 23 insertions, 16 deletions
diff --git a/pcap_loop.3pcap b/pcap_loop.3pcap
index 15ad41012b40..0193714b885b 100644
--- a/pcap_loop.3pcap
+++ b/pcap_loop.3pcap
@@ -17,7 +17,7 @@
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
-.TH PCAP_LOOP 3PCAP "20 January 2017"
+.TH PCAP_LOOP 3PCAP "25 July 2018"
.SH NAME
pcap_loop, pcap_dispatch \- process packets from a live capture or savefile
.SH SYNOPSIS
@@ -47,7 +47,7 @@ processes packets from a live capture or ``savefile'' until
.I cnt
packets are processed, the end of the ``savefile'' is
reached when reading from a ``savefile'',
-.B pcap_breakloop()
+.B pcap_breakloop(3PCAP)
is called, or an error occurs.
It does
.B not
@@ -123,20 +123,20 @@ 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()
+.B pcap_datalink(3PCAP)
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
+.I https://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()
+.B pcap_set_datalink(3PCAP)
is called; after a successful call to
.BR pcap_set_datalink() ,
all subsequent packets will have a link-layer header of the type
@@ -160,8 +160,11 @@ for Ethernet.
returns 0 if
.I cnt
is exhausted or if, when reading from a ``savefile'', no more packets
-are available. It returns \-1 if an error occurs or \-2 if the loop
-terminated due to a call to
+are available. It returns
+.B PCAP_ERROR
+if an error occurs or
+.B PCAP_ERROR_BREAK
+if the loop terminated due to a call to
.B pcap_breakloop()
before any packets were processed.
It does
@@ -177,23 +180,27 @@ platforms that support a packet buffer timeout that starts before any
packets arrive, the timeout expires before any packets arrive, or if the
file descriptor for the capture device is in non-blocking mode and no
packets were available to be read) or if no more packets are available
-in a ``savefile.'' It returns \-1 if an error occurs or \-2 if the loop
-terminated due to a call to
+in a ``savefile.'' It returns
+.B PCAP_ERROR
+if an error occurs or
+.B PCAP_ERROR_BREAK
+if the loop terminated due to a call to
.B pcap_breakloop()
before any packets were processed.
.ft B
If your application uses pcap_breakloop(),
-make sure that you explicitly check for \-1 and \-2, rather than just
-checking for a return value < 0.
+make sure that you explicitly check for PCAP_ERROR and PCAP_ERROR_BREAK,
+rather than just checking for a return value < 0.
.ft R
.PP
-If \-1 is returned,
-.B pcap_geterr()
+If
+.B PCAP_ERROR
+is returned,
+.B pcap_geterr(3PCAP)
or
-.B pcap_perror()
+.B pcap_perror(3PCAP)
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_datalink(3PCAP)
+pcap(3PCAP)