BIO_find_type.pod 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. =pod
  2. =head1 NAME
  3. BIO_find_type, BIO_next, BIO_method_type - BIO chain traversal
  4. =head1 SYNOPSIS
  5. #include <openssl/bio.h>
  6. BIO *BIO_find_type(BIO *b, int bio_type);
  7. BIO *BIO_next(BIO *b);
  8. int BIO_method_type(const BIO *b);
  9. =head1 DESCRIPTION
  10. The BIO_find_type() searches for a BIO of a given type in a chain, starting
  11. at BIO B<b>. If B<type> is a specific type (such as B<BIO_TYPE_MEM>) then a search
  12. is made for a BIO of that type. If B<type> is a general type (such as
  13. B<BIO_TYPE_SOURCE_SINK>) then the next matching BIO of the given general type is
  14. searched for. BIO_find_type() returns the next matching BIO or NULL if none is
  15. found.
  16. The following general types are defined:
  17. B<BIO_TYPE_DESCRIPTOR>, B<BIO_TYPE_FILTER>, and B<BIO_TYPE_SOURCE_SINK>.
  18. For a list of the specific types, see the B<openssl/bio.h> header file.
  19. BIO_next() returns the next BIO in a chain. It can be used to traverse all BIOs
  20. in a chain or used in conjunction with BIO_find_type() to find all BIOs of a
  21. certain type.
  22. BIO_method_type() returns the type of a BIO.
  23. =head1 RETURN VALUES
  24. BIO_find_type() returns a matching BIO or NULL for no match.
  25. BIO_next() returns the next BIO in a chain.
  26. BIO_method_type() returns the type of the BIO B<b>.
  27. =head1 EXAMPLE
  28. Traverse a chain looking for digest BIOs:
  29. BIO *btmp;
  30. btmp = in_bio; /* in_bio is chain to search through */
  31. do {
  32. btmp = BIO_find_type(btmp, BIO_TYPE_MD);
  33. if (btmp == NULL)
  34. break; /* Not found */
  35. /* btmp is a digest BIO, do something with it ...*/
  36. ...
  37. btmp = BIO_next(btmp);
  38. } while (btmp);
  39. =head1 COPYRIGHT
  40. Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
  41. Licensed under the Apache License 2.0 (the "License"). You may not use
  42. this file except in compliance with the License. You can obtain a copy
  43. in the file LICENSE in the source distribution or at
  44. L<https://www.openssl.org/source/license.html>.
  45. =cut