diff options
Diffstat (limited to 'src/lib/libcrypto/man/BIO_ctrl.3')
| -rw-r--r-- | src/lib/libcrypto/man/BIO_ctrl.3 | 637 |
1 files changed, 0 insertions, 637 deletions
diff --git a/src/lib/libcrypto/man/BIO_ctrl.3 b/src/lib/libcrypto/man/BIO_ctrl.3 deleted file mode 100644 index 2c537956e1..0000000000 --- a/src/lib/libcrypto/man/BIO_ctrl.3 +++ /dev/null | |||
| @@ -1,637 +0,0 @@ | |||
| 1 | .\" $OpenBSD: BIO_ctrl.3,v 1.25 2023/11/16 20:19:23 schwarze Exp $ | ||
| 2 | .\" full merge up to: OpenSSL 24a535eaf Tue Sep 22 13:14:20 2020 +0100 | ||
| 3 | .\" selective merge up to: OpenSSL 0c5bc96f Tue Mar 15 13:57:22 2022 +0000 | ||
| 4 | .\" | ||
| 5 | .\" This file is a derived work. | ||
| 6 | .\" The changes are covered by the following Copyright and license: | ||
| 7 | .\" | ||
| 8 | .\" Copyright (c) 2023 Ingo Schwarze <schwarze@openbsd.org> | ||
| 9 | .\" | ||
| 10 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 11 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 12 | .\" copyright notice and this permission notice appear in all copies. | ||
| 13 | .\" | ||
| 14 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 15 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 16 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 17 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 18 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 19 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 20 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 21 | .\" | ||
| 22 | .\" The original file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
| 23 | .\" Copyright (c) 2000, 2016 The OpenSSL Project. All rights reserved. | ||
| 24 | .\" | ||
| 25 | .\" Redistribution and use in source and binary forms, with or without | ||
| 26 | .\" modification, are permitted provided that the following conditions | ||
| 27 | .\" are met: | ||
| 28 | .\" | ||
| 29 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 30 | .\" notice, this list of conditions and the following disclaimer. | ||
| 31 | .\" | ||
| 32 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 33 | .\" notice, this list of conditions and the following disclaimer in | ||
| 34 | .\" the documentation and/or other materials provided with the | ||
| 35 | .\" distribution. | ||
| 36 | .\" | ||
| 37 | .\" 3. All advertising materials mentioning features or use of this | ||
| 38 | .\" software must display the following acknowledgment: | ||
| 39 | .\" "This product includes software developed by the OpenSSL Project | ||
| 40 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 41 | .\" | ||
| 42 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 43 | .\" endorse or promote products derived from this software without | ||
| 44 | .\" prior written permission. For written permission, please contact | ||
| 45 | .\" openssl-core@openssl.org. | ||
| 46 | .\" | ||
| 47 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
| 48 | .\" nor may "OpenSSL" appear in their names without prior written | ||
| 49 | .\" permission of the OpenSSL Project. | ||
| 50 | .\" | ||
| 51 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
| 52 | .\" acknowledgment: | ||
| 53 | .\" "This product includes software developed by the OpenSSL Project | ||
| 54 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 55 | .\" | ||
| 56 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 57 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 58 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 59 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 60 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 61 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 62 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 63 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 64 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 65 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 66 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 67 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 68 | .\" | ||
| 69 | .Dd $Mdocdate: November 16 2023 $ | ||
| 70 | .Dt BIO_CTRL 3 | ||
| 71 | .Os | ||
| 72 | .Sh NAME | ||
| 73 | .Nm BIO_ctrl , | ||
| 74 | .Nm BIO_callback_ctrl , | ||
| 75 | .Nm BIO_ptr_ctrl , | ||
| 76 | .Nm BIO_int_ctrl , | ||
| 77 | .Nm BIO_reset , | ||
| 78 | .Nm BIO_seek , | ||
| 79 | .Nm BIO_tell , | ||
| 80 | .Nm BIO_flush , | ||
| 81 | .Nm BIO_eof , | ||
| 82 | .Nm BIO_set_close , | ||
| 83 | .Nm BIO_get_close , | ||
| 84 | .Nm BIO_pending , | ||
| 85 | .Nm BIO_wpending , | ||
| 86 | .Nm BIO_ctrl_pending , | ||
| 87 | .Nm BIO_ctrl_wpending , | ||
| 88 | .Nm BIO_get_info_callback , | ||
| 89 | .Nm BIO_set_info_callback , | ||
| 90 | .Nm BIO_info_cb , | ||
| 91 | .Nm bio_info_cb | ||
| 92 | .Nd BIO control operations | ||
| 93 | .Sh SYNOPSIS | ||
| 94 | .In openssl/bio.h | ||
| 95 | .Ft long | ||
| 96 | .Fo BIO_ctrl | ||
| 97 | .Fa "BIO *b" | ||
| 98 | .Fa "int cmd" | ||
| 99 | .Fa "long larg" | ||
| 100 | .Fa "void *parg" | ||
| 101 | .Fc | ||
| 102 | .Ft long | ||
| 103 | .Fo BIO_callback_ctrl | ||
| 104 | .Fa "BIO *b" | ||
| 105 | .Fa "int cmd" | ||
| 106 | .Fa "BIO_info_cb *cb" | ||
| 107 | .Fc | ||
| 108 | .Ft char * | ||
| 109 | .Fo BIO_ptr_ctrl | ||
| 110 | .Fa "BIO *b" | ||
| 111 | .Fa "int cmd" | ||
| 112 | .Fa "long larg" | ||
| 113 | .Fc | ||
| 114 | .Ft long | ||
| 115 | .Fo BIO_int_ctrl | ||
| 116 | .Fa "BIO *b" | ||
| 117 | .Fa "int cmd" | ||
| 118 | .Fa "long larg" | ||
| 119 | .Fa "int iarg" | ||
| 120 | .Fc | ||
| 121 | .Ft int | ||
| 122 | .Fo BIO_reset | ||
| 123 | .Fa "BIO *b" | ||
| 124 | .Fc | ||
| 125 | .Ft int | ||
| 126 | .Fo BIO_seek | ||
| 127 | .Fa "BIO *b" | ||
| 128 | .Fa "int ofs" | ||
| 129 | .Fc | ||
| 130 | .Ft int | ||
| 131 | .Fo BIO_tell | ||
| 132 | .Fa "BIO *b" | ||
| 133 | .Fc | ||
| 134 | .Ft int | ||
| 135 | .Fo BIO_flush | ||
| 136 | .Fa "BIO *b" | ||
| 137 | .Fc | ||
| 138 | .Ft int | ||
| 139 | .Fo BIO_eof | ||
| 140 | .Fa "BIO *b" | ||
| 141 | .Fc | ||
| 142 | .Ft int | ||
| 143 | .Fo BIO_set_close | ||
| 144 | .Fa "BIO *b" | ||
| 145 | .Fa "long flag" | ||
| 146 | .Fc | ||
| 147 | .Ft int | ||
| 148 | .Fo BIO_get_close | ||
| 149 | .Fa "BIO *b" | ||
| 150 | .Fc | ||
| 151 | .Ft int | ||
| 152 | .Fo BIO_pending | ||
| 153 | .Fa "BIO *b" | ||
| 154 | .Fc | ||
| 155 | .Ft int | ||
| 156 | .Fo BIO_wpending | ||
| 157 | .Fa "BIO *b" | ||
| 158 | .Fc | ||
| 159 | .Ft size_t | ||
| 160 | .Fo BIO_ctrl_pending | ||
| 161 | .Fa "BIO *b" | ||
| 162 | .Fc | ||
| 163 | .Ft size_t | ||
| 164 | .Fo BIO_ctrl_wpending | ||
| 165 | .Fa "BIO *b" | ||
| 166 | .Fc | ||
| 167 | .Ft int | ||
| 168 | .Fo BIO_get_info_callback | ||
| 169 | .Fa "BIO *b" | ||
| 170 | .Fa "BIO_info_cb **cbp" | ||
| 171 | .Fc | ||
| 172 | .Ft int | ||
| 173 | .Fo BIO_set_info_callback | ||
| 174 | .Fa "BIO *b" | ||
| 175 | .Fa "BIO_info_cb *cb" | ||
| 176 | .Fc | ||
| 177 | .Ft typedef int | ||
| 178 | .Fo BIO_info_cb | ||
| 179 | .Fa "BIO *b" | ||
| 180 | .Fa "int state" | ||
| 181 | .Fa "int res" | ||
| 182 | .Fc | ||
| 183 | .Ft typedef int | ||
| 184 | .Fo bio_info_cb | ||
| 185 | .Fa "BIO *b" | ||
| 186 | .Fa "int state" | ||
| 187 | .Fa "int res" | ||
| 188 | .Fc | ||
| 189 | .Sh DESCRIPTION | ||
| 190 | .Fn BIO_ctrl , | ||
| 191 | .Fn BIO_callback_ctrl , | ||
| 192 | .Fn BIO_ptr_ctrl , | ||
| 193 | and | ||
| 194 | .Fn BIO_int_ctrl | ||
| 195 | are BIO "control" operations taking arguments of various types. | ||
| 196 | These functions are not normally called directly - | ||
| 197 | various macros are used instead. | ||
| 198 | The standard macros are described below. | ||
| 199 | Macros specific to a particular type of BIO | ||
| 200 | are described in the specific BIO's manual page | ||
| 201 | as well as any special features of the standard calls. | ||
| 202 | .Pp | ||
| 203 | Depending on the | ||
| 204 | .Fa cmd | ||
| 205 | and on the type of | ||
| 206 | .Fa b , | ||
| 207 | .Fn BIO_ctrl | ||
| 208 | may have a read-only effect on | ||
| 209 | .Fa b | ||
| 210 | or change data in | ||
| 211 | .Fa b | ||
| 212 | or in its sub-structures. | ||
| 213 | It may also have a side effect of changing the memory pointed to by | ||
| 214 | .Fa parg . | ||
| 215 | .Pp | ||
| 216 | .Fn BIO_callback_ctrl | ||
| 217 | does not call | ||
| 218 | .Fn BIO_ctrl | ||
| 219 | but instead requires that the BIO type of | ||
| 220 | .Fa b | ||
| 221 | provides a dedicated | ||
| 222 | .Fa callback_ctrl | ||
| 223 | function pointer, which is built into the library for some standard BIO | ||
| 224 | types and can be provided with | ||
| 225 | .Xr BIO_meth_set_callback_ctrl 3 | ||
| 226 | for application-defined BIO types. | ||
| 227 | The only | ||
| 228 | .Fa cmd | ||
| 229 | supported by | ||
| 230 | .Fn BIO_callback_ctrl | ||
| 231 | is | ||
| 232 | .Dv BIO_CTRL_SET_CALLBACK . | ||
| 233 | .Pp | ||
| 234 | .Fn BIO_ptr_ctrl | ||
| 235 | calls | ||
| 236 | .Fn BIO_ctrl | ||
| 237 | with | ||
| 238 | .Fa parg | ||
| 239 | pointing to the location of a temporary pointer variable initialized to | ||
| 240 | .Dv NULL . | ||
| 241 | .Pp | ||
| 242 | .Fn BIO_int_ctrl | ||
| 243 | calls | ||
| 244 | .Fn BIO_ctrl | ||
| 245 | with | ||
| 246 | .Fa parg | ||
| 247 | pointing to the location of a temporary | ||
| 248 | .Vt int | ||
| 249 | variable initialized to | ||
| 250 | .Fa iarg . | ||
| 251 | If | ||
| 252 | .Fn BIO_ctrl | ||
| 253 | changes the value stored at | ||
| 254 | .Pf * Fa parg , | ||
| 255 | the new value is ignored. | ||
| 256 | .Pp | ||
| 257 | .Fn BIO_reset | ||
| 258 | typically resets a BIO to some initial state. | ||
| 259 | In the case of file related BIOs, for example, | ||
| 260 | it rewinds the file pointer to the start of the file. | ||
| 261 | .Pp | ||
| 262 | .Fn BIO_seek | ||
| 263 | resets a file related BIO's (that is file descriptor and | ||
| 264 | FILE BIOs) file position pointer to | ||
| 265 | .Fa ofs | ||
| 266 | bytes from start of file. | ||
| 267 | .Pp | ||
| 268 | .Fn BIO_tell | ||
| 269 | returns the current file position of a file related BIO. | ||
| 270 | .Pp | ||
| 271 | .Fn BIO_flush | ||
| 272 | normally writes out any internally buffered data. | ||
| 273 | In some cases it is used to signal EOF and that no more data will be written. | ||
| 274 | .Pp | ||
| 275 | .Fn BIO_eof | ||
| 276 | returns 1 if the BIO has read EOF. | ||
| 277 | The precise meaning of "EOF" varies according to the BIO type. | ||
| 278 | .Pp | ||
| 279 | .Fn BIO_set_close | ||
| 280 | sets the BIO | ||
| 281 | .Fa b | ||
| 282 | close flag to | ||
| 283 | .Fa flag . | ||
| 284 | .Fa flag | ||
| 285 | can take the value | ||
| 286 | .Dv BIO_CLOSE | ||
| 287 | or | ||
| 288 | .Dv BIO_NOCLOSE . | ||
| 289 | Typically | ||
| 290 | .Dv BIO_CLOSE | ||
| 291 | is used in a source/sink BIO to indicate that the underlying I/O stream | ||
| 292 | should be closed when the BIO is freed. | ||
| 293 | .Pp | ||
| 294 | .Fn BIO_get_close | ||
| 295 | returns the BIO's close flag. | ||
| 296 | .Pp | ||
| 297 | .Fn BIO_pending , | ||
| 298 | .Fn BIO_ctrl_pending , | ||
| 299 | .Fn BIO_wpending , | ||
| 300 | and | ||
| 301 | .Fn BIO_ctrl_wpending | ||
| 302 | return the number of pending characters in the BIO's read and write buffers. | ||
| 303 | Not all BIOs support these calls. | ||
| 304 | .Fn BIO_ctrl_pending | ||
| 305 | and | ||
| 306 | .Fn BIO_ctrl_wpending | ||
| 307 | return a | ||
| 308 | .Vt size_t | ||
| 309 | type and are functions. | ||
| 310 | .Pp | ||
| 311 | .Fn BIO_set_info_callback | ||
| 312 | installs the function pointer | ||
| 313 | .Fa cb | ||
| 314 | as an info callback in | ||
| 315 | .Fa b | ||
| 316 | by calling | ||
| 317 | .Fn BIO_callback_ctrl | ||
| 318 | with a command of | ||
| 319 | .Dv BIO_CTRL_SET_CALLBACK . | ||
| 320 | Among the BIO types built into the library, only | ||
| 321 | .Xr BIO_s_connect 3 | ||
| 322 | and | ||
| 323 | .Xr BIO_f_ssl 3 | ||
| 324 | support this functionality. | ||
| 325 | Some filter BIO types forward this control call | ||
| 326 | to the next BIO in the chain instead of processing it themselves. | ||
| 327 | .Pp | ||
| 328 | .Fn BIO_get_info_callback | ||
| 329 | places the function pointer to the info callback into | ||
| 330 | .Pf * Fa cbp | ||
| 331 | if any was installed using | ||
| 332 | .Fn BIO_set_info_callback | ||
| 333 | or | ||
| 334 | .Fn BIO_callback_ctrl . | ||
| 335 | If the type of | ||
| 336 | .Fa b | ||
| 337 | supports setting an info callback but none was installed, it stores a | ||
| 338 | .Dv NULL | ||
| 339 | pointer in | ||
| 340 | .Pf * Fa cbp . | ||
| 341 | .Pp | ||
| 342 | The function type name | ||
| 343 | .Vt bio_info_cb | ||
| 344 | is a deprecated synonym for | ||
| 345 | .Vt BIO_info_cb | ||
| 346 | provided for backward compatibility with some existing application software. | ||
| 347 | .Pp | ||
| 348 | The following | ||
| 349 | .Fa cmd | ||
| 350 | constants correspond to macros: | ||
| 351 | .Bl -column BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT BIO_set_ssl_renegotiate_timeout(3) | ||
| 352 | .It Fa cmd No constant Ta corresponding macro | ||
| 353 | .It Dv BIO_C_DESTROY_BIO_PAIR Ta Xr BIO_destroy_bio_pair 3 | ||
| 354 | .It Dv BIO_C_DO_STATE_MACHINE Ta Xr BIO_do_handshake 3 | ||
| 355 | .It Dv BIO_C_FILE_SEEK Ta Fn BIO_seek | ||
| 356 | .It Dv BIO_C_FILE_TELL Ta Fn BIO_tell | ||
| 357 | .It Dv BIO_C_GET_ACCEPT Ta Xr BIO_get_accept_port 3 | ||
| 358 | .It Dv BIO_C_GET_BIND_MODE Ta Xr BIO_get_bind_mode 3 | ||
| 359 | .It Dv BIO_C_GET_BUF_MEM_PTR Ta Xr BIO_get_mem_ptr 3 | ||
| 360 | .It Dv BIO_C_GET_BUFF_NUM_LINES Ta Xr BIO_get_buffer_num_lines 3 | ||
| 361 | .It Dv BIO_C_GET_CIPHER_CTX Ta Xr BIO_get_cipher_ctx 3 | ||
| 362 | .It Dv BIO_C_GET_CIPHER_STATUS Ta Xr BIO_get_cipher_status 3 | ||
| 363 | .It Dv BIO_C_GET_FD Ta Xr BIO_get_fd 3 | ||
| 364 | .It Dv BIO_C_GET_FILE_PTR Ta Xr BIO_get_fp 3 | ||
| 365 | .It Dv BIO_C_GET_MD Ta Xr BIO_get_md 3 | ||
| 366 | .It Dv BIO_C_GET_MD_CTX Ta Xr BIO_get_md_ctx 3 | ||
| 367 | .It Dv BIO_C_GET_READ_REQUEST Ta Xr BIO_get_read_request 3 | ||
| 368 | .It Dv BIO_C_GET_SSL Ta Xr BIO_get_ssl 3 | ||
| 369 | .It Dv BIO_C_GET_SSL_NUM_RENEGOTIATES Ta Xr BIO_get_num_renegotiates 3 | ||
| 370 | .It Dv BIO_C_GET_WRITE_BUF_SIZE Ta Xr BIO_get_write_buf_size 3 | ||
| 371 | .It Dv BIO_C_GET_WRITE_GUARANTEE Ta Xr BIO_get_write_guarantee 3 | ||
| 372 | .It Dv BIO_C_MAKE_BIO_PAIR Ta Xr BIO_make_bio_pair 3 | ||
| 373 | .It Dv BIO_C_RESET_READ_REQUEST Ta Xr BIO_ctrl_reset_read_request 3 | ||
| 374 | .It Dv BIO_C_SET_BIND_MODE Ta Xr BIO_set_bind_mode 3 | ||
| 375 | .It Dv BIO_C_SET_BUF_MEM Ta Xr BIO_set_mem_buf 3 | ||
| 376 | .It Dv BIO_C_SET_BUF_MEM_EOF_RETURN Ta Xr BIO_set_mem_eof_return 3 | ||
| 377 | .It Dv BIO_C_SET_BUFF_READ_DATA Ta Xr BIO_set_buffer_read_data 3 | ||
| 378 | .It Dv BIO_C_SET_FD Ta Xr BIO_set_fd 3 | ||
| 379 | .It Dv BIO_C_SET_FILE_PTR Ta Xr BIO_set_fp 3 | ||
| 380 | .It Dv BIO_C_SET_MD Ta Xr BIO_set_md 3 | ||
| 381 | .It Dv BIO_C_SET_MD_CTX Ta Xr BIO_set_md_ctx 3 | ||
| 382 | .It Dv BIO_C_SET_NBIO Ta Xr BIO_set_nbio 3 | ||
| 383 | .It Dv BIO_C_SET_SSL Ta Xr BIO_set_ssl 3 | ||
| 384 | .It Dv BIO_C_SET_SSL_RENEGOTIATE_BYTES Ta Xr BIO_set_ssl_renegotiate_bytes 3 | ||
| 385 | .It Dv BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT Ta Xr BIO_set_ssl_renegotiate_timeout 3 | ||
| 386 | .It Dv BIO_C_SET_WRITE_BUF_SIZE Ta Xr BIO_set_write_buf_size 3 | ||
| 387 | .It Dv BIO_C_SHUTDOWN_WR Ta Xr BIO_shutdown_wr 3 | ||
| 388 | .It Dv BIO_C_SSL_MODE Ta Xr BIO_set_ssl_mode 3 | ||
| 389 | .It Dv BIO_CTRL_DGRAM_CONNECT Ta Xr BIO_ctrl_dgram_connect 3 | ||
| 390 | .It Dv BIO_CTRL_DGRAM_GET_PEER Ta Xr BIO_dgram_get_peer 3 | ||
| 391 | .It Dv BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP Ta Xr BIO_dgram_recv_timedout 3 | ||
| 392 | .It Dv BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP Ta Xr BIO_dgram_send_timedout 3 | ||
| 393 | .It Dv BIO_CTRL_DGRAM_SET_CONNECTED Ta Xr BIO_ctrl_set_connected 3 | ||
| 394 | .It Dv BIO_CTRL_DGRAM_SET_PEER Ta Xr BIO_dgram_set_peer 3 | ||
| 395 | .It Dv BIO_CTRL_DUP Ta Xr BIO_dup_state 3 | ||
| 396 | .It Dv BIO_CTRL_EOF Ta Fn BIO_eof | ||
| 397 | .It Dv BIO_CTRL_FLUSH Ta Fn BIO_flush | ||
| 398 | .It Dv BIO_CTRL_GET_CALLBACK Ta Fn BIO_get_info_callback | ||
| 399 | .It Dv BIO_CTRL_GET_CLOSE Ta Fn BIO_get_close | ||
| 400 | .It Dv BIO_CTRL_INFO Ta Xr BIO_get_mem_data 3 | ||
| 401 | .It Dv BIO_CTRL_PENDING Ta Fn BIO_pending | ||
| 402 | .It Dv BIO_CTRL_RESET Ta Fn BIO_reset | ||
| 403 | .It Dv BIO_CTRL_SET_CALLBACK Ta Fn BIO_set_info_callback | ||
| 404 | .It Dv BIO_CTRL_SET_CLOSE Ta Fn BIO_set_close | ||
| 405 | .It Dv BIO_CTRL_WPENDING Ta Fn BIO_wpending | ||
| 406 | .El | ||
| 407 | .Pp | ||
| 408 | A few | ||
| 409 | .Fa cmd | ||
| 410 | constants serve more than one macro each | ||
| 411 | and are documented in the following manual pages: | ||
| 412 | .Bl -column BIO_C_SET_BUFF_SIZE BIO_s_connect(3) -offset 3n | ||
| 413 | .It Fa cmd No constant Ta manual page | ||
| 414 | .It Dv BIO_C_GET_CONNECT Ta Xr BIO_s_connect 3 | ||
| 415 | .It Dv BIO_C_SET_ACCEPT Ta Xr BIO_s_accept 3 | ||
| 416 | .It Dv BIO_C_SET_BUFF_SIZE Ta Xr BIO_f_buffer 3 | ||
| 417 | .It Dv BIO_C_SET_CONNECT Ta Xr BIO_s_connect 3 | ||
| 418 | .It Dv BIO_C_SET_FILENAME Ta Xr BIO_s_file 3 | ||
| 419 | .El | ||
| 420 | .Pp | ||
| 421 | Some | ||
| 422 | .Fa cmd | ||
| 423 | constants are not associated with any macros. | ||
| 424 | They are documented in the following manual pages: | ||
| 425 | .Bl -column BIO_CTRL_DGRAM_SET_RECV_TIMEOUT BIO_dgram_recv_timedout(3)\ | ||
| 426 | -offset 3n | ||
| 427 | .It Fa cmd No constant Ta manual page | ||
| 428 | .\" The following constants are intentionally undocumented because | ||
| 429 | .\" BIO_f_asn1 has been removed from the public API. | ||
| 430 | .\" .It Dv BIO_C_GET_EX_ARG Ta Xr BIO_f_asn1 3 | ||
| 431 | .\" .It Dv BIO_C_SET_EX_ARG Ta Xr BIO_f_asn1 3 | ||
| 432 | .It Dv BIO_CTRL_DGRAM_GET_FALLBACK_MTU Ta Xr BIO_dgram_set_peer 3 | ||
| 433 | .It Dv BIO_CTRL_DGRAM_GET_MTU Ta Xr BIO_dgram_set_peer 3 | ||
| 434 | .It Dv BIO_CTRL_DGRAM_GET_RECV_TIMEOUT Ta Xr BIO_dgram_recv_timedout 3 | ||
| 435 | .It Dv BIO_CTRL_DGRAM_GET_SEND_TIMEOUT Ta Xr BIO_dgram_send_timedout 3 | ||
| 436 | .It Dv BIO_CTRL_DGRAM_SET_MTU Ta Xr BIO_dgram_set_peer 3 | ||
| 437 | .It Dv BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT Ta Xr BIO_dgram_recv_timedout 3 | ||
| 438 | .It Dv BIO_CTRL_DGRAM_SET_RECV_TIMEOUT Ta Xr BIO_dgram_recv_timedout 3 | ||
| 439 | .It Dv BIO_CTRL_DGRAM_SET_SEND_TIMEOUT Ta Xr BIO_dgram_send_timedout 3 | ||
| 440 | .It Dv BIO_CTRL_DGRAM_MTU_EXCEEDED Ta Xr BIO_s_datagram 3 | ||
| 441 | .It Dv BIO_CTRL_POP Ta Xr BIO_pop 3 | ||
| 442 | .It Dv BIO_CTRL_PUSH Ta Xr BIO_push 3 | ||
| 443 | .El | ||
| 444 | .Sh RETURN VALUES | ||
| 445 | The meaning of the return values of | ||
| 446 | .Fn BIO_ctrl , | ||
| 447 | .Fn BIO_callback_ctrl , | ||
| 448 | and | ||
| 449 | .Fn BIO_int_ctrl | ||
| 450 | depends on both the type of | ||
| 451 | .Fa b | ||
| 452 | and on the | ||
| 453 | .Fa cmd . | ||
| 454 | If | ||
| 455 | .Fa b | ||
| 456 | is a | ||
| 457 | .Dv NULL | ||
| 458 | pointer, no action occurs and 0 is returned. | ||
| 459 | The return value \-2 usually indicates a fatal error. | ||
| 460 | In particular, it is returned if the | ||
| 461 | .Fa cmd | ||
| 462 | is unsupported by the type of | ||
| 463 | .Fa b . | ||
| 464 | .Pp | ||
| 465 | .Fn BIO_callback_ctrl | ||
| 466 | and | ||
| 467 | .Fn BIO_set_info_callback | ||
| 468 | return 1 on success, 0 if | ||
| 469 | .Fa b | ||
| 470 | is | ||
| 471 | .Dv NULL | ||
| 472 | or to indicate failure of a valid | ||
| 473 | .Fa cmd , | ||
| 474 | or \-2 if the | ||
| 475 | .Fa cmd | ||
| 476 | is not supported by | ||
| 477 | .Fa b . | ||
| 478 | .Pp | ||
| 479 | .Fn BIO_ptr_ctrl | ||
| 480 | returns | ||
| 481 | .Dv NULL | ||
| 482 | if the | ||
| 483 | .Fn BIO_ctrl | ||
| 484 | call returns a negative value or does not change | ||
| 485 | .Pf * Fa parg , | ||
| 486 | or the pointer it puts into | ||
| 487 | .Pf * Fa parg | ||
| 488 | otherwise. | ||
| 489 | .Pp | ||
| 490 | .Fn BIO_int_ctrl | ||
| 491 | returns the return value of | ||
| 492 | .Fn BIO_ctrl . | ||
| 493 | .Pp | ||
| 494 | .Fn BIO_reset | ||
| 495 | normally returns 1 for success and 0 or -1 for failure. | ||
| 496 | File BIOs are an exception, returning 0 for success and -1 for failure. | ||
| 497 | .Pp | ||
| 498 | .Fn BIO_seek | ||
| 499 | and | ||
| 500 | .Fn BIO_tell | ||
| 501 | both return the current file position on success | ||
| 502 | and -1 for failure, except file BIOs which for | ||
| 503 | .Fn BIO_seek | ||
| 504 | always return 0 for success and -1 for failure. | ||
| 505 | .Pp | ||
| 506 | .Fn BIO_flush | ||
| 507 | returns 1 for success and 0 or -1 for failure. | ||
| 508 | .Pp | ||
| 509 | .Fn BIO_eof | ||
| 510 | returns 1 if EOF has been reached or 0 otherwise. | ||
| 511 | .Pp | ||
| 512 | .Fn BIO_set_close | ||
| 513 | always returns 1. | ||
| 514 | .Pp | ||
| 515 | .Fn BIO_get_close | ||
| 516 | returns the close flag value | ||
| 517 | .Dv BIO_CLOSE | ||
| 518 | or | ||
| 519 | .Dv BIO_NOCLOSE . | ||
| 520 | .Pp | ||
| 521 | .Fn BIO_pending , | ||
| 522 | .Fn BIO_ctrl_pending , | ||
| 523 | .Fn BIO_wpending , | ||
| 524 | and | ||
| 525 | .Fn BIO_ctrl_wpending | ||
| 526 | return the amount of pending data. | ||
| 527 | .Pp | ||
| 528 | .Fn BIO_get_info_callback | ||
| 529 | returns 1 on success, including when the type of | ||
| 530 | .Fa b | ||
| 531 | supports an info callback but none is installed, | ||
| 532 | 0 if | ||
| 533 | .Fa b | ||
| 534 | is | ||
| 535 | .Dv NULL | ||
| 536 | or \-2 if the type of | ||
| 537 | .Fa b | ||
| 538 | does not support an info callback. | ||
| 539 | .Pp | ||
| 540 | If a callback was installed in | ||
| 541 | .Fa b | ||
| 542 | using | ||
| 543 | .Xr BIO_set_callback_ex 3 | ||
| 544 | or | ||
| 545 | .Xr BIO_set_callback 3 , | ||
| 546 | it can modify the return values of all these functions. | ||
| 547 | .Sh NOTES | ||
| 548 | Because it can write data, | ||
| 549 | .Fn BIO_flush | ||
| 550 | may return 0 or -1 indicating that the call should be retried later | ||
| 551 | in a similar manner to | ||
| 552 | .Xr BIO_write 3 . | ||
| 553 | The | ||
| 554 | .Xr BIO_should_retry 3 | ||
| 555 | call should be used and appropriate action taken if the call fails. | ||
| 556 | .Pp | ||
| 557 | The return values of | ||
| 558 | .Fn BIO_pending | ||
| 559 | and | ||
| 560 | .Fn BIO_wpending | ||
| 561 | may not reliably determine the amount of pending data in all cases. | ||
| 562 | For example in the case of a file BIO some data may be available in the | ||
| 563 | .Vt FILE | ||
| 564 | structure's internal buffers but it is not possible | ||
| 565 | to determine this in a portable way. | ||
| 566 | For other types of BIO they may not be supported. | ||
| 567 | .Pp | ||
| 568 | If they do not internally handle a particular | ||
| 569 | .Fn BIO_ctrl | ||
| 570 | operation, filter BIOs usually pass the operation | ||
| 571 | to the next BIO in the chain. | ||
| 572 | This often means there is no need to locate the required BIO for | ||
| 573 | a particular operation: it can be called on a chain and it will | ||
| 574 | be automatically passed to the relevant BIO. | ||
| 575 | However, this can cause unexpected results. | ||
| 576 | For example no current filter BIOs implement | ||
| 577 | .Fn BIO_seek , | ||
| 578 | but this may still succeed if the chain ends | ||
| 579 | in a FILE or file descriptor BIO. | ||
| 580 | .Pp | ||
| 581 | Source/sink BIOs return a 0 if they do not recognize the | ||
| 582 | .Fn BIO_ctrl | ||
| 583 | operation. | ||
| 584 | .Sh SEE ALSO | ||
| 585 | .Xr BIO_meth_new 3 , | ||
| 586 | .Xr BIO_new 3 | ||
| 587 | .Sh HISTORY | ||
| 588 | .Fn BIO_ctrl , | ||
| 589 | .Fn BIO_reset , | ||
| 590 | .Fn BIO_flush , | ||
| 591 | .Fn BIO_eof , | ||
| 592 | .Fn BIO_set_close , | ||
| 593 | .Fn BIO_get_close , | ||
| 594 | and | ||
| 595 | .Fn BIO_pending | ||
| 596 | first appeared in SSLeay 0.6.0. | ||
| 597 | .Fn BIO_wpending | ||
| 598 | first appeared in SSLeay 0.8.1. | ||
| 599 | .Fn BIO_ptr_ctrl , | ||
| 600 | .Fn BIO_int_ctrl , | ||
| 601 | .Fn BIO_get_info_callback | ||
| 602 | and | ||
| 603 | .Fn BIO_set_info_callback | ||
| 604 | first appeared in SSLeay 0.9.0. | ||
| 605 | All these functions have been available since | ||
| 606 | .Ox 2.4 . | ||
| 607 | .Pp | ||
| 608 | .Fn BIO_seek | ||
| 609 | and | ||
| 610 | .Fn BIO_tell | ||
| 611 | first appeared in SSLeay 0.9.1. | ||
| 612 | .Fn BIO_ctrl_pending | ||
| 613 | and | ||
| 614 | .Fn BIO_ctrl_wpending | ||
| 615 | first appeared in OpenSSL 0.9.4. | ||
| 616 | These functions have been available since | ||
| 617 | .Ox 2.6 . | ||
| 618 | .Pp | ||
| 619 | .Fn BIO_callback_ctrl | ||
| 620 | first appeared in OpenSSL 0.9.5 and has been available since | ||
| 621 | .Ox 2.7 . | ||
| 622 | .Pp | ||
| 623 | .Fn bio_info_cb | ||
| 624 | first appeared with a more complicated prototype in OpenSSL 0.9.6 | ||
| 625 | and has been available since | ||
| 626 | .Ox 2.9 . | ||
| 627 | .Pp | ||
| 628 | .Fn BIO_info_cb | ||
| 629 | first appeared in OpenSSL 1.1.0h and has been available since | ||
| 630 | .Ox 6.3 . | ||
| 631 | .Sh BUGS | ||
| 632 | Some of the return values are ambiguous and care should be taken. | ||
| 633 | In particular a return value of 0 can be returned if an operation | ||
| 634 | is not supported, if an error occurred, if EOF has not been reached | ||
| 635 | and in the case of | ||
| 636 | .Fn BIO_seek | ||
| 637 | on a file BIO for a successful operation. | ||
