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