]> git.ipfire.org Git - thirdparty/dhcp.git/blob - server/stables.c
055b4fe223d35ab1fd7011e8345f7c42213a102a
[thirdparty/dhcp.git] / server / stables.c
1 /* stables.c
2
3 Tables of information only used by server... */
4
5 /*
6 * Copyright (c) 1995-1999 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
19 * of its 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,
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
34 * SUCH DAMAGE.
35 *
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''.
42 */
43
44 #ifndef lint
45 static char copyright[] =
46 "$Id: stables.c,v 1.11 2000/05/02 00:25:10 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
47 #endif /* not lint */
48
49 #include "dhcpd.h"
50
51 #if defined (FAILOVER_PROTOCOL)
52
53 /* This is used to indicate some kind of failure when generating a
54 failover option. */
55 failover_option_t null_failover_option = { 0, 0 };
56 failover_option_t skip_failover_option = { 0, 0 };
57
58 /* Information about failover options, for printing, encoding
59 and decoding. */
60 struct failover_option_info ft_options [] =
61 {
62 { 0, "unused", FT_UNDEF, 0, 0, 0 },
63 { FTO_BINDING_STATUS, "binding-status",
64 FT_UINT8, 1, FM_OFFSET (binding_status), FTB_BINDING_STATUS },
65 { FTO_ASSIGNED_IP_ADDRESS, "assigned-IP-address",
66 FT_IPADDR, 1, FM_OFFSET (assigned_addr), FTB_ASSIGNED_IP_ADDRESS },
67 { FTO_SERVER_ADDR, "sending-server-IP-address",
68 FT_IPADDR, 1, FM_OFFSET (server_addr), FTB_SERVER_ADDR },
69 { FTO_ADDRESSES_TRANSFERRED, "addresses-transferred",
70 FT_UINT32, 1, FM_OFFSET (addresses_transferred),
71 FTB_ADDRESSES_TRANSFERRED },
72 { FTO_CLIENT_IDENTIFIER, "client-identifier",
73 FT_BYTES, 0, FM_OFFSET (client_identifier), FTB_CLIENT_IDENTIFIER },
74 { FTO_CHADDR, "client-hardware-address",
75 FT_BYTES, 0, FM_OFFSET (chaddr), FTB_CHADDR },
76 { FTO_DDNS, "DDNS",
77 FT_DDNS, 1, FM_OFFSET (ddns), FTB_DDNS },
78 { FTO_REJECT_REASON, "reject-reason",
79 FT_UINT8, 1, FM_OFFSET (reject_reason), FTB_REJECT_REASON },
80 { FTO_MESSAGE, "message",
81 FT_TEXT, 0, FM_OFFSET (message), FTB_MESSAGE },
82 { FTO_MCLT, "MCLT",
83 FT_UINT32, 1, FM_OFFSET (mclt), FTB_MCLT },
84 { FTO_VENDOR_CLASS, "vendor-class-identifier",
85 FT_TEXT_OR_BYTES, 0, FM_OFFSET (vendor_class), FTB_VENDOR_CLASS },
86 { 12, "undefined", FT_UNDEF, 0, 0, 0 },
87 { FTO_LEASE_EXPIRY, "lease-expiration-time",
88 FT_UINT32, 1, FM_OFFSET (expiry), FTB_LEASE_EXPIRY },
89 { FTO_POTENTIAL_EXPIRY, "potential-expiration-time",
90 FT_UINT32, 1, FM_OFFSET (potential_expiry), FTB_POTENTIAL_EXPIRY },
91 { FTO_GRACE_EXPIRY, "grace-expiration-time",
92 FT_UINT32, 1, FM_OFFSET (grace_expiry), FTB_GRACE_EXPIRY },
93 { FTO_CLTT, "client-last-transaction-time",
94 FT_UINT32, 1, FM_OFFSET (client_ltt), FTB_CLTT },
95 { FTO_STOS, "start-time-of-state",
96 FT_UINT32, 1, FM_OFFSET (stos), FTB_STOS },
97 { FTO_SERVER_STATE, "server-state",
98 FT_UINT8, 1, FM_OFFSET (server_state), FTB_SERVER_STATE },
99 { FTO_SERVER_FLAGS, "server-flags",
100 FT_UINT8, 1, FM_OFFSET (server_flags), FTB_SERVER_FLAGS },
101 { FTO_VENDOR_OPTIONS, "vendor-specific-options",
102 FT_BYTES, 0, FM_OFFSET (vendor_options), FTB_VENDOR_OPTIONS },
103 { FTO_MAX_UNACKED, "max-unacked-bndupd",
104 FT_UINT32, 1, FM_OFFSET (max_unacked), FTB_MAX_UNACKED },
105 { 22, "undefined", FT_UNDEF, 0, 0 },
106 { FTO_RECEIVE_TIMER, "receive-timer",
107 FT_UINT32, 1, FM_OFFSET (receive_timer), FTB_RECEIVE_TIMER },
108 { FTO_HBA, "hash-bucket-assignment",
109 FT_BYTES, 0, FM_OFFSET (hba), FTB_HBA },
110 { FTO_MESSAGE_DIGEST, "message-digest",
111 FT_DIGEST, 0, 0, FTB_MESSAGE_DIGEST },
112 { FTO_PROTOCOL_VERSION, "protocol-version",
113 FT_UINT8, 1, FM_OFFSET (protocol_version), FTB_PROTOCOL_VERSION },
114 { FTO_TLS_REQUEST, "TLS-request",
115 FT_UINT8, 2, FM_OFFSET (tls_request), FTB_TLS_REQUEST },
116 { FTO_TLS_REPLY, "TLS-reply",
117 FT_BYTES, 1, FM_OFFSET (tls_reply ), FTB_TLS_REPLY },
118 { FTO_REQUEST_OPTIONS, "client-request-options",
119 FT_BYTES, 0, FM_OFFSET (request_options), FTB_REQUEST_OPTIONS },
120 { FTO_REPLY_OPTIONS, "client-reply-options",
121 FT_BYTES, 0, FM_OFFSET (reply_options), FTB_REPLY_OPTIONS }
122 };
123
124 /* These are really options that make sense for a particular request - if
125 some other option comes in, we're not going to use it, so we can just
126 discard it. Note that the message-digest option is allowed for all
127 message types, but is not saved - it's just used to validate the message
128 and then discarded - so it's not mentioned here. */
129
130 u_int32_t fto_allowed [] = {
131 0, /* 0 unused */
132 0, /* 1 POOLREQ */
133 FTB_ADDRESSES_TRANSFERRED, /* 2 POOLRESP */
134 (FTB_ASSIGNED_IP_ADDRESS | FTB_BINDING_STATUS | FTB_CLIENT_IDENTIFIER |
135 FTB_CHADDR | FTB_LEASE_EXPIRY | FTB_POTENTIAL_EXPIRY | FTB_STOS |
136 FTB_CLTT | FTB_REQUEST_OPTIONS | FTB_REPLY_OPTIONS), /* 3 BNDUPD */
137 (FTB_ASSIGNED_IP_ADDRESS | FTB_BINDING_STATUS | FTB_CLIENT_IDENTIFIER |
138 FTB_CHADDR | FTB_LEASE_EXPIRY | FTB_POTENTIAL_EXPIRY | FTB_STOS |
139 FTB_CLTT | FTB_REQUEST_OPTIONS | FTB_REPLY_OPTIONS), /* 4 BNDACK */
140 (FTB_SERVER_ADDR | FTB_MAX_UNACKED | FTB_RECEIVE_TIMER |
141 FTB_VENDOR_CLASS | FTB_PROTOCOL_VERSION | FTB_TLS_REQUEST |
142 FTB_MCLT | FTB_HBA), /* 5 CONNECT */
143 (FTB_SERVER_ADDR | FTB_MAX_UNACKED | FTB_RECEIVE_TIMER |
144 FTB_VENDOR_CLASS | FTB_PROTOCOL_VERSION | FTB_TLS_REPLY |
145 FTB_REJECT_REASON | FTB_MESSAGE), /* CONNECTACK */
146 0, /* 7 UPDREQ */
147 0, /* 8 UPDDONE */
148 0, /* 9 UPDREQALL */
149 (FTB_SERVER_STATE | FTB_SERVER_FLAGS | FTB_STOS), /* 10 STATE */
150 0, /* 11 CONTACT */
151 (FTB_REJECT_REASON | FTB_MESSAGE) /* 12 DISCONNECT */
152 };
153
154 /* Sizes of the various types. */
155 int ft_sizes [] = {
156 1, /* FT_UINT8 */
157 4, /* FT_IPADDR */
158 4, /* FT_UINT32 */
159 1, /* FT_BYTES */
160 1, /* FT_TEXT_OR_BYTES */
161 0, /* FT_DDNS */
162 0, /* FT_DDNS1 */
163 2, /* FT_UINT16 */
164 1, /* FT_TEXT */
165 0, /* FT_UNDEF */
166 0, /* FT_DIGEST */
167 };
168
169 /* Names of the various failover link states. */
170 const char *dhcp_flink_state_names [] = {
171 "invalid state 0",
172 "startup",
173 "message length wait",
174 "message wait",
175 "disconnected"
176 };
177 #endif /* FAILOVER_PROTOCOL */
178
179 struct universe agent_universe;
180 struct option agent_options [256] = {
181 { "pad", "", &agent_universe, 0 },
182 { "circuit-id", "X", &agent_universe, 1 },
183 { "remote-id", "X", &agent_universe, 2 },
184 { "agent-id", "I", &agent_universe, 3 },
185 { "option-4", "X", &agent_universe, 4 },
186 { "option-5", "X", &agent_universe, 5 },
187 { "option-6", "X", &agent_universe, 6 },
188 { "option-7", "X", &agent_universe, 7 },
189 { "option-8", "X", &agent_universe, 8 },
190 { "option-9", "X", &agent_universe, 9 },
191 { "option-10", "X", &agent_universe, 10 },
192 { "option-11", "X", &agent_universe, 11 },
193 { "option-12", "X", &agent_universe, 12 },
194 { "option-13", "X", &agent_universe, 13 },
195 { "option-14", "X", &agent_universe, 14 },
196 { "option-15", "X", &agent_universe, 15 },
197 { "option-16", "X", &agent_universe, 16 },
198 { "option-17", "X", &agent_universe, 17 },
199 { "option-18", "X", &agent_universe, 18 },
200 { "option-19", "X", &agent_universe, 19 },
201 { "option-20", "X", &agent_universe, 20 },
202 { "option-21", "X", &agent_universe, 21 },
203 { "option-22", "X", &agent_universe, 22 },
204 { "option-23", "X", &agent_universe, 23 },
205 { "option-24", "X", &agent_universe, 24 },
206 { "option-25", "X", &agent_universe, 25 },
207 { "option-26", "X", &agent_universe, 26 },
208 { "option-27", "X", &agent_universe, 27 },
209 { "option-28", "X", &agent_universe, 28 },
210 { "option-29", "X", &agent_universe, 29 },
211 { "option-30", "X", &agent_universe, 30 },
212 { "option-31", "X", &agent_universe, 31 },
213 { "option-32", "X", &agent_universe, 32 },
214 { "option-33", "X", &agent_universe, 33 },
215 { "option-34", "X", &agent_universe, 34 },
216 { "option-35", "X", &agent_universe, 35 },
217 { "option-36", "X", &agent_universe, 36 },
218 { "option-37", "X", &agent_universe, 37 },
219 { "option-38", "X", &agent_universe, 38 },
220 { "option-39", "X", &agent_universe, 39 },
221 { "option-40", "X", &agent_universe, 40 },
222 { "option-41", "X", &agent_universe, 41 },
223 { "option-42", "X", &agent_universe, 42 },
224 { "option-43", "X", &agent_universe, 43 },
225 { "option-44", "X", &agent_universe, 44 },
226 { "option-45", "X", &agent_universe, 45 },
227 { "option-46", "X", &agent_universe, 46 },
228 { "option-47", "X", &agent_universe, 47 },
229 { "option-48", "X", &agent_universe, 48 },
230 { "option-49", "X", &agent_universe, 49 },
231 { "option-50", "X", &agent_universe, 50 },
232 { "option-51", "X", &agent_universe, 51 },
233 { "option-52", "X", &agent_universe, 52 },
234 { "option-53", "X", &agent_universe, 53 },
235 { "option-54", "X", &agent_universe, 54 },
236 { "option-55", "X", &agent_universe, 55 },
237 { "option-56", "X", &agent_universe, 56 },
238 { "option-57", "X", &agent_universe, 57 },
239 { "option-58", "X", &agent_universe, 58 },
240 { "option-59", "X", &agent_universe, 59 },
241 { "option-60", "X", &agent_universe, 60 },
242 { "option-61", "X", &agent_universe, 61 },
243 { "option-62", "X", &agent_universe, 62 },
244 { "option-63", "X", &agent_universe, 63 },
245 { "option-64", "X", &agent_universe, 64 },
246 { "option-65", "X", &agent_universe, 65 },
247 { "option-66", "X", &agent_universe, 66 },
248 { "option-67", "X", &agent_universe, 67 },
249 { "option-68", "X", &agent_universe, 68 },
250 { "option-69", "X", &agent_universe, 69 },
251 { "option-70", "X", &agent_universe, 70 },
252 { "option-71", "X", &agent_universe, 71 },
253 { "option-72", "X", &agent_universe, 72 },
254 { "option-73", "X", &agent_universe, 73 },
255 { "option-74", "X", &agent_universe, 74 },
256 { "option-75", "X", &agent_universe, 75 },
257 { "option-76", "X", &agent_universe, 76 },
258 { "option-77", "X", &agent_universe, 77 },
259 { "option-78", "X", &agent_universe, 78 },
260 { "option-79", "X", &agent_universe, 79 },
261 { "option-80", "X", &agent_universe, 80 },
262 { "option-81", "X", &agent_universe, 81 },
263 { "option-82", "X", &agent_universe, 82 },
264 { "option-83", "X", &agent_universe, 83 },
265 { "option-84", "X", &agent_universe, 84 },
266 { "option-85", "X", &agent_universe, 85 },
267 { "option-86", "X", &agent_universe, 86 },
268 { "option-87", "X", &agent_universe, 87 },
269 { "option-88", "X", &agent_universe, 88 },
270 { "option-89", "X", &agent_universe, 89 },
271 { "option-90", "X", &agent_universe, 90 },
272 { "option-91", "X", &agent_universe, 91 },
273 { "option-92", "X", &agent_universe, 92 },
274 { "option-93", "X", &agent_universe, 93 },
275 { "option-94", "X", &agent_universe, 94 },
276 { "option-95", "X", &agent_universe, 95 },
277 { "option-96", "X", &agent_universe, 96 },
278 { "option-97", "X", &agent_universe, 97 },
279 { "option-98", "X", &agent_universe, 98 },
280 { "option-99", "X", &agent_universe, 99 },
281 { "option-100", "X", &agent_universe, 100 },
282 { "option-101", "X", &agent_universe, 101 },
283 { "option-102", "X", &agent_universe, 102 },
284 { "option-103", "X", &agent_universe, 103 },
285 { "option-104", "X", &agent_universe, 104 },
286 { "option-105", "X", &agent_universe, 105 },
287 { "option-106", "X", &agent_universe, 106 },
288 { "option-107", "X", &agent_universe, 107 },
289 { "option-108", "X", &agent_universe, 108 },
290 { "option-109", "X", &agent_universe, 109 },
291 { "option-110", "X", &agent_universe, 110 },
292 { "option-111", "X", &agent_universe, 111 },
293 { "option-112", "X", &agent_universe, 112 },
294 { "option-113", "X", &agent_universe, 113 },
295 { "option-114", "X", &agent_universe, 114 },
296 { "option-115", "X", &agent_universe, 115 },
297 { "option-116", "X", &agent_universe, 116 },
298 { "option-117", "X", &agent_universe, 117 },
299 { "option-118", "X", &agent_universe, 118 },
300 { "option-119", "X", &agent_universe, 119 },
301 { "option-120", "X", &agent_universe, 120 },
302 { "option-121", "X", &agent_universe, 121 },
303 { "option-122", "X", &agent_universe, 122 },
304 { "option-123", "X", &agent_universe, 123 },
305 { "option-124", "X", &agent_universe, 124 },
306 { "option-125", "X", &agent_universe, 125 },
307 { "option-126", "X", &agent_universe, 126 },
308 { "option-127", "X", &agent_universe, 127 },
309 { "option-128", "X", &agent_universe, 128 },
310 { "option-129", "X", &agent_universe, 129 },
311 { "option-130", "X", &agent_universe, 130 },
312 { "option-131", "X", &agent_universe, 131 },
313 { "option-132", "X", &agent_universe, 132 },
314 { "option-133", "X", &agent_universe, 133 },
315 { "option-134", "X", &agent_universe, 134 },
316 { "option-135", "X", &agent_universe, 135 },
317 { "option-136", "X", &agent_universe, 136 },
318 { "option-137", "X", &agent_universe, 137 },
319 { "option-138", "X", &agent_universe, 138 },
320 { "option-139", "X", &agent_universe, 139 },
321 { "option-140", "X", &agent_universe, 140 },
322 { "option-141", "X", &agent_universe, 141 },
323 { "option-142", "X", &agent_universe, 142 },
324 { "option-143", "X", &agent_universe, 143 },
325 { "option-144", "X", &agent_universe, 144 },
326 { "option-145", "X", &agent_universe, 145 },
327 { "option-146", "X", &agent_universe, 146 },
328 { "option-147", "X", &agent_universe, 147 },
329 { "option-148", "X", &agent_universe, 148 },
330 { "option-149", "X", &agent_universe, 149 },
331 { "option-150", "X", &agent_universe, 150 },
332 { "option-151", "X", &agent_universe, 151 },
333 { "option-152", "X", &agent_universe, 152 },
334 { "option-153", "X", &agent_universe, 153 },
335 { "option-154", "X", &agent_universe, 154 },
336 { "option-155", "X", &agent_universe, 155 },
337 { "option-156", "X", &agent_universe, 156 },
338 { "option-157", "X", &agent_universe, 157 },
339 { "option-158", "X", &agent_universe, 158 },
340 { "option-159", "X", &agent_universe, 159 },
341 { "option-160", "X", &agent_universe, 160 },
342 { "option-161", "X", &agent_universe, 161 },
343 { "option-162", "X", &agent_universe, 162 },
344 { "option-163", "X", &agent_universe, 163 },
345 { "option-164", "X", &agent_universe, 164 },
346 { "option-165", "X", &agent_universe, 165 },
347 { "option-166", "X", &agent_universe, 166 },
348 { "option-167", "X", &agent_universe, 167 },
349 { "option-168", "X", &agent_universe, 168 },
350 { "option-169", "X", &agent_universe, 169 },
351 { "option-170", "X", &agent_universe, 170 },
352 { "option-171", "X", &agent_universe, 171 },
353 { "option-172", "X", &agent_universe, 172 },
354 { "option-173", "X", &agent_universe, 173 },
355 { "option-174", "X", &agent_universe, 174 },
356 { "option-175", "X", &agent_universe, 175 },
357 { "option-176", "X", &agent_universe, 176 },
358 { "option-177", "X", &agent_universe, 177 },
359 { "option-178", "X", &agent_universe, 178 },
360 { "option-179", "X", &agent_universe, 179 },
361 { "option-180", "X", &agent_universe, 180 },
362 { "option-181", "X", &agent_universe, 181 },
363 { "option-182", "X", &agent_universe, 182 },
364 { "option-183", "X", &agent_universe, 183 },
365 { "option-184", "X", &agent_universe, 184 },
366 { "option-185", "X", &agent_universe, 185 },
367 { "option-186", "X", &agent_universe, 186 },
368 { "option-187", "X", &agent_universe, 187 },
369 { "option-188", "X", &agent_universe, 188 },
370 { "option-189", "X", &agent_universe, 189 },
371 { "option-190", "X", &agent_universe, 190 },
372 { "option-191", "X", &agent_universe, 191 },
373 { "option-192", "X", &agent_universe, 192 },
374 { "option-193", "X", &agent_universe, 193 },
375 { "option-194", "X", &agent_universe, 194 },
376 { "option-195", "X", &agent_universe, 195 },
377 { "option-196", "X", &agent_universe, 196 },
378 { "option-197", "X", &agent_universe, 197 },
379 { "option-198", "X", &agent_universe, 198 },
380 { "option-199", "X", &agent_universe, 199 },
381 { "option-200", "X", &agent_universe, 200 },
382 { "option-201", "X", &agent_universe, 201 },
383 { "option-202", "X", &agent_universe, 202 },
384 { "option-203", "X", &agent_universe, 203 },
385 { "option-204", "X", &agent_universe, 204 },
386 { "option-205", "X", &agent_universe, 205 },
387 { "option-206", "X", &agent_universe, 206 },
388 { "option-207", "X", &agent_universe, 207 },
389 { "option-208", "X", &agent_universe, 208 },
390 { "option-209", "X", &agent_universe, 209 },
391 { "option-210", "X", &agent_universe, 210 },
392 { "option-211", "X", &agent_universe, 211 },
393 { "option-212", "X", &agent_universe, 212 },
394 { "option-213", "X", &agent_universe, 213 },
395 { "option-214", "X", &agent_universe, 214 },
396 { "option-215", "X", &agent_universe, 215 },
397 { "option-216", "X", &agent_universe, 216 },
398 { "option-217", "X", &agent_universe, 217 },
399 { "option-218", "X", &agent_universe, 218 },
400 { "option-219", "X", &agent_universe, 219 },
401 { "option-220", "X", &agent_universe, 220 },
402 { "option-221", "X", &agent_universe, 221 },
403 { "option-222", "X", &agent_universe, 222 },
404 { "option-223", "X", &agent_universe, 223 },
405 { "option-224", "X", &agent_universe, 224 },
406 { "option-225", "X", &agent_universe, 225 },
407 { "option-226", "X", &agent_universe, 226 },
408 { "option-227", "X", &agent_universe, 227 },
409 { "option-228", "X", &agent_universe, 228 },
410 { "option-229", "X", &agent_universe, 229 },
411 { "option-230", "X", &agent_universe, 230 },
412 { "option-231", "X", &agent_universe, 231 },
413 { "option-232", "X", &agent_universe, 232 },
414 { "option-233", "X", &agent_universe, 233 },
415 { "option-234", "X", &agent_universe, 234 },
416 { "option-235", "X", &agent_universe, 235 },
417 { "option-236", "X", &agent_universe, 236 },
418 { "option-237", "X", &agent_universe, 237 },
419 { "option-238", "X", &agent_universe, 238 },
420 { "option-239", "X", &agent_universe, 239 },
421 { "option-240", "X", &agent_universe, 240 },
422 { "option-241", "X", &agent_universe, 241 },
423 { "option-242", "X", &agent_universe, 242 },
424 { "option-243", "X", &agent_universe, 243 },
425 { "option-244", "X", &agent_universe, 244 },
426 { "option-245", "X", &agent_universe, 245 },
427 { "option-246", "X", &agent_universe, 246 },
428 { "option-247", "X", &agent_universe, 247 },
429 { "option-248", "X", &agent_universe, 248 },
430 { "option-249", "X", &agent_universe, 249 },
431 { "option-250", "X", &agent_universe, 250 },
432 { "option-251", "X", &agent_universe, 251 },
433 { "option-252", "X", &agent_universe, 252 },
434 { "option-253", "X", &agent_universe, 253 },
435 { "option-254", "X", &agent_universe, 254 },
436 { "option-end", "e", &agent_universe, 255 },
437 };
438
439 struct universe server_universe;
440 struct option server_options [256] = {
441 { "pad", "", &server_universe, 0 },
442 { "default-lease-time", "T", &server_universe, 1 },
443 { "max-lease-time", "T", &server_universe, 2 },
444 { "min-lease-time", "T", &server_universe, 3 },
445 { "dynamic-bootp-lease-cutoff", "L", &server_universe, 4 },
446 { "dynamic-bootp-lease-length", "T", &server_universe, 5 },
447 { "boot-unknown-clients", "f", &server_universe, 6 },
448 { "dynamic-bootp", "f", &server_universe, 7 },
449 { "allow-bootp", "f", &server_universe, 8 },
450 { "allow-booting", "f", &server_universe, 9 },
451 { "one-lease-per-client", "f", &server_universe, 10 },
452 { "get-lease-hostnames", "f", &server_universe, 11 },
453 { "use-host-decl-names", "f", &server_universe, 12 },
454 { "use-lease-addr-for-default-route", "f", &server_universe, 13 },
455 { "min-secs", "B", &server_universe, 14 },
456 { "filename", "t", &server_universe, 15 },
457 { "server-name", "t", &server_universe, 16 },
458 { "next-server", "I", &server_universe, 17 },
459 { "authoritative", "f", &server_universe, 18 },
460 { "vendor-option-space", "U", &server_universe, 19 },
461 { "always-reply-rfc1048", "f", &server_universe, 20 },
462 { "site-option-space", "X", &server_universe, 21 },
463 { "always-broadcast", "f", &server_universe, 22 },
464 { "ddns-domainname", "t", &server_universe, 23 },
465 { "ddns-hostname", "t", &server_universe, 24 },
466 { "ddns-rev-domainname", "t", &server_universe, 25 },
467 { "lease-file-name", "t", &server_universe, 26 },
468 { "pid-file-name", "t", &server_universe, 27 },
469 { "duplicates", "f", &server_universe, 28 },
470 { "declines", "f", &server_universe, 29 },
471 { "ddns-updates", "f", &server_universe, 30 },
472 { "omapi-port", "S", &server_universe, 31 },
473 { "local-port", "S", &server_universe, 32 },
474 { "limited-broadcast-address", "I", &server_universe, 33 },
475 { "remote-port", "S", &server_universe, 34 },
476 { "local-address", "I", &server_universe, 35 },
477 { "option-36", "X", &server_universe, 36 },
478 { "option-37", "X", &server_universe, 37 },
479 { "option-38", "X", &server_universe, 38 },
480 { "option-39", "X", &server_universe, 39 },
481 { "option-40", "X", &server_universe, 40 },
482 { "option-41", "X", &server_universe, 41 },
483 { "option-42", "X", &server_universe, 42 },
484 { "option-43", "X", &server_universe, 43 },
485 { "option-44", "X", &server_universe, 44 },
486 { "option-45", "X", &server_universe, 45 },
487 { "option-46", "X", &server_universe, 46 },
488 { "option-47", "X", &server_universe, 47 },
489 { "option-48", "X", &server_universe, 48 },
490 { "option-49", "X", &server_universe, 49 },
491 { "option-50", "X", &server_universe, 50 },
492 { "option-51", "X", &server_universe, 51 },
493 { "option-52", "X", &server_universe, 52 },
494 { "option-53", "X", &server_universe, 53 },
495 { "option-54", "X", &server_universe, 54 },
496 { "option-55", "X", &server_universe, 55 },
497 { "option-56", "X", &server_universe, 56 },
498 { "option-57", "X", &server_universe, 57 },
499 { "option-58", "X", &server_universe, 58 },
500 { "option-59", "X", &server_universe, 59 },
501 { "option-60", "X", &server_universe, 60 },
502 { "option-61", "X", &server_universe, 61 },
503 { "option-62", "X", &server_universe, 62 },
504 { "option-63", "X", &server_universe, 63 },
505 { "option-64", "X", &server_universe, 64 },
506 { "option-65", "X", &server_universe, 65 },
507 { "option-66", "X", &server_universe, 66 },
508 { "option-67", "X", &server_universe, 67 },
509 { "option-68", "X", &server_universe, 68 },
510 { "option-69", "X", &server_universe, 69 },
511 { "option-70", "X", &server_universe, 70 },
512 { "option-71", "X", &server_universe, 71 },
513 { "option-72", "X", &server_universe, 72 },
514 { "option-73", "X", &server_universe, 73 },
515 { "option-74", "X", &server_universe, 74 },
516 { "option-75", "X", &server_universe, 75 },
517 { "option-76", "X", &server_universe, 76 },
518 { "option-77", "X", &server_universe, 77 },
519 { "option-78", "X", &server_universe, 78 },
520 { "option-79", "X", &server_universe, 79 },
521 { "option-80", "X", &server_universe, 80 },
522 { "option-81", "X", &server_universe, 81 },
523 { "option-82", "X", &server_universe, 82 },
524 { "option-83", "X", &server_universe, 83 },
525 { "option-84", "X", &server_universe, 84 },
526 { "option-85", "X", &server_universe, 85 },
527 { "option-86", "X", &server_universe, 86 },
528 { "option-87", "X", &server_universe, 87 },
529 { "option-88", "X", &server_universe, 88 },
530 { "option-89", "X", &server_universe, 89 },
531 { "option-90", "X", &server_universe, 90 },
532 { "option-91", "X", &server_universe, 91 },
533 { "option-92", "X", &server_universe, 92 },
534 { "option-93", "X", &server_universe, 93 },
535 { "option-94", "X", &server_universe, 94 },
536 { "option-95", "X", &server_universe, 95 },
537 { "option-96", "X", &server_universe, 96 },
538 { "option-97", "X", &server_universe, 97 },
539 { "option-98", "X", &server_universe, 98 },
540 { "option-99", "X", &server_universe, 99 },
541 { "option-100", "X", &server_universe, 100 },
542 { "option-101", "X", &server_universe, 101 },
543 { "option-102", "X", &server_universe, 102 },
544 { "option-103", "X", &server_universe, 103 },
545 { "option-104", "X", &server_universe, 104 },
546 { "option-105", "X", &server_universe, 105 },
547 { "option-106", "X", &server_universe, 106 },
548 { "option-107", "X", &server_universe, 107 },
549 { "option-108", "X", &server_universe, 108 },
550 { "option-109", "X", &server_universe, 109 },
551 { "option-110", "X", &server_universe, 110 },
552 { "option-111", "X", &server_universe, 111 },
553 { "option-112", "X", &server_universe, 112 },
554 { "option-113", "X", &server_universe, 113 },
555 { "option-114", "X", &server_universe, 114 },
556 { "option-115", "X", &server_universe, 115 },
557 { "option-116", "X", &server_universe, 116 },
558 { "option-117", "X", &server_universe, 117 },
559 { "option-118", "X", &server_universe, 118 },
560 { "option-119", "X", &server_universe, 119 },
561 { "option-120", "X", &server_universe, 120 },
562 { "option-121", "X", &server_universe, 121 },
563 { "option-122", "X", &server_universe, 122 },
564 { "option-123", "X", &server_universe, 123 },
565 { "option-124", "X", &server_universe, 124 },
566 { "option-125", "X", &server_universe, 125 },
567 { "option-126", "X", &server_universe, 126 },
568 { "option-127", "X", &server_universe, 127 },
569 { "option-128", "X", &server_universe, 128 },
570 { "option-129", "X", &server_universe, 129 },
571 { "option-130", "X", &server_universe, 130 },
572 { "option-131", "X", &server_universe, 131 },
573 { "option-132", "X", &server_universe, 132 },
574 { "option-133", "X", &server_universe, 133 },
575 { "option-134", "X", &server_universe, 134 },
576 { "option-135", "X", &server_universe, 135 },
577 { "option-136", "X", &server_universe, 136 },
578 { "option-137", "X", &server_universe, 137 },
579 { "option-138", "X", &server_universe, 138 },
580 { "option-139", "X", &server_universe, 139 },
581 { "option-140", "X", &server_universe, 140 },
582 { "option-141", "X", &server_universe, 141 },
583 { "option-142", "X", &server_universe, 142 },
584 { "option-143", "X", &server_universe, 143 },
585 { "option-144", "X", &server_universe, 144 },
586 { "option-145", "X", &server_universe, 145 },
587 { "option-146", "X", &server_universe, 146 },
588 { "option-147", "X", &server_universe, 147 },
589 { "option-148", "X", &server_universe, 148 },
590 { "option-149", "X", &server_universe, 149 },
591 { "option-150", "X", &server_universe, 150 },
592 { "option-151", "X", &server_universe, 151 },
593 { "option-152", "X", &server_universe, 152 },
594 { "option-153", "X", &server_universe, 153 },
595 { "option-154", "X", &server_universe, 154 },
596 { "option-155", "X", &server_universe, 155 },
597 { "option-156", "X", &server_universe, 156 },
598 { "option-157", "X", &server_universe, 157 },
599 { "option-158", "X", &server_universe, 158 },
600 { "option-159", "X", &server_universe, 159 },
601 { "option-160", "X", &server_universe, 160 },
602 { "option-161", "X", &server_universe, 161 },
603 { "option-162", "X", &server_universe, 162 },
604 { "option-163", "X", &server_universe, 163 },
605 { "option-164", "X", &server_universe, 164 },
606 { "option-165", "X", &server_universe, 165 },
607 { "option-166", "X", &server_universe, 166 },
608 { "option-167", "X", &server_universe, 167 },
609 { "option-168", "X", &server_universe, 168 },
610 { "option-169", "X", &server_universe, 169 },
611 { "option-170", "X", &server_universe, 170 },
612 { "option-171", "X", &server_universe, 171 },
613 { "option-172", "X", &server_universe, 172 },
614 { "option-173", "X", &server_universe, 173 },
615 { "option-174", "X", &server_universe, 174 },
616 { "option-175", "X", &server_universe, 175 },
617 { "option-176", "X", &server_universe, 176 },
618 { "option-177", "X", &server_universe, 177 },
619 { "option-178", "X", &server_universe, 178 },
620 { "option-179", "X", &server_universe, 179 },
621 { "option-180", "X", &server_universe, 180 },
622 { "option-181", "X", &server_universe, 181 },
623 { "option-182", "X", &server_universe, 182 },
624 { "option-183", "X", &server_universe, 183 },
625 { "option-184", "X", &server_universe, 184 },
626 { "option-185", "X", &server_universe, 185 },
627 { "option-186", "X", &server_universe, 186 },
628 { "option-187", "X", &server_universe, 187 },
629 { "option-188", "X", &server_universe, 188 },
630 { "option-189", "X", &server_universe, 189 },
631 { "option-190", "X", &server_universe, 190 },
632 { "option-191", "X", &server_universe, 191 },
633 { "option-192", "X", &server_universe, 192 },
634 { "option-193", "X", &server_universe, 193 },
635 { "option-194", "X", &server_universe, 194 },
636 { "option-195", "X", &server_universe, 195 },
637 { "option-196", "X", &server_universe, 196 },
638 { "option-197", "X", &server_universe, 197 },
639 { "option-198", "X", &server_universe, 198 },
640 { "option-199", "X", &server_universe, 199 },
641 { "option-200", "X", &server_universe, 200 },
642 { "option-201", "X", &server_universe, 201 },
643 { "option-202", "X", &server_universe, 202 },
644 { "option-203", "X", &server_universe, 203 },
645 { "option-204", "X", &server_universe, 204 },
646 { "option-205", "X", &server_universe, 205 },
647 { "option-206", "X", &server_universe, 206 },
648 { "option-207", "X", &server_universe, 207 },
649 { "option-208", "X", &server_universe, 208 },
650 { "option-209", "X", &server_universe, 209 },
651 { "option-210", "X", &server_universe, 210 },
652 { "option-211", "X", &server_universe, 211 },
653 { "option-212", "X", &server_universe, 212 },
654 { "option-213", "X", &server_universe, 213 },
655 { "option-214", "X", &server_universe, 214 },
656 { "option-215", "X", &server_universe, 215 },
657 { "option-216", "X", &server_universe, 216 },
658 { "option-217", "X", &server_universe, 217 },
659 { "option-218", "X", &server_universe, 218 },
660 { "option-219", "X", &server_universe, 219 },
661 { "option-220", "X", &server_universe, 220 },
662 { "option-221", "X", &server_universe, 221 },
663 { "option-222", "X", &server_universe, 222 },
664 { "option-223", "X", &server_universe, 223 },
665 { "option-224", "X", &server_universe, 224 },
666 { "option-225", "X", &server_universe, 225 },
667 { "option-226", "X", &server_universe, 226 },
668 { "option-227", "X", &server_universe, 227 },
669 { "option-228", "X", &server_universe, 228 },
670 { "option-229", "X", &server_universe, 229 },
671 { "option-230", "X", &server_universe, 230 },
672 { "option-231", "X", &server_universe, 231 },
673 { "option-232", "X", &server_universe, 232 },
674 { "option-233", "X", &server_universe, 233 },
675 { "option-234", "X", &server_universe, 234 },
676 { "option-235", "X", &server_universe, 235 },
677 { "option-236", "X", &server_universe, 236 },
678 { "option-237", "X", &server_universe, 237 },
679 { "option-238", "X", &server_universe, 238 },
680 { "option-239", "X", &server_universe, 239 },
681 { "option-240", "X", &server_universe, 240 },
682 { "option-241", "X", &server_universe, 241 },
683 { "option-242", "X", &server_universe, 242 },
684 { "option-243", "X", &server_universe, 243 },
685 { "option-244", "X", &server_universe, 244 },
686 { "option-245", "X", &server_universe, 245 },
687 { "option-246", "X", &server_universe, 246 },
688 { "option-247", "X", &server_universe, 247 },
689 { "option-248", "X", &server_universe, 248 },
690 { "option-249", "X", &server_universe, 249 },
691 { "option-250", "X", &server_universe, 250 },
692 { "option-251", "X", &server_universe, 251 },
693 { "option-252", "X", &server_universe, 252 },
694 { "option-253", "X", &server_universe, 253 },
695 { "option-254", "X", &server_universe, 254 },
696 { "option-end", "e", &server_universe, 255 },
697 };
698
699 void initialize_server_option_spaces()
700 {
701 int i;
702
703 /* Set up the Relay Agent Information Option suboption space... */
704 agent_universe.name = "agent";
705 agent_universe.option_state_dereference =
706 agent_option_state_dereference;
707 agent_universe.get_func = agent_option_get;
708 agent_universe.index = universe_count++;
709 agent_universe.length_size = 1;
710 agent_universe.tag_size = 1;
711 agent_universe.store_tag = putUChar;
712 agent_universe.store_length = putUChar;
713 universes [agent_universe.index] = &agent_universe;
714 agent_universe.hash = new_hash (0, 0, 1);
715 if (!agent_universe.hash)
716 log_fatal ("Can't allocate agent option hash table.");
717 for (i = 0; i < 256; i++) {
718 agent_universe.options [i] = &agent_options [i];
719 add_hash (agent_universe.hash,
720 (const unsigned char *)agent_options [i].name, 0,
721 (unsigned char *)&agent_options [i]);
722 }
723
724 /* Set up the server option universe... */
725 server_universe.name = "server";
726 server_universe.lookup_func = lookup_hashed_option;
727 server_universe.option_state_dereference =
728 hashed_option_state_dereference;
729 server_universe.get_func = hashed_option_get;
730 server_universe.set_func = hashed_option_set;
731 server_universe.save_func = save_hashed_option;
732 server_universe.delete_func = delete_hashed_option;
733 server_universe.encapsulate = hashed_option_space_encapsulate;
734 server_universe.length_size = 1;
735 server_universe.tag_size = 1;
736 server_universe.store_tag = putUChar;
737 server_universe.store_length = putUChar;
738 server_universe.index = universe_count++;
739 universes [server_universe.index] = &server_universe;
740 server_universe.hash = new_hash (0, 0, 1);
741 if (!server_universe.hash)
742 log_fatal ("Can't allocate server option hash table.");
743 for (i = 0; i < 256; i++) {
744 server_universe.options [i] = &server_options [i];
745 add_hash (server_universe.hash,
746 (const unsigned char *)server_options [i].name, 0,
747 (unsigned char *)&server_options [i]);
748 }
749
750 /* Add the server and agent option spaces to the option space hash. */
751 add_hash (universe_hash,
752 (const unsigned char *)agent_universe.name, 0,
753 (unsigned char *)&agent_universe);
754 add_hash (universe_hash,
755 (const unsigned char *)server_universe.name, 0,
756 (unsigned char *)&server_universe);
757
758 /* Make the server universe the configuration option universe. */
759 config_universe = &server_universe;
760 }