The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
Functions
base.c File Reference

Binary IO abstractions. More...

#include <freeradius-devel/bio/bio_priv.h>
#include <freeradius-devel/bio/null.h>
#include <freeradius-devel/util/syserror.h>
+ Include dependency graph for base.c:

Go to the source code of this file.

Functions

void fr_bio_cb_set (fr_bio_t *bio, fr_bio_cb_funcs_t const *cb)
 
int fr_bio_destructor (fr_bio_t *bio)
 Free this bio.
 
void fr_bio_eof (fr_bio_t *bio)
 Internal BIO function to run EOF callbacks.
 
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.
 
int fr_bio_shutdown_intermediate (fr_bio_t *bio)
 Like fr_bio_shutdown(), but can be called by anyone in the chain.
 
ssize_t fr_bio_shutdown_read (UNUSED fr_bio_t *bio, UNUSED void *packet_ctx, UNUSED void *buffer, UNUSED size_t size)
 
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.
 

Detailed Description

Binary IO abstractions.

Id
f1dbf6378462d1f592c5f70be4ca454bb74cb654

Definition in file base.c.

Function Documentation

◆ fr_bio_cb_set()

void fr_bio_cb_set ( fr_bio_t bio,
fr_bio_cb_funcs_t const *  cb 
)

Definition at line 193 of file base.c.

+ Here is the caller graph for this function:

◆ fr_bio_destructor()

int fr_bio_destructor ( fr_bio_t bio)

Free this bio.

We allow talloc_free() to be called on just about anything in the bio chain. But we ensure that the chain is always shut down in an orderly fashion.

Definition at line 35 of file base.c.

+ Here is the caller graph for this function:

◆ fr_bio_eof()

void fr_bio_eof ( fr_bio_t bio)

Internal BIO function to run EOF callbacks.

When a BIO hits EOF, it MUST call this function. This function will take care of changing the read() function to return nothing. It will also take care of walking back up the hierarchy, and calling any BIO EOF callbacks.

Once all of the BIOs have been marked as blocked, it will call the application EOF callback.

Definition at line 212 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_next_read()

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.

It is mainly used when the current bio needs to modify the write path, but does not need to do anything on the read path.

Definition at line 49 of file base.c.

+ Here is the call graph for this function:

◆ fr_bio_next_write()

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.

It is mainly used when the current bio needs to modify the read path, but does not need to do anything on the write path.

Definition at line 64 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_shutdown()

int fr_bio_shutdown ( fr_bio_t bio)

Shut down a set of BIOs.

We shut down the BIOs from the top to the bottom. This gives the TLS BIO an opportunity to call the SSL_shutdown() routine, which should then write to the FD BIO. Once that write is completed, the FD BIO can then close its socket.

Any shutdown is "stop read / write", but is not "free all resources". A shutdown can happen when one of the intermediary BIOs hits a fatal error. It can't free the BIO, but it has to mark the entire BIO chain as being unusable.

A destructor will first shutdown the BIOs, and then free all resources.

Definition at line 98 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_shutdown_intermediate()

int fr_bio_shutdown_intermediate ( fr_bio_t bio)

Like fr_bio_shutdown(), but can be called by anyone in the chain.

Definition at line 150 of file base.c.

+ Here is the call graph for this function:

◆ fr_bio_shutdown_read()

ssize_t fr_bio_shutdown_read ( UNUSED fr_bio_t bio,
UNUSED void *  packet_ctx,
UNUSED void *  buffer,
UNUSED size_t  size 
)

Definition at line 74 of file base.c.

+ Here is the caller graph for this function:

◆ fr_bio_shutdown_write()

ssize_t fr_bio_shutdown_write ( UNUSED fr_bio_t bio,
UNUSED void *  packet_ctx,
UNUSED void const *  buffer,
UNUSED size_t  size 
)

Definition at line 79 of file base.c.

+ Here is the caller graph for this function:

◆ fr_bio_strerror()

char const * fr_bio_strerror ( ssize_t  error)

Definition at line 161 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_bio_write_blocked()

int fr_bio_write_blocked ( fr_bio_t bio)

Internal BIO function to tell all BIOs that it's blocked.

When a BIO blocks on write, it MUST call this function. This function will take care of walking back up the hierarchy, and calling any write_blocked callbacks.

Once all of the BIOs have been marked as blocked, it will call the application write_blocked callback.

Definition at line 261 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: