This routine is part of the XTI interfaces that evolved from the TLI interfaces. XTI represents the
future evolution of these interfaces. However, TLI interfaces are supported for compatibility. When using a TLI routine that has the same
name as an XTI routine, a different header file, tiuser.h, must be used. Refer to the TLI COMPATIBILITY section
for a description of differences between the two interfaces.
This function is issued by a transport user to accept a connection request. The parameter fd identifies the local transport endpoint where the connection indication arrived; resfd specifies the local transport endpoint where the connection is to be established, and call contains information required by the transport provider to complete
the connection. The parameter call points to a t_call structure which contains the following members:
|
struct netbuf addr;
struct netbuf opt;
struct netbuf udata;
int sequence;
|
In call, addr is the protocol address of the calling transport user, opt indicates any options associated
with the connection, udata points to any user data to be returned to the caller, and sequence is the value returned by t_listen(3NSL) that uniquely associates the response with a previously received connection indication. The address of the caller, addr may be null (length zero). Where addr is not null then it may optionally be checked by XTI.
A transport user may accept a connection on either the same, or on a different, local transport endpoint than the one on which the connection indication arrived. Before the connection can be accepted
on the same endpoint (resfd==fd), the user must have responded to any previous connection indications received on that transport endpoint by means of t_accept()
or t_snddis(3NSL). Otherwise, t_accept() will fail and set t_errno to TINDOUT.
If a different transport endpoint is specified (resfd!=fd), then the user may or may not choose to bind the endpoint before the t_accept() is issued.
If the endpoint is not bound prior to the t_accept(), the endpoint must be in the T_UNBND state before the t_accept()
is issued, and the transport provider will automatically bind it to an address that is appropriate for the protocol concerned. If the transport user chooses to bind the endpoint it must be bound to a protocol
address with a qlen of zero and must be in the T_IDLE state before the t_accept() is issued.
Responding endpoints should be supplied to t_accept() in the state T_UNBND.
The call to t_accept() may fail with t_errno set to TLOOK if there are indications (for example connect or disconnect) waiting to be received on endpoint fd. Applications should be prepared for such a failure.
The udata argument enables the called transport user to send user data to the caller and the amount of user data must not exceed the limits supported by the transport provider
as returned in the connect field of the info argument of t_open(3NSL) or t_getinfo(3NSL). If the len
field of udata is zero, no data will be sent to the caller. All the maxlen fields are meaningless.
When the user does not indicate any option (call->opt.len = 0) the connection shall be accepted with the option values currently set for the responding endpoint resfd.
|