t_getinfo(3N)
NAME
t_getinfo − get protocol-specific service information
SYNOPSIS
cc [ flag ... ] file ... −lnsl [ library ... ]
#include <xti.h>
int t_getinfo(int fd, struct t_info ∗info);
DESCRIPTION
This routine is part of the XTI interfaces which 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 section, TLI COMPATIBILITY , for a description of differences between the two interfaces.
This function returns the current characteristics of the underlying transport protocol or transport connection associated with file descriptor fd. The info pointer is used to return the same information returned by t_open(3N), although not necessarily precisely the same values. This function enables a transport user to access this information during any phase of communication.
The info argument points to a t_info structure, which contains the following members:
long addr; /∗ max size in octets of the transport protocol address ∗/
long options; /∗ max number of bytes of protocol-specific options ∗/
long tsdu; /∗ max size in octets of transport service data unit ∗/
long etsdu; /∗ max size in octets of expedited transport service ∗/
data unit (ETSDU) ∗/
long connect; /∗ max number of octets allowed on connection ∗/
/∗ establishment functions ∗/
long discon; /∗ max number of octets of data allowed on t_snddis() and t_rcvdis() functions ∗/
long servtype; /∗ service type supported by the transport provider ∗/
long flags; /∗ other info about the transport provider ∗/
The values of the fields have the following meanings:
addr A value greater than zero (> T_NULL ) indicates the maximum octet size of a transport protocol address; a value of −2 ( T_INVALID ) specifies that the transport provider does not provide user access to transport protocol addresses.
options A value greater than zero (> T_NULL ) indicates the maximum number of bytes of protocol-specific options supported by the provider; a value of −2 ( T_INVALID ) specifies that the transport provider does not support user-settable options.
tsdu A value greater than zero (> T_NULL ) specifies the maximum octet size of a transport service data unit (TSDU); a value of zero ( T_NULL ) specifies that the transport provider does not support the concept of TSDU, although it does support the sending of a data stream across a connection with no logical boundaries preserved for the connection; a tsdu value of −1 ( T_INFINITE ) specifies that there is no limit to the size of a TSDU ; a value of −2 ( T_INVALID ) specifies that the transfer of normal data is not supported by the transport provider.
etsdu A value greater than zero (> T_NULL ) specifies the maximum amount of octets for an expedited transport service data unit (ETSDU); an etsdu value of zero ( T_NULL ) specifies that the transport provider does not support the concept of ETSDU, although it does support the sending of an expedited data stream across a connection with no logical boundaries preserved for the connection; an etsdu value of −1 ( T_INFINITE ) specifies that there is no limit to the size of a ETSDU ; an etsdu value of −2 ( T_INVALID ) specifies that the transfer of expedited data is not supported by the transport provider. Note that the semantics of expedited data may be quite different for different transport providers
connect A value greater than zero (> T_NULL ) specifies the maximum amount of octets that may be associated with connection establishment functions; a connect field value of −2 ( T_INVALID ) specifies that the transport provider does not allow data to be sent with connection establishment functions.
discon a discon field value greater than zero (> T_NULL ) specifies the maximum amount of octets that may be associated with the t_snddis() and t_rcvdis() functions; a discon field value of −2 ( T_INVALID ) specifies that the transport provider does not allow data to be sent with the abortive release functions.
servtype This field specifies the service type supported by the transport provider, as described below.
flags This is a bit field used to specify other information about the communications provider. If the T_SENDZERO bit is set in flags, this indicates that the underlying transport provider supports the sending of zero-length TSDU s.
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 t_alloc(3N) function may be used to allocate these buffers. An error will result if a transport user exceeds the allowed data size on any function.
Because the value of each field may change as a result of option negotiation, a user may need to call t_getinfo() to retrieve the current characteristics.
The value of each field may change as a result of protocol option negotiation during connection establishment (the t_optmgmt(3N) call has no effect on the values returned by t_getinfo()). These values will only change from the values presented to t_open(3N) after the endpoint enters the T_DATAXFER state.
The servtype field of info specifies one of the following values on return:
T_COTS The transport provider supports a connection-mode service but does not support the optional orderly release facility.
T_COTS_ORD
The transport provider supports a connection-mode service with the optional orderly release facility.
T_CLTS The transport provider supports a connectionless-mode service. For this service type, t_open(3N) will return −2 for etsdu, connect, and discon.
VALID STATES
Legitimate states (see t_getstate(3N)) for a call to this routine are every one except T_UNINIT .
RETURN VALUES
t_getinfo() returns:
0 On success.
−1 On failure.
On failure, t_errno is set to indicate the error, and possibly errno is set.
ERRORS
On failure, t_errno will be set to one of the following:
TBADF The specified file descriptor does not refer to a transport endpoint.
TPROTO This error indicates that a communication problem has been detected between XTI and the transport provider for which there is no other suitable XTI t_errno.
TSYSERR A system error has occurred during execution of this function, errno will be set to the specific error.
TLI COMPATIBILITY
The XTI and TLI interface definitions have common names but use different header files. This, and other semantic differences between the two interfaces are described in the subsections below.
Interface Header
The XTI interfaces use the header file, xti.h . TLI interfaces should not use this header. They should use the header:
#include <tiuser.h>
Error Description Values
The t_errno value that can be set by the XTI interface and cannot be set by the TLI interface is:
TPROTO
Notes
For TLI , the t_info structure referenced by info lacks the following structure member:
long flags;
/∗ other info about the transport provider ∗/
This member was added to struct t_info in the XTI interfaces.
When a value of −1 is observed as the return value in various t_info structure members, it signifies that the transport provider can handle an infinite length buffer for a corresponding attribute, such as address data, option data, TSDU (octet size), ETSDU (octet size), connection data, and disconnection data. The corresponding structure members are addr, options, tsdu, estdu, connect, and discon, respectively.
For more information refer to the Transport Interfaces Programming Guide.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
| MT-Level | MT-Safe |
SEE ALSO
t_alloc(3N), t_getstate(3N), t_open(3N), t_optmgmt(3N), t_rcvdis(3N), t_snddis(3N), attributes(5)
Transport Interfaces Programming Guide
SunOS 5.6 — Last change: 10 Feb 1997