IPQ_READ(3)

NAME
ipq_read - wait for queue messages from ip_queue and read into supplied buffer

SYNOPSIS
#include <linux/netfilter.h>
#include <libipq.h>

ssize_t ipq_read(const struct ipq_handle *h, unsigned char *buf, size_t len, int timeout);

DESCRIPTION
The ipq_read function waits for a queue message to arrive from the kernel and copies it to the memory pointed to by buf to a maximum length of len .

The h parameter is a context handle which must previously have been returned successfully from a call to ipq_create_handle .

The caller is responsible for ensuring that the memory pointed to by buf is large enough to contain len bytes.

The timeout parameter is not currently implemented.

Data returned via buf should not be accessed directly. Use the ipq_message_type, ipq_get_packet, and ipq_get_msgerr functions to access the queue message in the buffer.

RETURN VALUE
On failure, -1 is returned.
On success, a non-zero positive value is returned.

ERRORS
On error, a descriptive error message will be available via the ipq_errstr function.

DIAGNOSTICS
While the ipq_read function may return successfully, the queue message copied to the buffer may itself be an error message from a higher level kernel component. Use ipq_message_type to determine if it is an error message, and ipq_get_msgerr to access the value of the message.

TODO
Implement timeout as part of a non-blocking interface.

BUGS
None known.

AUTHOR
James Morris <jmorris@intercode.com.au>

COPYRIGHT
Copyright (c) 2000 Netfilter Core Team.

Distributed under the GNU General Public License.

SEE ALSO
iptables(8), libipq(3).