'\"macro stdmacro
.if n .pH g3n.t_getinfo @(#)t_getinfo	40.5 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} t_getinfo 3N "Networking Support Utilities" "\&"
.if \nX=1 .ds x} t_getinfo 3N "Networking Support Utilities"
.if \nX=2 .ds x} t_getinfo 3N "" "\&"
.if \nX=3 .ds x} t_getinfo "" "" "\&"
.if \nX=4 .ds x} t_getinfo "NS_LIB" "EXTENSION" " "
.TH \*(x}
.SH NAME
\f4t_getinfo\f1 \- get protocol-specific service information
.SH SYNOPSIS
\f4#include <tiuser.h>\f1
.PP
\f4int t_getinfo(fd, info)\f1
.br
\f4int fd;\f1
.br
\f4struct t_info *info;\f1
.SH DESCRIPTION
This function returns the current characteristics of the underlying
transport protocol associated with file descriptor \f4fd\fP.
The \f4info\fP structure is used to return the same information returned by
\f4t_open\fP.
This function enables a transport user to access this
information during any phase of communication.
.PP
This argument points to a \f4t_info\f1 structure, which contains the following
members:
.PP
.nf
.ps-1
.ta1i
\f4long addr;\fP	/* max size of the transport protocol address */
.br
\f4long options;\fP	/* max number of bytes of protocol-specific options */
.br
\f4long tsdu;\fP	/* max size of a transport service data unit (\f4TSDU\fP) */
.br
\f4long etsdu;\fP	/* max size of an expedited transport service data unit (\f4ETSDU\fP) */
.br
\f4long connect;\fP	/* max amount of data allowed on connection establishment functions */
.br
\f4long discon;\fP	/* max amount of data allowed on \f4t_snddis\fP and \f4t_rcvdis\fP functions */
.br
\f4long servtype;\fP	/* service type supported by the transport provider */
.fi
.ps+1
.PP
The values of the fields have the following meanings:
.TP 14
\f4addr\f1
A value greater than or equal to zero indicates the maximum
size of a transport protocol address; a value of \-1 specifies
that there is no limit on the address size; and a value of \-2
specifies that the transport provider does not provide user
access to transport protocol addresses.
.TP
\f4options\f1
A value greater than or equal to zero indicates the maximum
number of bytes of protocol-specific options supported by the
provider; a value of \-1 specifies that there is no limit on the
option size; and a value of \-2 specifies that the transport provider
does not support user-settable options.
.TP
\f4tsdu\f1
A value greater than zero specifies
the maximum size of a transport service
data unit (\f4TSDU\fP);
a value of zero specifies that the
transport provider does not support the concept of
\f4TSDU\fP,
although it does support the sending of a data stream with no
logical boundaries preserved across a connection;
a value of \-1 specifies that there is no limit on the size of a
\f4TSDU\fP;
and a value of \-2 specifies that the transfer of normal data is
not supported by the transport provider.
.TP
\f4etsdu\f1
A value greater than zero specifies
the maximum size of an expedited transport
service data unit (\f4ETSDU\fP);
a value of zero specifies that the
transport provider does not support the concept of \f4ETSDU\fP,
although it does support the sending of an expedited data stream with no
logical boundaries preserved across a connection;
a value of \-1 specifies that there is no limit on the size of an
\f4ETSDU\fP;
and a value of \-2 specifies that the transfer of expedited data is
not supported by the transport provider.
.TP
\f4connect\f1
A value greater than or equal to zero specifies
the maximum amount of data that may be associated with
connection establishment functions;
a value of \-1 specifies that there is no limit on the amount of data
sent during connection establishment;
and a value of \-2 specifies that the transport provider does not
allow data to be sent with connection establishment functions.
.TP
\f4discon\f1
A value greater than or equal to zero specifies
the maximum amount of data that may be associated with the
\f4t_snddis\fP and \f4t_rcvdis\fP functions;
a value of \-1 specifies that there is no limit on the amount of data
sent with these abortive release functions;
and a value of \-2 specifies that the transport provider does not
allow data to be sent with the abortive release functions.
.TP
\f4servtype\f1
This field specifies the service type supported by the transport provider,
as described below.
.LE
.PP
If a transport user is concerned with protocol independence, the above
sizes may be accessed to determine how large the buffers must be
to hold each piece of information.
Alternatively, the \f4t_alloc\fP function may be used to allocate these
buffers.
An error will result if a transport user exceeds the allowed
data size on any function.
The value of each field may change as a result of option negotiation,
and \f4t_getinfo\fP enables a user to retrieve the current characteristics.
.PP
The \f4servtype\fP field of \f4info\fP
may specify one of the following values on return:
.TP 15
\f4T_COTS\fP
The transport provider supports a connection-mode service but
does not support the optional orderly release facility.
.TP
\f4T_COTS_ORD\fP
The transport provider supports a connection-mode service with
the optional orderly release facility.
.TP
\f4T_CLTS\fP
The transport provider supports a connectionless-mode service.
For this service type, \f4t_open\fP will return \-2 for
\f4etsdu\fP, \f4connect\fP, and \f4discon\fP.
.P
On failure, \f4t_errno\f1 may be set to one of the following:
.TP 15
\f4[TBADF]\fP
The specified file descriptor does not refer to a transport
endpoint.
.TP
\f4[TSYSERR]\fP
A system error has occurred during execution of this function.
.SH SEE ALSO
\f4t_open\fP(3N).
.sp .2
\f2UNIX System V Network Programmer's Guide\f1.
.SH DIAGNOSTICS
\f4t_getinfo\fP
returns 0 on success and \-1 on failure and
\f4t_errno\f1 is set to indicate the error.
.Ee
