1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-03 03:59:02 +00:00

Update to libpcap 1.9.1 (initial commit, no Nmap-specific patches)

This commit is contained in:
dmiller
2019-11-19 17:53:36 +00:00
parent 42bb2feed8
commit f1107301e8
125 changed files with 7238 additions and 13624 deletions

View File

@@ -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,7 +123,7 @@ 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
@@ -136,7 +136,7 @@ lists the values
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)