revert between 56095 -> 55830 in arch
[AROS.git] / workbench / network / stacks / AROSTCP / dhcp / includes / cf / sunos5-5.h
blob8a1e416bc18bb261146e12beb7fed00e7e36ce6c
1 /* sunos5-5.h
3 System dependencies for Solaris 2.x (tested on 2.5 with gcc)... */
5 /*
6 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
7 * Copyright (c) 1996-2003 by Internet Software Consortium
9 * Permission to use, copy, modify, and distribute this software for any
10 * purpose with or without fee is hereby granted, provided that the above
11 * copyright notice and this permission notice appear in all copies.
13 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
19 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 * Internet Systems Consortium, Inc.
22 * 950 Charter Street
23 * Redwood City, CA 94063
24 * <info@isc.org>
25 * http://www.isc.org/
27 * This software has been written for Internet Systems Consortium
28 * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
29 * To learn more about Internet Systems Consortium, see
30 * ``http://www.isc.org/''. To learn more about Vixie Enterprises,
31 * see ``http://www.vix.com''. To learn more about Nominum, Inc., see
32 * ``http://www.nominum.com''.
35 /* SunOS defines uint*_t and int*_t, but not u_int*_t. */
37 typedef uint8_t u_int8_t;
38 typedef uint16_t u_int16_t;
39 typedef uint32_t u_int32_t;
41 /* The jmp_buf type is an array on Solaris, so we can't dereference it
42 and must declare it differently. */
44 #define jbp_decl(x) jmp_buf x
45 #define jref(x) (x)
46 #define jdref(x) (x)
47 #define jrefproto jmp_buf
49 #include <syslog.h>
50 #include <sys/types.h>
51 #include <sys/sockio.h>
53 #include <string.h>
54 #include <errno.h>
55 #include <unistd.h>
56 #include <sys/wait.h>
57 #include <signal.h>
58 #include <setjmp.h>
59 #include <limits.h>
61 extern int h_errno;
63 #include <net/if.h>
64 #include <net/if_arp.h>
66 /* Solaris 2.6 defines AF_LINK, so we need the rest of the baggage that
67 comes with it, but of course Solaris 2.5 and previous do not. */
68 #if defined (AF_LINK)
69 #include <net/if_dl.h>
70 #endif
73 * Definitions for IP type of service (ip_tos)
75 #define IPTOS_LOWDELAY 0x10
76 #define IPTOS_THROUGHPUT 0x08
77 #define IPTOS_RELIABILITY 0x04
78 /* IPTOS_LOWCOST 0x02 XXX */
80 /* Solaris systems don't have /var/run, but some sites have added it.
81 If you want to put dhcpd.pid in /var/run, define _PATH_DHCPD_PID
82 in site.h. */
83 #ifndef _PATH_DHCPD_PID
84 #define _PATH_DHCPD_PID "/etc/dhcpd.pid"
85 #endif
86 #ifndef _PATH_DHCLIENT_PID
87 #define _PATH_DHCLIENT_PID "/etc/dhclient.pid"
88 #endif
89 #ifndef _PATH_DHCRELAY_PID
90 #define _PATH_DHCRELAY_PID "/etc/dhcrelay.pid"
91 #endif
93 #if defined (__GNUC__) || defined (__SVR4)
94 /* Varargs stuff: use stdarg.h instead ... */
95 #include <stdarg.h>
96 #define VA_DOTDOTDOT ...
97 #define VA_start(list, last) va_start (list, last)
98 #define va_dcl
99 #else /* !__GNUC__*/
100 /* Varargs stuff... */
101 #include <varargs.h>
102 #define VA_DOTDOTDOT va_alist
103 #define VA_start(list, last) va_start (list)
104 #endif /* !__GNUC__*/
106 #define NEED_INET_ATON
108 #if defined (USE_DEFAULT_NETWORK)
109 # define USE_DLPI
110 # define USE_DLPI_PFMOD
111 #endif
113 #define USE_POLL
115 #define EOL '\n'
116 #define VOIDPTR void *
118 /* Time stuff... */
120 #include <time.h>
122 #define TIME time_t
123 #define GET_TIME(x) time ((x))
125 #define HAVE_MKSTEMP
127 /* Solaris prior to 2.5 didn't have random(). Rather than being clever and
128 using random() only on versions >2.5, always use rand() and srand(). */
130 #if SOLARIS_MAJOR == 5 && SOLARIS_MINOR < 5
131 #define random() rand()
132 #define srandom(x) srand(x)
133 #endif
135 /* Solaris doesn't provide an endian.h, so we have to do it. */
137 #if !defined (BIG_ENDIAN)
138 # define BIG_ENDIAN 1
139 #endif
141 #if !defined (BIG_ENDIAN)
142 # define LITTLE_ENDIAN 2
143 #endif
145 #if !defined (BYTE_ORDER)
146 # if defined (__i386) || defined (i386)
147 # define BYTE_ORDER LITTLE_ENDIAN
148 # else
149 # if defined (__sparc) || defined (sparc)
150 # define BYTE_ORDER BIG_ENDIAN
151 # else
152 @@@ ERROR @@@ Unable to determine byte order!
153 # endif
154 # endif
155 #endif
157 #define ALIAS_NAMES_PERMUTED
159 #if SOLARIS_MAJOR == 5 && SOLARIS_MINOR < 7
160 typedef int socklen_t;
161 #endif
163 #ifdef NEED_PRAND_CONF
164 const char *cmds[] = {
165 "/bin/ps -ef 2>&1",
166 "/usr/ucb/netstat -an 2>&1",
167 "/bin/df 2>&1",
168 "/usr/bin/dig com. soa +ti=1 +retry=0 2>&1",
169 "/usr/ucb/uptime 2>&1",
170 "/usr/ucb/netstat -an 2>&1",
171 "/bin/iostat 2>&1",
172 NULL
175 const char *dirs[] = {
176 "/tmp",
177 "/var/tmp",
178 ".",
179 "/",
180 "/var/spool",
181 "/var/adm",
182 "/dev",
183 "/var/mail",
184 "/home",
185 NULL
188 const char *files[] = {
189 "/proc/self/status",
190 "/var/adm/messages",
191 "/var/adm/wtmp",
192 "/var/adm/lastlog",
193 NULL
195 #endif /* NEED_PRAND_CONF */