25 #include <freeradius-devel/bio/bio_priv.h>
26 #include <freeradius-devel/bio/null.h>
27 #include <freeradius-devel/util/syserror.h>
60 if (rcode >= 0)
return rcode;
83 if (rcode >= 0)
return rcode;
119 next->entry.prev = NULL;
162 if (!
my->priv_cb.shutdown)
continue;
167 my->priv_cb.shutdown(&
my->bio);
168 my->priv_cb.shutdown = NULL;
176 if (
my->cb.shutdown)
my->cb.shutdown(first);
177 my->cb.shutdown = NULL;
203 return "IO operation would block";
212 return "Packet fails verification";
215 return "Output buffer is full";
218 return "Output buffer is too small to cache the data";
230 memset(&
my->cb, 0,
sizeof(
my->cb));
261 this->cb.eof(&this->bio);
272 if (!this->priv_cb.eof)
continue;
277 if (this->priv_cb.eof((
fr_bio_t *)
this) == 0)
break;
282 this->priv_cb.eof = NULL;
306 if (this->cb.write_blocked) {
307 rcode = this->cb.write_blocked(&this->bio);
308 if (rcode < 0)
return rcode;
309 is_blocked &= (rcode == 1);
319 if (!this->priv_cb.write_blocked)
continue;
324 rcode = this->priv_cb.write_blocked((
fr_bio_t *)
this);
325 if (rcode < 0)
return rcode;
326 is_blocked &= (rcode == 1);
static int const char char buffer[256]
fr_bio_write_t _CONST write
write to the underlying 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_prev(fr_bio_t *bio)
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.
int fr_bio_write_blocked(fr_bio_t *bio)
Internal BIO function to tell all BIOs that it's blocked.
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.
char const * fr_bio_strerror(ssize_t error)
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.