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