diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile | 4 | ||||
-rw-r--r-- | include/bl.h | 10 | ||||
-rw-r--r-- | include/blocklist.h | 29 |
3 files changed, 27 insertions, 16 deletions
diff --git a/include/Makefile b/include/Makefile index 6854907be25e..49eea8ff8bf5 100644 --- a/include/Makefile +++ b/include/Makefile @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.1 2015/01/21 16:16:00 christos Exp $ +# $NetBSD: Makefile,v 1.140 2013/12/11 01:24:08 joerg Exp $ # Doing a make includes builds /usr/include NOOBJ= # defined -INCS= blacklist.h +INCS= blocklist.h INCSDIR= /usr/include .include <bsd.prog.mk> diff --git a/include/bl.h b/include/bl.h index 68249cdf8230..b89a49d3eb60 100644 --- a/include/bl.h +++ b/include/bl.h @@ -35,12 +35,14 @@ #include <stdarg.h> #include <sys/param.h> #include <sys/socket.h> -#include "blacklist.h" +#include "blocklist.h" typedef enum { BL_INVALID, BL_ADD, - BL_DELETE + BL_DELETE, + BL_ABUSE, + BL_BADUSER } bl_type_t; typedef struct { @@ -56,12 +58,12 @@ typedef struct { #define bi_cred bi_u._bi_cred #ifndef _PATH_BLSOCK -#define _PATH_BLSOCK "/var/run/blacklistd.sock" +#define _PATH_BLSOCK "/var/run/blocklistd.sock" #endif __BEGIN_DECLS -typedef struct blacklist *bl_t; +typedef struct blocklist *bl_t; bl_t bl_create(bool, const char *, void (*)(int, const char *, va_list)); void bl_destroy(bl_t); diff --git a/include/blocklist.h b/include/blocklist.h index 9ebe11b95e08..2a3c4750a650 100644 --- a/include/blocklist.h +++ b/include/blocklist.h @@ -1,4 +1,4 @@ -/* $NetBSD: blacklist.h,v 1.3 2015/01/23 18:48:56 christos Exp $ */ +/* $NetBSD: blocklist.h,v 1.3 2015/01/23 18:48:56 christos Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -28,19 +28,28 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _BLACKLIST_H -#define _BLACKLIST_H +#ifndef _BLOCKLIST_H +#define _BLOCKLIST_H #include <sys/socket.h> __BEGIN_DECLS -struct blacklist *blacklist_open(void); -void blacklist_close(struct blacklist *); -int blacklist(int, int, const char *); -int blacklist_r(struct blacklist *, int, int, const char *); -int blacklist_sa(int, int, const struct sockaddr *, socklen_t, const char *); -int blacklist_sa_r(struct blacklist *, int, int, +struct blocklist *blocklist_open(void); +void blocklist_close(struct blocklist *); +int blocklist(int, int, const char *); +int blocklist_r(struct blocklist *, int, int, const char *); +int blocklist_sa(int, int, const struct sockaddr *, socklen_t, const char *); +int blocklist_sa_r(struct blocklist *, int, int, const struct sockaddr *, socklen_t, const char *); __END_DECLS -#endif /* _BLACKLIST_H */ +/* action values for user applications */ +#define BLOCKLIST_API_ENUM 1 +enum { + BLOCKLIST_AUTH_OK = 0, + BLOCKLIST_AUTH_FAIL, + BLOCKLIST_ABUSIVE_BEHAVIOR, + BLOCKLIST_BAD_USER +}; + +#endif /* _BLOCKLIST_H */ |