'\"macro stdmacro
.if n .pH g3n.t_snddis @(#)t_snddis	40.5 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} t_snddis 3N "Networking Support Utilities" "\&"
.if \nX=1 .ds x} t_snddis 3N "Networking Support Utilities"
.if \nX=2 .ds x} t_snddis 3N "" "\&"
.if \nX=3 .ds x} t_snddis "" "" "\&"
.if \nX=4 .ds x} t_snddis "NS_LIB" "EXTENSION" " "
.TH \*(x}
.SH NAME
\f4t_snddis\f1 \- send user-initiated disconnect request
.SH SYNOPSIS
\f4#include <tiuser.h>\f1
.PP
\f4int t_snddis (int fd, struct t_call \(**call):\f1
.SH DESCRIPTION
This function is used to
initiate an abortive release on an already established connection or
to reject a connect request.
\f4fd\fP
identifies the local transport endpoint of the connection, and
\f4call\fP
specifies information associated with the abortive release.
\f4call\fP
points to a \f4t_call\f1 structure that contains the following members:
.PP
.RS
\f4struct netbuf addr;\fP
.br
\f4struct netbuf opt;\fP
.br
\f4struct netbuf udata;\fP
.br
\f4int sequence;\fP
.RE
.PP
\f4netbuf\f1 is described in \f4intro\fP(3).
The values in
\f4call\fP
have different semantics, depending on the context of the call to
\f4t_snddis\fP.
When rejecting a connect request,
\f4call\fP
must be non-\s-1NULL\s+1 and contain a valid value of
\f4sequence\fP
to identify uniquely the rejected connect indication to the transport provider.
The
\f4addr\fP
and
\f4opt\fP
fields of
\f4call\fP
are ignored.
In all other cases,
\f4call\fP
need only be used when data is being sent with the disconnect request.
The \f4addr\fP, \f4opt\fP, and \f4sequence\fP fields of the \f4t_call\fP
structure are ignored.
If the user does not wish to send data to the remote user,
the value of \f4call\fP may be \s-1NULL\s+1.
.PP
\f4udata\fP specifies the user data to be sent to the remote user.
The amount of user data must not exceed the limits supported by
the transport provider as returned in the \f4discon\fP field of
the \f4info\fP argument of \f4t_open\fP or \f4t_getinfo\fP.
If the \f4len\fP field of \f4udata\fP is zero, no data will be
sent to the remote user.
.P
On failure, \f4t_errno\f1 may be set to one of the following:
.TP 19 
\f4[TBADF]\fP
The specified file descriptor does not refer to a transport endpoint.
.TP
\f4[TOUTSTATE]
The function was issued in the wrong sequence.
The transport provider's outgoing queue may be flushed, so data may be lost.
.TP
\f4[TBADDATA]\fP
The amount of user data specified was not within the bounds allowed by
the transport provider.
The transport provider's outgoing queue will be flushed, so data may be lost.
.TP
\f4[TBADSEQ]\fP
An invalid sequence number was specified, or a \s-1NULL\s0
call structure was specified when rejecting a connect request.
The transport provider's outgoing queue will be flushed, so data may be lost.
.TP
\f4[TLOOK]\fP
An asynchronous event has occurred on this transport endpoint and requires
immediate attention.
.TP
\f4[TNOTSUPPORT]
This function is not supported by the underlying transport
provider.
.TP
\f4[TSYSERR]\fP
A system error has occurred during execution of this function.
.SH SEE ALSO
\f4intro\fP(3), \f4t_connect\fP(3N), \f4t_getinfo\fP(3N), \f4t_listen\fP(3N),
\f4t_open\fP(3N).
.sp .2
\f2UNIX System V Network Programmer's Guide\f1.
.SH DIAGNOSTICS
\f4t_snddis\fP returns 0 on success and \-1 on failure and
\f4t_errno\f1 is set to indicate the error.
.Ee
