blob: 84a94119c63a74d29cacacca6724c66685b15276 [file] [log] [blame]
James Morris460c7472001-10-16 14:41:02 +00001.TH IPQ_SET_VERDICT 3 "16 October 2001" "Linux iptables 1.2" "Linux Programmer's Manual"
James Morris949810c2000-11-20 14:13:31 +00002.\"
James Morris460c7472001-10-16 14:41:02 +00003.\" $Id: ipq_set_verdict.3,v 1.1 2000/11/20 14:13:32 jamesm Exp $
James Morris949810c2000-11-20 14:13:31 +00004.\"
James Morris460c7472001-10-16 14:41:02 +00005.\" Copyright (c) 2000-2001 Netfilter Core Team
James Morris949810c2000-11-20 14:13:31 +00006.\"
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_set_verdict - issue verdict and optionally modified packet to kernel
24.SH SYNOPSIS
25.B #include <linux/netfilter.h>
26.br
27.B #include <libipq.h>
28.sp
29.BI "int ipq_set_verdict(const struct ipq_handle *" h ", ipq_id_t " id ", unsigned int " verdict ", size_t " data_len ", unsigned char *" buf ");"
30.SH DESCRIPTION
31The
32.B ipq_set_verdict
33function issues a verdict on a packet previously obtained with
34.BR ipq_read ,
35specifing the intended disposition of the packet, and optionally
36supplying a modified version of the payload data.
37.PP
38The
39.I h
40parameter is a context handle which must previously have been returned
41successfully from a call to
42.BR ipq_create_handle .
43.PP
44The
45.I id
46parameter is the packet identifier obtained via
47.BR ipq_get_packet .
48.PP
49The
50.I verdict
51parameter must be one of:
52.TP
53.B NF_ACCEPT
54Accept the packet and continue traversal within the kernel.
55.br
56.TP
57.B NF_DROP
58Drop the packet.
59.PP
60The
61.I data_len
62parameter is the length of the data pointed to
63by
64.IR buf ,
65the optional replacement payload data.
66.PP
67If simply setting a verdict without modifying the payload data, use zero
68for
69.I data_len
70and NULL for
71.IR buf .
72.PP
73The application is responsible for recalculating any packet checksums
74when modifying packets.
75.SH RETURN VALUE
76On failure, -1 is returned.
77.br
78On success, a non-zero positive value is returned.
79.SH ERRORS
80On error, a descriptive error message will be available
81via the
82.B ipq_errstr
83function.
84.SH BUGS
85None known.
86.SH AUTHOR
87James Morris <jmorris@intercode.com.au>
88.SH COPYRIGHT
James Morris460c7472001-10-16 14:41:02 +000089Copyright (c) 2000-2001 Netfilter Core Team.
James Morris949810c2000-11-20 14:13:31 +000090.PP
91Distributed under the GNU General Public License.
92.SH SEE ALSO
93.BR iptables (8),
94.BR libipq (3).
95