3 Operating system dependencies... */
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 #if !defined (__ISC_DHCP_OSDEP_H__)
36 #define __ISC_DHCP_OSDEP_H__
42 If you add a new network API, you must add a check for it below: */
44 #if !defined (USE_SOCKETS) && \
45 !defined (USE_SOCKET_SEND) && \
46 !defined (USE_SOCKET_RECEIVE) && \
47 !defined (USE_RAW_SOCKETS) && \
48 !defined (USE_RAW_SEND) && \
49 !defined (USE_SOCKET_RECEIVE) && \
50 !defined (USE_BPF) && \
51 !defined (USE_BPF_SEND) && \
52 !defined (USE_BPF_RECEIVE) && \
53 !defined (USE_LPF) && \
54 !defined (USE_LPF_SEND) && \
55 !defined (USE_LPF_RECEIVE) && \
56 !defined (USE_NIT) && \
57 !defined (USE_NIT_SEND) && \
58 !defined (USE_NIT_RECEIVE) && \
59 !defined (USR_DLPI_SEND) && \
60 !defined (USE_DLPI_RECEIVE)
61 # define USE_DEFAULT_NETWORK
64 #if !defined (TIME_MAX)
65 # define TIME_MAX 2147483647
70 If you add a new system configuration file, include it here: */
73 # if defined (__svr4__) || defined (__SVR4)
74 # include "cf/sunos5-5.h"
76 # include "cf/sunos4.h"
85 # include "cf/bsdos.h"
89 # include "cf/netbsd.h"
93 # include "cf/freebsd.h"
97 # include "cf/openbsd.h"
100 #if defined (__osf__) && defined (__alpha)
101 # include "cf/alphaosf.h"
105 # include "cf/ultrix.h"
109 # include "cf/linux.h"
116 #if defined (hpux) || defined (__hpux)
117 # include "cf/hpux.h"
125 # include "cf/cygwin32.h"
129 # include "cf/rhapsody.h"
132 # include "cf/nextstep.h"
136 /* snprintf/vsnprintf hacks. for systems with no libc versions only. */
138 extern int isc_print_snprintf(char *, size_t, const char *, ...);
139 extern int isc_print_vsnprintf(char *, size_t, const char *, va_list ap
);
140 # define snprintf isc_print_snprintf
141 # define vsnprintf isc_print_vsnprintf
146 If you add a new network API, and have it set up so that it can be
147 used for sending or receiving, but doesn't have to be used for both,
148 then set up an ifdef like the ones below: */
151 # define USE_SOCKET_SEND
152 # define USE_SOCKET_RECEIVE
155 #ifdef USE_RAW_SOCKETS
156 # define USE_RAW_SEND
157 # define USE_SOCKET_RECEIVE
161 # define USE_BPF_SEND
162 # define USE_BPF_RECEIVE
166 # define USE_LPF_SEND
167 # define USE_LPF_RECEIVE
171 # define USE_NIT_SEND
172 # define USE_NIT_RECEIVE
176 # define USE_DLPI_SEND
177 # define USE_DLPI_RECEIVE
181 # define USE_UPF_SEND
182 # define USE_UPF_RECEIVE
187 If you add support for sending packets directly out an interface,
188 and your support does not do ARP or routing, you must use a fallback
189 mechanism to deal with packets that need to be sent to routers.
190 Currently, all low-level packet interfaces use BSD sockets as a
193 #if defined (USE_BPF_SEND) || defined (USE_NIT_SEND) || \
194 defined (USE_DLPI_SEND) || defined (USE_UPF_SEND) || \
195 defined (USE_LPF_SEND) || \
196 (defined (USE_SOCKET_SEND) && defined (HAVE_SO_BINDTODEVICE))
197 # define USE_SOCKET_FALLBACK
198 # define USE_FALLBACK
203 If you add support for sending packets directly out an interface
204 and need to be able to assemble packets, add the USE_XXX_SEND
205 definition for your interface to the list tested below. */
207 #if defined (USE_RAW_SEND) || defined (USE_BPF_SEND) || \
208 defined (USE_NIT_SEND) || defined (USE_UPF_SEND) || \
209 defined (USE_DLPI_SEND) || defined (USE_LPF_SEND)
210 # define PACKET_ASSEMBLY
215 If you add support for receiving packets directly from an interface
216 and need to be able to decode raw packets, add the USE_XXX_RECEIVE
217 definition for your interface to the list tested below. */
219 #if defined (USE_RAW_RECEIVE) || defined (USE_BPF_SEND) || \
220 defined (USE_NIT_RECEIVE) || defined (USE_UPF_RECEIVE) || \
221 defined (USE_DLPI_RECEIVE) || defined (USE_LPF_RECEIVE)
222 # define PACKET_DECODING
225 /* If we don't have a DLPI packet filter, we have to filter in userland.
226 Probably not worth doing, actually. */
227 #if defined (USE_DLPI_RECEIVE) && !defined (USE_DLPI_PFMOD)
228 # define USERLAND_FILTER
231 /* jmp_buf is assumed to be a struct unless otherwise defined in the
234 # define jbp_decl(x) jmp_buf *x
237 # define jref(x) (&(x))
240 # define jdref(x) (*(x))
243 # define jrefproto jmp_buf *
247 # define BPF_FORMAT "/dev/bpf%d"
250 #if defined (F_SETFD) && !defined (HAVE_SETFD)
254 #if defined (IFF_POINTOPOINT) && !defined (HAVE_IFF_POINTOPOINT)
255 # define HAVE_IFF_POINTOPOINT
258 #if defined (AF_LINK) && !defined (HAVE_AF_LINK)
259 # define HAVE_AF_LINK
262 #if defined (ARPHRD_TUNNEL) && !defined (HAVE_ARPHRD_TUNNEL)
263 # define HAVE_ARPHRD_TUNNEL
266 #if defined (ARPHRD_LOOPBACK) && !defined (HAVE_ARPHRD_LOOPBACK)
267 # define HAVE_ARPHRD_LOOPBACK
270 #if defined (ARPHRD_ROSE) && !defined (HAVE_ARPHRD_ROSE)
271 # define HAVE_ARPHRD_ROSE
274 #if defined (ARPHRD_IEEE802) && !defined (HAVE_ARPHRD_IEEE802)
275 # define HAVE_ARPHRD_IEEE802
278 #if defined (ARPHRD_IEEE802_TR) && !defined (HAVE_ARPHRD_IEEE802_TR)
279 # define HAVE_ARPHRD_IEEE802_TR
282 #if defined (ARPHRD_FDDI) && !defined (HAVE_ARPHRD_FDDI)
283 # define HAVE_ARPHRD_FDDI
286 #if defined (ARPHRD_AX25) && !defined (HAVE_ARPHRD_AX25)
287 # define HAVE_ARPHRD_AX25
290 #if defined (ARPHRD_NETROM) && !defined (HAVE_ARPHRD_NETROM)
291 # define HAVE_ARPHRD_NETROM
294 #if defined (ARPHRD_METRICOM) && !defined (HAVE_ARPHRD_METRICOM)
295 # define HAVE_ARPHRD_METRICOM
298 #if defined (SO_BINDTODEVICE) && !defined (HAVE_SO_BINDTODEVICE)
299 # define HAVE_SO_BINDTODEVICE
302 #if defined (AF_LINK) && !defined (HAVE_AF_LINK)
303 # define HAVE_AF_LINK
306 /* Linux needs to define SHUT_* in /usr/include/sys/socket.h someday... */
307 #if !defined (SHUT_RD)
311 #if !defined (SOCKLEN_T)
312 # define SOCKLEN_T socklen_t
315 #if !defined (STDERR_FILENO)
316 # define STDERR_FILENO 2
319 #endif /* __ISC_DHCP_OSDEP_H__ */