]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/isc-dhcp/includes/osdep.h
This commit was generated by cvs2svn to compensate for changes in r51899,
[FreeBSD/FreeBSD.git] / contrib / isc-dhcp / includes / osdep.h
1 /* osdep.h
2
3    Operating system dependencies... */
4
5 /*
6  * Copyright (c) 1996, 1997, 1998, 1999 The Internet Software Consortium.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
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.
21  *
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.
34  *
35  * This software was written for the Internet Software Consortium by Ted Lemon
36  * under a contract with Vixie Laboratories.
37  */
38
39 #include "site.h"
40
41 /* Porting::
42
43    If you add a new network API, you must add a check for it below: */
44
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
63 #endif
64
65
66 /* Porting::
67
68    If you add a new system configuration file, include it here: */
69
70 #if defined (sun)
71 # if defined (__svr4__) || defined (__SVR4)
72 #  include "cf/sunos5-5.h"
73 # else
74 #  include "cf/sunos4.h"
75 # endif
76 #endif
77
78 #ifdef aix
79 #  include "cf/aix.h"
80 #endif
81
82 #ifdef bsdi
83 #  include "cf/bsdos.h"
84 #endif
85
86 #ifdef __NetBSD__
87 #  include "cf/netbsd.h"
88 #endif
89
90 #ifdef __FreeBSD__
91 #  include "cf/freebsd.h"
92 #endif
93
94 #if defined (__osf__) && defined (__alpha)
95 #  include "cf/alphaosf.h"
96 #endif
97
98 #ifdef ultrix
99 #  include "cf/ultrix.h"
100 #endif
101
102 #ifdef linux
103 #  include "cf/linux.h"
104 #endif
105
106 #ifdef SCO
107 #  include "cf/sco.h"
108 #endif
109
110 #ifdef hpux
111 #  include "cf/hpux.h"
112 #endif
113
114 #ifdef __QNX__
115 #  include "cf/qnx.h"
116 #endif
117
118 #ifdef __CYGWIN32__
119 #  include "cf/cygwin32.h"
120 #endif
121
122 #ifdef __APPLE__
123 # include "cf/rhapsody.h"
124 #else
125 # if defined (NeXT)
126 #  include "cf/nextstep.h"
127 # endif
128 #endif
129
130 #if defined(IRIX) || defined(__sgi)
131 # include "cf/irix.h"
132 #endif
133
134 #if !defined (TIME_MAX)
135 # define TIME_MAX 2147483647
136 #endif
137
138 /* Porting::
139
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: */
143
144 #ifdef USE_SOCKETS
145 #  define USE_SOCKET_SEND
146 #  define USE_SOCKET_RECEIVE
147 #endif
148
149 #ifdef USE_RAW_SOCKETS
150 #  define USE_RAW_SEND
151 #  define USE_SOCKET_RECEIVE
152 #endif
153
154 #ifdef USE_BPF
155 #  define USE_BPF_SEND
156 #  define USE_BPF_RECEIVE
157 #endif
158
159 #ifdef USE_LPF
160 #  define USE_LPF_SEND
161 #  define USE_LPF_RECEIVE
162 #endif
163
164 #ifdef USE_NIT
165 #  define USE_NIT_SEND
166 #  define USE_NIT_RECEIVE
167 #endif
168
169 #ifdef USE_DLPI
170 #  define USE_DLPI_SEND
171 #  define USE_DLPI_RECEIVE
172 #endif
173
174 #ifdef USE_UPF
175 #  define USE_UPF_SEND
176 #  define USE_UPF_RECEIVE
177 #endif
178
179 /* Porting::
180
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
185    fallback. */
186
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
191 #endif
192
193 /* Porting::
194
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. */
198
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
203 #endif
204
205 /* Porting::
206
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. */
210
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
215 #endif
216
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
221 #endif
222
223 /* jmp_buf is assumed to be a struct unless otherwise defined in the
224    system header. */
225 #ifndef jbp_decl
226 # define jbp_decl(x)    jmp_buf *x
227 #endif
228 #ifndef jref
229 # define jref(x)        (&(x))
230 #endif
231 #ifndef jdref
232 # define jdref(x)       (*(x))
233 #endif
234 #ifndef jrefproto
235 # define jrefproto      jmp_buf *
236 #endif
237
238 #ifndef BPF_FORMAT
239 # define BPF_FORMAT "/dev/bpf%d"
240 #endif
241
242 #if defined (IFF_POINTOPOINT) && !defined (HAVE_IFF_POINTOPOINT)
243 # define HAVE_IFF_POINTOPOINT
244 #endif
245
246 #if defined (AF_LINK) && !defined (HAVE_AF_LINK)
247 # define HAVE_AF_LINK
248 #endif
249
250 #if defined (ARPHRD_TUNNEL) && !defined (HAVE_ARPHRD_TUNNEL)
251 # define HAVE_ARPHRD_TUNNEL
252 #endif
253
254 #if defined (ARPHRD_LOOPBACK) && !defined (HAVE_ARPHRD_LOOPBACK)
255 # define HAVE_ARPHRD_LOOPBACK
256 #endif
257
258 #if defined (ARPHRD_ROSE) && !defined (HAVE_ARPHRD_ROSE)
259 # define HAVE_ARPHRD_ROSE
260 #endif
261
262 #if defined (ARPHRD_IEEE802) && !defined (HAVE_ARPHRD_IEEE802)
263 # define HAVE_ARPHRD_IEEE802
264 #endif
265
266 #if defined (ARPHRD_FDDI) && !defined (HAVE_ARPHRD_FDDI)
267 # define HAVE_ARPHRD_FDDI
268 #endif
269
270 #if defined (ARPHRD_AX25) && !defined (HAVE_ARPHRD_AX25)
271 # define HAVE_ARPHRD_AX25
272 #endif
273
274 #if defined (ARPHRD_NETROM) && !defined (HAVE_ARPHRD_NETROM)
275 # define HAVE_ARPHRD_NETROM
276 #endif
277
278 #if defined (ARPHRD_METRICOM) && !defined (HAVE_ARPHRD_METRICOM)
279 # define HAVE_ARPHRD_METRICOM
280 #endif
281
282 #if defined (SO_BINDTODEVICE) && !defined (HAVE_SO_BINDTODEVICE)
283 # define HAVE_SO_BINDTODEVICE
284 #endif
285
286 #if defined (SIOCGIFHWADDR) && !defined (HAVE_SIOCGIFHWADDR)
287 # define HAVE_SIOCGIFHWADDR
288 #endif
289
290 #if defined (AF_LINK) && !defined (HAVE_AF_LINK)
291 # define HAVE_AF_LINK
292 #endif