25#include <freeradius-devel/bio/bio_priv.h>
26#include <freeradius-devel/bio/null.h>
27#include <freeradius-devel/util/syserror.h>
59 rcode = next->
read(next, packet_ctx,
buffer, size);
60 if (rcode >= 0)
return rcode;
82 rcode = next->
write(next, packet_ctx,
buffer, size);
83 if (rcode >= 0)
return rcode;
170 if (
my->priv_cb.shutdown) {
171 my->priv_cb.shutdown(&
my->bio);
172 my->priv_cb.shutdown = NULL;
177 talloc_set_destructor(
my, NULL);
185 if (
my->cb.shutdown)
my->cb.shutdown(first);
186 my->cb.shutdown = NULL;
212 return "IO operation would block";
221 return "Packet fails verification";
224 return "Output buffer is full";
227 return "Output buffer is too small to cache the data";
230 return "The IO handler is not available. It has been shut down due to a previous error";
242 memset(&
my->cb, 0,
sizeof(
my->cb));
273 this->cb.eof(&this->bio);
284 if (!this->priv_cb.eof)
continue;
289 if (this->priv_cb.eof((
fr_bio_t *)
this) == 0)
break;
294 this->priv_cb.eof = NULL;
318 if (this->cb.write_blocked) {
319 rcode = this->cb.write_blocked(&this->bio);
320 if (rcode < 0)
return rcode;
321 is_blocked &= (rcode == 1);
331 if (!this->priv_cb.write_blocked)
continue;
336 rcode = this->priv_cb.write_blocked((
fr_bio_t *)
this);
337 if (rcode < 0)
return rcode;
338 is_blocked &= (rcode == 1);
static int const char char buffer[256]
fr_bio_write_t _CONST write
write to the underlying bio
static fr_bio_t * fr_bio_prev(fr_bio_t *bio)
fr_bio_read_t _CONST read
read from the underlying bio
fr_dlist_t _CONST entry
in the linked list of multiple bios
static fr_bio_t * fr_bio_next(fr_bio_t *bio)
int fr_bio_free(fr_bio_t *bio)
Free this bio, and everything it calls.
static ssize_t fr_bio_shutdown_write(UNUSED fr_bio_t *bio, UNUSED void *packet_ctx, UNUSED void const *buffer, UNUSED size_t size)
char const * fr_bio_strerror(ssize_t error)
int fr_bio_write_blocked(fr_bio_t *bio)
Internal BIO function to tell all BIOs that it's blocked.
static ssize_t fr_bio_shutdown_read(UNUSED fr_bio_t *bio, UNUSED void *packet_ctx, UNUSED void *buffer, UNUSED size_t size)
void fr_bio_cb_set(fr_bio_t *bio, fr_bio_cb_funcs_t const *cb)
int fr_bio_shutdown_intermediate(fr_bio_t *bio)
Like fr_bio_shutdown(), but can be called by anyone in the chain.
void fr_bio_eof(fr_bio_t *bio)
Internal BIO function to run EOF callbacks.
int fr_bio_destructor(fr_bio_t *bio)
Free this bio.
ssize_t fr_bio_next_read(fr_bio_t *bio, void *packet_ctx, void *buffer, size_t size)
Internal bio function which just reads from the "next" bio.
ssize_t fr_bio_next_write(fr_bio_t *bio, void *packet_ctx, void const *buffer, size_t size)
Internal bio function which just writes to the "next" bio.
int fr_bio_shutdown(fr_bio_t *bio)
Shut down a set of BIOs.
ssize_t fr_bio_null_read(UNUSED fr_bio_t *bio, UNUSED void *packet_ctx, UNUSED void *buffer, UNUSED size_t size)
Always return 0 on read.
ssize_t fr_bio_fail_read(UNUSED fr_bio_t *bio, UNUSED void *packet_ctx, UNUSED void *buffer, UNUSED size_t size)
Always return error on read.
ssize_t fr_bio_fail_write(UNUSED fr_bio_t *bio, UNUSED void *packet_ctx, UNUSED void const *buffer, UNUSED size_t size)
Always return 0 on write.
char const * fr_syserror(int num)
Guaranteed to be thread-safe version of strerror.
char const * fr_strerror(void)
Get the last library error.