DragonFly On-Line Manual Pages

Search: Section:  


BIO(3)		      DragonFly Library Functions Manual		BIO(3)

NAME

BIO -- I/O abstraction

SYNOPSIS

#include <openssl/bio.h>

DESCRIPTION

A BIO is an I/O abstraction, it hides many of the underlying I/O details from an application. If an application uses a BIO for its I/O, it can transparently handle SSL connections, unencrypted network connections and file I/O. There are two types of BIO, a source/sink BIO and a filter BIO. As its name implies, a source/sink BIO is a source and/or sink of data, examples include a socket BIO and a file BIO. A filter BIO takes data from one BIO and passes it through to another, or to the application. The data may be left unmodified (for example a mes- sage digest BIO) or translated (for example an encryption BIO). The effect of a filter BIO may change according to the I/O operation it is performing: for example an encryption BIO will encrypt data if it is being written to and decrypt data if it is being read from. BIOs can be joined together to form a chain (a single BIO is a chain with one component). A chain normally consist of one source/sink BIO and one or more filter BIOs. Data read from or written to the first BIO then traverses the chain to the end (normally a source/sink BIO).

SEE ALSO

BIO_ctrl(3), BIO_f_base64(3), BIO_f_buffer(3), BIO_f_cipher(3), BIO_f_md(3), BIO_f_null(3), BIO_f_ssl(3), BIO_find_type(3), BIO_new(3), BIO_new_bio_pair(3), BIO_push(3), BIO_read(3), BIO_s_accept(3), BIO_s_bio(3), BIO_s_connect(3), BIO_s_fd(3), BIO_s_file(3), BIO_s_mem(3), BIO_s_null(3), BIO_s_socket(3), BIO_set_callback(3), BIO_should_retry(3) DragonFly 4.7 July 17, 2014 DragonFly 4.7 BIO_GET_DATA(3) OpenSSL BIO_GET_DATA(3)

NAME

BIO_set_data, BIO_get_data, BIO_set_init, BIO_get_init, BIO_set_shutdown, BIO_get_shutdown - functions for managing BIO state information

SYNOPSIS

#include <openssl/bio.h> void BIO_set_data(BIO *a, void *ptr); void *BIO_get_data(BIO *a); void BIO_set_init(BIO *a, int init); int BIO_get_init(BIO *a); void BIO_set_shutdown(BIO *a, int shut); int BIO_get_shutdown(BIO *a);

DESCRIPTION

These functions are mainly useful when implementing a custom BIO. The BIO_set_data() function associates the custom data pointed to by ptr with the BIO. This data can subsequently be retrieved via a call to BIO_get_data(). This can be used by custom BIOs for storing implementation specific information. The BIO_set_init() function sets the value of the BIO's "init" flag to indicate whether initialisation has been completed for this BIO or not. A nonzero value indicates that initialisation is complete, whilst zero indicates that it is not. Often initialisation will complete during initial construction of the BIO. For some BIOs however, initialisation may not complete until after additional steps have occurred (for example through calling custom ctrls). The BIO_get_init() function returns the value of the "init" flag. The BIO_set_shutdown() and BIO_get_shutdown() functions set and get the state of this BIO's shutdown (i.e. BIO_CLOSE) flag. If set then the underlying resource is also closed when the BIO is freed.

RETURN VALUES

BIO_get_data() returns a pointer to the implementation specific custom data associated with this BIO, or NULL if none has been set. BIO_get_init() returns the state of the BIO's init flag. BIO_get_shutdown() returns the stat of the BIO's shutdown (i.e. BIO_CLOSE) flag.

SEE ALSO

bio, BIO_meth_new

HISTORY

The functions described here were added in OpenSSL 1.1.0.

COPYRIGHT

Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>. 1.1.1v 2023-08-01 BIO_GET_DATA(3)

Search: Section: