19d6bbf9bSAlfred Perlstein.\" 29d6bbf9bSAlfred Perlstein.\" Copyright (c) 2000 Alfred Perlstein 39d6bbf9bSAlfred Perlstein.\" 49d6bbf9bSAlfred Perlstein.\" All rights reserved. 59d6bbf9bSAlfred Perlstein.\" 69d6bbf9bSAlfred Perlstein.\" Redistribution and use in source and binary forms, with or without 79d6bbf9bSAlfred Perlstein.\" modification, are permitted provided that the following conditions 89d6bbf9bSAlfred Perlstein.\" are met: 99d6bbf9bSAlfred Perlstein.\" 1. Redistributions of source code must retain the above copyright 109d6bbf9bSAlfred Perlstein.\" notice, this list of conditions and the following disclaimer. 119d6bbf9bSAlfred Perlstein.\" 2. Redistributions in binary form must reproduce the above copyright 129d6bbf9bSAlfred Perlstein.\" notice, this list of conditions and the following disclaimer in the 139d6bbf9bSAlfred Perlstein.\" documentation and/or other materials provided with the distribution. 149d6bbf9bSAlfred Perlstein.\" 159d6bbf9bSAlfred Perlstein.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 169d6bbf9bSAlfred Perlstein.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 179d6bbf9bSAlfred Perlstein.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 189d6bbf9bSAlfred Perlstein.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 199d6bbf9bSAlfred Perlstein.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 209d6bbf9bSAlfred Perlstein.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 219d6bbf9bSAlfred Perlstein.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 229d6bbf9bSAlfred Perlstein.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 239d6bbf9bSAlfred Perlstein.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 249d6bbf9bSAlfred Perlstein.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 259d6bbf9bSAlfred Perlstein.\" " 269d6bbf9bSAlfred Perlstein.Dd November 15, 2000 275f95f24bSRuslan Ermilov.Dt ACCF_DATA 9 28aa12cea2SUlrich Spörlein.Os 299d6bbf9bSAlfred Perlstein.Sh NAME 309d6bbf9bSAlfred Perlstein.Nm accf_data 319d6bbf9bSAlfred Perlstein.Nd buffer incoming connections until data arrives 329d6bbf9bSAlfred Perlstein.Sh SYNOPSIS 339d6bbf9bSAlfred Perlstein.Nm options INET 349d6bbf9bSAlfred Perlstein.Nm options ACCEPT_FILTER_DATA 359d6bbf9bSAlfred Perlstein.Nm kldload accf_data 369d6bbf9bSAlfred Perlstein.Sh DESCRIPTION 3788bc7f85SJimmy OlgeniThis is a filter to be placed on a socket that will be using 389d6bbf9bSAlfred Perlstein.Fn accept 390381c6e5SBen Smithurstto receive incoming connections. 409d6bbf9bSAlfred Perlstein.Pp 410381c6e5SBen SmithurstIt prevents the application from receiving the connected descriptor via 429d6bbf9bSAlfred Perlstein.Fn accept 439d6bbf9bSAlfred Perlsteinuntil data arrives on the connection. 449d6bbf9bSAlfred Perlstein.Pp 459d6bbf9bSAlfred PerlsteinThe 469d6bbf9bSAlfred Perlstein.Fa ACCEPT_FILTER_DATA 479d6bbf9bSAlfred Perlsteinkernel option is also a module that can be enabled at runtime via 489d6bbf9bSAlfred Perlstein.Xr kldload 8 499d6bbf9bSAlfred Perlsteinif the INET option has been compiled into the kernel. 50324cfdb7SRuslan Ermilov.Sh EXAMPLES 519d6bbf9bSAlfred PerlsteinAssuming ACCEPT_FILTER_DATA has been included in the kernel config 52facc6767SRuslan Ermilovfile or the 53facc6767SRuslan Ermilov.Nm 54facc6767SRuslan Ermilovmodule 559d6bbf9bSAlfred Perlsteinhas been loaded, this will enable the data accept filter 569d6bbf9bSAlfred Perlsteinon the socket 579d6bbf9bSAlfred Perlstein.Fa sok . 589d6bbf9bSAlfred Perlstein.Bd -literal -offset 0i 599d6bbf9bSAlfred Perlstein struct accept_filter_arg afa; 609d6bbf9bSAlfred Perlstein 619d6bbf9bSAlfred Perlstein bzero(&afa, sizeof(afa)); 629d6bbf9bSAlfred Perlstein strcpy(afa.af_name, "dataready"); 639d6bbf9bSAlfred Perlstein setsockopt(sok, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa)); 649d6bbf9bSAlfred Perlstein.Ed 659d6bbf9bSAlfred Perlstein.Sh SEE ALSO 669d6bbf9bSAlfred Perlstein.Xr setsockopt 2 , 675521ff5aSRuslan Ermilov.Xr accept_filter 9 , 68*1e9469d1SChristian Brueffer.Xr accf_dns 9 , 695521ff5aSRuslan Ermilov.Xr accf_http 9 709d6bbf9bSAlfred Perlstein.Sh HISTORY 719d6bbf9bSAlfred PerlsteinThe accept filter mechanism and the 729d6bbf9bSAlfred Perlsteinaccf_data filter were introduced in 739d6bbf9bSAlfred Perlstein.Fx 4.0 . 749d6bbf9bSAlfred Perlstein.Sh AUTHORS 759d6bbf9bSAlfred PerlsteinThis manual page and the filter were written by 7688bc7f85SJimmy Olgeni.An Alfred Perlstein . 77