blob: 62763ca44e23692eee5089b8d7dba46f2fed7c7f [file] [log] [blame]
James Morris949810c2000-11-20 14:13:31 +00001.TH IPQ_READ 3 "18 November 2000" "Linux iptables 1.1.3+" "Linux Programmer's Manual"
2.\"
3.\" $Id: $
4.\"
5.\" Copyright (c) 2000 Netfilter Core Team
6.\"
7.\" This program is free software; you can redistribute it and/or modify
8.\" it under the terms of the GNU General Public License as published by
9.\" the Free Software Foundation; either version 2 of the License, or
10.\" (at your option) any later version.
11.\"
12.\" This program is distributed in the hope that it will be useful,
13.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
14.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15.\" GNU General Public License for more details.
16.\"
17.\" You should have received a copy of the GNU General Public License
18.\" along with this program; if not, write to the Free Software
19.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20.\"
21.\"
22.SH NAME
23ipq_read - wait for queue messages from ip_queue and read into supplied buffer
24.SH SYNOPSIS
25.B #include <linux/netfilter.h>
26.br
27.B #include <libipq.h>
28.sp
29.BI "ssize_t ipq_read(const struct ipq_handle *" h ", unsigned char *" buf ", size_t " len ", int " timeout ");"
30.SH DESCRIPTION
31The
32.B ipq_read
33function waits for a queue message to arrive from the kernel and copies it to
34the memory pointed to by
35.I buf
36to a maximum length of
37. I len .
38.PP
39The
40.I h
41parameter is a context handle which must previously have been returned
42successfully from a call to
43.B ipq_create_handle .
44.PP
45The caller is responsible for ensuring that the memory pointed to by
46.I buf
47is large enough to contain
48.I len
49bytes.
50.PP
51The
52.I timeout
53parameter is not currently implemented.
54.PP
55Data returned via
56.I buf
57should not be accessed directly. Use the
58.BR ipq_message_type ,
59.BR ipq_get_packet ", and"
60.BR ipq_get_msgerr
61functions to access the queue message in the buffer.
62.SH RETURN VALUE
63On failure, -1 is returned.
64.br
65On success, a non-zero positive value is returned.
66.SH ERRORS
67On error, a descriptive error message will be available
68via the
69.B ipq_errstr
70function.
71.SH DIAGNOSTICS
72While the
73.B ipq_read
74function may return successfully, the queue message copied to the buffer
75may itself be an error message from a higher level kernel component. Use
76.B ipq_message_type
77to determine if it is an error message, and
78.B ipq_get_msgerr
79to access the value of the message.
80.SH TODO
81Implement
82.I timeout
83as part of a non-blocking interface.
84.SH BUGS
85None known.
86.SH AUTHOR
87James Morris <jmorris@intercode.com.au>
88.SH COPYRIGHT
89Copyright (c) 2000 Netfilter Core Team.
90.PP
91Distributed under the GNU General Public License.
92.SH SEE ALSO
93.BR iptables (8),
94.BR libipq (3).
95