xref: /freebsd/crypto/openssh/blocklist_client.h (revision 7238317403b95a8e35cf0bc7cd66fbd78ecbe521)
1*72383174SJose Luis Duran /*-
2*72383174SJose Luis Duran  * Copyright (c) 2015 The NetBSD Foundation, Inc.
3*72383174SJose Luis Duran  * Copyright (c) 2016 The FreeBSD Foundation
4*72383174SJose Luis Duran  * All rights reserved.
5*72383174SJose Luis Duran  *
6*72383174SJose Luis Duran  * Portions of this software were developed by Kurt Lidl
7*72383174SJose Luis Duran  * under sponsorship from the FreeBSD Foundation.
8*72383174SJose Luis Duran  *
9*72383174SJose Luis Duran  * This code is derived from software contributed to The NetBSD Foundation
10*72383174SJose Luis Duran  * by Christos Zoulas.
11*72383174SJose Luis Duran  *
12*72383174SJose Luis Duran  * Redistribution and use in source and binary forms, with or without
13*72383174SJose Luis Duran  * modification, are permitted provided that the following conditions
14*72383174SJose Luis Duran  * are met:
15*72383174SJose Luis Duran  * 1. Redistributions of source code must retain the above copyright
16*72383174SJose Luis Duran  *    notice, this list of conditions and the following disclaimer.
17*72383174SJose Luis Duran  * 2. Redistributions in binary form must reproduce the above copyright
18*72383174SJose Luis Duran  *    notice, this list of conditions and the following disclaimer in the
19*72383174SJose Luis Duran  *    documentation and/or other materials provided with the distribution.
20*72383174SJose Luis Duran  *
21*72383174SJose Luis Duran  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
22*72383174SJose Luis Duran  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23*72383174SJose Luis Duran  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24*72383174SJose Luis Duran  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
25*72383174SJose Luis Duran  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26*72383174SJose Luis Duran  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27*72383174SJose Luis Duran  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28*72383174SJose Luis Duran  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29*72383174SJose Luis Duran  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30*72383174SJose Luis Duran  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31*72383174SJose Luis Duran  * POSSIBILITY OF SUCH DAMAGE.
32*72383174SJose Luis Duran  */
33*72383174SJose Luis Duran 
34*72383174SJose Luis Duran #ifndef BLOCKLIST_CLIENT_H
35*72383174SJose Luis Duran #define BLOCKLIST_CLIENT_H
36*72383174SJose Luis Duran 
37*72383174SJose Luis Duran #ifndef BLOCKLIST_API_ENUM
38*72383174SJose Luis Duran enum {
39*72383174SJose Luis Duran 	BLOCKLIST_AUTH_OK = 0,
40*72383174SJose Luis Duran 	BLOCKLIST_AUTH_FAIL,
41*72383174SJose Luis Duran 	BLOCKLIST_ABUSIVE_BEHAVIOR,
42*72383174SJose Luis Duran 	BLOCKLIST_BAD_USER
43*72383174SJose Luis Duran };
44*72383174SJose Luis Duran #endif
45*72383174SJose Luis Duran 
46*72383174SJose Luis Duran #ifdef USE_BLOCKLIST
47*72383174SJose Luis Duran void blocklist_init(void);
48*72383174SJose Luis Duran void blocklist_notify(struct ssh *, int, const char *);
49*72383174SJose Luis Duran 
50*72383174SJose Luis Duran #define BLOCKLIST_INIT() blocklist_init()
51*72383174SJose Luis Duran #define BLOCKLIST_NOTIFY(ssh,x,msg) blocklist_notify(ssh,x,msg)
52*72383174SJose Luis Duran 
53*72383174SJose Luis Duran #else
54*72383174SJose Luis Duran 
55*72383174SJose Luis Duran #define BLOCKLIST_INIT()
56*72383174SJose Luis Duran #define BLOCKLIST_NOTIFY(ssh,x,msg)
57*72383174SJose Luis Duran 
58*72383174SJose Luis Duran #endif
59*72383174SJose Luis Duran 
60*72383174SJose Luis Duran 
61*72383174SJose Luis Duran #endif /* BLOCKLIST_CLIENT_H */
62