3 Operating system dependencies... */
6 * Copyright (c) 1996, 1997, 1998, 1999 The 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 of its
19 * 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, INCLUDING,
24 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
26 * THE INTERNET SOFTWARE CONSORTIUM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33 * OF THE POSSIBILITY OF SUCH DAMAGE.
35 * This software was written for the Internet Software Consortium by Ted Lemon
36 * under a contract with Vixie Laboratories.
43 If you add a new network API, you must add a check for it below: */
45 #if !defined (USE_SOCKETS) && \
46 !defined (USE_SOCKET_SEND) && \
47 !defined (USE_SOCKET_RECEIVE) && \
48 !defined (USE_RAW_SOCKETS) && \
49 !defined (USE_RAW_SEND) && \
50 !defined (USE_SOCKET_RECEIVE) && \
51 !defined (USE_BPF) && \
52 !defined (USE_BPF_SEND) && \
53 !defined (USE_BPF_RECEIVE) && \
54 !defined (USE_LPF) && \
55 !defined (USE_LPF_SEND) && \
56 !defined (USE_LPF_RECEIVE) && \
57 !defined (USE_NIT) && \
58 !defined (USE_NIT_SEND) && \
59 !defined (USE_NIT_RECEIVE) && \
60 !defined (USR_DLPI_SEND) && \
61 !defined (USE_DLPI_RECEIVE)
62 # define USE_DEFAULT_NETWORK
68 If you add a new system configuration file, include it here: */
71 # if defined (__svr4__) || defined (__SVR4)
72 # include "cf/sunos5-5.h"
74 # include "cf/sunos4.h"
83 # include "cf/bsdos.h"
87 # include "cf/netbsd.h"
91 # include "cf/freebsd.h"
94 #if defined (__osf__) && defined (__alpha)
95 # include "cf/alphaosf.h"
99 # include "cf/ultrix.h"
103 # include "cf/linux.h"
111 # include "cf/hpux.h"
119 # include "cf/cygwin32.h"
123 # include "cf/rhapsody.h"
126 # include "cf/nextstep.h"
130 #if defined(IRIX) || defined(__sgi)
131 # include "cf/irix.h"
134 #if !defined (TIME_MAX)
135 # define TIME_MAX 2147483647
140 If you add a new network API, and have it set up so that it can be
141 used for sending or receiving, but doesn't have to be used for both,
142 then set up an ifdef like the ones below: */
145 # define USE_SOCKET_SEND
146 # define USE_SOCKET_RECEIVE
149 #ifdef USE_RAW_SOCKETS
150 # define USE_RAW_SEND
151 # define USE_SOCKET_RECEIVE
155 # define USE_BPF_SEND
156 # define USE_BPF_RECEIVE
160 # define USE_LPF_SEND
161 # define USE_LPF_RECEIVE
165 # define USE_NIT_SEND
166 # define USE_NIT_RECEIVE
170 # define USE_DLPI_SEND
171 # define USE_DLPI_RECEIVE
175 # define USE_UPF_SEND
176 # define USE_UPF_RECEIVE
181 If you add support for sending packets directly out an interface,
182 and your support does not do ARP or routing, you must use a fallback
183 mechanism to deal with packets that need to be sent to routers.
184 Currently, all low-level packet interfaces use BSD sockets as a
187 #if defined (USE_BPF_SEND) || defined (USE_NIT_SEND) || \
188 defined (USE_DLPI_SEND) || defined (USE_UPF_SEND) || defined (USE_LPF_SEND)
189 # define USE_SOCKET_FALLBACK
190 # define USE_FALLBACK
195 If you add support for sending packets directly out an interface
196 and need to be able to assemble packets, add the USE_XXX_SEND
197 definition for your interface to the list tested below. */
199 #if defined (USE_RAW_SEND) || defined (USE_BPF_SEND) || \
200 defined (USE_NIT_SEND) || defined (USE_UPF_SEND) || \
201 defined (USE_DLPI_SEND) || defined (USE_LPF_SEND)
202 # define PACKET_ASSEMBLY
207 If you add support for receiving packets directly from an interface
208 and need to be able to decode raw packets, add the USE_XXX_RECEIVE
209 definition for your interface to the list tested below. */
211 #if defined (USE_RAW_RECEIVE) || defined (USE_BPF_SEND) || \
212 defined (USE_NIT_RECEIVE) || defined (USE_UPF_RECEIVE) || \
213 defined (USE_DLPI_RECEIVE) || defined (USE_LPF_RECEIVE)
214 # define PACKET_DECODING
217 /* If we don't have a DLPI packet filter, we have to filter in userland.
218 Probably not worth doing, actually. */
219 #if defined (USE_DLPI_RECEIVE) && !defined (USE_DLPI_PFMOD)
220 # define USERLAND_FILTER
223 /* jmp_buf is assumed to be a struct unless otherwise defined in the
226 # define jbp_decl(x) jmp_buf *x
229 # define jref(x) (&(x))
232 # define jdref(x) (*(x))
235 # define jrefproto jmp_buf *
239 # define BPF_FORMAT "/dev/bpf%d"
242 #if defined (IFF_POINTOPOINT) && !defined (HAVE_IFF_POINTOPOINT)
243 # define HAVE_IFF_POINTOPOINT
246 #if defined (AF_LINK) && !defined (HAVE_AF_LINK)
247 # define HAVE_AF_LINK
250 #if defined (ARPHRD_TUNNEL) && !defined (HAVE_ARPHRD_TUNNEL)
251 # define HAVE_ARPHRD_TUNNEL
254 #if defined (ARPHRD_LOOPBACK) && !defined (HAVE_ARPHRD_LOOPBACK)
255 # define HAVE_ARPHRD_LOOPBACK
258 #if defined (ARPHRD_ROSE) && !defined (HAVE_ARPHRD_ROSE)
259 # define HAVE_ARPHRD_ROSE
262 #if defined (ARPHRD_IEEE802) && !defined (HAVE_ARPHRD_IEEE802)
263 # define HAVE_ARPHRD_IEEE802
266 #if defined (ARPHRD_FDDI) && !defined (HAVE_ARPHRD_FDDI)
267 # define HAVE_ARPHRD_FDDI
270 #if defined (ARPHRD_AX25) && !defined (HAVE_ARPHRD_AX25)
271 # define HAVE_ARPHRD_AX25
274 #if defined (ARPHRD_NETROM) && !defined (HAVE_ARPHRD_NETROM)
275 # define HAVE_ARPHRD_NETROM
278 #if defined (ARPHRD_METRICOM) && !defined (HAVE_ARPHRD_METRICOM)
279 # define HAVE_ARPHRD_METRICOM
282 #if defined (SO_BINDTODEVICE) && !defined (HAVE_SO_BINDTODEVICE)
283 # define HAVE_SO_BINDTODEVICE
286 #if defined (SIOCGIFHWADDR) && !defined (HAVE_SIOCGIFHWADDR)
287 # define HAVE_SIOCGIFHWADDR
290 #if defined (AF_LINK) && !defined (HAVE_AF_LINK)
291 # define HAVE_AF_LINK