|
static int8_t | _expiry_cmp (void const *one, void const *two) |
|
static int8_t | _next_retry_cmp (void const *one, void const *two) |
|
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. More...
|
|
static int | fr_bio_retry_destructor (fr_bio_retry_t *my) |
| Cancel all outstanding packets. More...
|
|
int | fr_bio_retry_entry_cancel (fr_bio_t *bio, fr_bio_retry_entry_t *item) |
| Cancel one item. More...
|
|
const fr_retry_t * | fr_bio_retry_entry_info (UNUSED fr_bio_t *bio, fr_bio_retry_entry_t *item) |
| Allow the callbacks / application to know when things are being retried. More...
|
|
int | fr_bio_retry_entry_init (UNUSED fr_bio_t *bio, fr_bio_retry_entry_t *item, fr_retry_config_t const *cfg) |
| Set a per-packet retry config. More...
|
|
static void | fr_bio_retry_expiry_timer (UNUSED fr_event_list_t *el, fr_time_t now, void *uctx) |
| Run an expiry timer event. More...
|
|
static int | fr_bio_retry_expiry_timer_reset (fr_bio_retry_t *my) |
| Reset the expiry timer after expiring one element. More...
|
|
fr_bio_retry_info_t const * | fr_bio_retry_info (fr_bio_t *bio) |
|
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() More...
|
|
size_t | fr_bio_retry_outstanding (fr_bio_t *bio) |
|
static ssize_t | fr_bio_retry_read (fr_bio_t *bio, void *packet_ctx, void *buffer, size_t size) |
|
static void | fr_bio_retry_release (fr_bio_retry_t *my, fr_bio_retry_entry_t *item, fr_bio_retry_release_reason_t reason) |
| Release an entry back to the free list. More...
|
|
ssize_t | fr_bio_retry_rewrite (fr_bio_t *bio, fr_bio_retry_entry_t *item, const void *buffer, size_t size) |
| Resend a packet. More...
|
|
static ssize_t | fr_bio_retry_save_write (fr_bio_retry_t *my, fr_bio_retry_entry_t *item, ssize_t rcode) |
| Save a partial packet when the write becomes blocked. More...
|
|
static void | fr_bio_retry_shutdown (fr_bio_t *bio) |
| Orderly shutdown. More...
|
|
static void | fr_bio_retry_timer (UNUSED fr_event_list_t *el, fr_time_t now, void *uctx) |
| Run a timer event. More...
|
|
static int | fr_bio_retry_timer_reset (fr_bio_retry_t *my) |
| Reset the timer after changing the rb tree. More...
|
|
static ssize_t | fr_bio_retry_write (fr_bio_t *bio, void *packet_ctx, void const *buffer, size_t size) |
| Write a request, and see if we have a reply. More...
|
|
static int | fr_bio_retry_write_blocked (fr_bio_t *bio) |
| Writes are blocked. More...
|
|
static int | fr_bio_retry_write_delayed (fr_bio_retry_t *my, fr_time_t now) |
|
static ssize_t | fr_bio_retry_write_fatal (fr_bio_t *bio, UNUSED void *packet_ctx, UNUSED void const *buffer, UNUSED size_t size) |
| A previous timer write had a fatal error, so we forbid further writes. More...
|
|
static int | fr_bio_retry_write_item (fr_bio_retry_t *my, fr_bio_retry_entry_t *item, fr_time_t now) |
| Write one item. More...
|
|
static ssize_t | fr_bio_retry_write_partial (fr_bio_t *bio, void *packet_ctx, const void *buffer, size_t size) |
| There's a partial packet written. More...
|
|
static int | fr_bio_retry_write_resume (fr_bio_t *bio) |
| Resume writes. More...
|
|
Binary IO abstractions for retrying packets.
- Id
- a0d3078b8bb4db8ba2a96e7b0d3ef85a54c66f4b
The retry BIO provides a mechanism for the application to send one packet, and then delegate retransmissions to the retry bio.
This BIO will monitor writes, and run callbacks when a packet is sent, received, and released. The application should cache the request and response until the release callback has been run. The BIO will call the application on retries, or when the retransmissions have stopped.
The retry BIO also deals with partially written packets. The BIO takes responsibility for not writing partial packets, which means that requests can be rleeased even if the data has been partially written. The application can also cancel an ongoing retryt entrty at any time.
If something blocks IO, the application should call the blocked / resume functions for this BIO to inform it of IO changes. Otherwise, the only time this BIO blocks is when it runs out of retransmission slots.
There are provisions for application-layer watchdogs, where the application can reserve a retry entry. It can then call the fr_bio_retry_rewrite() function instead of fr_bio_write() to write the watchdog packet. Any retransmission timers for the application-layer watchdog must be handled by the application. The BIO will not retry reserved watchdog requests.
In general, the next BIO after this one should be the memory bio, so that this bio receives only complete packets.
- Copyright
- 2024 Network RADIUS SAS (legal.nosp@m.@net.nosp@m.workr.nosp@m.adiu.nosp@m.s.com)
Definition in file retry.c.