iPXE
dhcp.h
Go to the documentation of this file.
1 #ifndef CONFIG_DHCP_H
2 #define CONFIG_DHCP_H
3 
4 /** @file
5  *
6  * DHCP configuration
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 FILE_SECBOOT ( PERMITTED );
12 
13 #include <config/defaults.h>
14 
15 /*
16  * DHCP and PXE Boot Server timeout parameters
17  *
18  * Initial and final timeout for DHCP discovery
19  *
20  * The PXE spec indicates discover request are sent 4 times, with
21  * timeouts of 4, 8, 16, 32 seconds. iPXE by default uses 1, 2, 4, 8.
22  */
23 #define DHCP_DISC_START_TIMEOUT_SEC 1
24 #define DHCP_DISC_END_TIMEOUT_SEC 10
25 //#define DHCP_DISC_START_TIMEOUT_SEC 4 /* as per PXE spec */
26 //#define DHCP_DISC_END_TIMEOUT_SEC 32 /* as per PXE spec */
27 
28 /*
29  * Maximum number of discovery deferrals due to blocked links
30  * (e.g. from non-forwarding STP ports)
31  */
32 #define DHCP_DISC_MAX_DEFERRALS 180
33 
34 /*
35  * ProxyDHCP offers are given precedence by continue to wait for them
36  * after a valid DHCPOFFER is received. We'll wait through this
37  * timeout for it. The PXE spec indicates waiting through the 4 & 8
38  * second timeouts, iPXE by default stops after 2.
39  */
40 #define DHCP_DISC_PROXY_TIMEOUT_SEC 2
41 //#define DHCP_DISC_PROXY_TIMEOUT_SEC 11 /* as per PXE spec */
42 
43 /*
44  * Per the PXE spec, requests are also tried 4 times, but at timeout
45  * intervals of 1, 2, 3, 4 seconds. To adapt this to an exponential
46  * backoff timer, we can either do 1, 2, 4, 8, ie. 4 retires with a
47  * longer interval or start at 0 (0.25s) for 0.25, 0.5, 1, 2, 4,
48  * ie. one extra try and shorter initial timeouts. iPXE by default
49  * does a combination of both, starting at 0 and going through the 8
50  * second timeout.
51  */
52 #define DHCP_REQ_START_TIMEOUT_SEC 0
53 #define DHCP_REQ_END_TIMEOUT_SEC 10
54 //#define DHCP_REQ_END_TIMEOUT_SEC 4 /* as per PXE spec */
55 
56 /*
57  * A ProxyDHCP offer without PXE options also goes through a request
58  * phase using these same parameters, but note the early break below.
59  */
60 #define DHCP_PROXY_START_TIMEOUT_SEC 0
61 #define DHCP_PROXY_END_TIMEOUT_SEC 10
62 //#define DHCP_PROXY_END_TIMEOUT_SEC 8 /* as per PXE spec */
63 
64 /*
65  * A ProxyDHCP request timeout should not induce a failure condition,
66  * so we always want to break before the above set of timers expire.
67  * The iPXE default value of 2 breaks at the first timeout after 2
68  * seconds, which will be after the 2 second timeout.
69  */
70 #define DHCP_REQ_PROXY_TIMEOUT_SEC 2
71 //#define DHCP_REQ_PROXY_TIMEOUT_SEC 7 /* as per PXE spec */
72 
73 /*
74  * Per the PXE spec, a PXE boot server request is also be retried 4
75  * times at timeouts of 1, 2, 3, 4. iPXE uses the same timeouts as
76  * discovery, 1, 2, 4, 8, but will move on to the next server if
77  * available after an elapsed time greater than 3 seconds, therefore
78  * effectively only sending 3 tries at timeouts of 1, 2, 4.
79  */
80 #define PXEBS_START_TIMEOUT_SEC 1
81 #define PXEBS_END_TIMEOUT_SEC 10
82 //#define PXEBS_START_TIMEOUT_SEC 0 /* as per PXE spec */
83 //#define PXEBS_END_TIMEOUT_SEC 8 /* as per PXE spec */
84 
85 /*
86  * Increment to the next PXE Boot server, if available, after this
87  * this much time has elapsed.
88  */
89 #define PXEBS_MAX_TIMEOUT_SEC 3
90 //#define PXEBS_MAX_TIMEOUT_SEC 7 /* as per PXE spec */
91 
92 #include <config/local/dhcp.h>
93 
94 #endif /* CONFIG_DHCP_H */
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
FILE_SECBOOT(PERMITTED)