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/aros.h"
133 # include "cf/morphos.h"
137 # include "cf/rhapsody.h"
140 # include "cf/nextstep.h"
144 /* snprintf/vsnprintf hacks. for systems with no libc versions only. */
146 extern int isc_print_snprintf(char *, size_t, const char *, ...);
147 extern int isc_print_vsnprintf(char *, size_t, const char *, va_list ap
);
148 # define snprintf isc_print_snprintf
149 # define vsnprintf isc_print_vsnprintf
154 If you add a new network API, and have it set up so that it can be
155 used for sending or receiving, but doesn't have to be used for both,
156 then set up an ifdef like the ones below: */
159 # define USE_SOCKET_SEND
160 # define USE_SOCKET_RECEIVE
163 #ifdef USE_RAW_SOCKETS
164 # define USE_RAW_SEND
165 # define USE_SOCKET_RECEIVE
169 # define USE_BPF_SEND
170 # define USE_BPF_RECEIVE
174 # define USE_LPF_SEND
175 # define USE_LPF_RECEIVE
179 # define USE_NIT_SEND
180 # define USE_NIT_RECEIVE
184 # define USE_DLPI_SEND
185 # define USE_DLPI_RECEIVE
189 # define USE_UPF_SEND
190 # define USE_UPF_RECEIVE
195 If you add support for sending packets directly out an interface,
196 and your support does not do ARP or routing, you must use a fallback
197 mechanism to deal with packets that need to be sent to routers.
198 Currently, all low-level packet interfaces use BSD sockets as a
201 #if defined (USE_BPF_SEND) || defined (USE_NIT_SEND) || \
202 defined (USE_DLPI_SEND) || defined (USE_UPF_SEND) || \
203 defined (USE_LPF_SEND) || \
204 (defined (USE_SOCKET_SEND) && defined (HAVE_SO_BINDTODEVICE))
205 # define USE_SOCKET_FALLBACK
206 # define USE_FALLBACK
211 If you add support for sending packets directly out an interface
212 and need to be able to assemble packets, add the USE_XXX_SEND
213 definition for your interface to the list tested below. */
215 #if defined (USE_RAW_SEND) || defined (USE_BPF_SEND) || \
216 defined (USE_NIT_SEND) || defined (USE_UPF_SEND) || \
217 defined (USE_DLPI_SEND) || defined (USE_LPF_SEND)
218 # define PACKET_ASSEMBLY
223 If you add support for receiving packets directly from an interface
224 and need to be able to decode raw packets, add the USE_XXX_RECEIVE
225 definition for your interface to the list tested below. */
227 #if defined (USE_RAW_RECEIVE) || defined (USE_BPF_SEND) || \
228 defined (USE_NIT_RECEIVE) || defined (USE_UPF_RECEIVE) || \
229 defined (USE_DLPI_RECEIVE) || defined (USE_LPF_RECEIVE)
230 # define PACKET_DECODING
233 /* If we don't have a DLPI packet filter, we have to filter in userland.
234 Probably not worth doing, actually. */
235 #if defined (USE_DLPI_RECEIVE) && !defined (USE_DLPI_PFMOD)
236 # define USERLAND_FILTER
239 /* jmp_buf is assumed to be a struct unless otherwise defined in the
242 # define jbp_decl(x) jmp_buf *x
245 # define jref(x) (&(x))
248 # define jdref(x) (*(x))
251 # define jrefproto jmp_buf *
255 # define BPF_FORMAT "/dev/bpf%d"
258 #ifndef NO_AUTO_SETFD
259 #if defined (F_SETFD) && !defined (HAVE_SETFD)
264 #if defined (IFF_POINTOPOINT) && !defined (HAVE_IFF_POINTOPOINT)
265 # define HAVE_IFF_POINTOPOINT
268 #if defined (AF_LINK) && !defined (HAVE_AF_LINK)
269 # define HAVE_AF_LINK
272 #if defined (ARPHRD_TUNNEL) && !defined (HAVE_ARPHRD_TUNNEL)
273 # define HAVE_ARPHRD_TUNNEL
276 #if defined (ARPHRD_LOOPBACK) && !defined (HAVE_ARPHRD_LOOPBACK)
277 # define HAVE_ARPHRD_LOOPBACK
280 #if defined (ARPHRD_ROSE) && !defined (HAVE_ARPHRD_ROSE)
281 # define HAVE_ARPHRD_ROSE
284 #if defined (ARPHRD_IEEE802) && !defined (HAVE_ARPHRD_IEEE802)
285 # define HAVE_ARPHRD_IEEE802
288 #if defined (ARPHRD_IEEE802_TR) && !defined (HAVE_ARPHRD_IEEE802_TR)
289 # define HAVE_ARPHRD_IEEE802_TR
292 #if defined (ARPHRD_FDDI) && !defined (HAVE_ARPHRD_FDDI)
293 # define HAVE_ARPHRD_FDDI
296 #if defined (ARPHRD_AX25) && !defined (HAVE_ARPHRD_AX25)
297 # define HAVE_ARPHRD_AX25
300 #if defined (ARPHRD_NETROM) && !defined (HAVE_ARPHRD_NETROM)
301 # define HAVE_ARPHRD_NETROM
304 #if defined (ARPHRD_METRICOM) && !defined (HAVE_ARPHRD_METRICOM)
305 # define HAVE_ARPHRD_METRICOM
308 #if defined (SO_BINDTODEVICE) && !defined (HAVE_SO_BINDTODEVICE)
309 # define HAVE_SO_BINDTODEVICE
312 #if defined (AF_LINK) && !defined (HAVE_AF_LINK)
313 # define HAVE_AF_LINK
316 /* Linux needs to define SHUT_* in /usr/include/sys/socket.h someday... */
317 #if !defined (SHUT_RD)
321 #if !defined (SOCKLEN_T)
322 # define SOCKLEN_T socklen_t
325 #if !defined (STDERR_FILENO)
326 # define STDERR_FILENO 2
329 #endif /* __ISC_DHCP_OSDEP_H__ */