blob: da99e54940da22cba38379295ec7d67af886a622 [file] [log] [blame]
James Morris460c7472001-10-16 14:41:02 +00001.TH IPQ_CREATE_HANDLE 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_create_handle.3,v 1.1 2000/11/20 14:13:31 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_create_handle, ipq_destroy_handle - create and destroy libipq handles.
24.SH SYNOPSIS
25.B #include <linux/netfilter.h>
26.br
27.B #include <libipq.h>
28.sp
29.BI "struct ipq_handle *ipq_create_handle(u_int32_t " flags );
30.br
31.BI "int ipq_destroy_handle(struct ipq_handle *" h );
32.SH DESCRIPTION
33The
34.B ipq_create_handle
35function initialises libipq for an application, attempts to bind to the
36Netlink socket used by ip_queue, and returns an opaque context handle. It
37should be the first libipq function to be called by an application. The
38handle returned should be used in all subsequent library calls which
39require a handle parameter.
40.PP
41The
42.I flags
43parameter is not currently used and should be set to zero by the application
44for forward compatibility.
45.PP
46The
47.B ipq_destroy_handle
48function frees up resources allocated by
49.BR ipq_create_handle ,
50and should be used when the handle is no longer required by the application.
51.SH RETURN VALUES
52On success,
53.B ipq_create_handle
54returns a pointer to a context handle.
55.br
56On failure, NULL is returned.
57.PP
58On success,
59.B ipq_destroy_handle
60returns zero.
61.br
62On failure, -1 is returned.
63.SH ERRORS
64On failure, a descriptive error message will be available
65via the
66.B ipq_errstr
67function.
68.SH BUGS
69None known.
70.SH AUTHOR
71James Morris <jmorris@intercode.com.au>
72.SH COPYRIGHT
James Morris460c7472001-10-16 14:41:02 +000073Copyright (c) 2000-2001 Netfilter Core Team.
James Morris949810c2000-11-20 14:13:31 +000074.PP
75Distributed under the GNU General Public License.
76.SH SEE ALSO
77.BR iptables (8),
78.BR libipq (3).