]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/BIO_find_type.pod
Implement EVP_MAC_do_all_ex()
[thirdparty/openssl.git] / doc / man3 / BIO_find_type.pod
CommitLineData
cfd3bb17
DSH
1=pod
2
3=head1 NAME
4
aafbe1cc 5BIO_find_type, BIO_next, BIO_method_type - BIO chain traversal
cfd3bb17
DSH
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
aebb9aac 11 BIO *BIO_find_type(BIO *b, int bio_type);
91da5e77
RS
12 BIO *BIO_next(BIO *b);
13 int BIO_method_type(const BIO *b);
cfd3bb17
DSH
14
15=head1 DESCRIPTION
16
17The BIO_find_type() searches for a BIO of a given type in a chain, starting
91da5e77 18at BIO B<b>. If B<type> is a specific type (such as B<BIO_TYPE_MEM>) then a search
cfd3bb17
DSH
19is made for a BIO of that type. If B<type> is a general type (such as
20B<BIO_TYPE_SOURCE_SINK>) then the next matching BIO of the given general type is
21searched for. BIO_find_type() returns the next matching BIO or NULL if none is
22found.
23
91da5e77
RS
24The following general types are defined:
25B<BIO_TYPE_DESCRIPTOR>, B<BIO_TYPE_FILTER>, and B<BIO_TYPE_SOURCE_SINK>.
26
aebb9aac 27For a list of the specific types, see the B<openssl/bio.h> header file.
cfd3bb17
DSH
28
29BIO_next() returns the next BIO in a chain. It can be used to traverse all BIOs
30in a chain or used in conjunction with BIO_find_type() to find all BIOs of a
31certain type.
32
33BIO_method_type() returns the type of a BIO.
34
35=head1 RETURN VALUES
36
37BIO_find_type() returns a matching BIO or NULL for no match.
38
39BIO_next() returns the next BIO in a chain.
40
41BIO_method_type() returns the type of the BIO B<b>.
42
cfd3bb17
DSH
43=head1 EXAMPLE
44
45Traverse a chain looking for digest BIOs:
46
47 BIO *btmp;
cfd3bb17 48
e9b77246 49 btmp = in_bio; /* in_bio is chain to search through */
f50c11ca 50 do {
2947af32
BB
51 btmp = BIO_find_type(btmp, BIO_TYPE_MD);
52 if (btmp == NULL)
53 break; /* Not found */
54 /* btmp is a digest BIO, do something with it ...*/
55 ...
cfd3bb17 56
2947af32 57 btmp = BIO_next(btmp);
2f8e53d7 58 } while (btmp);
cfd3bb17
DSH
59
60
e2f92610
RS
61=head1 COPYRIGHT
62
63Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
64
4746f25a 65Licensed under the Apache License 2.0 (the "License"). You may not use
e2f92610
RS
66this file except in compliance with the License. You can obtain a copy
67in the file LICENSE in the source distribution or at
68L<https://www.openssl.org/source/license.html>.
69
70=cut