1 .TH IPQ_SET_MODE 3 "16 October 2001" "Linux iptables 1.2" "Linux Programmer's Manual"
3 .\" $Id: ipq_set_mode.3 1041 2001-10-16 14:41:02Z 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_set_mode - set the ip_queue queuing mode
25 .B #include <linux/netfilter.h>
27 .B #include <libipq.h>
29 .BI "int ipq_set_mode(const struct ipq_handle *" h ", u_int8_t " mode ", size_t " range );
33 function sends a message to the kernel ip_queue module, specifying whether
34 packet metadata only, or packet payloads as well as metadata should be copied to
39 parameter is a context handle which must previously have been returned
40 successfully from a call to
41 .BR ipq_create_handle .
45 parameter must be one of:
48 Copy only packet metadata to userspace.
51 Copy packet metadata and packet payloads to userspace.
55 parameter is used to specify how many bytes of the payload to copy
56 to userspace. It is only valid for
58 mode and is otherwise ignored. The maximum useful value for
60 is 65535 (greater values will be clamped to this by ip_queue).
63 is usually used immediately following
65 to enable the flow of packets to userspace.
67 Note that as the underlying Netlink messaging transport is connectionless,
68 the ip_queue module does not know that a userspace application is ready to
69 communicate until it receives a message such as this.
71 On failure, -1 is returned.
73 On success, a non-zero positive value is returned.
75 On failure, a descriptive error message will be available
80 A relatively common failure may occur if the ip_queue module is not loaded.
81 In this case, the following code excerpt:
85 status = ipq_set_mode(h, IPQ_COPY_META, 0);
88 ipq_destroy_handle(h);
94 would generate the following output:
96 .I myapp: Failed to send netlink message: Connection refused
100 James Morris <jmorris@intercode.com.au>
102 Copyright (c) 2000-2001 Netfilter Core Team.
104 Distributed under the GNU General Public License.