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