1/* sco.h
2
3   System dependencies for SCO ODT 3.0...
4
5   Based on changes contributed by Gerald Rosenberg. */
6
7/*
8 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
9 * Copyright (c) 1996-2003 by Internet Software Consortium
10 *
11 * Permission to use, copy, modify, and distribute this software for any
12 * purpose with or without fee is hereby granted, provided that the above
13 * copyright notice and this permission notice appear in all copies.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
16 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
18 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 *   Internet Systems Consortium, Inc.
24 *   950 Charter Street
25 *   Redwood City, CA 94063
26 *   <info@isc.org>
27 *   http://www.isc.org/
28 *
29 * This software has been written for Internet Systems Consortium
30 * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
31 * To learn more about Internet Systems Consortium, see
32 * ``http://www.isc.org/''.  To learn more about Vixie Enterprises,
33 * see ``http://www.vix.com''.   To learn more about Nominum, Inc., see
34 * ``http://www.nominum.com''.
35 */
36
37#include <syslog.h>
38#include <sys/types.h>
39
40/* Basic Integer Types not defined in SCO headers... */
41
42typedef char int8_t;
43typedef short int16_t;
44typedef long int32_t;
45
46typedef unsigned char u_int8_t;
47typedef unsigned short u_int16_t;
48typedef unsigned long u_int32_t;
49
50#include <string.h>
51#include <errno.h>
52#include <unistd.h>
53#include <sys/wait.h>
54#include <signal.h>
55#include <setjmp.h>
56#include <limits.h>
57
58extern int h_errno;
59
60#include <net/if.h>
61#include <net/if_dl.h>
62#include <net/if_arp.h>
63#include <netinet/tcp.h>
64#include <netinet/in.h>
65#include <netinet/tcp.h>
66
67/* XXX dunno if this is required for SCO... */
68/*
69 * Definitions for IP type of service (ip_tos)
70 */
71#define IPTOS_LOWDELAY          0x10
72#define IPTOS_THROUGHPUT        0x08
73#define IPTOS_RELIABILITY       0x04
74/*      IPTOS_LOWCOST           0x02 XXX */
75
76/* SCO doesn't have /var/run. */
77#ifndef _PATH_DHCPD_CONF
78#define _PATH_DHCPD_CONF	"/etc/dhcpd.conf"
79#endif
80#ifndef _PATH_DHCPD_PID
81#define _PATH_DHCPD_PID 	"/etc/dhcpd.pid"
82#endif
83#ifndef _PATH_DHCLIENT_PID
84#define _PATH_DHCLIENT_PID  "/etc/dhclient.pid"
85#endif
86#ifndef _PATH_DHCRELAY_PID
87#define _PATH_DHCRELAY_PID  "/etc/dhcrelay.pid"
88#endif
89#ifndef _PATH_DHCPD_DB
90#define _PATH_DHCPD_DB      "/etc/dhcpd.leases"
91#endif
92#ifndef _PATH_DHCLIENT_DB
93#define _PATH_DHCLIENT_DB   "/etc/dhclient.leases"
94#endif
95
96
97#if !defined (INADDR_LOOPBACK)
98#define INADDR_LOOPBACK	((u_int32_t)0x7f000001)
99#endif
100
101/* Varargs stuff: use stdarg.h instead ... */
102#include <stdarg.h>
103#define VA_DOTDOTDOT ...
104#define VA_start(list, last) va_start (list, last)
105#define va_dcl
106
107/* SCO doesn't support limited sprintfs. */
108#define NO_SNPRINTF
109
110/* By default, use BSD Socket API for receiving and sending packets.
111   This actually works pretty well on Solaris, which doesn't censor
112   the all-ones broadcast address. */
113#if defined (USE_DEFAULT_NETWORK)
114# define USE_SOCKETS
115#endif
116
117#define EOL	'\n'
118#define VOIDPTR	void *
119
120/* socklen_t */
121typedef int socklen_t;
122
123/*
124 * Time stuff...
125 *
126 * Definitions for an ISC DHCPD system that uses time_t
127 * to represent time internally as opposed to, for example,  struct timeval.)
128 */
129
130#include <time.h>
131#include <sys/time.h>
132
133#define TIME time_t
134#define GET_TIME(x)	time ((x))
135
136#ifdef NEED_PRAND_CONF
137const char *cmds[] = {
138	"/bin/ps -ef 2>&1",
139	"/etc/arp -n -a 2>&1",
140	"/usr/bin/netstat -an 2>&1",
141	"/bin/df  2>&1",
142	"/usr/bin/uptime  2>&1",
143	"/usr/bin/netstat -s 2>&1",
144	"/usr/bin/vmstat  2>&1",
145	"/usr/bin/w  2>&1",
146	NULL
147};
148
149const char *dirs[] = {
150	"/tmp",
151	"/usr/tmp",
152	".",
153	"/",
154	"/var/spool",
155	"/var/adm",
156	"/dev",
157	NULL
158};
159
160const char *files[] = {
161	NULL
162};
163#endif /* NEED_PRAND_CONF */
164