bio.pod 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. =head2 TCP Fast Open
  39. TCP Fast Open (RFC7413), abbreviated "TFO", is supported by the BIO
  40. interface since OpenSSL 3.1. TFO is supported in the following operating systems:
  41. =over 4
  42. =item * Linux kernel 3.13 and later, where TFO is enabled by default.
  43. =item * Linux kernel 4.11 and later, using TCP_FASTOPEN_CONNECT.
  44. =item * FreeBSD 10.3 to 11.4, supports server TFO only.
  45. =item * FreeBSD 12.0 and later, supports both client and server TFO.
  46. =item * macOS 10.14 and later.
  47. =back
  48. Each operating system has a slightly different API for TFO. Please
  49. refer to the operating systems' API documentation when using
  50. sockets directly.
  51. =head1 EXAMPLES
  52. Create a memory BIO:
  53. BIO *mem = BIO_new(BIO_s_mem());
  54. =head1 SEE ALSO
  55. L<BIO_ctrl(3)>,
  56. L<BIO_f_base64(3)>, L<BIO_f_buffer(3)>,
  57. L<BIO_f_cipher(3)>, L<BIO_f_md(3)>,
  58. L<BIO_f_null(3)>, L<BIO_f_ssl(3)>,
  59. L<BIO_f_readbuffer(3)>,
  60. L<BIO_find_type(3)>,
  61. L<BIO_get_conn_mode(3)>,
  62. L<BIO_new(3)>,
  63. L<BIO_new_bio_pair(3)>,
  64. L<BIO_push(3)>, L<BIO_read_ex(3)>,
  65. L<BIO_s_accept(3)>, L<BIO_s_bio(3)>,
  66. L<BIO_s_connect(3)>, L<BIO_s_fd(3)>,
  67. L<BIO_s_file(3)>, L<BIO_s_mem(3)>,
  68. L<BIO_s_null(3)>, L<BIO_s_socket(3)>,
  69. L<BIO_set_callback(3)>,
  70. L<BIO_set_conn_mode(3)>,
  71. L<BIO_set_tfo(3)>,
  72. L<BIO_set_tfo_accept(3)>,
  73. L<BIO_should_retry(3)>
  74. =head1 COPYRIGHT
  75. Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
  76. Licensed under the Apache License 2.0 (the "License"). You may not use
  77. this file except in compliance with the License. You can obtain a copy
  78. in the file LICENSE in the source distribution or at
  79. L<https://www.openssl.org/source/license.html>.
  80. =cut