xref: /freebsd/crypto/openssl/doc/man3/BIO_get_data.pod (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1e71b7053SJung-uk Kim=pod
2e71b7053SJung-uk Kim
3e71b7053SJung-uk Kim=head1 NAME
4e71b7053SJung-uk Kim
5e71b7053SJung-uk KimBIO_set_data, BIO_get_data, BIO_set_init, BIO_get_init, BIO_set_shutdown,
6e71b7053SJung-uk KimBIO_get_shutdown - functions for managing BIO state information
7e71b7053SJung-uk Kim
8e71b7053SJung-uk Kim=head1 SYNOPSIS
9e71b7053SJung-uk Kim
10e71b7053SJung-uk Kim #include <openssl/bio.h>
11e71b7053SJung-uk Kim
12e71b7053SJung-uk Kim void BIO_set_data(BIO *a, void *ptr);
13e71b7053SJung-uk Kim void *BIO_get_data(BIO *a);
14e71b7053SJung-uk Kim void BIO_set_init(BIO *a, int init);
15e71b7053SJung-uk Kim int BIO_get_init(BIO *a);
16e71b7053SJung-uk Kim void BIO_set_shutdown(BIO *a, int shut);
17e71b7053SJung-uk Kim int BIO_get_shutdown(BIO *a);
18e71b7053SJung-uk Kim
19e71b7053SJung-uk Kim=head1 DESCRIPTION
20e71b7053SJung-uk Kim
21e71b7053SJung-uk KimThese functions are mainly useful when implementing a custom BIO.
22e71b7053SJung-uk Kim
23e71b7053SJung-uk KimThe BIO_set_data() function associates the custom data pointed to by B<ptr> with
24e71b7053SJung-uk Kimthe BIO. This data can subsequently be retrieved via a call to BIO_get_data().
25e71b7053SJung-uk KimThis can be used by custom BIOs for storing implementation specific information.
26e71b7053SJung-uk Kim
27e71b7053SJung-uk KimThe BIO_set_init() function sets the value of the BIO's "init" flag to indicate
2858f35182SJung-uk Kimwhether initialisation has been completed for this BIO or not. A nonzero value
29e71b7053SJung-uk Kimindicates that initialisation is complete, whilst zero indicates that it is not.
30e71b7053SJung-uk KimOften initialisation will complete during initial construction of the BIO. For
31e71b7053SJung-uk Kimsome BIOs however, initialisation may not complete until after additional steps
32e71b7053SJung-uk Kimhave occurred (for example through calling custom ctrls). The BIO_get_init()
33e71b7053SJung-uk Kimfunction returns the value of the "init" flag.
34e71b7053SJung-uk Kim
35e71b7053SJung-uk KimThe BIO_set_shutdown() and BIO_get_shutdown() functions set and get the state of
36e71b7053SJung-uk Kimthis BIO's shutdown (i.e. BIO_CLOSE) flag. If set then the underlying resource
37e71b7053SJung-uk Kimis also closed when the BIO is freed.
38e71b7053SJung-uk Kim
39e71b7053SJung-uk Kim=head1 RETURN VALUES
40e71b7053SJung-uk Kim
41e71b7053SJung-uk KimBIO_get_data() returns a pointer to the implementation specific custom data
42e71b7053SJung-uk Kimassociated with this BIO, or NULL if none has been set.
43e71b7053SJung-uk Kim
44e71b7053SJung-uk KimBIO_get_init() returns the state of the BIO's init flag.
45e71b7053SJung-uk Kim
46e71b7053SJung-uk KimBIO_get_shutdown() returns the stat of the BIO's shutdown (i.e. BIO_CLOSE) flag.
47e71b7053SJung-uk Kim
48e71b7053SJung-uk Kim=head1 SEE ALSO
49e71b7053SJung-uk Kim
50*b077aed3SPierre ProncheryL<bio(7)>, L<BIO_meth_new(3)>
51e71b7053SJung-uk Kim
52e71b7053SJung-uk Kim=head1 HISTORY
53e71b7053SJung-uk Kim
54e71b7053SJung-uk KimThe functions described here were added in OpenSSL 1.1.0.
55e71b7053SJung-uk Kim
56e71b7053SJung-uk Kim=head1 COPYRIGHT
57e71b7053SJung-uk Kim
58*b077aed3SPierre ProncheryCopyright 2016 The OpenSSL Project Authors. All Rights Reserved.
59e71b7053SJung-uk Kim
60*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
61e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
62e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
63e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
64e71b7053SJung-uk Kim
65e71b7053SJung-uk Kim=cut
66