david/ipxe
Archived
1
0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
ipxe/src/include/gpxe/retry.h
Michael Brown 1db1a6dad3 Added first sketch of a generic retry timer mechanism. The idea is to use
these timer objects in AoE and UDP protocols (where there is no underlying
retransmission mechanism) without requiring each protocol to implement its
own individual retry logic.  Eventually, we should be able to use the same
timer code for TCP retransmissions as well.
2006-05-29 14:55:07 +00:00

37 lines
758 B
C

#ifndef _GPXE_RETRY_H
#define _GPXE_RETRY_H
/** @file
*
* Retry timers
*
*/
#include <gpxe/list.h>
/** Effective maximum retry count for exponential backoff calculation */
#define BACKOFF_LIMIT 5
/** A retry timer */
struct retry_timer {
/** List of active timers */
struct list_head list;
/** Base timeout (in ticks) */
unsigned int base;
/** Retry count */
unsigned int retries;
/** Expiry time (in ticks) */
unsigned long expiry;
/** Timer expired callback
*
* @v timer Retry timer
*/
void ( * expired ) ( struct retry_timer *timer );
};
extern void start_timer ( struct retry_timer *timer );
extern void reset_timer ( struct retry_timer *timer );
extern void stop_timer ( struct retry_timer *timer );
#endif /* _GPXE_RETRY_H */