Blame doc/man3/BIO_push.pod

Packit Service 084de1
=pod
Packit Service 084de1
Packit Service 084de1
=head1 NAME
Packit Service 084de1
Packit Service 084de1
BIO_push, BIO_pop, BIO_set_next - add and remove BIOs from a chain
Packit Service 084de1
Packit Service 084de1
=head1 SYNOPSIS
Packit Service 084de1
Packit Service 084de1
 #include <openssl/bio.h>
Packit Service 084de1
Packit Service 084de1
 BIO *BIO_push(BIO *b, BIO *append);
Packit Service 084de1
 BIO *BIO_pop(BIO *b);
Packit Service 084de1
 void BIO_set_next(BIO *b, BIO *next);
Packit Service 084de1
Packit Service 084de1
=head1 DESCRIPTION
Packit Service 084de1
Packit Service 084de1
The BIO_push() function appends the BIO B<append> to B, it returns
Packit Service 084de1
B.
Packit Service 084de1
Packit Service 084de1
BIO_pop() removes the BIO B from a chain and returns the next BIO
Packit Service 084de1
in the chain, or NULL if there is no next BIO. The removed BIO then
Packit Service 084de1
becomes a single BIO with no association with the original chain,
Packit Service 084de1
it can thus be freed or attached to a different chain.
Packit Service 084de1
Packit Service 084de1
BIO_set_next() replaces the existing next BIO in a chain with the BIO pointed to
Packit Service 084de1
by B<next>. The new chain may include some of the same BIOs from the old chain
Packit Service 084de1
or it may be completely different.
Packit Service 084de1
Packit Service 084de1
=head1 NOTES
Packit Service 084de1
Packit Service 084de1
The names of these functions are perhaps a little misleading. BIO_push()
Packit Service 084de1
joins two BIO chains whereas BIO_pop() deletes a single BIO from a chain,
Packit Service 084de1
the deleted BIO does not need to be at the end of a chain.
Packit Service 084de1
Packit Service 084de1
The process of calling BIO_push() and BIO_pop() on a BIO may have additional
Packit Service 084de1
consequences (a control call is made to the affected BIOs) any effects will
Packit Service 084de1
be noted in the descriptions of individual BIOs.
Packit Service 084de1
Packit Service 084de1
=head1 RETURN VALUES
Packit Service 084de1
Packit Service 084de1
BIO_push() returns the end of the chain, B.
Packit Service 084de1
Packit Service 084de1
BIO_pop() returns the next BIO in the chain, or NULL if there is no next
Packit Service 084de1
BIO.
Packit Service 084de1
Packit Service 084de1
=head1 EXAMPLES
Packit Service 084de1
Packit Service 084de1
For these examples suppose B<md1> and B<md2> are digest BIOs, B<b64> is
Packit Service 084de1
a base64 BIO and B<f> is a file BIO.
Packit Service 084de1
Packit Service 084de1
If the call:
Packit Service 084de1
Packit Service 084de1
 BIO_push(b64, f);
Packit Service 084de1
Packit Service 084de1
is made then the new chain will be B<b64-f>. After making the calls
Packit Service 084de1
Packit Service 084de1
 BIO_push(md2, b64);
Packit Service 084de1
 BIO_push(md1, md2);
Packit Service 084de1
Packit Service 084de1
the new chain is B<md1-md2-b64-f>. Data written to B<md1> will be digested
Packit Service 084de1
by B<md1> and B<md2>, B<base64> encoded and written to B<f>.
Packit Service 084de1
Packit Service 084de1
It should be noted that reading causes data to pass in the reverse
Packit Service 084de1
direction, that is data is read from B<f>, base64 B<decoded> and digested
Packit Service 084de1
by B<md1> and B<md2>. If the call:
Packit Service 084de1
Packit Service 084de1
 BIO_pop(md2);
Packit Service 084de1
Packit Service 084de1
The call will return B<b64> and the new chain will be B<md1-b64-f> data can
Packit Service 084de1
be written to B<md1> as before.
Packit Service 084de1
Packit Service 084de1
=head1 SEE ALSO
Packit Service 084de1
Packit Service 084de1
L<bio>
Packit Service 084de1
Packit Service 084de1
=head1 HISTORY
Packit Service 084de1
Packit Service 084de1
The BIO_set_next() function was added in OpenSSL 1.1.0.
Packit Service 084de1
Packit Service 084de1
=head1 COPYRIGHT
Packit Service 084de1
Packit Service 084de1
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
Packit Service 084de1
Packit Service 084de1
Licensed under the OpenSSL license (the "License").  You may not use
Packit Service 084de1
this file except in compliance with the License.  You can obtain a copy
Packit Service 084de1
in the file LICENSE in the source distribution or at
Packit Service 084de1
L<https://www.openssl.org/source/license.html>.
Packit Service 084de1
Packit Service 084de1
=cut