3 Operating system dependencies... */
6 * Copyright (c) 1996-1999 Internet Software Consortium.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of The Internet Software Consortium nor the names
19 * of its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
23 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
27 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
33 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * This software has been written for the Internet Software Consortium
37 * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
38 * To learn more about the Internet Software Consortium, see
39 * ``http://www.isc.org/''. To learn more about Vixie Enterprises,
40 * see ``http://www.vix.com''. To learn more about Nominum, Inc., see
41 * ``http://www.nominum.com''.
44 #if !defined (__ISC_DHCP_OSDEP_H__)
45 #define __ISC_DHCP_OSDEP_H__
51 If you add a new network API, you must add a check for it below: */
53 #if !defined (USE_SOCKETS) && \
54 !defined (USE_SOCKET_SEND) && \
55 !defined (USE_SOCKET_RECEIVE) && \
56 !defined (USE_RAW_SOCKETS) && \
57 !defined (USE_RAW_SEND) && \
58 !defined (USE_SOCKET_RECEIVE) && \
59 !defined (USE_BPF) && \
60 !defined (USE_BPF_SEND) && \
61 !defined (USE_BPF_RECEIVE) && \
62 !defined (USE_LPF) && \
63 !defined (USE_LPF_SEND) && \
64 !defined (USE_LPF_RECEIVE) && \
65 !defined (USE_NIT) && \
66 !defined (USE_NIT_SEND) && \
67 !defined (USE_NIT_RECEIVE) && \
68 !defined (USR_DLPI_SEND) && \
69 !defined (USE_DLPI_RECEIVE)
70 # define USE_DEFAULT_NETWORK
73 #if !defined (TIME_MAX)
74 # define TIME_MAX 2147483647
79 If you add a new system configuration file, include it here: */
82 # if defined (__svr4__) || defined (__SVR4)
83 # include "cf/sunos5-5.h"
85 # include "cf/sunos4.h"
94 # include "cf/bsdos.h"
98 # include "cf/netbsd.h"
102 # include "cf/freebsd.h"
106 # include "cf/openbsd.h"
109 #if defined (__osf__) && defined (__alpha)
110 # include "cf/alphaosf.h"
114 # include "cf/ultrix.h"
118 # include "cf/linux.h"
125 #if defined (hpux) || defined (__hpux)
126 # include "cf/hpux.h"
134 # include "cf/cygwin32.h"
138 # include "cf/rhapsody.h"
141 # include "cf/nextstep.h"
147 If you add a new network API, and have it set up so that it can be
148 used for sending or receiving, but doesn't have to be used for both,
149 then set up an ifdef like the ones below: */
152 # define USE_SOCKET_SEND
153 # define USE_SOCKET_RECEIVE
156 #ifdef USE_RAW_SOCKETS
157 # define USE_RAW_SEND
158 # define USE_SOCKET_RECEIVE
162 # define USE_BPF_SEND
163 # define USE_BPF_RECEIVE
167 # define USE_LPF_SEND
168 # define USE_LPF_RECEIVE
172 # define USE_NIT_SEND
173 # define USE_NIT_RECEIVE
177 # define USE_DLPI_SEND
178 # define USE_DLPI_RECEIVE
182 # define USE_UPF_SEND
183 # define USE_UPF_RECEIVE
188 If you add support for sending packets directly out an interface,
189 and your support does not do ARP or routing, you must use a fallback
190 mechanism to deal with packets that need to be sent to routers.
191 Currently, all low-level packet interfaces use BSD sockets as a
194 #if defined (USE_BPF_SEND) || defined (USE_NIT_SEND) || \
195 defined (USE_DLPI_SEND) || defined (USE_UPF_SEND) || \
196 defined (USE_LPF_SEND) || \
197 (defined (USE_SOCKET_SEND) && defined (HAVE_SO_BINDTODEVICE))
198 # define USE_SOCKET_FALLBACK
199 # define USE_FALLBACK
204 If you add support for sending packets directly out an interface
205 and need to be able to assemble packets, add the USE_XXX_SEND
206 definition for your interface to the list tested below. */
208 #if defined (USE_RAW_SEND) || defined (USE_BPF_SEND) || \
209 defined (USE_NIT_SEND) || defined (USE_UPF_SEND) || \
210 defined (USE_DLPI_SEND) || defined (USE_LPF_SEND)
211 # define PACKET_ASSEMBLY
216 If you add support for receiving packets directly from an interface
217 and need to be able to decode raw packets, add the USE_XXX_RECEIVE
218 definition for your interface to the list tested below. */
220 #if defined (USE_RAW_RECEIVE) || defined (USE_BPF_SEND) || \
221 defined (USE_NIT_RECEIVE) || defined (USE_UPF_RECEIVE) || \
222 defined (USE_DLPI_RECEIVE) || defined (USE_LPF_RECEIVE)
223 # define PACKET_DECODING
226 /* If we don't have a DLPI packet filter, we have to filter in userland.
227 Probably not worth doing, actually. */
228 #if defined (USE_DLPI_RECEIVE) && !defined (USE_DLPI_PFMOD)
229 # define USERLAND_FILTER
232 /* jmp_buf is assumed to be a struct unless otherwise defined in the
235 # define jbp_decl(x) jmp_buf *x
238 # define jref(x) (&(x))
241 # define jdref(x) (*(x))
244 # define jrefproto jmp_buf *
248 # define BPF_FORMAT "/dev/bpf%d"
251 #if defined (F_SETFD) && !defined (HAVE_SETFD)
255 #if defined (IFF_POINTOPOINT) && !defined (HAVE_IFF_POINTOPOINT)
256 # define HAVE_IFF_POINTOPOINT
259 #if defined (AF_LINK) && !defined (HAVE_AF_LINK)
260 # define HAVE_AF_LINK
263 #if defined (ARPHRD_TUNNEL) && !defined (HAVE_ARPHRD_TUNNEL)
264 # define HAVE_ARPHRD_TUNNEL
267 #if defined (ARPHRD_LOOPBACK) && !defined (HAVE_ARPHRD_LOOPBACK)
268 # define HAVE_ARPHRD_LOOPBACK
271 #if defined (ARPHRD_ROSE) && !defined (HAVE_ARPHRD_ROSE)
272 # define HAVE_ARPHRD_ROSE
275 #if defined (ARPHRD_IEEE802) && !defined (HAVE_ARPHRD_IEEE802)
276 # define HAVE_ARPHRD_IEEE802
279 #if defined (ARPHRD_IEEE802_TR) && !defined (HAVE_ARPHRD_IEEE802_TR)
280 # define HAVE_ARPHRD_IEEE802_TR
283 #if defined (ARPHRD_FDDI) && !defined (HAVE_ARPHRD_FDDI)
284 # define HAVE_ARPHRD_FDDI
287 #if defined (ARPHRD_AX25) && !defined (HAVE_ARPHRD_AX25)
288 # define HAVE_ARPHRD_AX25
291 #if defined (ARPHRD_NETROM) && !defined (HAVE_ARPHRD_NETROM)
292 # define HAVE_ARPHRD_NETROM
295 #if defined (ARPHRD_METRICOM) && !defined (HAVE_ARPHRD_METRICOM)
296 # define HAVE_ARPHRD_METRICOM
299 #if defined (SO_BINDTODEVICE) && !defined (HAVE_SO_BINDTODEVICE)
300 # define HAVE_SO_BINDTODEVICE
303 #if defined (AF_LINK) && !defined (HAVE_AF_LINK)
304 # define HAVE_AF_LINK
307 /* Linux needs to define SHUT_* in /usr/include/sys/socket.h someday... */
308 #if !defined (SHUT_RD)
312 #if !defined (SOCKLEN_T)
313 #define SOCKLEN_T socklen_t
316 #endif /* __ISC_DHCP_OSDEP_H__ */