3 Sample config file for clients.
5 This file is provided as a sample in case the system you want to run
6 on is not currently supported. If that is the case, follow the Porting::
7 comments here and in other files as guides for what to change. Also,
8 note that this file hasn't been updated in a lo-o-o-ong time, so it's
9 probably worth looking at the config files for working ports as well. */
12 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
13 * Copyright (c) 1996-2003 by Internet Software Consortium
15 * Permission to use, copy, modify, and distribute this software for any
16 * purpose with or without fee is hereby granted, provided that the above
17 * copyright notice and this permission notice appear in all copies.
19 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
20 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
22 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
23 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
24 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
25 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
27 * Internet Systems Consortium, Inc.
29 * Redwood City, CA 94063
33 * This software has been written for Internet Systems Consortium
34 * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
35 * To learn more about Internet Systems Consortium, see
36 * ``http://www.isc.org/''. To learn more about Vixie Enterprises,
37 * see ``http://www.vix.com''. To learn more about Nominum, Inc., see
38 * ``http://www.nominum.com''.
43 Some systems do not define basic integer types as shown below.
44 On some systems, you need to include <bitypes.h> or <sys/bitypes.h>.
45 If you get parse errors in dhcpd.h while compiling dhcpd.conf, try
46 including bitypes.h, and if that fails, use the hard-coded definitions
50 #include <sys/bitypes.h>
58 #define u_int8_t unsigned char
59 #define u_int16_t unsigned short
60 #define u_int32_t unsigned long
63 #include <sys/types.h>
67 The jmp_buf type as declared in <setjmp.h> is sometimes a structure
68 and sometimes an array. By default, we assume it's a structure.
69 If it's an array on your system, you may get compile warnings or errors
70 as a result in confpars.c. If so, try including the following definitions,
71 which treat jmp_buf as an array: */
74 #define jbp_decl(x) jmp_buf x
77 #define jrefproto jmp_buf
82 Some older systems (e.g., Ultrix) still use the 4.2BSD-style syslog
83 API. These differ from later versions of the syslog API in that the
84 openlog system call takes two arguments instead of three, and the
85 facility code (the third argument to modern versions of openlog())
86 is ORed into the log priority in the syslog() call.
88 If you are running with the 4.2BSD-style syslog interface, define
91 /* #define SYSLOG_4_2 */
106 #include <net/if_arp.h>
110 Some older systems do not have defines for IP type-of-service,
111 or don't define them the way we expect. If you get undefined
112 symbol errors on the following symbols, they probably need to be
116 #define IPTOS_LOWDELAY 0x10
117 #define IPTOS_THROUGHPUT 0x08
118 #define IPTOS_RELIABILITY 0x04
123 Newer BSD derivatives store non-permanent daemon files in a
124 directory called /var/run. If your system has a /var/run,
125 use it; otherwise, use /etc. */
127 #ifndef _PATH_DHCPD_PID
128 #define _PATH_DHCPD_PID "/etc/dhcpd.pid"
130 #ifndef _PATH_DHCLIENT_PID
131 #define _PATH_DHCLIENT_PID "/etc/dhclient.pid"
133 #ifndef _PATH_DHCRELAY_PID
134 #define _PATH_DHCRELAY_PID "/etc/dhcrelay.pid"
139 If your system supports standard ANSI C, it should provide the file
140 /usr/include/stdarg.h. This contains the ANSI standard declarations
141 for functions which take a variable number of arguments.
143 Older systems with non-ANSI compilers cannot support this interface,
144 and generally use the older varargs interface, defined in <varargs.h>.
145 Some systems only support varargs, but define the interface in
148 You must choose one of the two sets of definitions below. Try
149 stdarg.h first, unless you know it won't work. If you have
150 trouble compiling errwarn.c, try switching to the varargs.h definitions.
151 If that fails, try using stdarg.h with the varargs definitions. */
154 /* Stdarg definitions for ANSI-compliant C compilers. */
156 #define VA_DOTDOTDOT ...
157 #define VA_start(list, last) va_start (list, last)
162 /* Varargs definitions, for non-ANSI-compliant C compilers. */
164 #define VA_DOTDOTDOT va_alist
165 #define VA_start(list, last) va_start (list)
170 Some systems (notably 4.4BSD derivatives) support versions of the
171 sprintf functions which will deposit a limited number of characters
172 into the buffer; that limit is provided in an extra argument.
173 If your system doesn't support this functionality, you must include
174 the definition below for a dhcp-distribution-local version to be
183 Some systems provide a function, strerror(), which takes the unix
184 error number (see errno) and returns a pointer to a static buffer
185 containing the corresponding error message.
187 If your system doesn't provide strerror(), define NO_STRERROR
192 char *strerror
PROTO ((int));
197 Once dhcpd has initialized itself, it loops forever waiting for
198 packets to come in. Since we need to support multiple input streams
199 in order to support multiple interfaces, dhcpd needs to be able to
200 do a syscall to determine which descriptors have input waiting on
203 Normally, dhcpd uses the select() system call, which is a 4.2BSD
204 syscall invented precisely for this purpose. Unfortunately, some
205 System V-based systems do not support select() properly when it
206 operates on streams. The System V interface which does (largely)
207 the same thing as select is called poll(). In some cases, this may
208 work better than select() - if you find that dhcpd is hanging and not
209 responding to packets very consistently, you might try defining
210 USE_POLL and including <poll.h>. */
219 You must define the default network API for your port. This
220 will depend on whether one of the existing APIs will work for
221 you, or whether you need to implement support for a new API.
222 Currently, the following APIs are supported:
224 The BSD socket API: define USE_SOCKETS.
225 The Berkeley Packet Filter: define USE_BPF.
226 The Streams Network Interface Tap (NIT): define USE_NIT.
227 Raw sockets: define USE_RAW_SOCKETS
229 If your system supports the BSD socket API and doesn't provide
230 one of the supported interfaces to the physical packet layer,
231 you can either provide support for the low-level API that your
232 system does support (if any) or just use the BSD socket interface.
233 The BSD socket interface doesn't support multiple network interfaces,
234 and on many systems, it does not support the all-ones broadcast
235 address, which can cause problems with some DHCP clients (e.g.
236 Microsoft Windows 95). */
238 #if defined (USE_DEFAULT_NETWORK)
244 Recent versions of BSD added a new element to the sockaddr structure:
245 sa_len. This indicates the length of the structure, and is used
246 in a variety of places, not the least of which is the SIOCGIFCONF
247 ioctl, which is used to figure out what interfaces are attached to
250 You should be able to determine if your system has an sa_len element
251 by looking at the struct sockaddr definition in /usr/include/sys/socket.h.
252 If it does, you must define HAVE_SA_LEN. Otherwise, you must not.
253 The most obvious symptom that you've got this wrong is either a compile
254 error complaining about the use of the sa_len structure element, or
255 the failure of dhcpd to find any interfaces. */
257 /* #define HAVE_SA_LEN */
259 /* Every operating system has its own way of seperating lines in a
260 sequential text file. Most modern systems use a single character,
261 either an ASCII Newline (10) or an ASCII Carriage Return (13).
263 The most notable exception is MS-DOS (and consequently, Windows),
264 which uses an ASCII Carriage Return followed by a Newline to
265 seperate each line. Fortunately, MS-DOS C compiler libraries
266 typically hide this from the programmer, returning just a Newline.
268 Define EOL to be whatever getc() returns for a newline. */
272 /* Some older C compilers don't support the void pointer type.
273 ANSI C defines void * to be a pointer type that matches
274 any other pointer type. This is handy for returning a pointer
275 which will always need to be cast to a different value. For
276 example, malloc() on an ANSI C-compliant system returns void *.
278 If your compiler doesn't support void pointers, you may need to
279 define VOIDPTR to be char *; otherwise, define it to be void *. */
281 #define VOIDPTR void *
285 The following definitions for time should work on any unix machine.
286 They may not work (or at least, may not work well) on a variety of
287 non-unix machines. If you are porting to a non-unix machine, you
288 probably need to change the definitions below and perhaps include
291 I should note that dhcpd is not yet entirely clean of unix-specific
292 time references, so the list of defines shown below probably isn't
293 good enough if you're porting to a system that really doesn't support
294 unix time. It's probably a reasonable place to start, though. */
299 #define GET_TIME(x) time ((x))