25 #include <freeradius-devel/util/debug.h>
26 #include <freeradius-devel/bio/buf.h>
52 if (!
used || !size)
return 0;
61 bio_buf->
read += size;
65 }
else if ((bio_buf->
end - bio_buf->
read) < (bio_buf->
read - bio_buf->
start)) {
109 bio_buf->
write += size;
118 ptr = talloc_array(ctx,
uint8_t, size);
static int const char char buffer[256]
size_t fr_bio_buf_make_room(fr_bio_buf_t *bio_buf)
size_t fr_bio_buf_read(fr_bio_buf_t *bio_buf, void *buffer, size_t size)
int fr_bio_buf_alloc(TALLOC_CTX *ctx, fr_bio_buf_t *bio_buf, size_t size)
ssize_t fr_bio_buf_write(fr_bio_buf_t *bio_buf, const void *buffer, size_t size)
static bool fr_bio_buf_contains(fr_bio_buf_t *bio_buf, void const *buffer)
static void fr_bio_buf_init(fr_bio_buf_t *bio_buf, uint8_t *buffer, size_t size)
static size_t fr_bio_buf_write_room(fr_bio_buf_t const *bio_buf)
uint8_t * start
start of the buffer
uint8_t * end
end of the buffer
static void fr_bio_buf_reset(fr_bio_buf_t *bio_buf)
static void fr_bio_buf_verify(fr_bio_buf_t const *bio_buf)
uint8_t * read
where in the buffer reads are taken from
uint8_t * write
where in the buffer writes are sent to