Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

dhcp.h 2.9KB

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