1BIO_FIND_TYPE(3) OpenSSL BIO_FIND_TYPE(3)
2
3
4
6 BIO_find_type, BIO_next, BIO_method_type - BIO chain traversal
7
9 #include <openssl/bio.h>
10
11 BIO *BIO_find_type(BIO *b, int bio_type);
12 BIO *BIO_next(BIO *b);
13 int BIO_method_type(const BIO *b);
14
16 The BIO_find_type() searches for a BIO of a given type in a chain,
17 starting at BIO b. If type is a specific type (such as BIO_TYPE_MEM)
18 then a search is made for a BIO of that type. If type is a general type
19 (such as BIO_TYPE_SOURCE_SINK) then the next matching BIO of the given
20 general type is searched for. BIO_find_type() returns the next matching
21 BIO or NULL if none is found.
22
23 The following general types are defined: BIO_TYPE_DESCRIPTOR,
24 BIO_TYPE_FILTER, and BIO_TYPE_SOURCE_SINK.
25
26 For a list of the specific types, see the openssl/bio.h header file.
27
28 BIO_next() returns the next BIO in a chain. It can be used to traverse
29 all BIOs in a chain or used in conjunction with BIO_find_type() to find
30 all BIOs of a certain type.
31
32 BIO_method_type() returns the type of a BIO.
33
35 BIO_find_type() returns a matching BIO or NULL for no match.
36
37 BIO_next() returns the next BIO in a chain.
38
39 BIO_method_type() returns the type of the BIO b.
40
42 Traverse a chain looking for digest BIOs:
43
44 BIO *btmp;
45
46 btmp = in_bio; /* in_bio is chain to search through */
47 do {
48 btmp = BIO_find_type(btmp, BIO_TYPE_MD);
49 if (btmp == NULL)
50 break; /* Not found */
51 /* btmp is a digest BIO, do something with it ...*/
52 ...
53
54 btmp = BIO_next(btmp);
55 } while (btmp);
56
58 Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
59
60 Licensed under the OpenSSL license (the "License"). You may not use
61 this file except in compliance with the License. You can obtain a copy
62 in the file LICENSE in the source distribution or at
63 <https://www.openssl.org/source/license.html>.
64
65
66
671.1.1i 2021-07-22 BIO_FIND_TYPE(3)