xref: /netbsd/share/man/man9/accf_data.9 (revision 6550d01e)
1.\" $NetBSD: accf_data.9,v 1.5 2010/04/11 21:32:10 wiz Exp $
2.\"
3.\" Copyright (c) 2000 Alfred Perlstein
4.\"
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.\" $FreeBSD: src/share/man/man9/accf_data.9,v 1.8 2005/01/18 20:52:51 ru Exp $
28.\" "
29.Dd August 10, 2008
30.Dt ACCF_DATA 9
31.Os
32.Sh NAME
33.Nm accf_data
34.Nd buffer incoming connections until data arrives
35.Sh SYNOPSIS
36.Cd "options INET"
37.Cd "pseudo-device accf_data"
38.Sh DESCRIPTION
39This is a filter to be placed on a socket that will be using
40.Fn accept
41to receive incoming connections.
42.Pp
43It prevents the application from receiving the connected descriptor via
44.Fn accept
45until data arrives on the connection.
46.Sh EXAMPLES
47If the
48.Nm
49accept filter is present in the kernel configuration,
50this will enable the data accept filter
51on the socket
52.Fa sok .
53.Bd -literal -offset 0i
54	struct accept_filter_arg afa;
55
56	bzero(\*[Am]afa, sizeof(afa));
57	strcpy(afa.af_name, "dataready");
58	setsockopt(sok, SOL_SOCKET, SO_ACCEPTFILTER, \*[Am]afa, sizeof(afa));
59.Ed
60.Sh SEE ALSO
61.Xr setsockopt 2 ,
62.Xr accept_filter 9 ,
63.Xr accf_http 9
64.Sh HISTORY
65The accept filter mechanism and the
66.Nm
67filter were introduced in
68.Fx 4.0 .
69They were ported to
70.Nx
71by Coyote Point Systems and appeared in
72.Nx 5.0 .
73.Sh AUTHORS
74This manual page and the filter were written by
75.An Alfred Perlstein .
76