]> git.ipfire.org Git - thirdparty/dhcp.git/blob - includes/cf/sco.h
DHCPv6 branch merged to HEAD.
[thirdparty/dhcp.git] / includes / cf / sco.h
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
42 typedef char int8_t;
43 typedef short int16_t;
44 typedef long int32_t;
45
46 typedef unsigned char u_int8_t;
47 typedef unsigned short u_int16_t;
48 typedef 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
58 extern 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_DHCLIENT6_PID
87 #define _PATH_DHCLIENT6_PID "/etc/dhclient6.pid"
88 #endif
89 #ifndef _PATH_DHCRELAY_PID
90 #define _PATH_DHCRELAY_PID "/etc/dhcrelay.pid"
91 #endif
92 #ifndef _PATH_DHCPD_DB
93 #define _PATH_DHCPD_DB "/etc/dhcpd.leases"
94 #endif
95 #ifndef _PATH_DHCLIENT_DB
96 #define _PATH_DHCLIENT_DB "/etc/dhclient.leases"
97 #endif
98 #ifndef _PATH_DHCLIENT6_DB
99 #define _PATH_DHCLIENT6_DB "/etc/dhclient6.leases"
100 #endif
101
102
103 #if !defined (INADDR_LOOPBACK)
104 #define INADDR_LOOPBACK ((u_int32_t)0x7f000001)
105 #endif
106
107 /* Varargs stuff: use stdarg.h instead ... */
108 #include <stdarg.h>
109 #define VA_DOTDOTDOT ...
110 #define VA_start(list, last) va_start (list, last)
111 #define va_dcl
112
113 /* SCO doesn't support limited sprintfs. */
114 #define NO_SNPRINTF
115
116 /* By default, use BSD Socket API for receiving and sending packets.
117 This actually works pretty well on Solaris, which doesn't censor
118 the all-ones broadcast address. */
119 #if defined (USE_DEFAULT_NETWORK)
120 # define USE_SOCKETS
121 #endif
122
123 #define EOL '\n'
124 #define VOIDPTR void *
125
126 /* socklen_t */
127 typedef int socklen_t;
128
129 /*
130 * Time stuff...
131 *
132 * Definitions for an ISC DHCPD system that uses time_t
133 * to represent time internally as opposed to, for example, struct timeval.)
134 */
135
136 #include <time.h>
137 #include <sys/time.h>
138
139 #define TIME time_t
140 #define GET_TIME(x) time ((x))
141
142 #ifdef NEED_PRAND_CONF
143 const char *cmds[] = {
144 "/bin/ps -ef 2>&1",
145 "/etc/arp -n -a 2>&1",
146 "/usr/bin/netstat -an 2>&1",
147 "/bin/df 2>&1",
148 "/usr/bin/uptime 2>&1",
149 "/usr/bin/netstat -s 2>&1",
150 "/usr/bin/vmstat 2>&1",
151 "/usr/bin/w 2>&1",
152 NULL
153 };
154
155 const char *dirs[] = {
156 "/tmp",
157 "/usr/tmp",
158 ".",
159 "/",
160 "/var/spool",
161 "/var/adm",
162 "/dev",
163 NULL
164 };
165
166 const char *files[] = {
167 NULL
168 };
169 #endif /* NEED_PRAND_CONF */