3 System dependencies for Solaris 2.x (tested on 2.5 with gcc)... */
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.
23 * Redwood City, CA 94063
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
47 #define jrefproto jmp_buf
50 #include <sys/types.h>
51 #include <sys/sockio.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. */
69 #include <net/if_dl.h>
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
83 #ifndef _PATH_DHCPD_PID
84 #define _PATH_DHCPD_PID "/etc/dhcpd.pid"
86 #ifndef _PATH_DHCLIENT_PID
87 #define _PATH_DHCLIENT_PID "/etc/dhclient.pid"
89 #ifndef _PATH_DHCRELAY_PID
90 #define _PATH_DHCRELAY_PID "/etc/dhcrelay.pid"
93 #if defined (__GNUC__) || defined (__SVR4)
94 /* Varargs stuff: use stdarg.h instead ... */
96 #define VA_DOTDOTDOT ...
97 #define VA_start(list, last) va_start (list, last)
100 /* Varargs stuff... */
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)
110 # define USE_DLPI_PFMOD
116 #define VOIDPTR void *
123 #define GET_TIME(x) time ((x))
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)
135 /* Solaris doesn't provide an endian.h, so we have to do it. */
137 #if !defined (BIG_ENDIAN)
138 # define BIG_ENDIAN 1
141 #if !defined (BIG_ENDIAN)
142 # define LITTLE_ENDIAN 2
145 #if !defined (BYTE_ORDER)
146 # if defined (__i386) || defined (i386)
147 # define BYTE_ORDER LITTLE_ENDIAN
149 # if defined (__sparc) || defined (sparc)
150 # define BYTE_ORDER BIG_ENDIAN
152 @@@ ERROR @@@ Unable to determine byte order
!
157 #define ALIAS_NAMES_PERMUTED
159 #if SOLARIS_MAJOR == 5 && SOLARIS_MINOR < 7
160 typedef int socklen_t
;
163 #ifdef NEED_PRAND_CONF
164 const char *cmds
[] = {
166 "/usr/ucb/netstat -an 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",
175 const char *dirs
[] = {
188 const char *files
[] = {
195 #endif /* NEED_PRAND_CONF */