BIO_FIND_TYPE(3)
π BIO_FIND_TYPE(3) π
okay bestie, welcome to the Library Functions Manual page for BIO_FIND_TYPE(3) β we're talking BIO chain traversal, and it's honestly iconic. Grab a lil snack π, because this one's got functions, constants, and a whole cast of BIO types.
β¨ NAME β¨
BIO_find_type, BIO_next, BIO_method_type, BIO_method_name β BIO chain traversal, periodt. π
πΈ SYNOPSIS πΈ
#include <openssl/bio.h>
BIO *
BIO_find_type(BIO *bio, int type);
BIO *
BIO_next(BIO *bio);
int
BIO_method_type(const BIO *bio);
const char *
BIO_method_name(const BIO *bio);
#define BIO_TYPE_NONE 0
#define BIO_TYPE_START 128
π¦ DESCRIPTION π¦
BIO_find_type() searches for a BIO matching the given type in the chain starting at bio. The way it matches is lowkey specific: if the least significant byte of the type argument is non-zero, only exact matches of the type are accepted. Otherwise, a match only requires that any of the bits set in the type argument is also set in the candidate BIO. iykyk π«Ά
Types with a least significant byte in the range from 0 to BIO_TYPE_START, inclusive, are reserved for BIO types built into the library. Types with a least significant byte greater than BIO_TYPE_START are available for user-defined BIO types; see BIO_get_new_index(3) for details. π
BIO_next() returns the next BIO in the chain after bio. This function can be used to traverse all BIOs in a chain or in conjunction with BIO_find_type() to find all BIOs of a certain type. main character traversal energy fr fr. π₯
BIO_method_type() returns the type of the given bio.
BIO_method_name() returns an ASCII string representing the type of the bio.
The following are the built-in source/sink BIO types that operate on file descriptors. They all have both of the bits BIO_TYPE_SOURCE_SINK and BIO_TYPE_DESCRIPTOR but not the bit BIO_TYPE_FILTER set in their type constant. β¨
BIO_TYPE_ACCEPTβ name stringsocket acceptβBIO_METHOD:BIO_s_accept(3)BIO_TYPE_CONNECTβ name stringsocket connectβBIO_METHOD:BIO_s_connect(3)BIO_TYPE_DGRAMβ name stringdatagram socketβBIO_METHOD:BIO_s_datagram(3)BIO_TYPE_FDβ name stringfile descriptorβBIO_METHOD:BIO_s_fd(3)BIO_TYPE_SOCKETβ name stringsocketβBIO_METHOD:BIO_s_socket(3)
The following are the built-in source/sink BIO types that do not directly operate on file descriptors. They all have the bit BIO_TYPE_SOURCE_SINK but not the bits BIO_TYPE_DESCRIPTOR and BIO_TYPE_FILTER set in their type constant. π
BIO_TYPE_BIOβ name stringBIO pairβBIO_METHOD:BIO_s_bio(3)BIO_TYPE_FILEβ name stringFILE pointerβBIO_METHOD:BIO_s_file(3)BIO_TYPE_MEMβ name stringmemory bufferβBIO_METHOD:BIO_s_mem(3)BIO_TYPE_NULLβ name stringNULLβBIO_METHOD:BIO_s_null(3)
The following are the built-in filter BIO types. They all have the bit BIO_TYPE_FILTER but not the bits BIO_TYPE_SOURCE_SINK and BIO_TYPE_DESCRIPTOR set in their type constant. π§
BIO_TYPE_BASE64β name stringbase64 encodingβBIO_METHOD:BIO_f_base64(3)BIO_TYPE_BUFFERβ name stringbufferβBIO_METHOD:BIO_f_buffer(3)BIO_TYPE_CIPHERβ name stringcipherβBIO_METHOD:BIO_f_cipher(3)BIO_TYPE_MDβ name stringmessage digestβBIO_METHOD:BIO_f_md(3)BIO_TYPE_NULL_FILTERβ name stringNULL filterβBIO_METHOD:BIO_f_null(3)BIO_TYPE_SSLβ name stringsslβBIO_METHOD:BIO_f_ssl(3)
The constants BIO_TYPE_BER, BIO_TYPE_PROXY_CLIENT, and BIO_TYPE_PROXY_SERVER do not correspond to any BIO types implemented by the library and are not intended to be used for application-defined types, either. π«
The constants BIO_TYPE_COMP, BIO_TYPE_LINEBUFFER, and BIO_TYPE_NBIO_TEST correspond to deprecated BIO types that are intentionally undocumented. So likeβ¦ they're giving mystery, but not the fun kind. π
If a variable in an application program is intended to store a BIO type but temporarily does not refer to any BIO or refers to a BIO of an unknown type, setting the variable to BIO_TYPE_NONE is recommended. cute safety habit, no cap. π
π RETURN VALUES π
BIO_find_type() returns the next matching BIO or NULL if bio is a NULL pointer or if no matching BIO is found. π
BIO_next() returns the next BIO or NULL if bio is a NULL pointer or points to the last BIO in a chain.
BIO_method_type() returns one of the BIO_TYPE_* constants. β
BIO_method_name() returns an internal pointer to a string. noted, bestie. π«Ά
π EXAMPLES π
Traverse a chain looking for digest BIOs:
BIO *btmp;
btmp = in_bio; /* in_bio is the chain to search through */
while (btmp != NULL) {
btmp = BIO_find_type(btmp, BIO_TYPE_MD);
if (btmp == NULL)
break; /* Not found */
/* btmp is a digest BIO, do something with it ... */
...
btmp = BIO_next(btmp);
}
π SEE ALSO π
BIO_meth_new(3), BIO_new(3) β go off, besties. π
π HISTORY π
BIO_method_type() and BIO_method_name() first appeared in SSLeay 0.6.0.
BIO_find_type() first appeared in SSLeay 0.6.6.
These functions have been available since OpenBSD 2.4.
BIO_next() first appeared in OpenSSL 0.9.6 and has been available since OpenBSD 2.9. iconic lineage behavior. π¦
and that's the vibe check: this page is from Debian, dated July 26, 2023, and signs off as BIO_FIND_TYPE(3) β mwah πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: libressl-devel-doc 4.1.0-bp160.1.1 Β· OpenSSL
- Copyright (c) 2021, 2023 Ingo Schwarze <schwarze@openbsd.org>
- Copyright (c) 2000, 2013, 2016 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms