summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2016-11-20 01:22:28 +0000
committerschwarze <>2016-11-20 01:22:28 +0000
commit9c7999ae75cdabf35c8bc55730e9fb1cd226e14a (patch)
treea9396afd9d719ab2568ad44a552c6ea1189beb9d /src/lib
parent0d7e2c2280049e5853d2da3c82b4bfee155312ed (diff)
downloadopenbsd-9c7999ae75cdabf35c8bc55730e9fb1cd226e14a.tar.gz
openbsd-9c7999ae75cdabf35c8bc55730e9fb1cd226e14a.tar.bz2
openbsd-9c7999ae75cdabf35c8bc55730e9fb1cd226e14a.zip
Add Copyright and license.
In the SYNOPSIS, provide prototypes rather than #define directives. Name arguments consistently. Remove lies about functions being macros.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/BIO_set_callback.3112
1 files changed, 87 insertions, 25 deletions
diff --git a/src/lib/libcrypto/man/BIO_set_callback.3 b/src/lib/libcrypto/man/BIO_set_callback.3
index 62b7b3773b..2a27d33428 100644
--- a/src/lib/libcrypto/man/BIO_set_callback.3
+++ b/src/lib/libcrypto/man/BIO_set_callback.3
@@ -1,6 +1,54 @@
1.\" $OpenBSD: BIO_set_callback.3,v 1.3 2016/11/07 15:52:47 jmc Exp $ 1.\" $OpenBSD: BIO_set_callback.3,v 1.4 2016/11/20 01:22:28 schwarze Exp $
2.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
2.\" 3.\"
3.Dd $Mdocdate: November 7 2016 $ 4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2000, 2016 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: November 20 2016 $
4.Dt BIO_SET_CALLBACK 3 52.Dt BIO_SET_CALLBACK 3
5.Os 53.Os
6.Sh NAME 54.Sh NAME
@@ -12,33 +60,47 @@
12.Nd BIO callback functions 60.Nd BIO callback functions
13.Sh SYNOPSIS 61.Sh SYNOPSIS
14.In openssl/bio.h 62.In openssl/bio.h
15.Fd #define BIO_set_callback(b,cb) ((b)->callback=(cb)) 63.Ft void
16.Fd #define BIO_get_callback(b) ((b)->callback) 64.Fo BIO_set_callback
17.Fd #define BIO_set_callback_arg(b,arg) ((b)->cb_arg=(char *)(arg)) 65.Fa "BIO *b"
18.Fd #define BIO_get_callback_arg(b) ((b)->cb_arg) 66.Fa "BIO_callback_fn cb"
67.Fc
68.Ft BIO_callback_fn
69.Fo BIO_get_callback
70.Fa "BIO *b"
71.Fc
72.Ft void
73.Fo BIO_set_callback_arg
74.Fa "BIO *b"
75.Fa "char *arg"
76.Fc
77.Ft char *
78.Fo BIO_get_callback_arg
79.Fa "const BIO *b"
80.Fc
19.Ft long 81.Ft long
20.Fo BIO_debug_callback 82.Fo BIO_debug_callback
21.Fa "BIO *bio" 83.Fa "BIO *bio"
22.Fa "int cmd" 84.Fa "int oper"
23.Fa "const char *argp" 85.Fa "const char *argp"
24.Fa "int argi" 86.Fa "int argi"
25.Fa "long argl" 87.Fa "long argl"
26.Fa "long ret" 88.Fa "long ret"
27.Fc 89.Fc
28.Ft typedef long * 90.Ft typedef long
29.Fo callback 91.Fo "(*BIO_callback_fn)"
30.Fa "BIO *b" 92.Fa "BIO *b"
31.Fa "int oper" 93.Fa "int oper"
32.Fa "const char *argp" 94.Fa "const char *argp"
33.Fa "int argi" 95.Fa "int argi"
34.Fa "long argl" 96.Fa "long argl"
35.Fa "long retvalue" 97.Fa "long ret"
36.Fc 98.Fc
37.Sh DESCRIPTION 99.Sh DESCRIPTION
38.Fn BIO_set_callback 100.Fn BIO_set_callback
39and 101and
40.Fn BIO_get_callback 102.Fn BIO_get_callback
41set and retrieve the BIO callback; they are both macros. 103set and retrieve the BIO callback.
42The callback is called during most high level BIO operations. 104The callback is called during most high level BIO operations.
43It can be used for debugging purposes to trace operations on a BIO 105It can be used for debugging purposes to trace operations on a BIO
44or to modify its operation. 106or to modify its operation.
@@ -46,8 +108,7 @@ or to modify its operation.
46.Fn BIO_set_callback_arg 108.Fn BIO_set_callback_arg
47and 109and
48.Fn BIO_get_callback_arg 110.Fn BIO_get_callback_arg
49are macros which can be used to set and retrieve an argument 111set and retrieve an argument for use in the callback.
50for use in the callback.
51.Pp 112.Pp
52.Fn BIO_debug_callback 113.Fn BIO_debug_callback
53is a standard debugging callback which prints 114is a standard debugging callback which prints
@@ -55,8 +116,8 @@ out information relating to each BIO operation.
55If the callback argument is set, it is interpreted as a BIO 116If the callback argument is set, it is interpreted as a BIO
56to send the information to, otherwise stderr is used. 117to send the information to, otherwise stderr is used.
57.Pp 118.Pp
58.Fn callback 119.Fn BIO_callback_fn
59is the callback function itself. 120is the type of the callback function.
60The meaning of each argument is described below. 121The meaning of each argument is described below.
61.Pp 122.Pp
62The BIO the callback is attached to is passed in 123The BIO the callback is attached to is passed in
@@ -80,17 +141,18 @@ depends on the value of
80.Fa oper 141.Fa oper
81(i.e. the operation being performed). 142(i.e. the operation being performed).
82.Pp 143.Pp
83.Fa retvalue 144.Fa ret
84is the return value that would be returned to the application 145is the return value that would be returned to the application
85if no callback were present. 146if no callback were present.
86The actual value returned is the return value of the callback itself. 147The actual value returned is the return value of the callback itself.
87In the case of callbacks called before the actual BIO operation, 148In the case of callbacks called before the actual BIO operation,
881 is placed in retvalue. 1491 is placed in
150.Fa ret .
89If the return value is not positive, it will be immediately returned to 151If the return value is not positive, it will be immediately returned to
90the application and the BIO operation will not be performed. 152the application and the BIO operation will not be performed.
91.Pp 153.Pp
92The callback should normally simply return 154The callback should normally simply return
93.Fa retvalue 155.Fa ret
94when it has finished processing, unless it specifically wishes 156when it has finished processing, unless it specifically wishes
95to modify the value returned to the application. 157to modify the value returned to the application.
96.Ss Callback operations 158.Ss Callback operations
@@ -101,27 +163,27 @@ is called before the free operation.
101.It Fn BIO_read b out outl 163.It Fn BIO_read b out outl
102.Fn callback b BIO_CB_READ out outl 0L 1L 164.Fn callback b BIO_CB_READ out outl 0L 1L
103is called before the read and 165is called before the read and
104.Fn callback b BIO_CB_READ|BIO_CB_RETURN out outl 0L retvalue 166.Fn callback b BIO_CB_READ|BIO_CB_RETURN out outl 0L ret
105after. 167after.
106.It Fn BIO_write b in inl 168.It Fn BIO_write b in inl
107.Fn callback b BIO_CB_WRITE in inl 0L 1L 169.Fn callback b BIO_CB_WRITE in inl 0L 1L
108is called before the write and 170is called before the write and
109.Fn callback b BIO_CB_WRITE|BIO_CB_RETURN in inl 0L retvalue 171.Fn callback b BIO_CB_WRITE|BIO_CB_RETURN in inl 0L ret
110after. 172after.
111.It Fn BIO_gets b out outl 173.It Fn BIO_gets b out outl
112.Fn callback b BIO_CB_GETS out outl 0L 1L 174.Fn callback b BIO_CB_GETS out outl 0L 1L
113is called before the operation and 175is called before the operation and
114.Fn callback b BIO_CB_GETS|BIO_CB_RETURN out outl 0L retvalue 176.Fn callback b BIO_CB_GETS|BIO_CB_RETURN out outl 0L ret
115after. 177after.
116.It Fn BIO_puts b in 178.It Fn BIO_puts b in
117.Fn callback b BIO_CB_WRITE in 0 0L 1L 179.Fn callback b BIO_CB_WRITE in 0 0L 1L
118is called before the operation and 180is called before the operation and
119.Fn callback b BIO_CB_WRITE|BIO_CB_RETURN in 0 0L retvalue 181.Fn callback b BIO_CB_WRITE|BIO_CB_RETURN in 0 0L ret
120after. 182after.
121.It Fn BIO_ctrl b cmd larg parg 183.It Fn BIO_ctrl b oper larg parg
122.Fn callback b BIO_CB_CTRL parg cmd larg 1L 184.Fn callback b BIO_CB_CTRL parg oper larg 1L
123is called before the call and 185is called before the call and
124.Fn callback b BIO_CB_CTRL|BIO_CB_RETURN parg cmd larg ret 186.Fn callback b BIO_CB_CTRL|BIO_CB_RETURN parg oper larg ret
125after. 187after.
126.El 188.El
127.Sh EXAMPLES 189.Sh EXAMPLES