![]() |
The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
|
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. | |
| fr_bio_t * | 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. | |
| static int | fr_bio_shutdown_chain (fr_bio_t *first) |
| Tear down every bio from "first" to the end of the chain. | |
| int | fr_bio_shutdown_discard (fr_bio_t *bio) |
| Shut down the chain now, discarding anything which is still buffered. | |
| static int | fr_bio_shutdown_final (fr_bio_t *bio) |
| Finish a shutdown: tear down the whole chain, and tell the application. | |
| 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. | |
Binary IO abstractions.
Definition in file base.c.
| 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.
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:Internal BIO function to run EOF callbacks.
Tell the chain that a bio is at EOF, and let the application drain whatever is buffered.
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 279 of file base.c.
Here is the call graph for this function:
Here is the caller graph for this function: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:
Here is the caller graph for this function: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:| 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.
Writes stop at once. Reads do not: a bio which still holds data which the application has not collected keeps its read routine, and the rest of the shutdown waits until that data has been drained. fr_bio_shutdown_discard() is the version which does not wait.
A destructor will first shutdown the BIOs, and then free all resources.
Definition at line 158 of file base.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
| int fr_bio_shutdown_discard | ( | fr_bio_t * | bio | ) |
Shut down the chain now, discarding anything which is still buffered.
For a caller which has decided that the buffered data is the problem, such as a verify failure, and for a free, which cannot wait for the application to drain anything.
Definition at line 207 of file base.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Finish a shutdown: tear down the whole chain, and tell the application.
Called either from fr_bio_shutdown() when nothing was buffered, or from fr_bio_eof() once the application has drained everything which had already been received.
Definition at line 117 of file base.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_bio_shutdown_intermediate | ( | fr_bio_t * | bio | ) |
Like fr_bio_shutdown(), but can be called by anyone in the chain.
fr_bio_shutdown() finds the head itself, so this is now the same function.
Definition at line 220 of file base.c.
Here is the call graph for this function:| 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.
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 346 of file base.c.
Here is the call graph for this function:
Here is the caller graph for this function:
1.9.8