xref: /netbsd-src/external/bsd/blocklist/bin/internal.c (revision df83713dd85c543f79ef38c5e4862663436a08ae)
1*df83713dSchristos /*	$NetBSD: internal.c,v 1.1.1.1 2020/06/15 01:52:53 christos Exp $	*/
2*df83713dSchristos 
3*df83713dSchristos /*-
4*df83713dSchristos  * Copyright (c) 2015 The NetBSD Foundation, Inc.
5*df83713dSchristos  * All rights reserved.
6*df83713dSchristos  *
7*df83713dSchristos  * This code is derived from software contributed to The NetBSD Foundation
8*df83713dSchristos  * by Christos Zoulas.
9*df83713dSchristos  *
10*df83713dSchristos  * Redistribution and use in source and binary forms, with or without
11*df83713dSchristos  * modification, are permitted provided that the following conditions
12*df83713dSchristos  * are met:
13*df83713dSchristos  * 1. Redistributions of source code must retain the above copyright
14*df83713dSchristos  *    notice, this list of conditions and the following disclaimer.
15*df83713dSchristos  * 2. Redistributions in binary form must reproduce the above copyright
16*df83713dSchristos  *    notice, this list of conditions and the following disclaimer in the
17*df83713dSchristos  *    documentation and/or other materials provided with the distribution.
18*df83713dSchristos  *
19*df83713dSchristos  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20*df83713dSchristos  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21*df83713dSchristos  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22*df83713dSchristos  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23*df83713dSchristos  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*df83713dSchristos  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*df83713dSchristos  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*df83713dSchristos  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*df83713dSchristos  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*df83713dSchristos  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*df83713dSchristos  * POSSIBILITY OF SUCH DAMAGE.
30*df83713dSchristos  */
31*df83713dSchristos #ifdef HAVE_CONFIG_H
32*df83713dSchristos #include "config.h"
33*df83713dSchristos #endif
34*df83713dSchristos 
35*df83713dSchristos #include <sys/cdefs.h>
36*df83713dSchristos __RCSID("$NetBSD: internal.c,v 1.1.1.1 2020/06/15 01:52:53 christos Exp $");
37*df83713dSchristos 
38*df83713dSchristos #include <stdio.h>
39*df83713dSchristos #include <syslog.h>
40*df83713dSchristos #include "conf.h"
41*df83713dSchristos #include "internal.h"
42*df83713dSchristos 
43*df83713dSchristos int debug;
44*df83713dSchristos const char *rulename = "blocklistd";
45*df83713dSchristos const char *controlprog = _PATH_BLCONTROL;
46*df83713dSchristos struct confset lconf, rconf;
47*df83713dSchristos struct ifaddrs *ifas;
48*df83713dSchristos void (*lfun)(int, const char *, ...) = syslog;
49