1 .TH IPQ_READ 3 "16 October 2001" "Linux iptables 1.2" "Linux Programmer's Manual"
3 .\" $Id: ipq_read.3 1042 2001-10-16 16:58:25Z jamesm $
5 .\" Copyright (c) 2000-2001 Netfilter Core Team
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.
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.
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.
23 ipq_read - read queue messages from ip_queue and read into supplied buffer
25 .B #include <linux/netfilter.h>
27 .B #include <libipq.h>
29 .BI "ssize_t ipq_read(const struct ipq_handle *" h ", unsigned char *" buf ", size_t " len ", int " timeout ");"
33 function reads a queue message from the kernel and copies it to
34 the memory pointed to by
36 to a maximum length of
41 parameter is a context handle which must previously have been returned
42 successfully from a call to
43 .BR ipq_create_handle .
45 The caller is responsible for ensuring that the memory pointed to by
47 is large enough to contain
53 parameter may be used to set a timeout for the operation, specified in microseconds.
54 This is implemented internally by the library via the
56 system call. A value of zero provides normal, backwards-compatible blocking behaviour
57 with no timeout. A negative value causes the function to return immediately.
61 should not be accessed directly. Use the
62 .BR ipq_message_type ,
63 .BR ipq_get_packet ", and"
65 functions to access the queue message in the buffer.
67 On failure, -1 is returned.
69 On success, a non-zero positive value is returned when no timeout
72 On success with a timeout value specified, zero is returned if no data
73 was available to read, or if a non-blocked signal was caught. In the
74 latter case, the global
79 On error, a descriptive error message will be available
86 function may return successfully, the queue message copied to the buffer
87 may itself be an error message from a higher level kernel component. Use
89 to determine if it is an error message, and
91 to access the value of the message.
95 James Morris <jmorris@intercode.com.au>
97 Copyright (c) 2000-2001 Netfilter Core Team.
99 Distributed under the GNU General Public License.
101 Joost Remijn implemented the timeout feature, which appeared in the 1.2.4 release of iptables.