t_getinfo() — Get protocol-specific service information

Standards

Standards / Extensions C or C++ Dependencies
XPG4.2 both  

Format

#define _XOPEN_SOURCE_EXTENDED 1
#include <xti.h>

int t_getinfo(int fd, struct t_info *info);

General description

Returns the current characteristics of the underlying transport protocol and/or transport connection associated with file descriptor fd. The info pointer is used to return the same information returned by t_open() , although not necessarily precisely the same values. This function enables a transport user to access this information during any phase of communication. This argument points to a t_info structure which contains the following members:
long addr;     /* max size of the transport protocol address       */
long options;  /* max number of bytes of protocol-specific options */
long tsdu;     /* max size of a transport service data unit (TSDU) */
long etsdu;    /* max size of an expedited transport service       */
               /* data unit (ETSDU)                                */
long connect;  /* max amount of data allowed on connection         */
               /* establishment functions                          */
long discon;   /* max amount of data allowed on t_snddis()         */
               /* and t_rcvdis() functions                         */
long servtype; /* sdis() functions                                 */
long servtype; /* service type supported by the transport provider */
long flags;    /* other info about the transport provider          */
The fields take on the following values:
addr
The size of a struct sockaddr_in is returned.
options
The value 304, which is the maximum number of bytes of options which can possibly be specified or requested, is returned.
tsdu
Zero is returned, indicating that the TCP transport provider does not support the concept of TSDUs.
etsdu
A value of -1 is returned, indicating that there is no limit on the size of an ETSDU.
connect
A value of -2 is returned, indicating that the TCP transport provider does not allow data to be sent with connection establishment functions.
discon
A value of -2 is returned, indicating that the transport provider does not allow data to be sent with the abortive release functions.
servtype
T_COTS is always returned, since this is the only service type supported.
flags
The T_SENDZERO bit is always set in this field, indicating that the TCP transport provider supports the sending of zero-length TSDUs.

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() function may be used to allocate these buffers. An error results if a transport user exceeds the allowed data size on any function. The value of each field may change as a result of protocol option negotiation during connection establishment (the t_optmgmt() call has no affect on the values returned by t_getinfo()). These values will only change from the values presented to t_open() after the endpoint enters the T_DATAXFER state.

Valid states: All - except for T_UNINIT

Returned value

If successful, t_getinfo() returns 0.

If unsuccessful, t_getinfo() returns -1 and sets errno to one of the following values:
Error Code
Description
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.

Related information