Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/blacklist *** empty log message ***



details:   https://anonhg.NetBSD.org/src/rev/e082a1b3072f
branches:  trunk
changeset: 335663:e082a1b3072f
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jan 19 19:02:35 2015 +0000

description:
*** empty log message ***

diffstat:

 external/bsd/blacklist/bin/internal.h |  36 +++++++++++++++++++++++++++++++++++
 external/bsd/blacklist/include/bl.h   |  23 ++-------------------
 external/bsd/blacklist/lib/bl.c       |  33 ++++++++++++++++++++++++++++++-
 3 files changed, 70 insertions(+), 22 deletions(-)

diffs (141 lines):

diff -r f1270817a3a1 -r e082a1b3072f external/bsd/blacklist/bin/internal.h
--- a/external/bsd/blacklist/bin/internal.h     Mon Jan 19 18:52:55 2015 +0000
+++ b/external/bsd/blacklist/bin/internal.h     Mon Jan 19 19:02:35 2015 +0000
@@ -1,6 +1,42 @@
+/*     $NetBSD: internal.h,v 1.3 2015/01/19 19:02:35 christos Exp $    */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _INTERNAL_H
+#define _INTERNAL_H
+
+#define _PATH_BLCONF "/etc/blacklistd/conf"
 
 struct conf *conf;
 size_t nconf;
 int debug;
 
 void (*lfun)(int, const char *, ...);
+
+#endif /* _INTERNAL_H */
diff -r f1270817a3a1 -r e082a1b3072f external/bsd/blacklist/include/bl.h
--- a/external/bsd/blacklist/include/bl.h       Mon Jan 19 18:52:55 2015 +0000
+++ b/external/bsd/blacklist/include/bl.h       Mon Jan 19 19:02:35 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bl.h,v 1.4 2015/01/19 18:52:55 christos Exp $  */
+/*     $NetBSD: bl.h,v 1.5 2015/01/19 19:02:35 christos Exp $  */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -42,29 +42,12 @@
        char bi_msg[1024];
 } bl_info_t;
 
-typedef struct blacklist *bl_t;
+#define _PATH_BLSOCK "/tmp/blsock"
 
 __BEGIN_DECLS
 bl_t bl_create2(bool, const char *, void (*)(int, const char *, ...));
 bl_info_t *bl_recv(bl_t);
+bool bl_isconnected(bl_t);
 __END_DECLS
 
-#define _PATH_BLSOCK "/tmp/blsock"
-#define _PATH_BLCONF "/etc/blacklistd/conf"
-
 #endif /* _BL_H */
-typedef struct {
-       uint32_t bl_len;
-       uint32_t bl_version;
-       uint32_t bl_type;
-       char bl_data[];
-} bl_message_t;
-
-struct blacklist {
-       int b_fd;
-       int b_connected;
-       const char *b_path;
-       void (*b_fun)(int, const char *, ...);
-       bl_info_t b_info;
-};
-#define BL_VERSION     1
diff -r f1270817a3a1 -r e082a1b3072f external/bsd/blacklist/lib/bl.c
--- a/external/bsd/blacklist/lib/bl.c   Mon Jan 19 18:52:55 2015 +0000
+++ b/external/bsd/blacklist/lib/bl.c   Mon Jan 19 19:02:35 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bl.c,v 1.4 2015/01/19 18:52:55 christos Exp $  */
+/*     $NetBSD: bl.c,v 1.5 2015/01/19 19:02:35 christos Exp $  */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bl.c,v 1.4 2015/01/19 18:52:55 christos Exp $");
+__RCSID("$NetBSD: bl.c,v 1.5 2015/01/19 19:02:35 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -46,6 +46,35 @@
 
 #include "bl.h"
 
+typedef struct {
+       uint32_t bl_len;
+       uint32_t bl_version;
+       uint32_t bl_type;
+       char bl_data[];
+} bl_message_t;
+
+struct blacklist {
+       int b_fd;
+       int b_connected;
+       const char *b_path;
+       void (*b_fun)(int, const char *, ...);
+       bl_info_t b_info;
+};
+
+#define BL_VERSION     1
+
+bool
+bl_isconnected(bl_t b)
+{
+       return b->b_connected;
+}
+
+int
+bl_getfd(bl_t b)
+{
+       return b->b_fd;
+}
+
 static void
 bl_reset(bl_t b)
 {



Home | Main Index | Thread Index | Old Index