Blame libipq/ipq_set_verdict.3

Packit Service d1fe03
.TH IPQ_SET_VERDICT 3 "16 October 2001" "Linux iptables 1.2" "Linux Programmer's Manual" 
Packit Service d1fe03
.\"
Packit Service d1fe03
.\"     Copyright (c) 2000-2001 Netfilter Core Team
Packit Service d1fe03
.\"
Packit Service d1fe03
.\"     This program is free software; you can redistribute it and/or modify
Packit Service d1fe03
.\"     it under the terms of the GNU General Public License as published by
Packit Service d1fe03
.\"     the Free Software Foundation; either version 2 of the License, or
Packit Service d1fe03
.\"     (at your option) any later version.
Packit Service d1fe03
.\"
Packit Service d1fe03
.\"     This program is distributed in the hope that it will be useful,
Packit Service d1fe03
.\"     but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service d1fe03
.\"     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service d1fe03
.\"     GNU General Public License for more details.
Packit Service d1fe03
.\"
Packit Service d1fe03
.\"     You should have received a copy of the GNU General Public License
Packit Service d1fe03
.\"     along with this program; if not, write to the Free Software
Packit Service d1fe03
.\"     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Packit Service d1fe03
.\"
Packit Service d1fe03
.\"
Packit Service d1fe03
.SH NAME
Packit Service d1fe03
ipq_set_verdict \(em issue verdict and optionally modified packet to kernel
Packit Service d1fe03
.SH SYNOPSIS
Packit Service d1fe03
.B #include <linux/netfilter.h>
Packit Service d1fe03
.br
Packit Service d1fe03
.B #include <libipq.h>
Packit Service d1fe03
.sp
Packit Service d1fe03
.BI "int ipq_set_verdict(const struct ipq_handle *" h ", ipq_id_t " id ", unsigned int " verdict ", size_t " data_len ", unsigned char *" buf ");"
Packit Service d1fe03
.SH DESCRIPTION
Packit Service d1fe03
The
Packit Service d1fe03
.B ipq_set_verdict
Packit Service d1fe03
function issues a verdict on a packet previously obtained with
Packit Service d1fe03
.BR ipq_read ,
Packit Service d1fe03
specifing the intended disposition of the packet, and optionally
Packit Service d1fe03
supplying a modified version of the payload data.
Packit Service d1fe03
.PP
Packit Service d1fe03
The
Packit Service d1fe03
.I h
Packit Service d1fe03
parameter is a context handle which must previously have been returned 
Packit Service d1fe03
successfully from a call to
Packit Service d1fe03
.BR ipq_create_handle .
Packit Service d1fe03
.PP
Packit Service d1fe03
The
Packit Service d1fe03
.I id
Packit Service d1fe03
parameter is the packet identifier obtained via
Packit Service d1fe03
.BR ipq_get_packet .
Packit Service d1fe03
.PP
Packit Service d1fe03
The
Packit Service d1fe03
.I verdict
Packit Service d1fe03
parameter must be one of:
Packit Service d1fe03
.TP
Packit Service d1fe03
.B NF_ACCEPT
Packit Service d1fe03
Accept the packet and continue traversal within the kernel.
Packit Service d1fe03
.br
Packit Service d1fe03
.TP
Packit Service d1fe03
.B NF_DROP
Packit Service d1fe03
Drop the packet.
Packit Service d1fe03
.TP
Packit Service d1fe03
\fBNF_QUEUE\fP
Packit Service d1fe03
Requeue the packet.
Packit Service d1fe03
.PP
Packit Service d1fe03
\fBNF_STOLEN\fP and \fBNF_REPEAT\fP are kernel-internal constants and should
Packit Service d1fe03
not be used from userspace as their exact side effects have not been
Packit Service d1fe03
investigated.
Packit Service d1fe03
.PP
Packit Service d1fe03
The
Packit Service d1fe03
.I data_len
Packit Service d1fe03
parameter is the length of the data pointed to
Packit Service d1fe03
by
Packit Service d1fe03
.IR buf ,
Packit Service d1fe03
the optional replacement payload data.
Packit Service d1fe03
.PP
Packit Service d1fe03
If simply setting a verdict without modifying the payload data, use zero
Packit Service d1fe03
for
Packit Service d1fe03
.I data_len
Packit Service d1fe03
and NULL for
Packit Service d1fe03
.IR buf .
Packit Service d1fe03
.PP
Packit Service d1fe03
The application is responsible for recalculating any packet checksums
Packit Service d1fe03
when modifying packets.
Packit Service d1fe03
.SH RETURN VALUE
Packit Service d1fe03
On failure, \-1 is returned.
Packit Service d1fe03
.br
Packit Service d1fe03
On success, a non-zero positive value is returned.
Packit Service d1fe03
.SH ERRORS
Packit Service d1fe03
On error, a descriptive error message will be available
Packit Service d1fe03
via the
Packit Service d1fe03
.B ipq_errstr
Packit Service d1fe03
function.
Packit Service d1fe03
.SH BUGS
Packit Service d1fe03
None known.
Packit Service d1fe03
.SH AUTHOR
Packit Service d1fe03
James Morris <jmorris@intercode.com.au>
Packit Service d1fe03
.SH COPYRIGHT
Packit Service d1fe03
Copyright (c) 2000-2001 Netfilter Core Team.
Packit Service d1fe03
.PP
Packit Service d1fe03
Distributed under the GNU General Public License.
Packit Service d1fe03
.SH SEE ALSO
Packit Service d1fe03
.BR iptables (8),
Packit Service d1fe03
.BR libipq (3).
Packit Service d1fe03