diff options
author | Andrew Schran <aschran@google.com> | 2008-08-12 01:05:26 +0100 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2008-08-12 01:05:26 +0100 |
commit | ff2b6a512d7a4f351e48dc9a042099a1010342a3 (patch) | |
tree | 20c909769e5cd2efdba9dc114cc69aa5d7c5db6d /src/include | |
parent | 5d4839b577e6b6836bd4828ab3ab5d7d2f5ae779 (diff) | |
download | ipxe-ff2b6a512d7a4f351e48dc9a042099a1010342a3.tar.gz |
[retry] Added configurable timeouts to retry timer
New min_timeout and max_timeout fields in struct retry_timer allow
users of this timer to set their own desired minimum and maximum
timeouts, without being constrained to a single global minimum and
maximum. Users of the timer can still elect to use the default global
values by leaving the min_timeout and max_timeout fields as 0.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gpxe/dhcp.h | 4 | ||||
-rw-r--r-- | src/include/gpxe/retry.h | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/include/gpxe/dhcp.h b/src/include/gpxe/dhcp.h index 7ce653991..c5ed0ead6 100644 --- a/src/include/gpxe/dhcp.h +++ b/src/include/gpxe/dhcp.h @@ -466,6 +466,10 @@ struct dhcphdr { /** Maximum time that we will wait for ProxyDHCP responses */ #define PROXYDHCP_WAIT_TIME ( TICKS_PER_SEC * 1 ) +/** Timeouts for sending DHCP packets */ +#define DHCP_MIN_TIMEOUT ( 1 * TICKS_PER_SEC ) +#define DHCP_MAX_TIMEOUT ( 10 * TICKS_PER_SEC ) + /** Settings block name used for DHCP responses */ #define DHCP_SETTINGS_NAME "dhcp" diff --git a/src/include/gpxe/retry.h b/src/include/gpxe/retry.h index 71982fca5..ec57db9e4 100644 --- a/src/include/gpxe/retry.h +++ b/src/include/gpxe/retry.h @@ -9,12 +9,28 @@ #include <gpxe/list.h> +/** Default timeout value */ +#define DEFAULT_MIN_TIMEOUT ( TICKS_PER_SEC / 4 ) + +/** Limit after which the timeout will be deemed permanent */ +#define DEFAULT_MAX_TIMEOUT ( 10 * TICKS_PER_SEC ) + /** A retry timer */ struct retry_timer { /** List of active timers */ struct list_head list; /** Timeout value (in ticks) */ unsigned long timeout; + /** Minimum timeout value (in ticks) + * + * A value of zero means "use default timeout." + */ + unsigned long min_timeout; + /** Maximum timeout value before failure (in ticks) + * + * A value of zero means "use default timeout." + */ + unsigned long max_timeout; /** Start time (in ticks) * * A start time of zero indicates a stopped timer. |