summaryrefslogtreecommitdiff
path: root/pcap.3pcap.in
diff options
context:
space:
mode:
Diffstat (limited to 'pcap.3pcap.in')
-rw-r--r--pcap.3pcap.in51
1 files changed, 44 insertions, 7 deletions
diff --git a/pcap.3pcap.in b/pcap.3pcap.in
index cf15941210bc..80101403b2b6 100644
--- a/pcap.3pcap.in
+++ b/pcap.3pcap.in
@@ -17,7 +17,7 @@
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
-.TH PCAP 3PCAP "20 January 2017"
+.TH PCAP 3PCAP "25 July 2018"
.SH NAME
pcap \- Packet Capture library
.SH SYNOPSIS
@@ -181,7 +181,7 @@ negative value is unpredictable.
the packet buffer timeout cannot be used to cause calls that read
packets to return within a limited period of time, because, on some
platforms, the packet buffer timeout isn't supported, and, on other
-platforms, the timer doesn't start until at least one packet arrives.
+platforms, the timer doesn't start until at least one packet arrives.
This means that the packet buffer timeout should
.B NOT
be used, for example, in an interactive application to allow the packet
@@ -191,6 +191,10 @@ expires even if no packets have arrived.
.IP
The packet buffer timeout is set with
.BR pcap_set_timeout ().
+.IP "immediate mode"
+In immediate mode, packets are always delivered as soon as they arrive,
+with no buffering. Immediate mode is set with
+.BR pcap_set_immediate_mode ().
.IP "buffer size"
Packets that arrive for a capture are stored in a buffer, so that they
do not have to be read by the application as soon as they arrive. On
@@ -304,7 +308,7 @@ link-layer header whose contents can differ for different network
interfaces. To determine the format of the packets supplied by the
handle, call
.BR pcap_datalink ();
-.I http://www.tcpdump.org/linktypes.html
+.I https://www.tcpdump.org/linktypes.html
lists the values it returns and describes the packet formats that
correspond to those values.
.PP
@@ -396,7 +400,7 @@ set promiscuous mode for a not-yet-activated
.B pcap_t
for live capture
.TP
-.BR pcap_set_protocol (3PCAP)
+.BR pcap_set_protocol_linux (3PCAP)
set capture protocol for a not-yet-activated
.B pcap_t
for live capture (Linux only)
@@ -416,6 +420,11 @@ set packet buffer timeout for a not-yet-activated
.B pcap_t
for live capture
.TP
+.BR pcap_set_immediate_mode (3PCAP)
+set immediate mode for a not-yet-activated
+.B pcap_t
+for live capture
+.TP
.BR pcap_set_buffer_size (3PCAP)
set buffer size for a not-yet-activated
.B pcap_t
@@ -632,9 +641,28 @@ or other routines a platform offers to wait for any of a set of
descriptors to be ready to read. To obtain, for a handle, a descriptor
that can be used in those routines, call
.BR pcap_get_selectable_fd ().
+If the routine indicates that data is
+available to read on the descriptor, an attempt should be made to read
+from the device.
+.PP
Not all handles have such a descriptor available;
.BR pcap_get_selectable_fd ()
-will return \-1 if no such descriptor exists. In addition, for various
+will return
+.B PCAP_ERROR
+if no such descriptor is available. If no such
+descriptor is available, this may be because the device must be polled
+periodically for packets; in that case,
+.BR pcap_get_required_select_timeout ()
+will return a pointer to a
+.B struct timeval
+whose value can be used as a timeout in those routines. When the
+routine returns, an attmept should be made to read packets from the
+device. If
+.BR pcap_get_required_select_timeout ()
+returns NULL, no such timeout is available, and those routines cannot be
+used with the device.
+.PP
+In addition, for various
reasons, one or more of those routines will not work properly with the
descriptor; the documentation for
.BR pcap_get_selectable_fd ()
@@ -693,6 +721,15 @@ that can be used in calls such as
.BR select (2)
and
.BR poll (2)
+.TP
+.BR pcap_get_required_select_timeout (3PCAP)
+if no descriptor usable with
+.BR select (2)
+and
+.BR poll (2)
+is available for the
+.BR pcap_t ,
+attempt to get a timeout usable with those routines
.RE
.SS Filters
In order to cause only certain packets to be returned when reading
@@ -890,7 +927,7 @@ To get a string giving version information about libpcap, call
.BR pcap_lib_version (3PCAP)
get library version string
.RE
-.SH BACKWARDS COMPATIBILITY
+.SH BACKWARD COMPATIBILITY
.PP
In versions of libpcap prior to 1.0, the
.B pcap.h
@@ -934,7 +971,7 @@ Lawrence Berkeley National Laboratory, University of California, Berkeley, CA.
The current version is available from "The Tcpdump Group"'s Web site at
.LP
.RS
-.I http://www.tcpdump.org/
+.I https://www.tcpdump.org/
.RE
.SH BUGS
To report a security issue please send an e-mail to security@tcpdump.org.