summaryrefslogtreecommitdiff
path: root/share/man
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2015-02-07 02:30:29 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2015-02-07 02:30:29 +0000
commit697eadc3047d9566d5252da81a73d6bb2bd656a7 (patch)
tree683271f8a047f813943279bf24e151ecbee504ba /share/man
parent6a872cb91fb60e8719a83c90b61ae24413498e4a (diff)
try and document ml_filter and mq_filter.
Diffstat (limited to 'share/man')
-rw-r--r--share/man/man9/mbuf.964
1 files changed, 62 insertions, 2 deletions
diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9
index 0f3516094ab..836adecd5d7 100644
--- a/share/man/man9/mbuf.9
+++ b/share/man/man9/mbuf.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mbuf.9,v 1.79 2015/02/01 03:32:32 lteo Exp $
+.\" $OpenBSD: mbuf.9,v 1.80 2015/02/07 02:30:28 dlg Exp $
.\"
.\" Copyright (c) 2001 Jean-Jacques Bernard-Gundol <jjbg@openbsd.org>
.\" All rights reserved.
@@ -25,7 +25,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: February 1 2015 $
+.Dd $Mdocdate: February 7 2015 $
.Dt MBUF 9
.Os
.Sh NAME
@@ -119,6 +119,12 @@
.Fn "ml_dequeue" "struct mbuf_list *ml"
.Ft struct mbuf *
.Fn "ml_dechain" "struct mbuf_list *ml"
+.Ft struct mbuf *
+.Fo ml_filter
+.Fa "struct mbuf_list *ml"
+.Fa "int (*filter)(void *, struct mbuf *)"
+.Fa "void *context"
+.Fc
.Ft unsigned int
.Fn "ml_len" "struct mbuf_list *ml"
.Ft int
@@ -137,6 +143,12 @@
.Fn "mq_delist" "struct mbuf_queue *mq" "struct mbuf_list *ml"
.Ft struct mbuf *
.Fn "mq_dechain" "struct mbuf_queue *mq"
+.Ft struct mbuf *
+.Fo mq_filter
+.Fa "struct mbuf_queue *mq"
+.Fa "int (*filter)(void *, struct mbuf *)"
+.Fa "void *context"
+.Fc
.Ft unsigned int
.Fn "mq_len" "struct mbuf_queue *mq"
.Ft int
@@ -780,6 +792,25 @@ mbuf list.
Dequeues all mbufs from the
.Fa ml
mbuf list.
+.It Fo ml_filter
+.Fa "struct mbuf_list *ml"
+.Fa "int (*filter)(void *, struct mbuf *)"
+.Fa "void *context"
+.Fc
+Iterates over the mbufs on the
+.Fa ml
+mbuf list, passing each of them to the
+.Fa filter
+function.
+If the
+.Fa filter
+returns non-zero, the packet is removed from the
+.Fa ml
+mbuf list to be returned as part of an mbuf chain by
+.Fn ml_filter .
+.Fa context
+is passed as the first argument to each call of
+.Fa filter .
.It Fn "ml_len" "struct mbuf_list *ml"
Return the number of mbufs on the
.Fa ml
@@ -857,6 +888,25 @@ mbuf list.
Dequeue all mbufs from the
.Fa mq
mbuf queue.
+.It Fo mq_filter
+.Fa "struct mbuf_queue *mq"
+.Fa "int (*filter)(void *, struct mbuf *)"
+.Fa "void *context"
+.Fc
+Iterates over the mbufs on the
+.Fa mq
+mbuf queue, passing each of them to the
+.Fa filter
+function.
+If the
+.Fa filter
+returns non-zero, the packet is removed from the
+.Fa mq
+mbuf queue to be returned as part of an mbuf chain by
+.Fn mq_filter .
+.Fa context
+is passed as the first argument to each call of
+.Fa filter .
.It Fn "mq_len" "struct mbuf_queue *mq"
Return the number of mbufs on the
.Fa ml
@@ -919,6 +969,16 @@ If the list or queue was empty,
.Dv NULL
is returned.
.Pp
+.Fn ml_filter
+and
+.Fn mq_filter
+return the mbufs that were successfully matched by the filter
+function on the respective list or queue via a pointer to a chain
+of mbufs.
+If no packets matched the filter,
+.Dv NULL
+is returned.
+.Pp
.Fn ml_len
and
.Fn mq_len