1 .TH IPQ_SET_MODE 3 "16 October 2001" "Linux iptables 1.2" "Linux Programmer's Manual"
3 .\" Copyright (c) 2000-2001 Netfilter Core Team
5 .\" This program is free software; you can redistribute it and/or modify
6 .\" it under the terms of the GNU General Public License as published by
7 .\" the Free Software Foundation; either version 2 of the License, or
8 .\" (at your option) any later version.
10 .\" This program is distributed in the hope that it will be useful,
11 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
12 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 .\" GNU General Public License for more details.
15 .\" You should have received a copy of the GNU General Public License
16 .\" along with this program; if not, write to the Free Software
17 .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 ipq_set_mode \(em set the ip_queue queuing mode
23 .B #include <linux/netfilter.h>
25 .B #include <libipq.h>
27 .BI "int ipq_set_mode(const struct ipq_handle *" h ", u_int8_t " mode ", size_t " range );
31 function sends a message to the kernel ip_queue module, specifying whether
32 packet metadata only, or packet payloads as well as metadata should be copied to
37 parameter is a context handle which must previously have been returned
38 successfully from a call to
39 .BR ipq_create_handle .
43 parameter must be one of:
46 Copy only packet metadata to userspace.
49 Copy packet metadata and packet payloads to userspace.
53 parameter is used to specify how many bytes of the payload to copy
54 to userspace. It is only valid for
56 mode and is otherwise ignored. The maximum useful value for
58 is 65535 (greater values will be clamped to this by ip_queue).
61 is usually used immediately following
63 to enable the flow of packets to userspace.
65 Note that as the underlying Netlink messaging transport is connectionless,
66 the ip_queue module does not know that a userspace application is ready to
67 communicate until it receives a message such as this.
69 On failure, \-1 is returned.
71 On success, a non-zero positive value is returned.
73 On failure, a descriptive error message will be available
78 A relatively common failure may occur if the ip_queue module is not loaded.
79 In this case, the following code excerpt:
83 status = ipq_set_mode(h, IPQ_COPY_META, 0);
86 ipq_destroy_handle(h);
92 would generate the following output:
94 .I myapp: Failed to send netlink message: Connection refused
98 James Morris <jmorris@intercode.com.au>
100 Copyright (c) 2000-2001 Netfilter Core Team.
102 Distributed under the GNU General Public License.