bio.pod 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. =pod
  2. =head1 NAME
  3. bio - Basic I/O abstraction
  4. =head1 SYNOPSIS
  5. =for openssl generic
  6. #include <openssl/bio.h>
  7. =head1 DESCRIPTION
  8. A BIO is an I/O abstraction, it hides many of the underlying I/O
  9. details from an application. If an application uses a BIO for its
  10. I/O it can transparently handle SSL connections, unencrypted network
  11. connections and file I/O.
  12. There are two types of BIO, a source/sink BIO and a filter BIO.
  13. As its name implies a source/sink BIO is a source and/or sink of data,
  14. examples include a socket BIO and a file BIO.
  15. A filter BIO takes data from one BIO and passes it through to
  16. another, or the application. The data may be left unmodified (for
  17. example a message digest BIO) or translated (for example an
  18. encryption BIO). The effect of a filter BIO may change according
  19. to the I/O operation it is performing: for example an encryption
  20. BIO will encrypt data if it is being written to and decrypt data
  21. if it is being read from.
  22. BIOs can be joined together to form a chain (a single BIO is a chain
  23. with one component). A chain normally consists of one source/sink
  24. BIO and one or more filter BIOs. Data read from or written to the
  25. first BIO then traverses the chain to the end (normally a source/sink
  26. BIO).
  27. Some BIOs (such as memory BIOs) can be used immediately after calling
  28. BIO_new(). Others (such as file BIOs) need some additional initialization,
  29. and frequently a utility function exists to create and initialize such BIOs.
  30. If BIO_free() is called on a BIO chain it will only free one BIO resulting
  31. in a memory leak.
  32. Calling BIO_free_all() on a single BIO has the same effect as calling
  33. BIO_free() on it other than the discarded return value.
  34. Normally the I<type> argument is supplied by a function which returns a
  35. pointer to a BIO_METHOD. There is a naming convention for such functions:
  36. a source/sink BIO typically starts with I<BIO_s_> and
  37. a filter BIO with I<BIO_f_>.
  38. =head1 EXAMPLES
  39. Create a memory BIO:
  40. BIO *mem = BIO_new(BIO_s_mem());
  41. =head1 SEE ALSO
  42. L<BIO_ctrl(3)>,
  43. L<BIO_f_base64(3)>, L<BIO_f_buffer(3)>,
  44. L<BIO_f_cipher(3)>, L<BIO_f_md(3)>,
  45. L<BIO_f_null(3)>, L<BIO_f_ssl(3)>,
  46. L<BIO_f_readbuffer(3)>,
  47. L<BIO_find_type(3)>, L<BIO_new(3)>,
  48. L<BIO_new_bio_pair(3)>,
  49. L<BIO_push(3)>, L<BIO_read_ex(3)>,
  50. L<BIO_s_accept(3)>, L<BIO_s_bio(3)>,
  51. L<BIO_s_connect(3)>, L<BIO_s_fd(3)>,
  52. L<BIO_s_file(3)>, L<BIO_s_mem(3)>,
  53. L<BIO_s_null(3)>, L<BIO_s_socket(3)>,
  54. L<BIO_set_callback(3)>,
  55. L<BIO_should_retry(3)>
  56. =head1 COPYRIGHT
  57. Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
  58. Licensed under the Apache License 2.0 (the "License"). You may not use
  59. this file except in compliance with the License. You can obtain a copy
  60. in the file LICENSE in the source distribution or at
  61. L<https://www.openssl.org/source/license.html>.
  62. =cut