iPXE
|
00001 #ifndef CONFIG_DHCP_H 00002 #define CONFIG_DHCP_H 00003 00004 /** @file 00005 * 00006 * DHCP configuration 00007 * 00008 */ 00009 00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 00011 00012 #include <config/defaults.h> 00013 00014 /* 00015 * DHCP and PXE Boot Server timeout parameters 00016 * 00017 * Initial and final timeout for DHCP discovery 00018 * 00019 * The PXE spec indicates discover request are sent 4 times, with 00020 * timeouts of 4, 8, 16, 32 seconds. iPXE by default uses 1, 2, 4, 8. 00021 */ 00022 #define DHCP_DISC_START_TIMEOUT_SEC 1 00023 #define DHCP_DISC_END_TIMEOUT_SEC 10 00024 //#define DHCP_DISC_START_TIMEOUT_SEC 4 /* as per PXE spec */ 00025 //#define DHCP_DISC_END_TIMEOUT_SEC 32 /* as per PXE spec */ 00026 00027 /* 00028 * Maximum number of discovery deferrals due to blocked links 00029 * (e.g. from non-forwarding STP ports) 00030 */ 00031 #define DHCP_DISC_MAX_DEFERRALS 60 00032 00033 /* 00034 * ProxyDHCP offers are given precedence by continue to wait for them 00035 * after a valid DHCPOFFER is received. We'll wait through this 00036 * timeout for it. The PXE spec indicates waiting through the 4 & 8 00037 * second timeouts, iPXE by default stops after 2. 00038 */ 00039 #define DHCP_DISC_PROXY_TIMEOUT_SEC 2 00040 //#define DHCP_DISC_PROXY_TIMEOUT_SEC 11 /* as per PXE spec */ 00041 00042 /* 00043 * Per the PXE spec, requests are also tried 4 times, but at timeout 00044 * intervals of 1, 2, 3, 4 seconds. To adapt this to an exponential 00045 * backoff timer, we can either do 1, 2, 4, 8, ie. 4 retires with a 00046 * longer interval or start at 0 (0.25s) for 0.25, 0.5, 1, 2, 4, 00047 * ie. one extra try and shorter initial timeouts. iPXE by default 00048 * does a combination of both, starting at 0 and going through the 8 00049 * second timeout. 00050 */ 00051 #define DHCP_REQ_START_TIMEOUT_SEC 0 00052 #define DHCP_REQ_END_TIMEOUT_SEC 10 00053 //#define DHCP_REQ_END_TIMEOUT_SEC 4 /* as per PXE spec */ 00054 00055 /* 00056 * A ProxyDHCP offer without PXE options also goes through a request 00057 * phase using these same parameters, but note the early break below. 00058 */ 00059 #define DHCP_PROXY_START_TIMEOUT_SEC 0 00060 #define DHCP_PROXY_END_TIMEOUT_SEC 10 00061 //#define DHCP_PROXY_END_TIMEOUT_SEC 8 /* as per PXE spec */ 00062 00063 /* 00064 * A ProxyDHCP request timeout should not induce a failure condition, 00065 * so we always want to break before the above set of timers expire. 00066 * The iPXE default value of 2 breaks at the first timeout after 2 00067 * seconds, which will be after the 2 second timeout. 00068 */ 00069 #define DHCP_REQ_PROXY_TIMEOUT_SEC 2 00070 //#define DHCP_REQ_PROXY_TIMEOUT_SEC 7 /* as per PXE spec */ 00071 00072 /* 00073 * Per the PXE spec, a PXE boot server request is also be retried 4 00074 * times at timeouts of 1, 2, 3, 4. iPXE uses the same timeouts as 00075 * discovery, 1, 2, 4, 8, but will move on to the next server if 00076 * available after an elapsed time greater than 3 seconds, therefore 00077 * effectively only sending 3 tries at timeouts of 1, 2, 4. 00078 */ 00079 #define PXEBS_START_TIMEOUT_SEC 1 00080 #define PXEBS_END_TIMEOUT_SEC 10 00081 //#define PXEBS_START_TIMEOUT_SEC 0 /* as per PXE spec */ 00082 //#define PXEBS_END_TIMEOUT_SEC 8 /* as per PXE spec */ 00083 00084 /* 00085 * Increment to the next PXE Boot server, if available, after this 00086 * this much time has elapsed. 00087 */ 00088 #define PXEBS_MAX_TIMEOUT_SEC 3 00089 //#define PXEBS_MAX_TIMEOUT_SEC 7 /* as per PXE spec */ 00090 00091 #include <config/local/dhcp.h> 00092 00093 #endif /* CONFIG_DHCP_H */