1996-03-16 17:50:30 +00:00
|
|
|
/* bsdos.h
|
1995-11-29 07:40:04 +00:00
|
|
|
|
1996-03-16 17:50:30 +00:00
|
|
|
System dependencies for BSDI BSD/OS... */
|
1995-11-29 07:40:04 +00:00
|
|
|
|
|
|
|
/*
|
1999-03-16 05:50:46 +00:00
|
|
|
* Copyright (c) 1996-1999 Internet Software Consortium.
|
2000-03-17 04:00:32 +00:00
|
|
|
* All rights reserved.
|
1995-11-29 07:40:04 +00:00
|
|
|
*
|
2000-03-17 04:00:32 +00:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
1995-11-29 07:40:04 +00:00
|
|
|
*
|
2000-03-17 04:00:32 +00:00
|
|
|
* 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.
|
|
|
|
* 3. Neither the name of The Internet Software Consortium nor the names
|
|
|
|
* of its contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
1995-11-29 07:40:04 +00:00
|
|
|
*
|
2000-03-17 04:00:32 +00:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM 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 INTERNET SOFTWARE CONSORTIUM 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.
|
|
|
|
*
|
|
|
|
* This software has been written for the Internet Software Consortium
|
|
|
|
* by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
|
|
|
|
* To learn more about the Internet Software Consortium, see
|
|
|
|
* ``http://www.isc.org/''. To learn more about Vixie Enterprises,
|
|
|
|
* see ``http://www.vix.com''. To learn more about Nominum, Inc., see
|
|
|
|
* ``http://www.nominum.com''.
|
1995-11-29 07:40:04 +00:00
|
|
|
*/
|
|
|
|
|
1996-05-17 00:29:29 +00:00
|
|
|
#include <syslog.h>
|
1995-11-29 07:40:04 +00:00
|
|
|
#include <sys/types.h>
|
2000-02-01 18:21:26 +00:00
|
|
|
#include <sys/param.h>
|
1995-11-29 07:40:04 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <paths.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <setjmp.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
1996-03-06 10:04:44 +00:00
|
|
|
#include <sys/wait.h>
|
|
|
|
#include <signal.h>
|
|
|
|
|
1995-11-29 07:40:04 +00:00
|
|
|
extern int h_errno;
|
|
|
|
|
|
|
|
#include <net/if.h>
|
1996-05-16 07:30:34 +00:00
|
|
|
#include <net/if_dl.h>
|
1996-05-20 00:36:47 +00:00
|
|
|
#define INADDR_LOOPBACK ((u_int32_t)0x7f000001)
|
1995-11-29 07:40:04 +00:00
|
|
|
|
|
|
|
/* Varargs stuff... */
|
|
|
|
#include <stdarg.h>
|
|
|
|
#define VA_DOTDOTDOT ...
|
|
|
|
#define va_dcl
|
|
|
|
#define VA_start(list, last) va_start (list, last)
|
|
|
|
|
1996-09-11 06:36:57 +00:00
|
|
|
#ifndef _PATH_DHCPD_PID
|
1996-03-06 10:04:44 +00:00
|
|
|
#define _PATH_DHCPD_PID "/var/run/dhcpd.pid"
|
1996-09-11 06:36:57 +00:00
|
|
|
#endif
|
|
|
|
#ifndef _PATH_DHCPD_DB
|
1996-06-01 00:30:39 +00:00
|
|
|
#define _PATH_DHCPD_DB "/var/db/dhcpd.leases"
|
1996-09-11 06:36:57 +00:00
|
|
|
#endif
|
1997-02-18 14:34:14 +00:00
|
|
|
#ifndef _PATH_DHCLIENT_PID
|
|
|
|
#define _PATH_DHCLIENT_PID "/var/run/dhclient.pid"
|
|
|
|
#endif
|
|
|
|
#ifndef _PATH_DHCLIENT_DB
|
|
|
|
#define _PATH_DHCLIENT_DB "/var/db/dhclient.leases"
|
|
|
|
#endif
|
1995-11-29 07:40:04 +00:00
|
|
|
|
|
|
|
#define EOL '\n'
|
1996-03-06 10:04:44 +00:00
|
|
|
#define VOIDPTR void *
|
1995-11-29 07:40:04 +00:00
|
|
|
|
|
|
|
/* Time stuff... */
|
|
|
|
#include <sys/time.h>
|
1996-03-06 10:04:44 +00:00
|
|
|
#define TIME time_t
|
|
|
|
#define GET_TIME(x) time ((x))
|
1996-05-13 00:10:37 +00:00
|
|
|
|
1996-05-20 00:34:56 +00:00
|
|
|
#define HAVE_SA_LEN
|
1996-05-16 23:08:03 +00:00
|
|
|
|
1996-05-13 00:10:37 +00:00
|
|
|
#if defined (USE_DEFAULT_NETWORK)
|
|
|
|
# define USE_BPF
|
|
|
|
#endif
|
2000-02-01 18:21:26 +00:00
|
|
|
|
|
|
|
#if _BSDI_VERSION < 199802
|
|
|
|
typedef int socklen_t;
|
|
|
|
#endif
|
2000-02-02 05:38:07 +00:00
|
|
|
|
|
|
|
#ifdef NEED_PRAND_CONF
|
|
|
|
const char *cmds[] = {
|
|
|
|
"/bin/ps -axlw 2>&1",
|
|
|
|
"/usr/sbin/arp -an 2>&1",
|
|
|
|
"/usr/sbin/netstat -an 2>&1",
|
|
|
|
"/bin/df 2>&1",
|
|
|
|
"/usr/bin/dig com. soa +ti=1 +retry=0 2>&1",
|
|
|
|
"/usr/ucb/uptime 2>&1",
|
|
|
|
"/usr/sbin/netstat -an 2>&1",
|
|
|
|
"/usr/sbin/iostat 2>&1",
|
|
|
|
"/usr/sbin/vmstat 2>&1",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
const char *dirs[] = {
|
|
|
|
"/tmp",
|
|
|
|
"/var/tmp",
|
|
|
|
".",
|
|
|
|
"/",
|
|
|
|
"/var/spool",
|
|
|
|
"/dev",
|
|
|
|
"/var/mail",
|
|
|
|
"/usr/home",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
const char *files[] = {
|
|
|
|
"/var/log/messages",
|
|
|
|
"/var/log/wtmp",
|
|
|
|
"/var/log/lastlog",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
#endif /* NEED_PRAND_CONF */
|