--- src/secure/lib/libcrypto/man/BIO_s_accept.3 2004/09/02 09:26:58 1.2 +++ src/secure/lib/libcrypto/man/BIO_s_accept.3 2004/12/18 21:34:10 1.3 @@ -1,12 +1,8 @@ -.rn '' }` -''' $RCSfile: BIO_s_accept.3,v $$Revision: 1.2 $$Date: 2004/09/02 09:26:58 $ -''' -''' $Log: BIO_s_accept.3,v $ -''' Revision 1.2 2004/09/02 09:26:58 asmodai -''' Commit manual pages after running 'man-update' and add new manual pages. -''' -''' -.de Sh +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sh \" Subsection heading .br .if t .Sp .ne 5 @@ -14,150 +10,98 @@ \fB\\$1\fR .PP .. -.de Sp +.de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. -.de Ip -.br -.ie \\n(.$>=3 .ne \\$3 -.el .ne 3 -.IP "\\$1" \\$2 -.. -.de Vb +.de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. -.de Ve +.de Ve \" End verbatim text .ft R - .fi .. -''' -''' -''' Set up \*(-- to give an unbreakable dash; -''' string Tr holds user defined translation string. -''' Bell System Logo is used as a dummy character. -''' +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to +.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' +.\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ -.ds -- \(*W- -.ds PI pi -.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -.ds L" "" -.ds R" "" -''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of -''' \*(L" and \*(R", except that they are used on ".xx" lines, -''' such as .IP and .SH, which do another additional levels of -''' double-quote interpretation -.ds M" """ -.ds S" """ -.ds N" """"" -.ds T" """"" -.ds L' ' -.ds R' ' -.ds M' ' -.ds S' ' -.ds N' ' -.ds T' ' +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" 'br\} .el\{\ -.ds -- \(em\| -.tr \*(Tr -.ds L" `` -.ds R" '' -.ds M" `` -.ds S" '' -.ds N" `` -.ds T" '' -.ds L' ` -.ds R' ' -.ds M' ` -.ds S' ' -.ds N' ` -.ds T' ' -.ds PI \(*p +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' 'br\} -.\" If the F register is turned on, we'll generate -.\" index entries out stderr for the following things: -.\" TH Title -.\" SH Header -.\" Sh Subsection -.\" Ip Item -.\" X<> Xref (embedded -.\" Of course, you have to process the output yourself -.\" in some meaninful fashion. -.if \nF \{ -.de IX -.tm Index:\\$1\t\\n%\t"\\$2" +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" .. -.nr % 0 -.rr F +. nr % 0 +. rr F .\} -.TH BIO_s_accept 3 "0.9.7d" "2/Sep/2004" "OpenSSL" -.UC -.if n .hy 0 +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.hy 0 .if n .na -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.de CQ \" put $1 in typewriter font -.ft CW -'if n "\c -'if t \\&\\$1\c -'if n \\&\\$1\c -'if n \&" -\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 -'.ft R -.. -.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2 -. \" AM - accent mark definitions -.bd B 3 -. \" fudge factors for nroff and troff +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff .if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP .\} .if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& .\} -. \" simple accents for nroff and troff +. \" simple accents for nroff and troff .if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds ? ? -. ds ! ! -. ds / -. ds q +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / .\} .if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10' -. ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -. ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10' +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} -. \" troff and (daisy-wheel) nroff accents +. \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#] -.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u' -.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u' -.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#] .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' @@ -165,93 +109,97 @@ .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E -.ds oe o\h'-(\w'o'u*4/10)'e -.ds Oe O\h'-(\w'O'u*4/10)'E -. \" corrections for vroff +. \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) +. \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ -. ds : e -. ds 8 ss -. ds v \h'-1'\o'\(aa\(ga' -. ds _ \h'-1'^ -. ds . \h'-1'. -. ds 3 3 -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -. ds oe oe -. ds Oe OE +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE .\} .rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "BIO_s_accept 3" +.TH BIO_s_accept 3 "2004-12-18" "0.9.7e" "OpenSSL" .SH "NAME" BIO_s_accept, BIO_set_accept_port, BIO_get_accept_port, BIO_set_nbio_accept, BIO_set_accept_bios, BIO_set_bind_mode, BIO_get_bind_mode, BIO_do_accept \- accept BIO .SH "SYNOPSIS" -.PP +.IX Header "SYNOPSIS" .Vb 1 \& #include .Ve +.PP .Vb 1 \& BIO_METHOD *BIO_s_accept(void); .Ve +.PP .Vb 2 \& long BIO_set_accept_port(BIO *b, char *name); \& char *BIO_get_accept_port(BIO *b); .Ve +.PP .Vb 1 \& BIO *BIO_new_accept(char *host_port); .Ve +.PP .Vb 2 \& long BIO_set_nbio_accept(BIO *b, int n); \& long BIO_set_accept_bios(BIO *b, char *bio); .Ve +.PP .Vb 2 \& long BIO_set_bind_mode(BIO *b, long mode); \& long BIO_get_bind_mode(BIO *b, long dummy); .Ve +.PP .Vb 3 \& #define BIO_BIND_NORMAL 0 \& #define BIO_BIND_REUSEADDR_IF_UNUSED 1 \& #define BIO_BIND_REUSEADDR 2 .Ve +.PP .Vb 1 \& int BIO_do_accept(BIO *b); .Ve .SH "DESCRIPTION" -\fIBIO_s_accept()\fR returns the accept BIO method. This is a wrapper -round the platform's TCP/IP socket accept routines. +.IX Header "DESCRIPTION" +\&\fIBIO_s_accept()\fR returns the accept \s-1BIO\s0 method. This is a wrapper +round the platform's \s-1TCP/IP\s0 socket accept routines. .PP -Using accept BIOs, TCP/IP connections can be accepted and data -transferred using only BIO routines. In this way any platform -specific operations are hidden by the BIO abstraction. +Using accept BIOs, \s-1TCP/IP\s0 connections can be accepted and data +transferred using only \s-1BIO\s0 routines. In this way any platform +specific operations are hidden by the \s-1BIO\s0 abstraction. .PP -Read and write operations on an accept BIO will perform I/O +Read and write operations on an accept \s-1BIO\s0 will perform I/O on the underlying connection. If no connection is established -and the port (see below) is set up properly then the BIO +and the port (see below) is set up properly then the \s-1BIO\s0 waits for an incoming connection. .PP Accept BIOs support \fIBIO_puts()\fR but not \fIBIO_gets()\fR. .PP -If the close flag is set on an accept BIO then any active +If the close flag is set on an accept \s-1BIO\s0 then any active connection on that chain is shutdown and the socket closed when -the BIO is freed. +the \s-1BIO\s0 is freed. .PP -Calling \fIBIO_reset()\fR on a accept BIO will close any active -connection and reset the BIO into a state where it awaits another +Calling \fIBIO_reset()\fR on a accept \s-1BIO\s0 will close any active +connection and reset the \s-1BIO\s0 into a state where it awaits another incoming connection. .PP -\fIBIO_get_fd()\fR and \fIBIO_set_fd()\fR can be called to retrieve or set -the accept socket. See BIO_s_fd(3) +\&\fIBIO_get_fd()\fR and \fIBIO_set_fd()\fR can be called to retrieve or set +the accept socket. See \fIBIO_s_fd\fR\|(3) .PP -\fIBIO_set_accept_port()\fR uses the string \fBname\fR to set the accept +\&\fIBIO_set_accept_port()\fR uses the string \fBname\fR to set the accept port. The port is represented as a string of the form \*(L"host:port\*(R", where \*(L"host\*(R" is the interface to use and \*(L"port\*(R" is the port. Either or both values can be \*(L"*\*(R" which is interpreted as meaning @@ -260,83 +208,87 @@ as the port specified in \fIBIO_set_conn that is it can be a numerical port string or a string to lookup using \fIgetservbyname()\fR and a string table. .PP -\fIBIO_new_accept()\fR combines \fIBIO_new()\fR and \fIBIO_set_accept_port()\fR into -a single call: that is it creates a new accept BIO with port -\fBhost_port\fR. +\&\fIBIO_new_accept()\fR combines \fIBIO_new()\fR and \fIBIO_set_accept_port()\fR into +a single call: that is it creates a new accept \s-1BIO\s0 with port +\&\fBhost_port\fR. .PP -\fIBIO_set_nbio_accept()\fR sets the accept socket to blocking mode +\&\fIBIO_set_nbio_accept()\fR sets the accept socket to blocking mode (the default) if \fBn\fR is 0 or non blocking mode if \fBn\fR is 1. .PP -\fIBIO_set_accept_bios()\fR can be used to set a chain of BIOs which +\&\fIBIO_set_accept_bios()\fR can be used to set a chain of BIOs which will be duplicated and prepended to the chain when an incoming connection is received. This is useful if, for example, a -buffering or SSL BIO is required for each connection. The +buffering or \s-1SSL\s0 \s-1BIO\s0 is required for each connection. The chain of BIOs must not be freed after this call, they will -be automatically freed when the accept BIO is freed. +be automatically freed when the accept \s-1BIO\s0 is freed. .PP -\fIBIO_set_bind_mode()\fR and \fIBIO_get_bind_mode()\fR set and retrieve -the current bind mode. If BIO_BIND_NORMAL (the default) is set +\&\fIBIO_set_bind_mode()\fR and \fIBIO_get_bind_mode()\fR set and retrieve +the current bind mode. If \s-1BIO_BIND_NORMAL\s0 (the default) is set then another socket cannot be bound to the same port. If -BIO_BIND_REUSEADDR is set then other sockets can bind to the -same port. If BIO_BIND_REUSEADDR_IF_UNUSED is set then and -attempt is first made to use BIO_BIN_NORMAL, if this fails +\&\s-1BIO_BIND_REUSEADDR\s0 is set then other sockets can bind to the +same port. If \s-1BIO_BIND_REUSEADDR_IF_UNUSED\s0 is set then and +attempt is first made to use \s-1BIO_BIN_NORMAL\s0, if this fails and the port is not in use then a second attempt is made -using BIO_BIND_REUSEADDR. +using \s-1BIO_BIND_REUSEADDR\s0. .PP -\fIBIO_do_accept()\fR serves two functions. When it is first -called, after the accept BIO has been setup, it will attempt +\&\fIBIO_do_accept()\fR serves two functions. When it is first +called, after the accept \s-1BIO\s0 has been setup, it will attempt to create the accept socket and bind an address to it. Second and subsequent calls to \fIBIO_do_accept()\fR will await an incoming connection, or request a retry in non blocking mode. .SH "NOTES" -When an accept BIO is at the end of a chain it will await an +.IX Header "NOTES" +When an accept \s-1BIO\s0 is at the end of a chain it will await an incoming connection before processing I/O calls. When an accept -BIO is not at then end of a chain it passes I/O calls to the next -BIO in the chain. +\&\s-1BIO\s0 is not at then end of a chain it passes I/O calls to the next +\&\s-1BIO\s0 in the chain. .PP -When a connection is established a new socket BIO is created for +When a connection is established a new socket \s-1BIO\s0 is created for the connection and appended to the chain. That is the chain is now -accept->socket. This effectively means that attempting I/O on +accept\->socket. This effectively means that attempting I/O on an initial accept socket will await an incoming connection then perform I/O on it. .PP If any additional BIOs have been set using \fIBIO_set_accept_bios()\fR -then they are placed between the socket and the accept BIO, -that is the chain will be accept->otherbios->socket. +then they are placed between the socket and the accept \s-1BIO\s0, +that is the chain will be accept\->otherbios\->socket. .PP If a server wishes to process multiple connections (as is normally -the case) then the accept BIO must be made available for further +the case) then the accept \s-1BIO\s0 must be made available for further incoming connections. This can be done by waiting for a connection and then calling: .PP .Vb 1 \& connection = BIO_pop(accept); .Ve -After this call \fBconnection\fR will contain a BIO for the recently -established connection and \fBaccept\fR will now be a single BIO +.PP +After this call \fBconnection\fR will contain a \s-1BIO\s0 for the recently +established connection and \fBaccept\fR will now be a single \s-1BIO\s0 again which can be used to await further incoming connections. If no further connections will be accepted the \fBaccept\fR can be freed using \fIBIO_free()\fR. .PP If only a single connection will be processed it is possible to -perform I/O using the accept BIO itself. This is often undesirable -however because the accept BIO will still accept additional incoming +perform I/O using the accept \s-1BIO\s0 itself. This is often undesirable +however because the accept \s-1BIO\s0 will still accept additional incoming connections. This can be resolved by using \fIBIO_pop()\fR (see above) -and freeing up the accept BIO after the initial connection. +and freeing up the accept \s-1BIO\s0 after the initial connection. .PP If the underlying accept socket is non-blocking and \fIBIO_do_accept()\fR is called to await an incoming connection it is possible for -\fIBIO_should_io_special()\fR with the reason BIO_RR_ACCEPT. If this happens +\&\fIBIO_should_io_special()\fR with the reason \s-1BIO_RR_ACCEPT\s0. If this happens then it is an indication that an accept attempt would block: the application should take appropriate action to wait until the underlying socket has accepted a connection and retry the call. .PP -\fIBIO_set_accept_port()\fR, \fIBIO_get_accept_port()\fR, \fIBIO_set_nbio_accept()\fR, -\fIBIO_set_accept_bios()\fR, \fIBIO_set_bind_mode()\fR, \fIBIO_get_bind_mode()\fR and -\fIBIO_do_accept()\fR are macros. +\&\fIBIO_set_accept_port()\fR, \fIBIO_get_accept_port()\fR, \fIBIO_set_nbio_accept()\fR, +\&\fIBIO_set_accept_bios()\fR, \fIBIO_set_bind_mode()\fR, \fIBIO_get_bind_mode()\fR and +\&\fIBIO_do_accept()\fR are macros. .SH "RETURN VALUES" -TBA +.IX Header "RETURN VALUES" +\&\s-1TBA\s0 .SH "EXAMPLE" +.IX Header "EXAMPLE" This example accepts two connections on port 4444, sends messages down each and finally closes both down. .PP @@ -345,6 +297,7 @@ down each and finally closes both down. \& ERR_load_crypto_strings(); \& abio = BIO_new_accept("4444"); .Ve +.PP .Vb 6 \& /* First call to BIO_accept() sets up accept BIO */ \& if(BIO_do_accept(abio) <= 0) { @@ -353,6 +306,7 @@ down each and finally closes both down. \& exit(0); \& } .Ve +.PP .Vb 23 \& /* Wait for incoming connection */ \& if(BIO_do_accept(abio) <= 0) { @@ -378,6 +332,7 @@ down each and finally closes both down. \& BIO_puts(cbio2, "Connection 2: Sending out Data on second\en"); \& fprintf(stderr, "Sent out data on connection 2\en"); .Ve +.PP .Vb 4 \& BIO_puts(cbio, "Connection 1: Second connection established\en"); \& /* Close the two established connections */ @@ -385,25 +340,5 @@ down each and finally closes both down. \& BIO_free(cbio2); .Ve .SH "SEE ALSO" -TBA - -.rn }` '' -.IX Title "BIO_s_accept 3" -.IX Name "BIO_s_accept, BIO_set_accept_port, BIO_get_accept_port, -BIO_set_nbio_accept, BIO_set_accept_bios, BIO_set_bind_mode, -BIO_get_bind_mode, BIO_do_accept - accept BIO" - -.IX Header "NAME" - -.IX Header "SYNOPSIS" - -.IX Header "DESCRIPTION" - -.IX Header "NOTES" - -.IX Header "RETURN VALUES" - -.IX Header "EXAMPLE" - .IX Header "SEE ALSO" - +\&\s-1TBA\s0