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