1502 Remove conversion cruft from manpages
[unleashed.git] / usr / src / man / man3nsl / t_accept.3nsl
blob2302ee3e8d078b74323c9bac0134b38ceaaa17fe
1 '\" te
2 .\"  Copyright 1994, The X/Open Company Ltd., All Rights Reserved. Portions Copyright 1989 AT&T. Portions Copyright (c) 1998, Sun Microsystems, Inc. , All Rights Reserved
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\"  This notice shall appear on any product containing this material.
7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
10 .TH T_ACCEPT 3NSL "May 1, 1998"
11 .SH NAME
12 t_accept \- accept a connection request
13 .SH SYNOPSIS
14 .LP
15 .nf
16 #include <xti.h>
21 \fBint\fR \fBt_accept\fR(\fBint\fR \fIfd\fR, \fBint\fR \fIresfd\fR, \fBconst struct t_call *\fR\fIcall\fR);
22 .fi
24 .SH DESCRIPTION
25 .sp
26 .LP
27 This routine is part of the \fBXTI\fR interfaces that evolved from the
28 \fBTLI\fR interfaces. \fBXTI\fR represents the future evolution of these
29 interfaces. However, \fBTLI\fR interfaces are supported for compatibility. When
30 using a \fBTLI\fR routine that has the same name as an \fBXTI\fR routine, a
31 different header file, \fBtiuser.h\fR, must be used.  Refer to the \fBTLI\fR
32 \fBCOMPATIBILITY\fR section for a description of differences between the two
33 interfaces.
34 .sp
35 .LP
36 This function is issued by a transport user to accept a connection request.
37 The parameter \fIfd\fR identifies the local transport endpoint where the
38 connection indication arrived; \fIresfd\fR specifies the local transport
39 endpoint where the connection is to be established, and \fIcall\fR contains
40 information required by the transport provider to complete the connection.  The
41 parameter \fIcall\fR points to a \fBt_call\fR structure which contains the
42 following members:
43 .sp
44 .in +2
45 .nf
46 struct netbuf addr;
47 struct netbuf opt;
48 struct netbuf udata;
49 int sequence;
50 .fi
51 .in -2
53 .sp
54 .LP
55 In \fIcall\fR, \fIaddr\fR is the protocol address of the calling transport
56 user, \fIopt\fR indicates any options associated with the connection,
57 \fIudata\fR points to any user data to be returned to the caller, and
58 \fIsequence\fR is the value returned by \fBt_listen\fR(3NSL) that uniquely
59 associates the response with a previously received connection indication.  The
60 address of the caller, \fIaddr\fR may be null (length zero). Where \fIaddr\fR
61 is not null then it may optionally be checked by XTI.
62 .sp
63 .LP
64 A transport user may accept a connection on either the same, or on a different,
65 local transport endpoint than the one on which the connection indication
66 arrived.  Before the connection can be accepted on the same endpoint
67 (\fIresfd==fd\fR), the user must have responded to any previous connection
68 indications received on that transport endpoint by means of \fBt_accept()\fR or
69 \fBt_snddis\fR(3NSL). Otherwise, \fBt_accept()\fR will fail and set
70 \fBt_errno\fR to \fBTINDOUT\fR.
71 .sp
72 .LP
73 If a different transport endpoint is specified (\fIresfd!=fd\fR), then the user
74 may or may not choose to bind the endpoint before the \fBt_accept()\fR is
75 issued. If the endpoint is not bound prior to the  \fBt_accept()\fR, the
76 endpoint must be in the  \fBT_UNBND\fR state before the  \fBt_accept()\fR is
77 issued, and the transport provider will automatically bind it to an address
78 that is appropriate for the protocol concerned. If the transport user chooses
79 to bind the endpoint it must be bound to a protocol address with a \fIqlen\fR
80 of zero and must be in the  \fBT_IDLE\fR state before the \fBt_accept()\fR is
81 issued.
82 .sp
83 .LP
84 Responding endpoints should be supplied to  \fBt_accept()\fR in the state
85 \fBT_UNBND.\fR
86 .sp
87 .LP
88 The call to  \fBt_accept()\fR may fail with t_errno set to \fBTLOOK\fR if there
89 are indications (for example connect or disconnect) waiting to be received on
90 endpoint  \fIfd\fR. Applications should be prepared for such a failure.
91 .sp
92 .LP
93 The \fIudata\fR argument enables the called transport user to send user data to
94 the caller and the amount of user data must not exceed the limits supported by
95 the transport provider as returned in the \fIconnect\fR field of the \fIinfo\fR
96 argument of \fBt_open\fR(3NSL) or \fBt_getinfo\fR(3NSL). If the \fIlen\fR field
97 of \fIudata\fR is zero, no data will be sent to the caller.  All the
98 \fImaxlen\fR fields are meaningless.
99 .sp
101 When the user does not indicate any option (\fIcall\(->opt.len\fR = 0) the
102 connection shall be accepted with the option values currently set for the
103 responding endpoint  \fIresfd\fR.
104 .SH RETURN VALUES
107 Upon successful completion, a value of  \fB0\fR is returned.  Otherwise, a
108 value of -1 is returned and \fBt_errno\fR is set to indicate an error.
109 .SH VALID STATES
112 \fBfd: T_INCON\fR
115 \fBresfd (fd!=resfd): T_IDLE, T_UNBND\fR
116 .SH ERRORS
119 On failure, \fBt_errno\fR is set to one of the following:
121 .ne 2
123 \fB\fBTACCES\fR\fR
125 .RS 17n
126 The user does not have permission to accept a connection on the responding
127 transport endpoint or to use the specified options.
131 .ne 2
133 \fB\fBTBADADDR\fR\fR
135 .RS 17n
136 The specified protocol address was in an incorrect format or contained illegal
137 information.
141 .ne 2
143 \fB\fBTBADDATA\fR\fR
145 .RS 17n
146 The amount of user data specified was not within the bounds allowed by the
147 transport provider.
151 .ne 2
153 \fB\fBTBADF\fR\fR
155 .RS 17n
156 The file descriptor \fIfd\fR or \fIresfd\fR does not refer to a transport
157 endpoint.
161 .ne 2
163 \fB\fBTBADOPT\fR\fR
165 .RS 17n
166 The specified options were in an incorrect format or contained illegal
167 information.
171 .ne 2
173 \fB\fBTBADSEQ\fR\fR
175 .RS 17n
176 Either an invalid sequence number was specified, or a valid sequence number was
177 specified but the connection request was aborted by the peer. In the latter
178 case, its  \fBT_DISCONNECT\fR event will be received on the listening endpoint.
182 .ne 2
184 \fB\fBTINDOUT\fR\fR
186 .RS 17n
187 The function was called with \fIfd==resfd\fR but there are outstanding
188 connection indications on the endpoint.  Those other connection indications
189 must be handled either by rejecting them by means of  \fBt_snddis\fR(3NSL) or
190 accepting them on a different endpoint by means of  \fBt_accept\fR.
194 .ne 2
196 \fB\fBTLOOK\fR\fR
198 .RS 17n
199 An asynchronous event has occurred on the transport endpoint referenced by
200 \fIfd\fR and requires immediate attention.
204 .ne 2
206 \fB\fBTNOTSUPPORT\fR\fR
208 .RS 17n
209 This function is not supported by the underlying transport provider.
213 .ne 2
215 \fB\fBTOUTSTATE\fR\fR
217 .RS 17n
218 The communications endpoint referenced by  \fIfd\fR or  \fIresfd\fR is not in
219 one of the states in which a call to this function is valid.
223 .ne 2
225 \fB\fBTPROTO\fR\fR
227 .RS 17n
228 This error indicates that a communication problem has been detected between XTI
229 and the transport provider for which there is no other suitable XTI error
230 (\fBt_errno\fR).
234 .ne 2
236 \fB\fBTPROVMISMATCH\fR\fR
238 .RS 17n
239 The file descriptors \fIfd\fR and \fIresfd\fR do not refer to the same
240 transport provider.
244 .ne 2
246 \fB\fBTRESADDR\fR\fR
248 .RS 17n
249 This transport provider requires both \fIfd\fR and \fIresfd\fR to be bound to
250 the same address. This error results if they are not.
254 .ne 2
256 \fB\fBTRESQLEN\fR\fR
258 .RS 17n
259 The endpoint referenced by \fIresfd\fR (where \fIresfd\fR != \fIfd\fR) was
260 bound to a protocol address with a \fIqlen\fR that is greater than zero.
264 .ne 2
266 \fB\fBTSYSERR\fR\fR
268 .RS 17n
269 A system error has occurred during execution of this function.
272 .SH TLI COMPATIBILITY
275 The \fBXTI\fR and \fBTLI\fR interface definitions have common names but use
276 different header files. This, and other semantic differences between the two
277 interfaces are described in the subsections below.
278 .SS "Interface Header"
281 The \fBXTI\fR interfaces use the header file, \fBxti.h\fR. \fBTLI\fR interfaces
282 should \fInot\fR use this header. They should use the header:
284 .in +2
286 #include <tiuser.h>
288 .in -2
290 .SS "Error Description Values"
293 The \fBt_errno\fR values that can be set by the \fBXTI\fR interface and cannot
294 be set by the \fBTLI\fR interface are:
296 .ne 2
298 \fB\fBTPROTO\fR \fR
300 .RS 18n
305 .ne 2
307 \fB\fBTINDOUT\fR \fR
309 .RS 18n
314 .ne 2
316 \fB\fBTPROVMISMATCH\fR \fR
318 .RS 18n
323 .ne 2
325 \fB\fBTRESADDR\fR \fR
327 .RS 18n
332 .ne 2
334 \fB\fBTRESQLEN\fR \fR
336 .RS 18n
340 .SS "Option Buffer"
343 The format of the options in an \fBopt\fR buffer is dictated by the transport
344 provider. Unlike the \fBXTI\fR interface, the \fBTLI\fR interface does not
345 specify the buffer format.
346 .SH ATTRIBUTES
349 See \fBattributes\fR(5)  for descriptions of the following attributes:
354 box;
355 c | c
356 l | l .
357 ATTRIBUTE TYPE  ATTRIBUTE VALUE
359 MT Level        Safe
362 .SH SEE ALSO
365 \fBt_connect\fR(3NSL), \fBt_getinfo\fR(3NSL), \fBt_getstate\fR(3NSL),
366 \fBt_listen\fR(3NSL), \fBt_open\fR(3NSL), \fBt_optmgmt\fR(3NSL),
367 \fBt_rcvconnect\fR(3NSL), \fBt_snddis\fR(3NSL), \fBattributes\fR(5)
368 .SH WARNINGS
371 There may be transport provider-specific restrictions on address binding.
374 Some transport providers do not differentiate between a connection  indication
375 and the connection itself.  If the connection has already been established
376 after a successful return of \fBt_listen\fR(3NSL), \fBt_accept()\fR will assign
377 the existing connection to the transport endpoint specified by \fIresfd\fR.