aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcap_inject.3pcap14
-rw-r--r--pcap_loop.3pcap20
-rw-r--r--pcap_next_ex.3pcap11
-rw-r--r--pcap_set_datalink.3pcap8
-rw-r--r--pcap_setdirection.3pcap8
-rw-r--r--pcap_setfilter.3pcap8
-rw-r--r--pcap_setnonblock.3pcap7
-rw-r--r--pcap_stats.3pcap9
8 files changed, 55 insertions, 30 deletions
diff --git a/pcap_inject.3pcap b/pcap_inject.3pcap
index 6b4554e7..83eae1c3 100644
--- a/pcap_inject.3pcap
+++ b/pcap_inject.3pcap
@@ -17,7 +17,7 @@
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
-.TH PCAP_INJECT 3PCAP "25 July 2018"
+.TH PCAP_INJECT 3PCAP "5 March 2022"
.SH NAME
pcap_inject, pcap_sendpacket \- transmit a packet
.SH SYNOPSIS
@@ -74,16 +74,20 @@ comes from OpenBSD;
comes from WinPcap/Npcap. Both are provided for compatibility.)
.SH RETURN VALUE
.BR pcap_inject ()
-returns the number of bytes written on success and
+returns the number of bytes written on success,
+.B PCAP_ERROR_NOT_ACTIVATED
+if called on a capture handle that has been created but not activated, and
.B PCAP_ERROR
-on failure.
+on other errors.
.PP
.BR pcap_sendpacket ()
returns
.B 0
-on success and
+on success,
+.B PCAP_ERROR_NOT_ACTIVATED
+if called on a capture handle that has been created but not activated, and
.B PCAP_ERROR
-on failure.
+on other errors.
.PP
If
.B PCAP_ERROR
diff --git a/pcap_loop.3pcap b/pcap_loop.3pcap
index 3d741efa..0c595262 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 "22 August 2020"
+.TH PCAP_LOOP 3PCAP "5 March 2022"
.SH NAME
pcap_loop, pcap_dispatch \- process packets from a live capture or savefile
.SH SYNOPSIS
@@ -164,12 +164,15 @@ if
.I cnt
is exhausted or if, when reading from a ``savefile'', no more packets
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
.BR pcap_breakloop ()
-before any packets were processed.
+before any packets were processed,
+.B PCAP_ERROR_NOT_ACTIVATED
+if called on a capture handle that has been created but not activated,
+or
+.B PCAP_ERROR
+if another error occurs.
It does
.B not
return when live packet buffer timeouts occur; instead, it attempts to
@@ -184,12 +187,15 @@ 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
-.B PCAP_ERROR
-if an error occurs or
.B PCAP_ERROR_BREAK
if the loop terminated due to a call to
.BR pcap_breakloop ()
-before any packets were processed.
+before any packets were processed,
+.B PCAP_ERROR_NOT_ACTIVATED
+if called on a capture handle that has been created but not activated,
+or
+.B PCAP_ERROR
+if another error occurs.
.ft B
If your application uses pcap_breakloop(),
make sure that you explicitly check for PCAP_ERROR and PCAP_ERROR_BREAK,
diff --git a/pcap_next_ex.3pcap b/pcap_next_ex.3pcap
index 2bd1a427..4d2c43e8 100644
--- a/pcap_next_ex.3pcap
+++ b/pcap_next_ex.3pcap
@@ -17,7 +17,7 @@
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
-.TH PCAP_NEXT_EX 3PCAP "25 July 2018"
+.TH PCAP_NEXT_EX 3PCAP "5 March 2022"
.SH NAME
pcap_next_ex, pcap_next \- read the next packet from a pcap_t
.SH SYNOPSIS
@@ -120,12 +120,15 @@ if the packet was read without problems,
.B 0
if packets are
being read from a live capture and the packet buffer timeout expired,
-.B PCAP_ERROR
-if an error occurred while reading the packet, and
.B PCAP_ERROR_BREAK
if packets
are being read from a ``savefile'' and there are no more packets to read
-from the savefile. If
+from the savefile,
+.B PCAP_ERROR_NOT_ACTIVATED
+if called on a capture handle that has been created but not activated,
+or
+.B PCAP_ERROR
+if an error occurred while reading the packet. If
.B PCAP_ERROR
is returned,
.BR pcap_geterr (3PCAP)
diff --git a/pcap_set_datalink.3pcap b/pcap_set_datalink.3pcap
index 14e9d209..fd907913 100644
--- a/pcap_set_datalink.3pcap
+++ b/pcap_set_datalink.3pcap
@@ -17,7 +17,7 @@
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
-.TH PCAP_SET_DATALINK 3PCAP "25 July 2018"
+.TH PCAP_SET_DATALINK 3PCAP "5 March 2022"
.SH NAME
pcap_set_datalink \- set the link-layer header type to be used by a
capture device
@@ -40,9 +40,11 @@ to the type specified by
.BR pcap_set_datalink ()
returns
.B 0
-on success and
+on success,
+.B PCAP_ERROR_NOT_ACTIVATED
+if called on a capture handle that has been created but not activated, or
.B PCAP_ERROR
-on failure. If
+on other errors. If
.B PCAP_ERROR
is returned,
.BR pcap_geterr (3PCAP)
diff --git a/pcap_setdirection.3pcap b/pcap_setdirection.3pcap
index 7b388450..04278e84 100644
--- a/pcap_setdirection.3pcap
+++ b/pcap_setdirection.3pcap
@@ -17,7 +17,7 @@
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
-.TH PCAP_SETDIRECTION 3PCAP "25 July 2018"
+.TH PCAP_SETDIRECTION 3PCAP "5 March 2022"
.SH NAME
pcap_setdirection \- set the direction for which packets will be captured
.SH SYNOPSIS
@@ -59,9 +59,11 @@ This operation is not supported if a ``savefile'' is being read.
.BR pcap_setdirection ()
returns
.B 0
-on success and
+on success,
+.B PCAP_ERROR_NOT_ACTIVATED
+if called on a capture handle that has been created but not activated, or
.B PCAP_ERROR
-on failure. If
+on other errors. If
.B PCAP_ERROR
is returned,
.BR pcap_geterr (3PCAP)
diff --git a/pcap_setfilter.3pcap b/pcap_setfilter.3pcap
index 1e3c5a59..e063ae0e 100644
--- a/pcap_setfilter.3pcap
+++ b/pcap_setfilter.3pcap
@@ -17,7 +17,7 @@
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
-.TH PCAP_SETFILTER 3PCAP "25 July 2018"
+.TH PCAP_SETFILTER 3PCAP "5 March 2022"
.SH NAME
pcap_setfilter \- set the filter
.SH SYNOPSIS
@@ -42,9 +42,11 @@ struct, usually the result of a call to
.BR pcap_setfilter ()
returns
.B 0
-on success and
+on success,
+.B PCAP_ERROR_NOT_ACTIVATED
+if called on a capture handle that has been created but not activated, or
.B PCAP_ERROR
-on failure. If
+on other errors. If
.B PCAP_ERROR
is returned,
.BR pcap_geterr (3PCAP)
diff --git a/pcap_setnonblock.3pcap b/pcap_setnonblock.3pcap
index 65cfea28..f194b949 100644
--- a/pcap_setnonblock.3pcap
+++ b/pcap_setnonblock.3pcap
@@ -17,7 +17,7 @@
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
-.TH PCAP_SETNONBLOCK 3PCAP "25 July 2018"
+.TH PCAP_SETNONBLOCK 3PCAP "5 March 2022"
.SH NAME
pcap_setnonblock, pcap_getnonblock \- set or get the state of
non-blocking mode on a capture device
@@ -87,7 +87,10 @@ returns the current ``non-blocking'' state of the capture descriptor; it
always returns
.B 0
on ``savefiles''.
-If there is an error,
+If called on a capture handle that has been created but not activated,
+.B PCAP_ERROR_NOT_ACTIVATED
+is returned.
+If there is another error,
.B PCAP_ERROR
is returned and
.I errbuf
diff --git a/pcap_stats.3pcap b/pcap_stats.3pcap
index aa03013c..98be9bd7 100644
--- a/pcap_stats.3pcap
+++ b/pcap_stats.3pcap
@@ -17,7 +17,7 @@
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
-.TH PCAP_STATS 3PCAP "25 July 2018"
+.TH PCAP_STATS 3PCAP "5 March 2022"
.SH NAME
pcap_stats \- get capture statistics
.SH SYNOPSIS
@@ -85,9 +85,12 @@ that the interface did not drop any packets.
.BR pcap_stats ()
returns
.B 0
-on success and returns
+on success,
+.B PCAP_ERROR_NOT_ACTIVATED
+if called on a capture handle that has been created but not activated,
+or
.B PCAP_ERROR
-if there is an error or if
+if there is another error or if
.I p
doesn't support packet statistics. If
.B PCAP_ERROR