tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / workbench / network / stacks / AROSTCP / dhcp / includes / dhcp_osdep.h
blob9efb2ae22aecf0a931c5c038266565c2731a3de0
1 /* osdep.h
3 Operating system dependencies... */
5 /*
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.
22 * 950 Charter Street
23 * Redwood City, CA 94063
24 * <info@isc.org>
25 * http://www.isc.org/
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__
38 #include "site.h"
40 /* Porting::
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
62 #endif
64 #if !defined (TIME_MAX)
65 # define TIME_MAX 2147483647
66 #endif
68 /* Porting::
70 If you add a new system configuration file, include it here: */
72 #if defined (sun)
73 # if defined (__svr4__) || defined (__SVR4)
74 # include "cf/sunos5-5.h"
75 # else
76 # include "cf/sunos4.h"
77 # endif
78 #endif
80 #ifdef aix
81 # include "cf/aix.h"
82 #endif
84 #ifdef bsdi
85 # include "cf/bsdos.h"
86 #endif
88 #ifdef __NetBSD__
89 # include "cf/netbsd.h"
90 #endif
92 #ifdef __FreeBSD__
93 # include "cf/freebsd.h"
94 #endif
96 #ifdef OpenBSD
97 # include "cf/openbsd.h"
98 #endif
100 #if defined (__osf__) && defined (__alpha)
101 # include "cf/alphaosf.h"
102 #endif
104 #ifdef ultrix
105 # include "cf/ultrix.h"
106 #endif
108 #ifdef linux
109 # include "cf/linux.h"
110 #endif
112 #ifdef SCO
113 # include "cf/sco.h"
114 #endif
116 #if defined (hpux) || defined (__hpux)
117 # include "cf/hpux.h"
118 #endif
120 #ifdef __QNX__
121 # include "cf/qnx.h"
122 #endif
124 #ifdef __CYGWIN32__
125 # include "cf/cygwin32.h"
126 #endif
128 #ifdef __AROS__
129 # include "cf/aros.h"
130 #endif
132 #ifdef __MORPHOS__
133 # include "cf/morphos.h"
134 #endif
136 #ifdef __APPLE__
137 # include "cf/rhapsody.h"
138 #else
139 # if defined (NeXT)
140 # include "cf/nextstep.h"
141 # endif
142 #endif
144 /* snprintf/vsnprintf hacks. for systems with no libc versions only. */
145 #ifdef NO_SNPRINTF
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
150 #endif
152 /* Porting::
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: */
158 #ifdef USE_SOCKETS
159 # define USE_SOCKET_SEND
160 # define USE_SOCKET_RECEIVE
161 #endif
163 #ifdef USE_RAW_SOCKETS
164 # define USE_RAW_SEND
165 # define USE_SOCKET_RECEIVE
166 #endif
168 #ifdef USE_BPF
169 # define USE_BPF_SEND
170 # define USE_BPF_RECEIVE
171 #endif
173 #ifdef USE_LPF
174 # define USE_LPF_SEND
175 # define USE_LPF_RECEIVE
176 #endif
178 #ifdef USE_NIT
179 # define USE_NIT_SEND
180 # define USE_NIT_RECEIVE
181 #endif
183 #ifdef USE_DLPI
184 # define USE_DLPI_SEND
185 # define USE_DLPI_RECEIVE
186 #endif
188 #ifdef USE_UPF
189 # define USE_UPF_SEND
190 # define USE_UPF_RECEIVE
191 #endif
193 /* Porting::
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
199 fallback. */
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
207 #endif
209 /* Porting::
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
219 #endif
221 /* Porting::
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
231 #endif
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
237 #endif
239 /* jmp_buf is assumed to be a struct unless otherwise defined in the
240 system header. */
241 #ifndef jbp_decl
242 # define jbp_decl(x) jmp_buf *x
243 #endif
244 #ifndef jref
245 # define jref(x) (&(x))
246 #endif
247 #ifndef jdref
248 # define jdref(x) (*(x))
249 #endif
250 #ifndef jrefproto
251 # define jrefproto jmp_buf *
252 #endif
254 #ifndef BPF_FORMAT
255 # define BPF_FORMAT "/dev/bpf%d"
256 #endif
258 #ifndef NO_AUTO_SETFD
259 #if defined (F_SETFD) && !defined (HAVE_SETFD)
260 # define HAVE_SETFD
261 #endif
262 #endif
264 #if defined (IFF_POINTOPOINT) && !defined (HAVE_IFF_POINTOPOINT)
265 # define HAVE_IFF_POINTOPOINT
266 #endif
268 #if defined (AF_LINK) && !defined (HAVE_AF_LINK)
269 # define HAVE_AF_LINK
270 #endif
272 #if defined (ARPHRD_TUNNEL) && !defined (HAVE_ARPHRD_TUNNEL)
273 # define HAVE_ARPHRD_TUNNEL
274 #endif
276 #if defined (ARPHRD_LOOPBACK) && !defined (HAVE_ARPHRD_LOOPBACK)
277 # define HAVE_ARPHRD_LOOPBACK
278 #endif
280 #if defined (ARPHRD_ROSE) && !defined (HAVE_ARPHRD_ROSE)
281 # define HAVE_ARPHRD_ROSE
282 #endif
284 #if defined (ARPHRD_IEEE802) && !defined (HAVE_ARPHRD_IEEE802)
285 # define HAVE_ARPHRD_IEEE802
286 #endif
288 #if defined (ARPHRD_IEEE802_TR) && !defined (HAVE_ARPHRD_IEEE802_TR)
289 # define HAVE_ARPHRD_IEEE802_TR
290 #endif
292 #if defined (ARPHRD_FDDI) && !defined (HAVE_ARPHRD_FDDI)
293 # define HAVE_ARPHRD_FDDI
294 #endif
296 #if defined (ARPHRD_AX25) && !defined (HAVE_ARPHRD_AX25)
297 # define HAVE_ARPHRD_AX25
298 #endif
300 #if defined (ARPHRD_NETROM) && !defined (HAVE_ARPHRD_NETROM)
301 # define HAVE_ARPHRD_NETROM
302 #endif
304 #if defined (ARPHRD_METRICOM) && !defined (HAVE_ARPHRD_METRICOM)
305 # define HAVE_ARPHRD_METRICOM
306 #endif
308 #if defined (SO_BINDTODEVICE) && !defined (HAVE_SO_BINDTODEVICE)
309 # define HAVE_SO_BINDTODEVICE
310 #endif
312 #if defined (AF_LINK) && !defined (HAVE_AF_LINK)
313 # define HAVE_AF_LINK
314 #endif
316 /* Linux needs to define SHUT_* in /usr/include/sys/socket.h someday... */
317 #if !defined (SHUT_RD)
318 # define SHUT_RD 0
319 #endif
321 #if !defined (SOCKLEN_T)
322 # define SOCKLEN_T socklen_t
323 #endif
325 #if !defined (STDERR_FILENO)
326 # define STDERR_FILENO 2
327 #endif
329 #endif /* __ISC_DHCP_OSDEP_H__ */