]>
Commit | Line | Data |
---|---|---|
d7837182 TL |
1 | /* dhcpd.h |
2 | ||
3 | Definitions for dhcpd... */ | |
4 | ||
5 | /* | |
f79e49f3 | 6 | * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. |
17b95f41 | 7 | * All rights reserved. |
d7837182 TL |
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 | ||
0c7802b1 | 43 | #ifndef __CYGWIN32__ |
d7837182 | 44 | #include <sys/types.h> |
d7837182 TL |
45 | #include <netinet/in.h> |
46 | #include <sys/socket.h> | |
47 | #include <arpa/inet.h> | |
48 | #include <netdb.h> | |
0c7802b1 TL |
49 | #else |
50 | #define fd_set cygwin_fd_set | |
51 | #include <sys/types.h> | |
52 | #endif | |
d7837182 TL |
53 | #include <fcntl.h> |
54 | #include <stdio.h> | |
089fb364 | 55 | #include <unistd.h> |
8fdfeffe | 56 | #include <string.h> |
089fb364 TL |
57 | #include <stdlib.h> |
58 | #include <sys/stat.h> | |
59 | #include <ctype.h> | |
97ca1699 | 60 | #include <time.h> |
089fb364 | 61 | |
2f620dce | 62 | #include "cdefs.h" |
a8b53b42 | 63 | #include "osdep.h" |
d7837182 | 64 | #include "dhcp.h" |
d7837182 TL |
65 | #include "tree.h" |
66 | #include "hash.h" | |
089fb364 | 67 | #include "inet.h" |
d7837182 | 68 | |
cc26de46 TL |
69 | struct option_data { |
70 | int len; | |
71 | u_int8_t *data; | |
72 | }; | |
73 | ||
6b3b97e1 TL |
74 | struct string_list { |
75 | struct string_list *next; | |
76 | char string [1]; | |
77 | }; | |
78 | ||
0c7802b1 TL |
79 | /* A name server, from /etc/resolv.conf. */ |
80 | struct name_server { | |
81 | struct name_server *next; | |
82 | struct sockaddr_in addr; | |
83 | TIME rcdate; | |
84 | }; | |
85 | ||
86 | /* A domain search list element. */ | |
87 | struct domain_search_list { | |
88 | struct domain_search_list *next; | |
89 | char *domain; | |
90 | TIME rcdate; | |
91 | }; | |
92 | ||
d7837182 TL |
93 | /* A dhcp packet and the pointers to its option values. */ |
94 | struct packet { | |
95 | struct dhcp_packet *raw; | |
96 | int packet_length; | |
97 | int packet_type; | |
98 | int options_valid; | |
089fb364 TL |
99 | int client_port; |
100 | struct iaddr client_addr; | |
17b95f41 TL |
101 | struct interface_info *interface; /* Interface on which packet |
102 | was received. */ | |
103 | struct hardware *haddr; /* Physical link address | |
104 | of local sender (maybe gateway). */ | |
c626ae69 | 105 | struct shared_network *shared_network; |
cc26de46 | 106 | struct option_data options [256]; |
d7837182 TL |
107 | }; |
108 | ||
109 | struct hardware { | |
110 | u_int8_t htype; | |
111 | u_int8_t hlen; | |
112 | u_int8_t haddr [16]; | |
113 | }; | |
114 | ||
d7837182 TL |
115 | /* A dhcp lease declaration structure. */ |
116 | struct lease { | |
117 | struct lease *next; | |
118 | struct lease *prev; | |
ab370123 | 119 | struct lease *n_uid, *n_hw; |
fc2df23a TL |
120 | struct lease *waitq_next; |
121 | ||
089fb364 | 122 | struct iaddr ip_addr; |
d7837182 TL |
123 | TIME starts, ends, timestamp; |
124 | unsigned char *uid; | |
125 | int uid_len; | |
fc2df23a TL |
126 | int uid_max; |
127 | unsigned char uid_buf [32]; | |
6aa71eeb | 128 | char *hostname; |
0c7802b1 | 129 | char *client_hostname; |
d7837182 | 130 | struct host_decl *host; |
c626ae69 TL |
131 | struct subnet *subnet; |
132 | struct shared_network *shared_network; | |
d7837182 | 133 | struct hardware hardware_addr; |
fc2df23a | 134 | |
c626ae69 TL |
135 | int flags; |
136 | # define STATIC_LEASE 1 | |
137 | # define BOOTP_LEASE 2 | |
138 | # define DYNAMIC_BOOTP_OK 4 | |
139 | # define PERSISTENT_FLAGS (DYNAMIC_BOOTP_OK) | |
140 | # define EPHEMERAL_FLAGS (BOOTP_LEASE) | |
fc2df23a | 141 | # define MS_NULL_TERMINATION 8 |
14b45fb6 | 142 | # define ABANDONED_LEASE 16 |
fc2df23a | 143 | |
6e5ed8bf TL |
144 | struct lease_state *state; |
145 | }; | |
146 | ||
147 | struct lease_state { | |
148 | struct lease_state *next; | |
149 | ||
150 | struct interface_info *ip; | |
151 | ||
152 | TIME offered_expiry; | |
153 | ||
fc2df23a TL |
154 | struct tree_cache *options [256]; |
155 | u_int32_t expiry, renewal, rebind; | |
156 | char *filename, *server_name; | |
157 | ||
158 | u_int32_t xid; | |
159 | u_int16_t secs; | |
160 | u_int16_t bootp_flags; | |
161 | struct in_addr ciaddr; | |
162 | struct in_addr giaddr; | |
163 | u_int8_t hops; | |
164 | u_int8_t offer; | |
c626ae69 TL |
165 | }; |
166 | ||
ab370123 | 167 | #define ROOT_GROUP 0 |
750d0800 TL |
168 | #define HOST_DECL 1 |
169 | #define SHARED_NET_DECL 2 | |
170 | #define SUBNET_DECL 3 | |
171 | #define CLASS_DECL 4 | |
172 | #define GROUP_DECL 5 | |
ab370123 | 173 | |
cc26de46 TL |
174 | /* Possible modes in which discover_interfaces can run. */ |
175 | ||
176 | #define DISCOVER_RUNNING 0 | |
177 | #define DISCOVER_SERVER 1 | |
178 | #define DISCOVER_UNCONFIGURED 2 | |
f79e49f3 | 179 | #define DISCOVER_RELAY 3 |
cc26de46 | 180 | |
750d0800 | 181 | /* Group of declarations that share common parameters. */ |
ab370123 TL |
182 | struct group { |
183 | struct group *next; | |
184 | ||
185 | struct subnet *subnet; | |
186 | struct shared_network *shared_network; | |
187 | ||
188 | TIME default_lease_time; | |
189 | TIME max_lease_time; | |
190 | TIME bootp_lease_cutoff; | |
191 | TIME bootp_lease_length; | |
192 | ||
193 | char *filename; | |
194 | char *server_name; | |
195 | struct iaddr next_server; | |
196 | ||
197 | int boot_unknown_clients; | |
198 | int dynamic_bootp; | |
6b3b97e1 TL |
199 | int allow_bootp; |
200 | int allow_booting; | |
6aa71eeb | 201 | int one_lease_per_client; |
5fea7b10 | 202 | int get_lease_hostnames; |
c256bae9 | 203 | int use_host_decl_names; |
ab370123 TL |
204 | |
205 | struct tree_cache *options [256]; | |
206 | }; | |
207 | ||
208 | /* A dhcp host declaration structure. */ | |
209 | struct host_decl { | |
210 | struct host_decl *n_ipaddr; | |
211 | char *name; | |
212 | struct hardware interface; | |
213 | struct tree_cache *fixed_addr; | |
214 | struct group *group; | |
215 | }; | |
216 | ||
c626ae69 TL |
217 | struct shared_network { |
218 | struct shared_network *next; | |
ab370123 | 219 | char *name; |
c626ae69 TL |
220 | struct subnet *subnets; |
221 | struct interface_info *interface; | |
222 | struct lease *leases; | |
223 | struct lease *insertion_point; | |
224 | struct lease *last_lease; | |
ab370123 TL |
225 | |
226 | struct group *group; | |
d7837182 TL |
227 | }; |
228 | ||
229 | struct subnet { | |
c626ae69 TL |
230 | struct subnet *next_subnet; |
231 | struct subnet *next_sibling; | |
232 | struct shared_network *shared_network; | |
233 | struct interface_info *interface; | |
234 | struct iaddr interface_address; | |
089fb364 TL |
235 | struct iaddr net; |
236 | struct iaddr netmask; | |
ab370123 TL |
237 | |
238 | struct group *group; | |
d7837182 TL |
239 | }; |
240 | ||
709f15cc TL |
241 | struct class { |
242 | char *name; | |
ab370123 TL |
243 | |
244 | struct group *group; | |
709f15cc TL |
245 | }; |
246 | ||
cc26de46 TL |
247 | /* DHCP client lease structure... */ |
248 | struct client_lease { | |
41fb155b TL |
249 | struct client_lease *next; /* Next lease in list. */ |
250 | TIME expiry, renewal, rebind; /* Lease timeouts. */ | |
251 | struct iaddr address; /* Address being leased. */ | |
252 | char *server_name; /* Name of boot server. */ | |
253 | char *filename; /* Name of file we're supposed to boot. */ | |
6b3b97e1 | 254 | struct string_list *medium; /* Network medium. */ |
cc26de46 | 255 | |
0c7802b1 TL |
256 | unsigned int is_static : 1; /* If set, lease is from config file. */ |
257 | unsigned int is_bootp: 1; /* If set, lease was aquired with BOOTP. */ | |
41fb155b TL |
258 | |
259 | struct option_data options [256]; /* Options supplied with lease. */ | |
cc26de46 TL |
260 | }; |
261 | ||
41fb155b | 262 | /* Possible states in which the client can be. */ |
cc26de46 | 263 | enum dhcp_state { |
fc2df23a | 264 | S_REBOOTING, |
cc26de46 TL |
265 | S_INIT, |
266 | S_SELECTING, | |
267 | S_REQUESTING, | |
268 | S_BOUND, | |
269 | S_RENEWING, | |
270 | S_REBINDING | |
271 | }; | |
272 | ||
273 | /* Configuration information from the config file... */ | |
274 | struct client_config { | |
6b3b97e1 | 275 | struct option_data defaults [256]; /* Default values for options. */ |
0c7802b1 TL |
276 | enum { |
277 | ACTION_DEFAULT, /* Use server value if present, | |
278 | otherwise default. */ | |
279 | ACTION_SUPERSEDE, /* Always use default. */ | |
280 | ACTION_PREPEND, /* Prepend default to server. */ | |
281 | ACTION_APPEND, /* Append default to server. */ | |
282 | } default_actions [256]; | |
283 | ||
6b3b97e1 | 284 | struct option_data send_options [256]; /* Send these to server. */ |
cc26de46 TL |
285 | u_int8_t required_options [256]; /* Options server must supply. */ |
286 | u_int8_t requested_options [256]; /* Options to request from server. */ | |
287 | int requested_option_count; /* Number of requested options. */ | |
cc26de46 TL |
288 | TIME timeout; /* Start to panic if we don't get a |
289 | lease in this time period when | |
290 | SELECTING. */ | |
83c1b012 TL |
291 | TIME initial_interval; /* All exponential backoff intervals |
292 | start here. */ | |
cc26de46 TL |
293 | TIME retry_interval; /* If the protocol failed to produce |
294 | an address before the timeout, | |
295 | try the protocol again after this | |
296 | many seconds. */ | |
297 | TIME select_interval; /* Wait this many seconds from the | |
298 | first DHCPDISCOVER before | |
299 | picking an offered lease. */ | |
fc2df23a TL |
300 | TIME reboot_timeout; /* When in INIT-REBOOT, wait this |
301 | long before giving up and going | |
302 | to INIT. */ | |
83c1b012 TL |
303 | TIME backoff_cutoff; /* When doing exponential backoff, |
304 | never back off to an interval | |
305 | longer than this amount. */ | |
6b3b97e1 | 306 | struct string_list *media; /* Possible network media values. */ |
cc26de46 TL |
307 | char *script_name; /* Name of config script. */ |
308 | enum { IGNORE, ACCEPT, PREFER } bootp_policy; | |
309 | /* Ignore, accept or prefer BOOTP | |
310 | responses. */ | |
6b3b97e1 | 311 | struct string_list *medium; /* Current network medium. */ |
0c7802b1 TL |
312 | |
313 | struct iaddrlist *reject_list; /* Servers to reject. */ | |
cc26de46 TL |
314 | }; |
315 | ||
316 | /* Per-interface state used in the dhcp client... */ | |
317 | struct client_state { | |
318 | struct client_lease *active; /* Currently active lease. */ | |
319 | struct client_lease *new; /* New lease. */ | |
320 | struct client_lease *offered_leases; /* Leases offered to us. */ | |
321 | struct client_lease *leases; /* Leases we currently hold. */ | |
f79e49f3 | 322 | struct client_lease *alias; /* Alias lease. */ |
cc26de46 TL |
323 | |
324 | enum dhcp_state state; /* Current state for this interface. */ | |
325 | struct iaddr destination; /* Where to send packet. */ | |
326 | u_int32_t xid; /* Transaction ID. */ | |
327 | TIME first_sending; /* When was first copy sent? */ | |
6b3b97e1 TL |
328 | TIME interval; /* What's the current resend interval? */ |
329 | struct string_list *medium; /* Last media type tried. */ | |
cc26de46 TL |
330 | |
331 | struct dhcp_packet packet; /* Outgoing DHCP packet. */ | |
332 | int packet_length; /* Actual length of generated packet. */ | |
333 | ||
41fb155b TL |
334 | struct iaddr requested_address; /* Address we would like to get. */ |
335 | ||
cc26de46 TL |
336 | struct client_config *config; /* Information from config file. */ |
337 | }; | |
338 | ||
17b95f41 TL |
339 | /* Information about each network interface. */ |
340 | ||
341 | struct interface_info { | |
342 | struct interface_info *next; /* Next interface in list... */ | |
c626ae69 TL |
343 | struct shared_network *shared_network; |
344 | /* Networks connected to this interface. */ | |
17b95f41 | 345 | struct hardware hw_address; /* Its physical address. */ |
6b3b97e1 | 346 | struct in_addr primary_address; /* Primary interface address. */ |
17b95f41 TL |
347 | char name [IFNAMSIZ]; /* Its name... */ |
348 | int rfdesc; /* Its read file descriptor. */ | |
349 | int wfdesc; /* Its write file descriptor, if | |
350 | different. */ | |
351 | unsigned char *rbuf; /* Read buffer, if required. */ | |
352 | size_t rbuf_max; /* Size of read buffer. */ | |
353 | size_t rbuf_offset; /* Current offset into buffer. */ | |
354 | size_t rbuf_len; /* Length of data in buffer. */ | |
c626ae69 | 355 | |
41fb155b | 356 | struct ifreq *ifp; /* Pointer to ifreq struct. */ |
7f91dcfb TL |
357 | u_int32_t flags; /* Control flags... */ |
358 | #define INTERFACE_REQUESTED 1 | |
cc26de46 TL |
359 | |
360 | /* Only used by DHCP client code. */ | |
361 | struct client_state *client; | |
17b95f41 TL |
362 | }; |
363 | ||
364 | struct hardware_link { | |
365 | struct hardware_link *next; | |
366 | char name [IFNAMSIZ]; | |
367 | struct hardware address; | |
368 | }; | |
369 | ||
cc26de46 TL |
370 | struct timeout { |
371 | struct timeout *next; | |
372 | TIME when; | |
6e5ed8bf TL |
373 | void (*func) PROTO ((void *)); |
374 | void *what; | |
375 | }; | |
376 | ||
377 | struct protocol { | |
378 | struct protocol *next; | |
379 | int fd; | |
380 | void (*handler) PROTO ((struct protocol *)); | |
381 | void *local; | |
cc26de46 TL |
382 | }; |
383 | ||
d7837182 TL |
384 | /* Bitmask of dhcp option codes. */ |
385 | typedef unsigned char option_mask [16]; | |
386 | ||
387 | /* DHCP Option mask manipulation macros... */ | |
388 | #define OPTION_ZERO(mask) (memset (mask, 0, 16)) | |
389 | #define OPTION_SET(mask, bit) (mask [bit >> 8] |= (1 << (bit & 7))) | |
390 | #define OPTION_CLR(mask, bit) (mask [bit >> 8] &= ~(1 << (bit & 7))) | |
391 | #define OPTION_ISSET(mask, bit) (mask [bit >> 8] & (1 << (bit & 7))) | |
392 | #define OPTION_ISCLR(mask, bit) (!OPTION_ISSET (mask, bit)) | |
393 | ||
394 | /* An option occupies its length plus two header bytes (code and | |
395 | length) for every 255 bytes that must be stored. */ | |
396 | #define OPTION_SPACE(x) ((x) + 2 * ((x) / 255 + 1)) | |
397 | ||
398 | /* Default path to dhcpd config file. */ | |
d7837182 | 399 | #ifdef DEBUG |
80ba033e | 400 | #undef _PATH_DHCPD_CONF |
d7837182 | 401 | #define _PATH_DHCPD_CONF "dhcpd.conf" |
80ba033e | 402 | #undef _PATH_DHCPD_DB |
1358b874 | 403 | #define _PATH_DHCPD_DB "dhcpd.leases" |
d7837182 | 404 | #else |
a8b53b42 | 405 | #ifndef _PATH_DHCPD_CONF |
d7837182 | 406 | #define _PATH_DHCPD_CONF "/etc/dhcpd.conf" |
a8b53b42 TL |
407 | #endif |
408 | ||
409 | #ifndef _PATH_DHCPD_DB | |
6e47d3d8 | 410 | #define _PATH_DHCPD_DB "/etc/dhcpd.leases" |
d7837182 | 411 | #endif |
a8b53b42 TL |
412 | |
413 | #ifndef _PATH_DHCPD_PID | |
414 | #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" | |
415 | #endif | |
d7837182 TL |
416 | #endif |
417 | ||
cc26de46 TL |
418 | #ifndef _PATH_DHCLIENT_CONF |
419 | #define _PATH_DHCLIENT_CONF "/etc/dhclient.conf" | |
420 | #endif | |
421 | ||
422 | #ifndef _PATH_DHCLIENT_PID | |
423 | #define _PATH_DHCLIENT_PID "/var/run/dhclient.pid" | |
424 | #endif | |
425 | ||
426 | #ifndef _PATH_DHCLIENT_DB | |
427 | #define _PATH_DHCLIENT_DB "/etc/dhclient.leases" | |
428 | #endif | |
429 | ||
0c7802b1 TL |
430 | #ifndef _PATH_RESOLV_CONF |
431 | #define _PATH_RESOLV_CONF "/etc/resolv.conf" | |
432 | #endif | |
cc26de46 | 433 | |
ab370123 TL |
434 | #ifndef DHCPD_LOG_FACILITY |
435 | #define DHCPD_LOG_FACILITY LOG_DAEMON | |
436 | #endif | |
437 | ||
d7837182 TL |
438 | #define MAX_TIME 0x7fffffff |
439 | #define MIN_TIME 0 | |
440 | ||
441 | /* External definitions... */ | |
442 | ||
443 | /* options.c */ | |
444 | ||
445 | void parse_options PROTO ((struct packet *)); | |
446 | void parse_option_buffer PROTO ((struct packet *, unsigned char *, int)); | |
cc26de46 | 447 | int cons_options PROTO ((struct packet *, struct dhcp_packet *, |
07b39db2 | 448 | struct tree_cache **, int, int)); |
709f15cc | 449 | int store_options PROTO ((unsigned char *, int, struct tree_cache **, |
07b39db2 | 450 | unsigned char *, int, int, int, int)); |
0c7802b1 TL |
451 | char *pretty_print_option PROTO ((unsigned int, |
452 | unsigned char *, int, int, int)); | |
6e5ed8bf TL |
453 | void do_packet PROTO ((struct interface_info *, |
454 | unsigned char *, int, | |
455 | unsigned short, struct iaddr, struct hardware *)); | |
d7837182 TL |
456 | |
457 | /* errwarn.c */ | |
88ddda34 | 458 | extern int warnings_occurred; |
8fdfeffe | 459 | void error PROTO ((char *, ...)); |
d7837182 TL |
460 | int warn PROTO ((char *, ...)); |
461 | int note PROTO ((char *, ...)); | |
462 | int debug PROTO ((char *, ...)); | |
463 | int parse_warn PROTO ((char *, ...)); | |
464 | ||
465 | /* dhcpd.c */ | |
8fdfeffe | 466 | extern TIME cur_time; |
35d1d5cd | 467 | extern struct group root_group; |
c626ae69 | 468 | |
cc26de46 TL |
469 | extern u_int16_t local_port; |
470 | extern u_int16_t remote_port; | |
40950384 | 471 | extern int log_priority; |
6aa71eeb | 472 | extern int log_perror; |
685963dc | 473 | |
c626ae69 TL |
474 | #ifdef USE_FALLBACK |
475 | extern struct interface_info fallback_interface; | |
476 | #endif | |
477 | ||
e2ac5814 TL |
478 | extern char *path_dhcpd_conf; |
479 | extern char *path_dhcpd_db; | |
480 | extern char *path_dhcpd_pid; | |
481 | ||
d7837182 TL |
482 | int main PROTO ((int, char **, char **)); |
483 | void cleanup PROTO ((void)); | |
e5078937 TL |
484 | void lease_pinged PROTO ((struct iaddr, u_int8_t *, int)); |
485 | void lease_ping_timeout PROTO ((void *)); | |
d7837182 TL |
486 | |
487 | /* conflex.c */ | |
ab370123 | 488 | extern int lexline, lexchar; |
6aa71eeb TL |
489 | extern char *token_line, *tlname; |
490 | extern char comments [4096]; | |
491 | extern int comment_index; | |
0c7802b1 | 492 | extern int eol_token; |
ab370123 | 493 | void new_parse PROTO ((char *)); |
d7837182 TL |
494 | int next_token PROTO ((char **, FILE *)); |
495 | int peek_token PROTO ((char **, FILE *)); | |
496 | ||
497 | /* confpars.c */ | |
88ddda34 | 498 | int readconf PROTO ((void)); |
1358b874 | 499 | void read_leases PROTO ((void)); |
ab370123 | 500 | int parse_statement PROTO ((FILE *, |
750d0800 | 501 | struct group *, int, struct host_decl *, int)); |
6b3b97e1 | 502 | void parse_allow_deny PROTO ((FILE *, struct group *, int)); |
d7837182 | 503 | void skip_to_semi PROTO ((FILE *)); |
6aa71eeb TL |
504 | int parse_boolean PROTO ((FILE *)); |
505 | int parse_semi PROTO ((FILE *)); | |
ab370123 | 506 | int parse_lbrace PROTO ((FILE *)); |
750d0800 | 507 | void parse_host_declaration PROTO ((FILE *, struct group *)); |
ab370123 | 508 | char *parse_host_name PROTO ((FILE *)); |
750d0800 | 509 | void parse_class_declaration PROTO ((FILE *, struct group *, int)); |
ab370123 | 510 | void parse_lease_time PROTO ((FILE *, TIME *)); |
750d0800 TL |
511 | void parse_shared_net_declaration PROTO ((FILE *, struct group *)); |
512 | void parse_subnet_declaration PROTO ((FILE *, struct shared_network *)); | |
513 | void parse_group_declaration PROTO ((FILE *, struct group *)); | |
514 | void parse_hardware_param PROTO ((FILE *, struct hardware *)); | |
6aa71eeb | 515 | char *parse_string PROTO ((FILE *)); |
ab370123 | 516 | struct tree *parse_ip_addr_or_hostname PROTO ((FILE *, int)); |
750d0800 TL |
517 | struct tree_cache *parse_fixed_addr_param PROTO ((FILE *)); |
518 | void parse_option_param PROTO ((FILE *, struct group *)); | |
ab370123 | 519 | TIME parse_timestamp PROTO ((FILE *)); |
750d0800 | 520 | struct lease *parse_lease_declaration PROTO ((FILE *)); |
ab370123 TL |
521 | void parse_address_range PROTO ((FILE *, struct subnet *)); |
522 | TIME parse_date PROTO ((FILE *)); | |
523 | unsigned char *parse_numeric_aggregate PROTO ((FILE *, | |
d7837182 TL |
524 | unsigned char *, int *, |
525 | int, int, int)); | |
526 | void convert_num PROTO ((unsigned char *, char *, int, int)); | |
527 | ||
528 | /* tree.c */ | |
529 | pair cons PROTO ((caddr_t, pair)); | |
530 | struct tree_cache *tree_cache PROTO ((struct tree *)); | |
531 | struct tree *tree_host_lookup PROTO ((char *)); | |
532 | struct dns_host_entry *enter_dns_host PROTO ((char *)); | |
533 | struct tree *tree_const PROTO ((unsigned char *, int)); | |
534 | struct tree *tree_concat PROTO ((struct tree *, struct tree *)); | |
535 | struct tree *tree_limit PROTO ((struct tree *, int)); | |
536 | int tree_evaluate PROTO ((struct tree_cache *)); | |
537 | ||
538 | /* dhcp.c */ | |
e5078937 TL |
539 | extern int outstanding_pings; |
540 | ||
d7837182 | 541 | void dhcp PROTO ((struct packet *)); |
8f5e2ec8 TL |
542 | void dhcpdiscover PROTO ((struct packet *)); |
543 | void dhcprequest PROTO ((struct packet *)); | |
544 | void dhcprelease PROTO ((struct packet *)); | |
709f15cc TL |
545 | void dhcpdecline PROTO ((struct packet *)); |
546 | void dhcpinform PROTO ((struct packet *)); | |
a8b53b42 | 547 | void nak_lease PROTO ((struct packet *, struct iaddr *cip)); |
8f5e2ec8 | 548 | void ack_lease PROTO ((struct packet *, struct lease *, unsigned char, TIME)); |
fc2df23a | 549 | void dhcp_reply PROTO ((struct lease *)); |
03807c84 TL |
550 | struct lease *find_lease PROTO ((struct packet *, struct shared_network *)); |
551 | struct lease *mockup_lease PROTO ((struct packet *, | |
552 | struct shared_network *, | |
553 | struct host_decl *)); | |
d7837182 TL |
554 | |
555 | /* bootp.c */ | |
556 | void bootp PROTO ((struct packet *)); | |
557 | ||
558 | /* memory.c */ | |
559 | void enter_host PROTO ((struct host_decl *)); | |
c626ae69 TL |
560 | struct host_decl *find_hosts_by_haddr PROTO ((int, unsigned char *, int)); |
561 | struct host_decl *find_hosts_by_uid PROTO ((unsigned char *, int)); | |
562 | struct subnet *find_host_for_network PROTO ((struct host_decl **, | |
563 | struct iaddr *, | |
564 | struct shared_network *)); | |
089fb364 | 565 | void new_address_range PROTO ((struct iaddr, struct iaddr, |
c626ae69 TL |
566 | struct subnet *, int)); |
567 | extern struct subnet *find_grouped_subnet PROTO ((struct shared_network *, | |
568 | struct iaddr)); | |
2f620dce | 569 | extern struct subnet *find_subnet PROTO ((struct iaddr)); |
c626ae69 | 570 | void enter_shared_network PROTO ((struct shared_network *)); |
2f620dce | 571 | void enter_subnet PROTO ((struct subnet *)); |
d7837182 | 572 | void enter_lease PROTO ((struct lease *)); |
1358b874 | 573 | int supersede_lease PROTO ((struct lease *, struct lease *, int)); |
97ca1699 | 574 | void release_lease PROTO ((struct lease *)); |
e5078937 | 575 | void abandon_lease PROTO ((struct lease *, char *)); |
d7837182 | 576 | struct lease *find_lease_by_uid PROTO ((unsigned char *, int)); |
97ca1699 | 577 | struct lease *find_lease_by_hw_addr PROTO ((unsigned char *, int)); |
089fb364 | 578 | struct lease *find_lease_by_ip_addr PROTO ((struct iaddr)); |
ab370123 TL |
579 | void uid_hash_add PROTO ((struct lease *)); |
580 | void uid_hash_delete PROTO ((struct lease *)); | |
581 | void hw_hash_add PROTO ((struct lease *)); | |
582 | void hw_hash_delete PROTO ((struct lease *)); | |
709f15cc TL |
583 | struct class *add_class PROTO ((int, char *)); |
584 | struct class *find_class PROTO ((int, char *, int)); | |
ab370123 | 585 | struct group *clone_group PROTO ((struct group *, char *)); |
1358b874 | 586 | void write_leases PROTO ((void)); |
97ca1699 | 587 | void dump_subnets PROTO ((void)); |
d7837182 TL |
588 | |
589 | /* alloc.c */ | |
590 | VOIDPTR dmalloc PROTO ((int, char *)); | |
591 | void dfree PROTO ((VOIDPTR, char *)); | |
592 | struct packet *new_packet PROTO ((char *)); | |
593 | struct dhcp_packet *new_dhcp_packet PROTO ((char *)); | |
594 | struct tree *new_tree PROTO ((char *)); | |
595 | struct tree_cache *new_tree_cache PROTO ((char *)); | |
596 | struct hash_table *new_hash_table PROTO ((int, char *)); | |
597 | struct hash_bucket *new_hash_bucket PROTO ((char *)); | |
598 | struct lease *new_lease PROTO ((char *)); | |
2f620dce | 599 | struct lease *new_leases PROTO ((int, char *)); |
d7837182 | 600 | struct subnet *new_subnet PROTO ((char *)); |
709f15cc | 601 | struct class *new_class PROTO ((char *)); |
c626ae69 | 602 | struct shared_network *new_shared_network PROTO ((char *)); |
ab370123 | 603 | struct group *new_group PROTO ((char *)); |
6e5ed8bf TL |
604 | struct protocol *new_protocol PROTO ((char *)); |
605 | struct lease_state *new_lease_state PROTO ((char *)); | |
0c7802b1 TL |
606 | struct domain_search_list *new_domain_search_list PROTO ((char *)); |
607 | struct name_server *new_name_server PROTO ((char *)); | |
608 | void free_name_server PROTO ((struct name_server *, char *)); | |
609 | void free_domain_search_list PROTO ((struct domain_search_list *, char *)); | |
6e5ed8bf TL |
610 | void free_lease_state PROTO ((struct lease_state *, char *)); |
611 | void free_protocol PROTO ((struct protocol *, char *)); | |
ab370123 | 612 | void free_group PROTO ((struct group *, char *)); |
c626ae69 | 613 | void free_shared_network PROTO ((struct shared_network *, char *)); |
709f15cc | 614 | void free_class PROTO ((struct class *, char *)); |
d7837182 TL |
615 | void free_subnet PROTO ((struct subnet *, char *)); |
616 | void free_lease PROTO ((struct lease *, char *)); | |
617 | void free_hash_bucket PROTO ((struct hash_bucket *, char *)); | |
618 | void free_hash_table PROTO ((struct hash_table *, char *)); | |
619 | void free_tree_cache PROTO ((struct tree_cache *, char *)); | |
620 | void free_packet PROTO ((struct packet *, char *)); | |
621 | void free_dhcp_packet PROTO ((struct dhcp_packet *, char *)); | |
622 | void free_tree PROTO ((struct tree *, char *)); | |
623 | ||
624 | /* print.c */ | |
625 | char *print_hw_addr PROTO ((int, int, unsigned char *)); | |
97ca1699 | 626 | void print_lease PROTO ((struct lease *)); |
709f15cc | 627 | void dump_raw PROTO ((unsigned char *, int)); |
17b95f41 | 628 | void dump_packet PROTO ((struct packet *)); |
c626ae69 | 629 | void hash_dump PROTO ((struct hash_table *)); |
d7837182 TL |
630 | |
631 | /* socket.c */ | |
c626ae69 TL |
632 | #if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_RECEIVE) \ |
633 | || defined (USE_SOCKET_FALLBACK) | |
41fb155b | 634 | int if_register_socket PROTO ((struct interface_info *)); |
17b95f41 TL |
635 | #endif |
636 | ||
c626ae69 | 637 | #ifdef USE_SOCKET_FALLBACK |
41fb155b TL |
638 | void if_reinitialize_fallback PROTO ((struct interface_info *)); |
639 | void if_register_fallback PROTO ((struct interface_info *)); | |
4595a58c TL |
640 | ssize_t send_fallback PROTO ((struct interface_info *, |
641 | struct packet *, struct dhcp_packet *, size_t, | |
642 | struct in_addr, | |
643 | struct sockaddr_in *, struct hardware *)); | |
6e5ed8bf | 644 | void fallback_discard PROTO ((struct protocol *)); |
c626ae69 TL |
645 | #endif |
646 | ||
6f10b1a4 | 647 | #ifdef USE_SOCKET_SEND |
41fb155b TL |
648 | void if_reinitialize_send PROTO ((struct interface_info *)); |
649 | void if_register_send PROTO ((struct interface_info *)); | |
4595a58c TL |
650 | ssize_t send_packet PROTO ((struct interface_info *, |
651 | struct packet *, struct dhcp_packet *, size_t, | |
652 | struct in_addr, | |
653 | struct sockaddr_in *, struct hardware *)); | |
6f10b1a4 TL |
654 | #endif |
655 | #ifdef USE_SOCKET_RECEIVE | |
41fb155b TL |
656 | void if_reinitialize_receive PROTO ((struct interface_info *)); |
657 | void if_register_receive PROTO ((struct interface_info *)); | |
4595a58c TL |
658 | ssize_t receive_packet PROTO ((struct interface_info *, |
659 | unsigned char *, size_t, | |
660 | struct sockaddr_in *, struct hardware *)); | |
6f10b1a4 | 661 | #endif |
469cf3a4 TL |
662 | #if defined (USE_SOCKET_SEND) && !defined (USE_SOCKET_FALLBACK) |
663 | void if_enable PROTO ((struct interface_info *)); | |
664 | #endif | |
6f10b1a4 TL |
665 | |
666 | /* bpf.c */ | |
17b95f41 | 667 | #if defined (USE_BPF_SEND) || defined (USE_BPF_RECEIVE) |
41fb155b | 668 | int if_register_bpf PROTO ( (struct interface_info *)); |
17b95f41 | 669 | #endif |
6f10b1a4 | 670 | #ifdef USE_BPF_SEND |
41fb155b TL |
671 | void if_reinitialize_send PROTO ((struct interface_info *)); |
672 | void if_register_send PROTO ((struct interface_info *)); | |
4595a58c TL |
673 | ssize_t send_packet PROTO ((struct interface_info *, |
674 | struct packet *, struct dhcp_packet *, size_t, | |
675 | struct in_addr, | |
676 | struct sockaddr_in *, struct hardware *)); | |
6f10b1a4 TL |
677 | #endif |
678 | #ifdef USE_BPF_RECEIVE | |
41fb155b TL |
679 | void if_reinitialize_receive PROTO ((struct interface_info *)); |
680 | void if_register_receive PROTO ((struct interface_info *)); | |
4595a58c TL |
681 | ssize_t receive_packet PROTO ((struct interface_info *, |
682 | unsigned char *, size_t, | |
683 | struct sockaddr_in *, struct hardware *)); | |
6f10b1a4 | 684 | #endif |
469cf3a4 TL |
685 | #if defined (USE_BPF_SEND) |
686 | void if_enable PROTO ((struct interface_info *)); | |
687 | #endif | |
6f10b1a4 TL |
688 | |
689 | /* nit.c */ | |
41fb155b TL |
690 | #if defined (USE_NIT_SEND) || defined (USE_NIT_RECEIVE) |
691 | int if_register_nit PROTO ( (struct interface_info *)); | |
692 | #endif | |
693 | ||
6f10b1a4 | 694 | #ifdef USE_NIT_SEND |
41fb155b TL |
695 | void if_reinitialize_send PROTO ((struct interface_info *)); |
696 | void if_register_send PROTO ((struct interface_info *)); | |
4595a58c TL |
697 | ssize_t send_packet PROTO ((struct interface_info *, |
698 | struct packet *, struct dhcp_packet *, size_t, | |
699 | struct in_addr, | |
700 | struct sockaddr_in *, struct hardware *)); | |
6f10b1a4 TL |
701 | #endif |
702 | #ifdef USE_NIT_RECEIVE | |
41fb155b TL |
703 | void if_reinitialize_receive PROTO ((struct interface_info *)); |
704 | void if_register_receive PROTO ((struct interface_info *)); | |
4595a58c TL |
705 | ssize_t receive_packet PROTO ((struct interface_info *, |
706 | unsigned char *, size_t, | |
707 | struct sockaddr_in *, struct hardware *)); | |
6f10b1a4 | 708 | #endif |
469cf3a4 TL |
709 | #if defined (USE_BPF_SEND) |
710 | void if_enable PROTO ((struct interface_info *)); | |
711 | #endif | |
6f10b1a4 TL |
712 | |
713 | /* raw.c */ | |
714 | #ifdef USE_RAW_SEND | |
41fb155b TL |
715 | void if_reinitialize_send PROTO ((struct interface_info *)); |
716 | void if_register_send PROTO ((struct interface_info *)); | |
4595a58c TL |
717 | ssize_t send_packet PROTO ((struct interface_info *, |
718 | struct packet *, struct dhcp_packet *, size_t, | |
719 | struct in_addr, | |
720 | struct sockaddr_in *, struct hardware *)); | |
6f10b1a4 TL |
721 | #endif |
722 | ||
723 | /* dispatch.c */ | |
41fb155b | 724 | extern struct interface_info *interfaces, *dummy_interfaces; |
6e5ed8bf TL |
725 | extern struct protocol *protocols; |
726 | extern void (*bootp_packet_handler) PROTO ((struct interface_info *, | |
727 | unsigned char *, int, unsigned short, | |
728 | struct iaddr, struct hardware *)); | |
cc26de46 | 729 | extern struct timeout *timeouts; |
8fec2c95 | 730 | void discover_interfaces PROTO ((int)); |
41fb155b | 731 | void reinitialize_interfaces PROTO ((void)); |
6e5ed8bf | 732 | void dispatch PROTO ((void)); |
abe9a343 | 733 | int locate_network PROTO ((struct packet *)); |
6e5ed8bf TL |
734 | void add_timeout PROTO ((TIME, void (*) PROTO ((void *)), void *)); |
735 | #if 0 | |
736 | void add_fast_timeout PROTO ((UTIME, void (*) PROTO ((void *)), void *)); | |
737 | #endif | |
738 | void cancel_timeout PROTO ((void (*) PROTO ((void *)), void *)); | |
739 | void add_protocol PROTO ((char *, int, | |
740 | void (*) PROTO ((struct protocol *)), void *)); | |
d7837182 TL |
741 | |
742 | /* hash.c */ | |
743 | struct hash_table *new_hash PROTO ((void)); | |
744 | void add_hash PROTO ((struct hash_table *, char *, int, unsigned char *)); | |
745 | void delete_hash_entry PROTO ((struct hash_table *, char *, int)); | |
746 | unsigned char *hash_lookup PROTO ((struct hash_table *, char *, int)); | |
747 | ||
748 | /* tables.c */ | |
749 | extern struct option dhcp_options [256]; | |
750 | extern unsigned char dhcp_option_default_priority_list []; | |
751 | extern int sizeof_dhcp_option_default_priority_list; | |
1358b874 | 752 | extern char *hardware_types [256]; |
d7837182 TL |
753 | extern struct hash_table universe_hash; |
754 | extern struct universe dhcp_universe; | |
755 | void initialize_universes PROTO ((void)); | |
756 | ||
089fb364 | 757 | /* convert.c */ |
597e1211 TL |
758 | u_int32_t getULong PROTO ((unsigned char *)); |
759 | int32_t getLong PROTO ((unsigned char *)); | |
760 | u_int16_t getUShort PROTO ((unsigned char *)); | |
761 | int16_t getShort PROTO ((unsigned char *)); | |
762 | void putULong PROTO ((unsigned char *, u_int32_t)); | |
763 | void putLong PROTO ((unsigned char *, int32_t)); | |
764 | void putUShort PROTO ((unsigned char *, u_int16_t)); | |
765 | void putShort PROTO ((unsigned char *, int16_t)); | |
089fb364 TL |
766 | |
767 | /* inet.c */ | |
1358b874 | 768 | struct iaddr subnet_number PROTO ((struct iaddr, struct iaddr)); |
73fd5718 TL |
769 | struct iaddr ip_addr PROTO ((struct iaddr, struct iaddr, u_int32_t)); |
770 | u_int32_t host_addr PROTO ((struct iaddr, struct iaddr)); | |
1358b874 TL |
771 | int addr_eq PROTO ((struct iaddr, struct iaddr)); |
772 | char *piaddr PROTO ((struct iaddr)); | |
95821729 TL |
773 | |
774 | /* dhclient.c */ | |
cc26de46 TL |
775 | extern char *path_dhclient_conf; |
776 | extern char *path_dhclient_db; | |
777 | extern char *path_dhclient_pid; | |
778 | ||
779 | extern struct client_config top_level_config; | |
780 | ||
abe9a343 TL |
781 | void dhcpoffer PROTO ((struct packet *)); |
782 | void dhcpack PROTO ((struct packet *)); | |
783 | void dhcpnak PROTO ((struct packet *)); | |
cc26de46 | 784 | |
6e5ed8bf TL |
785 | void send_discover PROTO ((void *)); |
786 | void send_request PROTO ((void *)); | |
787 | void send_release PROTO ((void *)); | |
788 | void send_decline PROTO ((void *)); | |
cc26de46 | 789 | |
6e5ed8bf TL |
790 | void state_reboot PROTO ((void *)); |
791 | void state_init PROTO ((void *)); | |
792 | void state_selecting PROTO ((void *)); | |
793 | void state_requesting PROTO ((void *)); | |
794 | void state_bound PROTO ((void *)); | |
795 | void state_panic PROTO ((void *)); | |
cc26de46 | 796 | |
0c7802b1 TL |
797 | void bind_lease PROTO ((struct interface_info *)); |
798 | ||
cc26de46 TL |
799 | void make_discover PROTO ((struct interface_info *, struct client_lease *)); |
800 | void make_request PROTO ((struct interface_info *, struct client_lease *)); | |
801 | void make_decline PROTO ((struct interface_info *, struct client_lease *)); | |
802 | void make_release PROTO ((struct interface_info *, struct client_lease *)); | |
803 | ||
804 | void free_client_lease PROTO ((struct client_lease *)); | |
805 | void rewrite_client_leases PROTO ((void)); | |
806 | void write_client_lease PROTO ((struct interface_info *, | |
807 | struct client_lease *)); | |
808 | char *dhcp_option_ev_name PROTO ((struct option *)); | |
809 | ||
6b3b97e1 TL |
810 | void script_init PROTO ((struct interface_info *, char *, |
811 | struct string_list *)); | |
cc26de46 TL |
812 | void script_write_params PROTO ((struct interface_info *, |
813 | char *, struct client_lease *)); | |
814 | int script_go PROTO ((struct interface_info *)); | |
815 | ||
816 | struct client_lease *packet_to_lease PROTO ((struct packet *)); | |
41fb155b | 817 | void go_daemon PROTO ((void)); |
95821729 | 818 | |
1358b874 TL |
819 | /* db.c */ |
820 | int write_lease PROTO ((struct lease *)); | |
821 | int commit_leases PROTO ((void)); | |
822 | void db_startup PROTO ((void)); | |
823 | void new_lease_file PROTO ((void)); | |
17b95f41 TL |
824 | |
825 | /* packet.c */ | |
e5078937 TL |
826 | u_int32_t checksum PROTO ((unsigned char *, int, u_int32_t)); |
827 | u_int32_t wrapsum PROTO ((u_int32_t)); | |
17b95f41 TL |
828 | void assemble_hw_header PROTO ((struct interface_info *, unsigned char *, |
829 | int *, struct hardware *)); | |
830 | void assemble_udp_ip_header PROTO ((struct interface_info *, unsigned char *, | |
c626ae69 | 831 | int *, u_int32_t, u_int32_t, u_int16_t, |
17b95f41 | 832 | unsigned char *, int)); |
4595a58c TL |
833 | ssize_t decode_hw_header PROTO ((struct interface_info *, unsigned char *, |
834 | int, struct hardware *)); | |
835 | ssize_t decode_udp_ip_header PROTO ((struct interface_info *, unsigned char *, | |
836 | int, struct sockaddr_in *, | |
837 | unsigned char *, int)); | |
ab370123 TL |
838 | |
839 | /* dhxpxlt.c */ | |
840 | void convert_statement PROTO ((FILE *)); | |
841 | void convert_host_statement PROTO ((FILE *, jrefproto)); | |
842 | void convert_host_name PROTO ((FILE *, jrefproto)); | |
843 | void convert_class_statement PROTO ((FILE *, jrefproto, int)); | |
844 | void convert_class_decl PROTO ((FILE *, jrefproto)); | |
845 | void convert_lease_time PROTO ((FILE *, jrefproto, char *)); | |
846 | void convert_shared_net_statement PROTO ((FILE *, jrefproto)); | |
847 | void convert_subnet_statement PROTO ((FILE *, jrefproto)); | |
848 | void convert_subnet_decl PROTO ((FILE *, jrefproto)); | |
849 | void convert_host_decl PROTO ((FILE *, jrefproto)); | |
850 | void convert_hardware_decl PROTO ((FILE *, jrefproto)); | |
851 | void convert_hardware_addr PROTO ((FILE *, jrefproto)); | |
852 | void convert_filename_decl PROTO ((FILE *, jrefproto)); | |
853 | void convert_servername_decl PROTO ((FILE *, jrefproto)); | |
854 | void convert_ip_addr_or_hostname PROTO ((FILE *, jrefproto, int)); | |
855 | void convert_fixed_addr_decl PROTO ((FILE *, jrefproto)); | |
856 | void convert_option_decl PROTO ((FILE *, jrefproto)); | |
857 | void convert_timestamp PROTO ((FILE *, jrefproto)); | |
858 | void convert_lease_statement PROTO ((FILE *, jrefproto)); | |
859 | void convert_address_range PROTO ((FILE *, jrefproto)); | |
860 | void convert_date PROTO ((FILE *, jrefproto, char *)); | |
861 | void convert_numeric_aggregate PROTO ((FILE *, jrefproto, int, int, int, int)); | |
862 | void indent PROTO ((int)); | |
469cf3a4 TL |
863 | |
864 | /* route.c */ | |
865 | void add_route_direct PROTO ((struct interface_info *, struct in_addr)); | |
866 | void add_route_net PROTO ((struct interface_info *, struct in_addr, | |
867 | struct in_addr)); | |
868 | void add_route_default_gateway PROTO ((struct interface_info *, | |
869 | struct in_addr)); | |
870 | void remove_routes PROTO ((struct in_addr)); | |
871 | void remove_if_route PROTO ((struct interface_info *, struct in_addr)); | |
872 | void remove_all_if_routes PROTO ((struct interface_info *)); | |
873 | void set_netmask PROTO ((struct interface_info *, struct in_addr)); | |
874 | void set_broadcast_addr PROTO ((struct interface_info *, struct in_addr)); | |
875 | void set_ip_address PROTO ((struct interface_info *, struct in_addr)); | |
cc26de46 TL |
876 | |
877 | /* clparse.c */ | |
878 | int read_client_conf PROTO ((void)); | |
879 | void read_client_leases PROTO ((void)); | |
880 | void parse_client_statement PROTO ((FILE *, struct interface_info *, | |
881 | struct client_config *)); | |
41fb155b | 882 | int parse_X PROTO ((FILE *, u_int8_t *, int)); |
cc26de46 TL |
883 | int parse_option_list PROTO ((FILE *, u_int8_t *)); |
884 | void parse_interface_declaration PROTO ((FILE *, struct client_config *)); | |
41fb155b TL |
885 | struct interface_info *interface_or_dummy PROTO ((char *)); |
886 | void make_client_state PROTO ((struct interface_info *)); | |
887 | void make_client_config PROTO ((struct interface_info *, | |
888 | struct client_config *)); | |
889 | void parse_client_lease_statement PROTO ((FILE *, int)); | |
cc26de46 TL |
890 | void parse_client_lease_declaration PROTO ((FILE *, struct client_lease *, |
891 | struct interface_info **)); | |
0c7802b1 | 892 | struct option *parse_option_decl PROTO ((FILE *, struct option_data *)); |
6b3b97e1 | 893 | void parse_string_list PROTO ((FILE *, struct string_list **, int)); |
0c7802b1 TL |
894 | int parse_ip_addr PROTO ((FILE *, struct iaddr *)); |
895 | void parse_reject_statement PROTO ((FILE *, struct client_config *)); | |
6b3b97e1 TL |
896 | |
897 | /* dhcrelay.c */ | |
6e5ed8bf TL |
898 | void relay PROTO ((struct interface_info *, u_int8_t *, int, |
899 | unsigned short, struct iaddr, struct hardware *)); | |
900 | ||
901 | /* icmp.c */ | |
902 | void icmp_startup PROTO ((int, void (*) PROTO ((struct iaddr, | |
fa25cc03 | 903 | u_int8_t *, int)))); |
6e5ed8bf TL |
904 | int icmp_echorequest PROTO ((struct iaddr *)); |
905 | void icmp_echoreply PROTO ((struct protocol *)); | |
83c1b012 TL |
906 | |
907 | /* dns.c */ | |
908 | void dns_startup PROTO ((void)); | |
0c7802b1 TL |
909 | int ns_inaddr_lookup PROTO ((u_int16_t, struct iaddr)); |
910 | void dns_packet PROTO ((struct protocol *)); | |
911 | ||
912 | /* resolv.c */ | |
913 | extern char path_resolv_conf []; | |
914 | struct name_server *name_servers; | |
915 | struct domain_search_list *domains; | |
916 | ||
917 | void read_resolv_conf PROTO ((TIME)); | |
918 | struct sockaddr_in *pick_name_server PROTO ((void)); | |
2b60cc68 TL |
919 | |
920 | /* inet_addr.c */ | |
921 | #ifdef NEED_INET_ATON | |
922 | int inet_aton PROTO ((char *, struct in_addr *)); | |
923 | #endif |