xref: /dflybsd-src/share/man/man9/accf_data.9 (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino.\"
286d7f5d3SJohn Marino.\" Copyright (c) 2000 Alfred Perlstein
386d7f5d3SJohn Marino.\"
486d7f5d3SJohn Marino.\" All rights reserved.
586d7f5d3SJohn Marino.\"
686d7f5d3SJohn Marino.\" Redistribution and use in source and binary forms, with or without
786d7f5d3SJohn Marino.\" modification, are permitted provided that the following conditions
886d7f5d3SJohn Marino.\" are met:
986d7f5d3SJohn Marino.\" 1. Redistributions of source code must retain the above copyright
1086d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer.
1186d7f5d3SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright
1286d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer in the
1386d7f5d3SJohn Marino.\"    documentation and/or other materials provided with the distribution.
1486d7f5d3SJohn Marino.\"
1586d7f5d3SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
1686d7f5d3SJohn Marino.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1786d7f5d3SJohn Marino.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1886d7f5d3SJohn Marino.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
1986d7f5d3SJohn Marino.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2086d7f5d3SJohn Marino.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2186d7f5d3SJohn Marino.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2286d7f5d3SJohn Marino.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2386d7f5d3SJohn Marino.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2486d7f5d3SJohn Marino.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2586d7f5d3SJohn Marino.\"
2686d7f5d3SJohn Marino.\" $FreeBSD: src/share/man/man9/accf_data.9,v 1.1.2.4 2001/08/17 13:08:54 ru Exp $
2786d7f5d3SJohn Marino.\"
2886d7f5d3SJohn Marino.Dd November 15, 2000
2986d7f5d3SJohn Marino.Dt ACCF_DATA 9
3086d7f5d3SJohn Marino.Os
3186d7f5d3SJohn Marino.Sh NAME
3286d7f5d3SJohn Marino.Nm accf_data
3386d7f5d3SJohn Marino.Nd buffer incoming connections until data arrives
3486d7f5d3SJohn Marino.Sh SYNOPSIS
3586d7f5d3SJohn Marino.Cd options INET
3686d7f5d3SJohn Marino.Cd options ACCEPT_FILTER_DATA
3786d7f5d3SJohn Marino.Li kldload accf_data
3886d7f5d3SJohn Marino.Sh DESCRIPTION
3986d7f5d3SJohn MarinoThis is a filter to be placed on a socket that will be using
4086d7f5d3SJohn Marino.Fn accept
4186d7f5d3SJohn Marinoto receive incoming connections.
4286d7f5d3SJohn Marino.Pp
4386d7f5d3SJohn MarinoIt prevents the application from receiving the connected descriptor via
4486d7f5d3SJohn Marino.Fn accept
4586d7f5d3SJohn Marinountil data arrives on the connection.
4686d7f5d3SJohn Marino.Pp
4786d7f5d3SJohn MarinoThe
4886d7f5d3SJohn Marino.Fa ACCEPT_FILTER_DATA
4986d7f5d3SJohn Marinokernel option is also a module that can be enabled at runtime via
5086d7f5d3SJohn Marino.Xr kldload 8
5186d7f5d3SJohn Marinoif the INET option has been compiled into the kernel.
5286d7f5d3SJohn Marino.Sh EXAMPLES
5386d7f5d3SJohn MarinoAssuming ACCEPT_FILTER_DATA has been included in the kernel config
5486d7f5d3SJohn Marinofile or the
5586d7f5d3SJohn Marino.Nm
5686d7f5d3SJohn Marinomodule has been loaded, this will enable the data accept filter
5786d7f5d3SJohn Marinoon the socket
5886d7f5d3SJohn Marino.Fa sok .
5986d7f5d3SJohn Marino.Bd -literal -offset 0i
6086d7f5d3SJohn Marino	struct accept_filter_arg afa;
6186d7f5d3SJohn Marino
6286d7f5d3SJohn Marino	bzero(&afa, sizeof(afa));
6386d7f5d3SJohn Marino	strcpy(afa.af_name, "dataready");
6486d7f5d3SJohn Marino	setsockopt(sok, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa));
6586d7f5d3SJohn Marino.Ed
6686d7f5d3SJohn Marino.Sh SEE ALSO
6786d7f5d3SJohn Marino.Xr setsockopt 2 ,
6886d7f5d3SJohn Marino.Xr accept_filter 9 ,
6986d7f5d3SJohn Marino.Xr accf_http 9
7086d7f5d3SJohn Marino.Sh HISTORY
7186d7f5d3SJohn MarinoThe accept filter mechanism and the
7286d7f5d3SJohn Marino.Nm
7386d7f5d3SJohn Marinofilter were introduced in
7486d7f5d3SJohn Marino.Fx 4.0 .
7586d7f5d3SJohn Marino.Sh AUTHORS
7686d7f5d3SJohn MarinoThis manual page and the filter were written by
7786d7f5d3SJohn Marino.An Alfred Perlstein .
78