1 .\" $NetBSD: libblacklist.3,v 1.3 2015/01/25 23:09:28 wiz Exp $
3 .\" Copyright (c) 2015 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Christos Zoulas.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
40 .Nd Blacklistd notification library
45 .Ft struct blacklist *
46 .Fn blacklist_open "void"
48 .Fn blacklist_close "struct blacklist *cookie"
50 .Fn blacklist "int action" "int fd" "const char *msg"
52 .Fn blacklist_r "struct blacklist *cookie" "int action" "int fd" "const char *msg"
54 .Fn blacklist_sa "int action" "int fd" "const struct sockaddr *sa" "socklen_t salen" "const char *msg"
56 .Fn blacklist_sa_r "struct blacklist *cookie" "int action" "int fd" "const struct sockaddr *sa" "socklen_t salen" "const char *msg"
58 These functions can be used by daemons to notify
60 about successful and failed remote connections so that blacklistd can
61 block or release port access to prevent Denial of Service attacks.
65 creates a the necessary state to communicate with
67 and returns a pointer to it, or
73 function frees all memory and resources used.
77 function sends a message to
83 for a failed connection or
85 for a successful connection,
88 specifying the accepted file descriptor connected to the client,
89 and an optional message in the
95 function is more efficient because it keeps the blacklist state around.
101 functions can be used with unconnected sockets, where
103 will not work, the server will pass the peer name in the message.
105 All functions log errors to
110 returns a cookie on success and
112 on failure setting errno to an appropriate value.
120 on failure setting errno to an appropriate value.
122 .Xr blacklistd.conf 5 ,