30 RCSIDH(lib_bio_retry_h,
"$Id: 83bf057f99ae0d3f056ee99360c08e0ea3feafff $")
32 #include <freeradius-devel/util/retry.h>
33 #include <freeradius-devel/util/event.h>
36 # error _CONST can only be defined in the local header
38 #ifndef _BIO_RETRY_PRIVATE
68 #ifndef _BIO_RETRY_PRIVATE
static int const char char buffer[256]
fr_bio_t * fr_bio_retry_alloc(TALLOC_CTX *ctx, size_t max_saved, fr_bio_retry_sent_t sent, fr_bio_retry_response_t response, fr_bio_retry_rewrite_t rewrite, fr_bio_retry_release_t release, fr_bio_retry_config_t const *cfg, fr_bio_t *next))
Allocate a fr_bio_retry_t.
fr_bio_retry_entry_t * fr_bio_retry_item_reserve(fr_bio_t *bio)
Reserve an entry for later use with fr_bio_retry_rewrite()
fr_retry_t _CONST retry
retry timers and counters
fr_time_t last_sent
last time we sent a packet.
fr_event_list_t * el
event list
void * rewrite_ctx
context specifically for rewriting this packet
fr_retry_config_t retry_config
base retry config
void(* fr_bio_retry_release_t)(fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx, fr_bio_retry_release_reason_t reason)
Callback on release the packet (timeout or have all replies)
int fr_bio_retry_entry_init(fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx, fr_retry_config_t const *cfg)
fr_bio_retry_release_reason_t
@ FR_BIO_RETRY_WRITE_ERROR
@ FR_BIO_RETRY_FATAL_ERROR
size_t fr_bio_retry_outstanding(fr_bio_t *bio)
fr_bio_retry_config_t const * cfg
so we know what was asked
size_t size
size of the cached packet
void(* fr_bio_retry_sent_t)(fr_bio_t *bio, void *packet_ctx, const void *buffer, size_t size, fr_bio_retry_entry_t *retry_ctx)
Callback for when a packet is sent.
ssize_t(* fr_bio_retry_rewrite_t)(fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx, const void *buffer, size_t size)
ssize_t fr_bio_retry_rewrite(fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx, const void *buffer, size_t size))
Resend a packet.
fr_time_t first_sent
first time we sent a packet since going idle
bool(* fr_bio_retry_response_t)(fr_bio_t *bio, fr_bio_retry_entry_t **item_p, void *packet_ctx, const void *buffer, size_t size)
Callback on read to see if a packet is a response.
fr_event_list_t * el
event list
fr_time_t mrs_time
Most recent sent time which had a reply.
void * packet_ctx
packet_ctx from the write() call
fr_time_t last_reply
When we last received a reply.
const fr_retry_t * fr_bio_retry_entry_info(fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx)
int fr_bio_retry_entry_cancel(fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx))
Cancel one item.
fr_bio_retry_rewrite_t rewrite
per-packet rewrite callback
void * uctx
user-writable context
bool write_blocked
are writes blocked?
fr_bio_retry_info_t const * fr_bio_retry_info(fr_bio_t *bio)
fr_time_t last_idle
last time we had nothing to do
Stores all information relating to an event list.