]>
Commit | Line | Data |
---|---|---|
d7837182 TL |
1 | /* osdep.h |
2 | ||
3 | Operating system dependencies... */ | |
4 | ||
5 | /* | |
f39b6e00 TL |
6 | * Copyright (c) 1996-1999 Internet Software Consortium. |
7 | * Use is subject to license terms which appear in the file named | |
8 | * ISC-LICENSE that should have accompanied this file when you | |
9 | * received it. If a file named ISC-LICENSE did not accompany this | |
10 | * file, or you are not sure the one you have is correct, you may | |
11 | * obtain an applicable copy of the license at: | |
d7837182 | 12 | * |
f39b6e00 | 13 | * http://www.isc.org/isc-license-1.0.html. |
d7837182 | 14 | * |
f39b6e00 TL |
15 | * This file is part of the ISC DHCP distribution. The documentation |
16 | * associated with this file is listed in the file DOCUMENTATION, | |
17 | * included in the top-level directory of this release. | |
d7837182 | 18 | * |
f39b6e00 TL |
19 | * Support and other services are available for ISC products - see |
20 | * http://www.isc.org for more information. | |
d7837182 TL |
21 | */ |
22 | ||
a04c50cd TL |
23 | #include "site.h" |
24 | ||
af0ef363 TL |
25 | /* Porting:: |
26 | ||
27 | If you add a new network API, you must add a check for it below: */ | |
28 | ||
a04c50cd TL |
29 | #if !defined (USE_SOCKETS) && \ |
30 | !defined (USE_SOCKET_SEND) && \ | |
31 | !defined (USE_SOCKET_RECEIVE) && \ | |
32 | !defined (USE_RAW_SOCKETS) && \ | |
33 | !defined (USE_RAW_SEND) && \ | |
34 | !defined (USE_SOCKET_RECEIVE) && \ | |
35 | !defined (USE_BPF) && \ | |
36 | !defined (USE_BPF_SEND) && \ | |
37 | !defined (USE_BPF_RECEIVE) && \ | |
d2bc90bd TL |
38 | !defined (USE_LPF) && \ |
39 | !defined (USE_LPF_SEND) && \ | |
40 | !defined (USE_LPF_RECEIVE) && \ | |
a04c50cd TL |
41 | !defined (USE_NIT) && \ |
42 | !defined (USE_NIT_SEND) && \ | |
961ea0f7 TL |
43 | !defined (USE_NIT_RECEIVE) && \ |
44 | !defined (USR_DLPI_SEND) && \ | |
45 | !defined (USE_DLPI_RECEIVE) | |
a04c50cd TL |
46 | # define USE_DEFAULT_NETWORK |
47 | #endif | |
48 | ||
d2bc90bd TL |
49 | #if !defined (TIME_MAX) |
50 | # define TIME_MAX 2147483647 | |
51 | #endif | |
a04c50cd | 52 | |
af0ef363 TL |
53 | /* Porting:: |
54 | ||
55 | If you add a new system configuration file, include it here: */ | |
56 | ||
b1af589d | 57 | #if defined (sun) |
3e7cd8c1 | 58 | # if defined (__svr4__) || defined (__SVR4) |
b1af589d TL |
59 | # include "cf/sunos5-5.h" |
60 | # else | |
a04c50cd | 61 | # include "cf/sunos4.h" |
b1af589d | 62 | # endif |
d7837182 TL |
63 | #endif |
64 | ||
65 | #ifdef bsdi | |
a04c50cd | 66 | # include "cf/bsdos.h" |
d7837182 TL |
67 | #endif |
68 | ||
69 | #ifdef __NetBSD__ | |
a04c50cd | 70 | # include "cf/netbsd.h" |
d7837182 TL |
71 | #endif |
72 | ||
a8b53b42 | 73 | #ifdef __FreeBSD__ |
a04c50cd | 74 | # include "cf/freebsd.h" |
a8b53b42 TL |
75 | #endif |
76 | ||
58a4aa84 TL |
77 | #if defined (__osf__) && defined (__alpha) |
78 | # include "cf/alphaosf.h" | |
79 | #endif | |
80 | ||
a8b53b42 | 81 | #ifdef ultrix |
a04c50cd | 82 | # include "cf/ultrix.h" |
a8b53b42 TL |
83 | #endif |
84 | ||
85 | #ifdef linux | |
a04c50cd | 86 | # include "cf/linux.h" |
a8b53b42 | 87 | #endif |
98078fdb | 88 | |
af0ef363 TL |
89 | #ifdef SCO |
90 | # include "cf/sco.h" | |
91 | #endif | |
92 | ||
74bbacb8 TL |
93 | #ifdef hpux |
94 | # include "cf/hpux.h" | |
95 | #endif | |
96 | ||
621be269 TL |
97 | #ifdef __QNX__ |
98 | # include "cf/qnx.h" | |
99 | #endif | |
100 | ||
d92bab9a TL |
101 | #ifdef __CYGWIN32__ |
102 | # include "cf/cygwin32.h" | |
103 | #endif | |
104 | ||
4e5a40cd | 105 | #ifdef NeXT |
aaf053e3 TL |
106 | # ifdef __APPLE__ |
107 | # include "cf/rhapsody.h" | |
108 | # else | |
4e5a40cd | 109 | # include "cf/nextstep.h" |
aaf053e3 | 110 | # endif |
4e5a40cd TL |
111 | #endif |
112 | ||
af0ef363 TL |
113 | /* Porting:: |
114 | ||
115 | If you add a new network API, and have it set up so that it can be | |
116 | used for sending or receiving, but doesn't have to be used for both, | |
117 | then set up an ifdef like the ones below: */ | |
118 | ||
98078fdb | 119 | #ifdef USE_SOCKETS |
a04c50cd TL |
120 | # define USE_SOCKET_SEND |
121 | # define USE_SOCKET_RECEIVE | |
98078fdb TL |
122 | #endif |
123 | ||
124 | #ifdef USE_RAW_SOCKETS | |
a04c50cd TL |
125 | # define USE_RAW_SEND |
126 | # define USE_SOCKET_RECEIVE | |
98078fdb TL |
127 | #endif |
128 | ||
129 | #ifdef USE_BPF | |
a04c50cd TL |
130 | # define USE_BPF_SEND |
131 | # define USE_BPF_RECEIVE | |
98078fdb TL |
132 | #endif |
133 | ||
d2bc90bd TL |
134 | #ifdef USE_LPF |
135 | # define USE_LPF_SEND | |
136 | # define USE_LPF_RECEIVE | |
137 | #endif | |
138 | ||
98078fdb | 139 | #ifdef USE_NIT |
a04c50cd TL |
140 | # define USE_NIT_SEND |
141 | # define USE_NIT_RECEIVE | |
98078fdb | 142 | #endif |
b7c4d8d5 | 143 | |
961ea0f7 TL |
144 | #ifdef USE_DLPI |
145 | # define USE_DLPI_SEND | |
146 | # define USE_DLPI_RECEIVE | |
147 | #endif | |
148 | ||
2f26c2dc TL |
149 | #ifdef USE_UPF |
150 | # define USE_UPF_SEND | |
151 | # define USE_UPF_RECEIVE | |
152 | #endif | |
153 | ||
b7c4d8d5 TL |
154 | /* Porting:: |
155 | ||
156 | If you add support for sending packets directly out an interface, | |
157 | and your support does not do ARP or routing, you must use a fallback | |
158 | mechanism to deal with packets that need to be sent to routers. | |
159 | Currently, all low-level packet interfaces use BSD sockets as a | |
160 | fallback. */ | |
161 | ||
961ea0f7 | 162 | #if defined (USE_BPF_SEND) || defined (USE_NIT_SEND) || \ |
d2bc90bd | 163 | defined (USE_DLPI_SEND) || defined (USE_UPF_SEND) || defined (USE_LPF_SEND) |
b7c4d8d5 TL |
164 | # define USE_SOCKET_FALLBACK |
165 | # define USE_FALLBACK | |
166 | #endif | |
10e99bf1 | 167 | |
af0ef363 TL |
168 | /* Porting:: |
169 | ||
170 | If you add support for sending packets directly out an interface | |
171 | and need to be able to assemble packets, add the USE_XXX_SEND | |
172 | definition for your interface to the list tested below. */ | |
173 | ||
2f26c2dc | 174 | #if defined (USE_RAW_SEND) || defined (USE_BPF_SEND) || \ |
961ea0f7 | 175 | defined (USE_NIT_SEND) || defined (USE_UPF_SEND) || \ |
d2bc90bd | 176 | defined (USE_DLPI_SEND) || defined (USE_LPF_SEND) |
af0ef363 TL |
177 | # define PACKET_ASSEMBLY |
178 | #endif | |
179 | ||
180 | /* Porting:: | |
181 | ||
182 | If you add support for receiving packets directly from an interface | |
183 | and need to be able to decode raw packets, add the USE_XXX_RECEIVE | |
184 | definition for your interface to the list tested below. */ | |
185 | ||
2f26c2dc | 186 | #if defined (USE_RAW_RECEIVE) || defined (USE_BPF_SEND) || \ |
961ea0f7 | 187 | defined (USE_NIT_RECEIVE) || defined (USE_UPF_RECEIVE) || \ |
d2bc90bd | 188 | defined (USE_DLPI_RECEIVE) || defined (USE_LPF_RECEIVE) |
af0ef363 TL |
189 | # define PACKET_DECODING |
190 | #endif | |
191 | ||
44947018 TL |
192 | /* If we don't have a DLPI packet filter, we have to filter in userland. |
193 | Probably not worth doing, actually. */ | |
194 | #if defined (USE_DLPI_RECEIVE) && !defined (USE_DLPI_PFMOD) | |
195 | # define USERLAND_FILTER | |
196 | #endif | |
197 | ||
10e99bf1 TL |
198 | /* jmp_buf is assumed to be a struct unless otherwise defined in the |
199 | system header. */ | |
200 | #ifndef jbp_decl | |
201 | # define jbp_decl(x) jmp_buf *x | |
202 | #endif | |
203 | #ifndef jref | |
204 | # define jref(x) (&(x)) | |
205 | #endif | |
206 | #ifndef jdref | |
207 | # define jdref(x) (*(x)) | |
208 | #endif | |
b1af589d TL |
209 | #ifndef jrefproto |
210 | # define jrefproto jmp_buf * | |
211 | #endif | |
10e99bf1 | 212 | |
58a4aa84 TL |
213 | #ifndef BPF_FORMAT |
214 | # define BPF_FORMAT "/dev/bpf%d" | |
215 | #endif | |
74f45f96 TL |
216 | |
217 | #if defined (IFF_POINTOPOINT) && !defined (HAVE_IFF_POINTOPOINT) | |
218 | # define HAVE_IFF_POINTOPOINT | |
219 | #endif | |
220 | ||
221 | #if defined (AF_LINK) && !defined (HAVE_AF_LINK) | |
222 | # define HAVE_AF_LINK | |
223 | #endif | |
224 | ||
225 | #if defined (ARPHRD_TUNNEL) && !defined (HAVE_ARPHRD_TUNNEL) | |
226 | # define HAVE_ARPHRD_TUNNEL | |
227 | #endif | |
228 | ||
229 | #if defined (ARPHRD_LOOPBACK) && !defined (HAVE_ARPHRD_LOOPBACK) | |
230 | # define HAVE_ARPHRD_LOOPBACK | |
231 | #endif | |
232 | ||
233 | #if defined (ARPHRD_METRICOM) && !defined (HAVE_ARPHRD_METRICOM) | |
234 | # define HAVE_ARPHRD_METRICOM | |
235 | #endif | |
236 | ||
237 | #if defined (SO_BINDTODEVICE) && !defined (HAVE_SO_BINDTODEVICE) | |
238 | # define HAVE_SO_BINDTODEVICE | |
239 | #endif | |
240 | ||
241 | #if defined (SIOCGIFHWADDR) && !defined (HAVE_SIOCGIFHWADDR) | |
242 | # define HAVE_SIOCGIFHWADDR | |
243 | #endif | |
244 | ||
245 | #if defined (AF_LINK) && !defined (HAVE_AF_LINK) | |
246 | # define HAVE_AF_LINK | |
247 | #endif | |
248 |