1 |
|
|
/* $OpenBSD: tables.c,v 1.13 2017/02/13 19:13:14 krw Exp $ */ |
2 |
|
|
|
3 |
|
|
/* Tables of information... */ |
4 |
|
|
|
5 |
|
|
/* |
6 |
|
|
* Copyright (c) 1995, 1996 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 |
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 <mellon@fugue.com> in cooperation with Vixie |
38 |
|
|
* Enterprises. To learn more about the Internet Software Consortium, |
39 |
|
|
* see ``http://www.vix.com/isc''. To learn more about Vixie |
40 |
|
|
* Enterprises, see ``http://www.vix.com''. |
41 |
|
|
*/ |
42 |
|
|
|
43 |
|
|
#include <sys/types.h> |
44 |
|
|
#include <sys/socket.h> |
45 |
|
|
|
46 |
|
|
#include <net/if.h> |
47 |
|
|
|
48 |
|
|
#include <netinet/in.h> |
49 |
|
|
|
50 |
|
|
#include <stdio.h> |
51 |
|
|
|
52 |
|
|
#include "dhcp.h" |
53 |
|
|
#include "tree.h" |
54 |
|
|
#include "dhcpd.h" |
55 |
|
|
#include "log.h" |
56 |
|
|
|
57 |
|
|
/* |
58 |
|
|
* DHCP Option names, formats and codes, from RFC1533. |
59 |
|
|
* |
60 |
|
|
* Format codes: |
61 |
|
|
* |
62 |
|
|
* e - end of data |
63 |
|
|
* I - IP address |
64 |
|
|
* l - 32-bit signed integer |
65 |
|
|
* L - 32-bit unsigned integer |
66 |
|
|
* s - 16-bit signed integer |
67 |
|
|
* S - 16-bit unsigned integer |
68 |
|
|
* b - 8-bit signed integer |
69 |
|
|
* B - 8-bit unsigned integer |
70 |
|
|
* t - ASCII text |
71 |
|
|
* f - flag (true or false) |
72 |
|
|
* A - array of whatever precedes (e.g., IA means array of IP addresses) |
73 |
|
|
*/ |
74 |
|
|
|
75 |
|
|
struct universe dhcp_universe; |
76 |
|
|
struct option dhcp_options[256] = { |
77 |
|
|
{ "pad", "", &dhcp_universe, 0 }, |
78 |
|
|
{ "subnet-mask", "I", &dhcp_universe, 1 }, |
79 |
|
|
{ "time-offset", "l", &dhcp_universe, 2 }, |
80 |
|
|
{ "routers", "IA", &dhcp_universe, 3 }, |
81 |
|
|
{ "time-servers", "IA", &dhcp_universe, 4 }, |
82 |
|
|
{ "ien116-name-servers", "IA", &dhcp_universe, 5 }, |
83 |
|
|
{ "domain-name-servers", "IA", &dhcp_universe, 6 }, |
84 |
|
|
{ "log-servers", "IA", &dhcp_universe, 7 }, |
85 |
|
|
{ "cookie-servers", "IA", &dhcp_universe, 8 }, |
86 |
|
|
{ "lpr-servers", "IA", &dhcp_universe, 9 }, |
87 |
|
|
{ "impress-servers", "IA", &dhcp_universe, 10 }, |
88 |
|
|
{ "resource-location-servers", "IA", &dhcp_universe, 11 }, |
89 |
|
|
{ "host-name", "X", &dhcp_universe, 12 }, |
90 |
|
|
{ "boot-size", "S", &dhcp_universe, 13 }, |
91 |
|
|
{ "merit-dump", "t", &dhcp_universe, 14 }, |
92 |
|
|
{ "domain-name", "t", &dhcp_universe, 15 }, |
93 |
|
|
{ "swap-server", "I", &dhcp_universe, 16 }, |
94 |
|
|
{ "root-path", "t", &dhcp_universe, 17 }, |
95 |
|
|
{ "extensions-path", "t", &dhcp_universe, 18 }, |
96 |
|
|
{ "ip-forwarding", "f", &dhcp_universe, 19 }, |
97 |
|
|
{ "non-local-source-routing", "f", &dhcp_universe, 20 }, |
98 |
|
|
{ "policy-filter", "IIA", &dhcp_universe, 21 }, |
99 |
|
|
{ "max-dgram-reassembly", "S", &dhcp_universe, 22 }, |
100 |
|
|
{ "default-ip-ttl", "B", &dhcp_universe, 23 }, |
101 |
|
|
{ "path-mtu-aging-timeout", "L", &dhcp_universe, 24 }, |
102 |
|
|
{ "path-mtu-plateau-table", "SA", &dhcp_universe, 25 }, |
103 |
|
|
{ "interface-mtu", "S", &dhcp_universe, 26 }, |
104 |
|
|
{ "all-subnets-local", "f", &dhcp_universe, 27 }, |
105 |
|
|
{ "broadcast-address", "I", &dhcp_universe, 28 }, |
106 |
|
|
{ "perform-mask-discovery", "f", &dhcp_universe, 29 }, |
107 |
|
|
{ "mask-supplier", "f", &dhcp_universe, 30 }, |
108 |
|
|
{ "router-discovery", "f", &dhcp_universe, 31 }, |
109 |
|
|
{ "router-solicitation-address", "I", &dhcp_universe, 32 }, |
110 |
|
|
{ "static-routes", "IIA", &dhcp_universe, 33 }, |
111 |
|
|
{ "trailer-encapsulation", "f", &dhcp_universe, 34 }, |
112 |
|
|
{ "arp-cache-timeout", "L", &dhcp_universe, 35 }, |
113 |
|
|
{ "ieee802-3-encapsulation", "f", &dhcp_universe, 36 }, |
114 |
|
|
{ "default-tcp-ttl", "B", &dhcp_universe, 37 }, |
115 |
|
|
{ "tcp-keepalive-interval", "L", &dhcp_universe, 38 }, |
116 |
|
|
{ "tcp-keepalive-garbage", "f", &dhcp_universe, 39 }, |
117 |
|
|
{ "nis-domain", "t", &dhcp_universe, 40 }, |
118 |
|
|
{ "nis-servers", "IA", &dhcp_universe, 41 }, |
119 |
|
|
{ "ntp-servers", "IA", &dhcp_universe, 42 }, |
120 |
|
|
{ "vendor-encapsulated-options", "X", &dhcp_universe, 43 }, |
121 |
|
|
{ "netbios-name-servers", "IA", &dhcp_universe, 44 }, |
122 |
|
|
{ "netbios-dd-server", "IA", &dhcp_universe, 45 }, |
123 |
|
|
{ "netbios-node-type", "B", &dhcp_universe, 46 }, |
124 |
|
|
{ "netbios-scope", "t", &dhcp_universe, 47 }, |
125 |
|
|
{ "font-servers", "IA", &dhcp_universe, 48 }, |
126 |
|
|
{ "x-display-manager", "IA", &dhcp_universe, 49 }, |
127 |
|
|
{ "dhcp-requested-address", "I", &dhcp_universe, 50 }, |
128 |
|
|
{ "dhcp-lease-time", "L", &dhcp_universe, 51 }, |
129 |
|
|
{ "dhcp-option-overload", "B", &dhcp_universe, 52 }, |
130 |
|
|
{ "dhcp-message-type", "B", &dhcp_universe, 53 }, |
131 |
|
|
{ "dhcp-server-identifier", "I", &dhcp_universe, 54 }, |
132 |
|
|
{ "dhcp-parameter-request-list", "BA", &dhcp_universe, 55 }, |
133 |
|
|
{ "dhcp-message", "t", &dhcp_universe, 56 }, |
134 |
|
|
{ "dhcp-max-message-size", "S", &dhcp_universe, 57 }, |
135 |
|
|
{ "dhcp-renewal-time", "L", &dhcp_universe, 58 }, |
136 |
|
|
{ "dhcp-rebinding-time", "L", &dhcp_universe, 59 }, |
137 |
|
|
{ "dhcp-class-identifier", "t", &dhcp_universe, 60 }, |
138 |
|
|
{ "dhcp-client-identifier", "X", &dhcp_universe, 61 }, |
139 |
|
|
{ "option-62", "X", &dhcp_universe, 62 }, |
140 |
|
|
{ "option-63", "X", &dhcp_universe, 63 }, |
141 |
|
|
{ "nisplus-domain", "t", &dhcp_universe, 64 }, |
142 |
|
|
{ "nisplus-servers", "IA", &dhcp_universe, 65 }, |
143 |
|
|
{ "tftp-server-name", "t", &dhcp_universe, 66 }, |
144 |
|
|
{ "bootfile-name", "t", &dhcp_universe, 67 }, |
145 |
|
|
{ "mobile-ip-home-agent", "IA", &dhcp_universe, 68 }, |
146 |
|
|
{ "smtp-server", "IA", &dhcp_universe, 69 }, |
147 |
|
|
{ "pop-server", "IA", &dhcp_universe, 70 }, |
148 |
|
|
{ "nntp-server", "IA", &dhcp_universe, 71 }, |
149 |
|
|
{ "www-server", "IA", &dhcp_universe, 72 }, |
150 |
|
|
{ "finger-server", "IA", &dhcp_universe, 73 }, |
151 |
|
|
{ "irc-server", "IA", &dhcp_universe, 74 }, |
152 |
|
|
{ "streettalk-server", "IA", &dhcp_universe, 75 }, |
153 |
|
|
{ "streettalk-directory-assistance-server", "IA", &dhcp_universe, 76 }, |
154 |
|
|
{ "user-class", "t", &dhcp_universe, 77 }, |
155 |
|
|
{ "option-78", "X", &dhcp_universe, 78 }, |
156 |
|
|
{ "option-79", "X", &dhcp_universe, 79 }, |
157 |
|
|
{ "option-80", "X", &dhcp_universe, 80 }, |
158 |
|
|
{ "option-81", "X", &dhcp_universe, 81 }, |
159 |
|
|
{ "relay-agent-information", "X", &dhcp_universe, 82 }, |
160 |
|
|
{ "option-83", "X", &dhcp_universe, 83 }, |
161 |
|
|
{ "option-84", "X", &dhcp_universe, 84 }, |
162 |
|
|
{ "nds-servers", "IA", &dhcp_universe, 85 }, |
163 |
|
|
{ "nds-tree-name", "X", &dhcp_universe, 86 }, |
164 |
|
|
{ "nds-context", "X", &dhcp_universe, 87 }, |
165 |
|
|
{ "option-88", "X", &dhcp_universe, 88 }, |
166 |
|
|
{ "option-89", "X", &dhcp_universe, 89 }, |
167 |
|
|
{ "option-90", "X", &dhcp_universe, 90 }, |
168 |
|
|
{ "option-91", "X", &dhcp_universe, 91 }, |
169 |
|
|
{ "option-92", "X", &dhcp_universe, 92 }, |
170 |
|
|
{ "option-93", "X", &dhcp_universe, 93 }, |
171 |
|
|
{ "option-94", "X", &dhcp_universe, 94 }, |
172 |
|
|
{ "option-95", "X", &dhcp_universe, 95 }, |
173 |
|
|
{ "option-96", "X", &dhcp_universe, 96 }, |
174 |
|
|
{ "option-97", "X", &dhcp_universe, 97 }, |
175 |
|
|
{ "option-98", "X", &dhcp_universe, 98 }, |
176 |
|
|
{ "option-99", "X", &dhcp_universe, 99 }, |
177 |
|
|
{ "option-100", "X", &dhcp_universe, 100 }, |
178 |
|
|
{ "option-101", "X", &dhcp_universe, 101 }, |
179 |
|
|
{ "option-102", "X", &dhcp_universe, 102 }, |
180 |
|
|
{ "option-103", "X", &dhcp_universe, 103 }, |
181 |
|
|
{ "option-104", "X", &dhcp_universe, 104 }, |
182 |
|
|
{ "option-105", "X", &dhcp_universe, 105 }, |
183 |
|
|
{ "option-106", "X", &dhcp_universe, 106 }, |
184 |
|
|
{ "option-107", "X", &dhcp_universe, 107 }, |
185 |
|
|
{ "option-108", "X", &dhcp_universe, 108 }, |
186 |
|
|
{ "option-109", "X", &dhcp_universe, 109 }, |
187 |
|
|
{ "option-110", "X", &dhcp_universe, 110 }, |
188 |
|
|
{ "option-111", "X", &dhcp_universe, 111 }, |
189 |
|
|
{ "option-112", "X", &dhcp_universe, 112 }, |
190 |
|
|
{ "option-113", "X", &dhcp_universe, 113 }, |
191 |
|
|
{ "option-114", "X", &dhcp_universe, 114 }, |
192 |
|
|
{ "option-115", "X", &dhcp_universe, 115 }, |
193 |
|
|
{ "option-116", "X", &dhcp_universe, 116 }, |
194 |
|
|
{ "option-117", "X", &dhcp_universe, 117 }, |
195 |
|
|
{ "option-118", "X", &dhcp_universe, 118 }, |
196 |
|
|
{ "option-119", "X", &dhcp_universe, 119 }, |
197 |
|
|
{ "option-120", "X", &dhcp_universe, 120 }, |
198 |
|
|
{ "classless-static-routes", "CIA", &dhcp_universe, 121 }, |
199 |
|
|
{ "option-122", "X", &dhcp_universe, 122 }, |
200 |
|
|
{ "option-123", "X", &dhcp_universe, 123 }, |
201 |
|
|
{ "option-124", "X", &dhcp_universe, 124 }, |
202 |
|
|
{ "option-125", "X", &dhcp_universe, 125 }, |
203 |
|
|
{ "option-126", "X", &dhcp_universe, 126 }, |
204 |
|
|
{ "option-127", "X", &dhcp_universe, 127 }, |
205 |
|
|
{ "option-128", "X", &dhcp_universe, 128 }, |
206 |
|
|
{ "option-129", "X", &dhcp_universe, 129 }, |
207 |
|
|
{ "option-130", "X", &dhcp_universe, 130 }, |
208 |
|
|
{ "option-131", "X", &dhcp_universe, 131 }, |
209 |
|
|
{ "option-132", "X", &dhcp_universe, 132 }, |
210 |
|
|
{ "option-133", "X", &dhcp_universe, 133 }, |
211 |
|
|
{ "option-134", "X", &dhcp_universe, 134 }, |
212 |
|
|
{ "option-135", "X", &dhcp_universe, 135 }, |
213 |
|
|
{ "option-136", "X", &dhcp_universe, 136 }, |
214 |
|
|
{ "option-137", "X", &dhcp_universe, 137 }, |
215 |
|
|
{ "option-138", "X", &dhcp_universe, 138 }, |
216 |
|
|
{ "option-139", "X", &dhcp_universe, 139 }, |
217 |
|
|
{ "option-140", "X", &dhcp_universe, 140 }, |
218 |
|
|
{ "option-141", "X", &dhcp_universe, 141 }, |
219 |
|
|
{ "option-142", "X", &dhcp_universe, 142 }, |
220 |
|
|
{ "option-143", "X", &dhcp_universe, 143 }, |
221 |
|
|
{ "tftp-config-file", "t", &dhcp_universe, 144 }, |
222 |
|
|
{ "option-145", "X", &dhcp_universe, 145 }, |
223 |
|
|
{ "option-146", "X", &dhcp_universe, 146 }, |
224 |
|
|
{ "option-147", "X", &dhcp_universe, 147 }, |
225 |
|
|
{ "option-148", "X", &dhcp_universe, 148 }, |
226 |
|
|
{ "option-149", "X", &dhcp_universe, 149 }, |
227 |
|
|
{ "voip-configuration-server", "IA", &dhcp_universe, 150 }, |
228 |
|
|
{ "option-151", "X", &dhcp_universe, 151 }, |
229 |
|
|
{ "option-152", "X", &dhcp_universe, 152 }, |
230 |
|
|
{ "option-153", "X", &dhcp_universe, 153 }, |
231 |
|
|
{ "option-154", "X", &dhcp_universe, 154 }, |
232 |
|
|
{ "option-155", "X", &dhcp_universe, 155 }, |
233 |
|
|
{ "option-156", "X", &dhcp_universe, 156 }, |
234 |
|
|
{ "option-157", "X", &dhcp_universe, 157 }, |
235 |
|
|
{ "option-158", "X", &dhcp_universe, 158 }, |
236 |
|
|
{ "option-159", "X", &dhcp_universe, 159 }, |
237 |
|
|
{ "option-160", "X", &dhcp_universe, 160 }, |
238 |
|
|
{ "option-161", "X", &dhcp_universe, 161 }, |
239 |
|
|
{ "option-162", "X", &dhcp_universe, 162 }, |
240 |
|
|
{ "option-163", "X", &dhcp_universe, 163 }, |
241 |
|
|
{ "option-164", "X", &dhcp_universe, 164 }, |
242 |
|
|
{ "option-165", "X", &dhcp_universe, 165 }, |
243 |
|
|
{ "option-166", "X", &dhcp_universe, 166 }, |
244 |
|
|
{ "option-167", "X", &dhcp_universe, 167 }, |
245 |
|
|
{ "option-168", "X", &dhcp_universe, 168 }, |
246 |
|
|
{ "option-169", "X", &dhcp_universe, 169 }, |
247 |
|
|
{ "option-170", "X", &dhcp_universe, 170 }, |
248 |
|
|
{ "option-171", "X", &dhcp_universe, 171 }, |
249 |
|
|
{ "option-172", "X", &dhcp_universe, 172 }, |
250 |
|
|
{ "option-173", "X", &dhcp_universe, 173 }, |
251 |
|
|
{ "option-174", "X", &dhcp_universe, 174 }, |
252 |
|
|
{ "option-175", "X", &dhcp_universe, 175 }, |
253 |
|
|
{ "option-176", "X", &dhcp_universe, 176 }, |
254 |
|
|
{ "option-177", "X", &dhcp_universe, 177 }, |
255 |
|
|
{ "option-178", "X", &dhcp_universe, 178 }, |
256 |
|
|
{ "option-179", "X", &dhcp_universe, 179 }, |
257 |
|
|
{ "option-180", "X", &dhcp_universe, 180 }, |
258 |
|
|
{ "option-181", "X", &dhcp_universe, 181 }, |
259 |
|
|
{ "option-182", "X", &dhcp_universe, 182 }, |
260 |
|
|
{ "option-183", "X", &dhcp_universe, 183 }, |
261 |
|
|
{ "option-184", "X", &dhcp_universe, 184 }, |
262 |
|
|
{ "option-185", "X", &dhcp_universe, 185 }, |
263 |
|
|
{ "option-186", "X", &dhcp_universe, 186 }, |
264 |
|
|
{ "option-187", "X", &dhcp_universe, 187 }, |
265 |
|
|
{ "option-188", "X", &dhcp_universe, 188 }, |
266 |
|
|
{ "option-189", "X", &dhcp_universe, 189 }, |
267 |
|
|
{ "option-190", "X", &dhcp_universe, 190 }, |
268 |
|
|
{ "option-191", "X", &dhcp_universe, 191 }, |
269 |
|
|
{ "option-192", "X", &dhcp_universe, 192 }, |
270 |
|
|
{ "option-193", "X", &dhcp_universe, 193 }, |
271 |
|
|
{ "option-194", "X", &dhcp_universe, 194 }, |
272 |
|
|
{ "option-195", "X", &dhcp_universe, 195 }, |
273 |
|
|
{ "option-196", "X", &dhcp_universe, 196 }, |
274 |
|
|
{ "option-197", "X", &dhcp_universe, 197 }, |
275 |
|
|
{ "option-198", "X", &dhcp_universe, 198 }, |
276 |
|
|
{ "option-199", "X", &dhcp_universe, 199 }, |
277 |
|
|
{ "option-200", "X", &dhcp_universe, 200 }, |
278 |
|
|
{ "option-201", "X", &dhcp_universe, 201 }, |
279 |
|
|
{ "option-202", "X", &dhcp_universe, 202 }, |
280 |
|
|
{ "option-203", "X", &dhcp_universe, 203 }, |
281 |
|
|
{ "option-204", "X", &dhcp_universe, 204 }, |
282 |
|
|
{ "option-205", "X", &dhcp_universe, 205 }, |
283 |
|
|
{ "option-206", "X", &dhcp_universe, 206 }, |
284 |
|
|
{ "option-207", "X", &dhcp_universe, 207 }, |
285 |
|
|
{ "option-208", "X", &dhcp_universe, 208 }, |
286 |
|
|
{ "option-209", "X", &dhcp_universe, 209 }, |
287 |
|
|
{ "option-210", "X", &dhcp_universe, 210 }, |
288 |
|
|
{ "option-211", "X", &dhcp_universe, 211 }, |
289 |
|
|
{ "option-212", "X", &dhcp_universe, 212 }, |
290 |
|
|
{ "option-213", "X", &dhcp_universe, 213 }, |
291 |
|
|
{ "option-214", "X", &dhcp_universe, 214 }, |
292 |
|
|
{ "option-215", "X", &dhcp_universe, 215 }, |
293 |
|
|
{ "option-216", "X", &dhcp_universe, 216 }, |
294 |
|
|
{ "option-217", "X", &dhcp_universe, 217 }, |
295 |
|
|
{ "option-218", "X", &dhcp_universe, 218 }, |
296 |
|
|
{ "option-219", "X", &dhcp_universe, 219 }, |
297 |
|
|
{ "option-220", "X", &dhcp_universe, 220 }, |
298 |
|
|
{ "option-221", "X", &dhcp_universe, 221 }, |
299 |
|
|
{ "option-222", "X", &dhcp_universe, 222 }, |
300 |
|
|
{ "option-223", "X", &dhcp_universe, 223 }, |
301 |
|
|
{ "option-224", "X", &dhcp_universe, 224 }, |
302 |
|
|
{ "option-225", "X", &dhcp_universe, 225 }, |
303 |
|
|
{ "option-226", "X", &dhcp_universe, 226 }, |
304 |
|
|
{ "option-227", "X", &dhcp_universe, 227 }, |
305 |
|
|
{ "option-228", "X", &dhcp_universe, 228 }, |
306 |
|
|
{ "option-229", "X", &dhcp_universe, 229 }, |
307 |
|
|
{ "option-230", "X", &dhcp_universe, 230 }, |
308 |
|
|
{ "option-231", "X", &dhcp_universe, 231 }, |
309 |
|
|
{ "option-232", "X", &dhcp_universe, 232 }, |
310 |
|
|
{ "option-233", "X", &dhcp_universe, 233 }, |
311 |
|
|
{ "option-234", "X", &dhcp_universe, 234 }, |
312 |
|
|
{ "option-235", "X", &dhcp_universe, 235 }, |
313 |
|
|
{ "option-236", "X", &dhcp_universe, 236 }, |
314 |
|
|
{ "option-237", "X", &dhcp_universe, 237 }, |
315 |
|
|
{ "option-238", "X", &dhcp_universe, 238 }, |
316 |
|
|
{ "option-239", "X", &dhcp_universe, 239 }, |
317 |
|
|
{ "option-240", "X", &dhcp_universe, 240 }, |
318 |
|
|
{ "option-241", "X", &dhcp_universe, 241 }, |
319 |
|
|
{ "option-242", "X", &dhcp_universe, 242 }, |
320 |
|
|
{ "option-243", "X", &dhcp_universe, 243 }, |
321 |
|
|
{ "option-244", "X", &dhcp_universe, 244 }, |
322 |
|
|
{ "option-245", "X", &dhcp_universe, 245 }, |
323 |
|
|
{ "option-246", "X", &dhcp_universe, 246 }, |
324 |
|
|
{ "option-247", "X", &dhcp_universe, 247 }, |
325 |
|
|
{ "option-248", "X", &dhcp_universe, 248 }, |
326 |
|
|
{ "classless-ms-static-routes", "CIA", &dhcp_universe, 249 }, |
327 |
|
|
{ "option-250", "X", &dhcp_universe, 250 }, |
328 |
|
|
{ "option-251", "X", &dhcp_universe, 251 }, |
329 |
|
|
{ "autoproxy-script", "t", &dhcp_universe, 252 }, |
330 |
|
|
{ "option-253", "X", &dhcp_universe, 253 }, |
331 |
|
|
{ "option-254", "X", &dhcp_universe, 254 }, |
332 |
|
|
{ "option-end", "e", &dhcp_universe, 255 }, |
333 |
|
|
}; |
334 |
|
|
|
335 |
|
|
/* |
336 |
|
|
* Default dhcp option priority list (this is ad hoc and should not be |
337 |
|
|
* mistaken for a carefully crafted and optimized list). |
338 |
|
|
*/ |
339 |
|
|
|
340 |
|
|
unsigned char dhcp_option_default_priority_list[256] = { |
341 |
|
|
DHO_DHCP_MESSAGE_TYPE, /* Mandatory */ |
342 |
|
|
DHO_DHCP_SERVER_IDENTIFIER, /* Mandatory */ |
343 |
|
|
DHO_DHCP_LEASE_TIME, /* Mandatory */ |
344 |
|
|
DHO_DHCP_MESSAGE, /* Mandatory */ |
345 |
|
|
DHO_END, /* End of mandatory options. */ |
346 |
|
|
DHO_DHCP_REQUESTED_ADDRESS, |
347 |
|
|
DHO_DHCP_OPTION_OVERLOAD, |
348 |
|
|
DHO_DHCP_MAX_MESSAGE_SIZE, |
349 |
|
|
DHO_DHCP_RENEWAL_TIME, |
350 |
|
|
DHO_DHCP_REBINDING_TIME, |
351 |
|
|
DHO_DHCP_CLASS_IDENTIFIER, |
352 |
|
|
DHO_DHCP_CLIENT_IDENTIFIER, |
353 |
|
|
DHO_SUBNET_MASK, |
354 |
|
|
DHO_TIME_OFFSET, |
355 |
|
|
DHO_CLASSLESS_STATIC_ROUTES, /* MUST be before DHO_ROUTERS! */ |
356 |
|
|
DHO_CLASSLESS_MS_STATIC_ROUTES, /* DITTO! */ |
357 |
|
|
DHO_ROUTERS, |
358 |
|
|
DHO_TIME_SERVERS, |
359 |
|
|
DHO_NAME_SERVERS, |
360 |
|
|
DHO_DOMAIN_NAME_SERVERS, |
361 |
|
|
DHO_HOST_NAME, |
362 |
|
|
DHO_LOG_SERVERS, |
363 |
|
|
DHO_COOKIE_SERVERS, |
364 |
|
|
DHO_LPR_SERVERS, |
365 |
|
|
DHO_IMPRESS_SERVERS, |
366 |
|
|
DHO_RESOURCE_LOCATION_SERVERS, |
367 |
|
|
DHO_BOOT_SIZE, |
368 |
|
|
DHO_MERIT_DUMP, |
369 |
|
|
DHO_DOMAIN_NAME, |
370 |
|
|
DHO_SWAP_SERVER, |
371 |
|
|
DHO_ROOT_PATH, |
372 |
|
|
DHO_EXTENSIONS_PATH, |
373 |
|
|
DHO_IP_FORWARDING, |
374 |
|
|
DHO_NON_LOCAL_SOURCE_ROUTING, |
375 |
|
|
DHO_POLICY_FILTER, |
376 |
|
|
DHO_MAX_DGRAM_REASSEMBLY, |
377 |
|
|
DHO_DEFAULT_IP_TTL, |
378 |
|
|
DHO_PATH_MTU_AGING_TIMEOUT, |
379 |
|
|
DHO_PATH_MTU_PLATEAU_TABLE, |
380 |
|
|
DHO_INTERFACE_MTU, |
381 |
|
|
DHO_ALL_SUBNETS_LOCAL, |
382 |
|
|
DHO_BROADCAST_ADDRESS, |
383 |
|
|
DHO_PERFORM_MASK_DISCOVERY, |
384 |
|
|
DHO_MASK_SUPPLIER, |
385 |
|
|
DHO_ROUTER_DISCOVERY, |
386 |
|
|
DHO_ROUTER_SOLICITATION_ADDRESS, |
387 |
|
|
DHO_STATIC_ROUTES, |
388 |
|
|
DHO_TRAILER_ENCAPSULATION, |
389 |
|
|
DHO_ARP_CACHE_TIMEOUT, |
390 |
|
|
DHO_IEEE802_3_ENCAPSULATION, |
391 |
|
|
DHO_DEFAULT_TCP_TTL, |
392 |
|
|
DHO_TCP_KEEPALIVE_INTERVAL, |
393 |
|
|
DHO_TCP_KEEPALIVE_GARBAGE, |
394 |
|
|
DHO_NIS_DOMAIN, |
395 |
|
|
DHO_NIS_SERVERS, |
396 |
|
|
DHO_NTP_SERVERS, |
397 |
|
|
DHO_VENDOR_ENCAPSULATED_OPTIONS, |
398 |
|
|
DHO_NETBIOS_NAME_SERVERS, |
399 |
|
|
DHO_NETBIOS_DD_SERVER, |
400 |
|
|
DHO_NETBIOS_NODE_TYPE, |
401 |
|
|
DHO_NETBIOS_SCOPE, |
402 |
|
|
DHO_FONT_SERVERS, |
403 |
|
|
DHO_X_DISPLAY_MANAGER, |
404 |
|
|
DHO_DHCP_PARAMETER_REQUEST_LIST, |
405 |
|
|
DHO_DHCP_USER_CLASS_ID, |
406 |
|
|
DHO_RELAY_AGENT_INFORMATION, /* Should be the last option. */ |
407 |
|
|
DHO_PAD, |
408 |
|
|
|
409 |
|
|
/* Presently-undefined options... */ |
410 |
|
|
62, 63, 64, 65, 66, 67, 68, 69, |
411 |
|
|
70, 71, 72, 73, 74, 75, 76, 78, 79, |
412 |
|
|
80, 81, 83, 84, 85, 86, 87, 88, 89, |
413 |
|
|
90, 91, 92, 93, 94, 95, 96, 97, 98, 99, |
414 |
|
|
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, |
415 |
|
|
110, 111, 112, 113, 114, 115, 116, 117, 118, 119, |
416 |
|
|
120, 122, 123, 124, 125, 126, 127, 128, 129, |
417 |
|
|
130, 131, 132, 133, 134, 135, 136, 137, 138, 139, |
418 |
|
|
140, 141, 142, 143, 144, 145, 146, 147, 148, 149, |
419 |
|
|
150, 151, 152, 153, 154, 155, 156, 157, 158, 159, |
420 |
|
|
160, 161, 162, 163, 164, 165, 166, 167, 168, 169, |
421 |
|
|
170, 171, 172, 173, 174, 175, 176, 177, 178, 179, |
422 |
|
|
180, 181, 182, 183, 184, 185, 186, 187, 188, 189, |
423 |
|
|
190, 191, 192, 193, 194, 195, 196, 197, 198, 199, |
424 |
|
|
200, 201, 202, 203, 204, 205, 206, 207, 208, 209, |
425 |
|
|
210, 211, 212, 213, 214, 215, 216, 217, 218, 219, |
426 |
|
|
220, 221, 222, 223, 224, 225, 226, 227, 228, 229, |
427 |
|
|
230, 231, 232, 233, 234, 235, 236, 237, 238, 239, |
428 |
|
|
240, 241, 242, 243, 244, 245, 246, 247, 248, |
429 |
|
|
250, 251, 252, 253, 254 |
430 |
|
|
}; |
431 |
|
|
|
432 |
|
|
char *hardware_types[] = { |
433 |
|
|
"unknown-0", |
434 |
|
|
"ethernet", |
435 |
|
|
"unknown-2", |
436 |
|
|
"unknown-3", |
437 |
|
|
"unknown-4", |
438 |
|
|
"unknown-5", |
439 |
|
|
"token-ring", |
440 |
|
|
"unknown-7", |
441 |
|
|
"fddi", |
442 |
|
|
"unknown-9", |
443 |
|
|
"unknown-10", |
444 |
|
|
"unknown-11", |
445 |
|
|
"unknown-12", |
446 |
|
|
"unknown-13", |
447 |
|
|
"unknown-14", |
448 |
|
|
"unknown-15", |
449 |
|
|
"unknown-16", |
450 |
|
|
"unknown-17", |
451 |
|
|
"unknown-18", |
452 |
|
|
"unknown-19", |
453 |
|
|
"unknown-20", |
454 |
|
|
"unknown-21", |
455 |
|
|
"unknown-22", |
456 |
|
|
"unknown-23", |
457 |
|
|
"unknown-24", |
458 |
|
|
"unknown-25", |
459 |
|
|
"unknown-26", |
460 |
|
|
"unknown-27", |
461 |
|
|
"unknown-28", |
462 |
|
|
"unknown-29", |
463 |
|
|
"unknown-30", |
464 |
|
|
"ipsec-tunnel", |
465 |
|
|
"unknown-32", |
466 |
|
|
"unknown-33", |
467 |
|
|
"unknown-34", |
468 |
|
|
"unknown-35", |
469 |
|
|
"unknown-36", |
470 |
|
|
"unknown-37", |
471 |
|
|
"unknown-38", |
472 |
|
|
"unknown-39", |
473 |
|
|
"unknown-40", |
474 |
|
|
"unknown-41", |
475 |
|
|
"unknown-42", |
476 |
|
|
"unknown-43", |
477 |
|
|
"unknown-44", |
478 |
|
|
"unknown-45", |
479 |
|
|
"unknown-46", |
480 |
|
|
"unknown-47", |
481 |
|
|
"unknown-48", |
482 |
|
|
"unknown-49", |
483 |
|
|
"unknown-50", |
484 |
|
|
"unknown-51", |
485 |
|
|
"unknown-52", |
486 |
|
|
"unknown-53", |
487 |
|
|
"unknown-54", |
488 |
|
|
"unknown-55", |
489 |
|
|
"unknown-56", |
490 |
|
|
"unknown-57", |
491 |
|
|
"unknown-58", |
492 |
|
|
"unknown-59", |
493 |
|
|
"unknown-60", |
494 |
|
|
"unknown-61", |
495 |
|
|
"unknown-62", |
496 |
|
|
"unknown-63", |
497 |
|
|
"unknown-64", |
498 |
|
|
"unknown-65", |
499 |
|
|
"unknown-66", |
500 |
|
|
"unknown-67", |
501 |
|
|
"unknown-68", |
502 |
|
|
"unknown-69", |
503 |
|
|
"unknown-70", |
504 |
|
|
"unknown-71", |
505 |
|
|
"unknown-72", |
506 |
|
|
"unknown-73", |
507 |
|
|
"unknown-74", |
508 |
|
|
"unknown-75", |
509 |
|
|
"unknown-76", |
510 |
|
|
"unknown-77", |
511 |
|
|
"unknown-78", |
512 |
|
|
"unknown-79", |
513 |
|
|
"unknown-80", |
514 |
|
|
"unknown-81", |
515 |
|
|
"unknown-82", |
516 |
|
|
"unknown-83", |
517 |
|
|
"unknown-84", |
518 |
|
|
"unknown-85", |
519 |
|
|
"unknown-86", |
520 |
|
|
"unknown-87", |
521 |
|
|
"unknown-88", |
522 |
|
|
"unknown-89", |
523 |
|
|
"unknown-90", |
524 |
|
|
"unknown-91", |
525 |
|
|
"unknown-92", |
526 |
|
|
"unknown-93", |
527 |
|
|
"unknown-94", |
528 |
|
|
"unknown-95", |
529 |
|
|
"unknown-96", |
530 |
|
|
"unknown-97", |
531 |
|
|
"unknown-98", |
532 |
|
|
"unknown-99", |
533 |
|
|
"unknown-100", |
534 |
|
|
"unknown-101", |
535 |
|
|
"unknown-102", |
536 |
|
|
"unknown-103", |
537 |
|
|
"unknown-104", |
538 |
|
|
"unknown-105", |
539 |
|
|
"unknown-106", |
540 |
|
|
"unknown-107", |
541 |
|
|
"unknown-108", |
542 |
|
|
"unknown-109", |
543 |
|
|
"unknown-110", |
544 |
|
|
"unknown-111", |
545 |
|
|
"unknown-112", |
546 |
|
|
"unknown-113", |
547 |
|
|
"unknown-114", |
548 |
|
|
"unknown-115", |
549 |
|
|
"unknown-116", |
550 |
|
|
"unknown-117", |
551 |
|
|
"unknown-118", |
552 |
|
|
"unknown-119", |
553 |
|
|
"unknown-120", |
554 |
|
|
"unknown-121", |
555 |
|
|
"unknown-122", |
556 |
|
|
"unknown-123", |
557 |
|
|
"unknown-124", |
558 |
|
|
"unknown-125", |
559 |
|
|
"unknown-126", |
560 |
|
|
"unknown-127", |
561 |
|
|
"unknown-128", |
562 |
|
|
"unknown-129", |
563 |
|
|
"unknown-130", |
564 |
|
|
"unknown-131", |
565 |
|
|
"unknown-132", |
566 |
|
|
"unknown-133", |
567 |
|
|
"unknown-134", |
568 |
|
|
"unknown-135", |
569 |
|
|
"unknown-136", |
570 |
|
|
"unknown-137", |
571 |
|
|
"unknown-138", |
572 |
|
|
"unknown-139", |
573 |
|
|
"unknown-140", |
574 |
|
|
"unknown-141", |
575 |
|
|
"unknown-142", |
576 |
|
|
"unknown-143", |
577 |
|
|
"unknown-144", |
578 |
|
|
"unknown-145", |
579 |
|
|
"unknown-146", |
580 |
|
|
"unknown-147", |
581 |
|
|
"unknown-148", |
582 |
|
|
"unknown-149", |
583 |
|
|
"unknown-150", |
584 |
|
|
"unknown-151", |
585 |
|
|
"unknown-152", |
586 |
|
|
"unknown-153", |
587 |
|
|
"unknown-154", |
588 |
|
|
"unknown-155", |
589 |
|
|
"unknown-156", |
590 |
|
|
"unknown-157", |
591 |
|
|
"unknown-158", |
592 |
|
|
"unknown-159", |
593 |
|
|
"unknown-160", |
594 |
|
|
"unknown-161", |
595 |
|
|
"unknown-162", |
596 |
|
|
"unknown-163", |
597 |
|
|
"unknown-164", |
598 |
|
|
"unknown-165", |
599 |
|
|
"unknown-166", |
600 |
|
|
"unknown-167", |
601 |
|
|
"unknown-168", |
602 |
|
|
"unknown-169", |
603 |
|
|
"unknown-170", |
604 |
|
|
"unknown-171", |
605 |
|
|
"unknown-172", |
606 |
|
|
"unknown-173", |
607 |
|
|
"unknown-174", |
608 |
|
|
"unknown-175", |
609 |
|
|
"unknown-176", |
610 |
|
|
"unknown-177", |
611 |
|
|
"unknown-178", |
612 |
|
|
"unknown-179", |
613 |
|
|
"unknown-180", |
614 |
|
|
"unknown-181", |
615 |
|
|
"unknown-182", |
616 |
|
|
"unknown-183", |
617 |
|
|
"unknown-184", |
618 |
|
|
"unknown-185", |
619 |
|
|
"unknown-186", |
620 |
|
|
"unknown-187", |
621 |
|
|
"unknown-188", |
622 |
|
|
"unknown-189", |
623 |
|
|
"unknown-190", |
624 |
|
|
"unknown-191", |
625 |
|
|
"unknown-192", |
626 |
|
|
"unknown-193", |
627 |
|
|
"unknown-194", |
628 |
|
|
"unknown-195", |
629 |
|
|
"unknown-196", |
630 |
|
|
"unknown-197", |
631 |
|
|
"unknown-198", |
632 |
|
|
"unknown-199", |
633 |
|
|
"unknown-200", |
634 |
|
|
"unknown-201", |
635 |
|
|
"unknown-202", |
636 |
|
|
"unknown-203", |
637 |
|
|
"unknown-204", |
638 |
|
|
"unknown-205", |
639 |
|
|
"unknown-206", |
640 |
|
|
"unknown-207", |
641 |
|
|
"unknown-208", |
642 |
|
|
"unknown-209", |
643 |
|
|
"unknown-210", |
644 |
|
|
"unknown-211", |
645 |
|
|
"unknown-212", |
646 |
|
|
"unknown-213", |
647 |
|
|
"unknown-214", |
648 |
|
|
"unknown-215", |
649 |
|
|
"unknown-216", |
650 |
|
|
"unknown-217", |
651 |
|
|
"unknown-218", |
652 |
|
|
"unknown-219", |
653 |
|
|
"unknown-220", |
654 |
|
|
"unknown-221", |
655 |
|
|
"unknown-222", |
656 |
|
|
"unknown-223", |
657 |
|
|
"unknown-224", |
658 |
|
|
"unknown-225", |
659 |
|
|
"unknown-226", |
660 |
|
|
"unknown-227", |
661 |
|
|
"unknown-228", |
662 |
|
|
"unknown-229", |
663 |
|
|
"unknown-230", |
664 |
|
|
"unknown-231", |
665 |
|
|
"unknown-232", |
666 |
|
|
"unknown-233", |
667 |
|
|
"unknown-234", |
668 |
|
|
"unknown-235", |
669 |
|
|
"unknown-236", |
670 |
|
|
"unknown-237", |
671 |
|
|
"unknown-238", |
672 |
|
|
"unknown-239", |
673 |
|
|
"unknown-240", |
674 |
|
|
"unknown-241", |
675 |
|
|
"unknown-242", |
676 |
|
|
"unknown-243", |
677 |
|
|
"unknown-244", |
678 |
|
|
"unknown-245", |
679 |
|
|
"unknown-246", |
680 |
|
|
"unknown-247", |
681 |
|
|
"unknown-248", |
682 |
|
|
"unknown-249", |
683 |
|
|
"unknown-250", |
684 |
|
|
"unknown-251", |
685 |
|
|
"unknown-252", |
686 |
|
|
"unknown-253", |
687 |
|
|
"unknown-254", |
688 |
|
|
"unknown-255" |
689 |
|
|
}; |
690 |
|
|
|
691 |
|
|
|
692 |
|
|
struct hash_table universe_hash; |
693 |
|
|
|
694 |
|
|
void |
695 |
|
|
initialize_universes(void) |
696 |
|
|
{ |
697 |
|
|
int i; |
698 |
|
|
|
699 |
|
|
dhcp_universe.name = "dhcp"; |
700 |
|
|
dhcp_universe.hash = new_hash(); |
701 |
|
|
if (!dhcp_universe.hash) |
702 |
|
|
fatalx("Can't allocate dhcp option hash table."); |
703 |
|
|
for (i = 0; i < 256; i++) { |
704 |
|
|
dhcp_universe.options[i] = &dhcp_options[i]; |
705 |
|
|
add_hash(dhcp_universe.hash, |
706 |
|
|
(unsigned char *)dhcp_options[i].name, 0, |
707 |
|
|
(unsigned char *)&dhcp_options[i]); |
708 |
|
|
} |
709 |
|
|
universe_hash.hash_count = DEFAULT_HASH_SIZE; |
710 |
|
|
add_hash(&universe_hash, |
711 |
|
|
(unsigned char *)dhcp_universe.name, 0, |
712 |
|
|
(unsigned char *)&dhcp_universe); |
713 |
|
|
} |