Previous section.

Technical Standard: Networking Services (XNS), Issue 5.2 Draft 2.0
Copyright © 1999 The Open Group

NAME

-<->Main

SYNOPSIS


#include <xti.h>


DESCRIPTION

<xti.h> makes available the definitions of t_scalar_t and t_uscalar_t respectively as a signed and unsigned opaque integral type of equal length of at least 32 bits.1

Quantity t_errno is defined as a modifiable lvalue of type int. See Error Handling.

The following symbols are defined for the errors reported by XTI.

Symbol Error
TBADADDR incorrect address format
TBADOPT incorrect option format
TACCES incorrect permissions
TBADF illegal fd
TNOADDR could not allocate address
TOUTSTATE out of state
TBADSEQ bad call sequence number
TSYSERR system error
TLOOK event requires attention
TBADDATA illegal amount of data
TBUFOVFLW buffer not large enough
TFLOW flow control
TNODATA no data
TNODIS disconnection indication not found on queue
TNOUDERR unitdata error not found
TBADFLAG bad flags
TNOREL no orderly release event found on queue
TNOTSUPPORT primitive/action not supported
TSTATECHNG state is in process of changing
TNOSTRUCTYPE unsupported structure type requested
TBADNAME invalid transport provider name
TBADQLEN qlen is zero
TADDRBUSY address in use
TINDOUT outstanding connection indications
TPROVMISMATCH transport provider mismatch
TRESQLEN resfd specified to t_accept() with qlen >0
TRESADDR resfd not bound to same addr as fd
TQFULL incoming connection queue full
TPROTO XTI protocol error


The following symbols are defined with bitwise distinct values for the XTI events described in States and Events in XTI.

Symbol Event
T_LISTEN connection indication received
T_CONNECT connection confirmation received
T_DATA normal data received
T_EXDATA expedited data received
T_DISCONNECT disconnection received
T_UDERR datagram error indication
T_ORDREL orderly release indication
T_GODATA sending normal data is again possible
T_GOEXDATA sending expedited data is again possible

The following symbols are defined for the flags used by the XTI functions. The values of T_MORE, T_EXPEDITED and T_PUSH are bitwise distinct. The values of the other symbols are bitwise distinct from each other, but not necessarily bitwise distinct from the values of T_MORE, T_EXPEDITED and T_PUSH.

Symbol Value
T_MORE more data
T_EXPEDITED expedited data
T_PUSH send data immediately
T_NEGOTIATE set options
T_CHECK check options
T_DEFAULT get default options
T_SUCCESS successful
T_FAILURE failure
T_CURRENT get current options
T_PARTSUCCESS partial success
T_READONLY read-only
T_NOTSUPPORT not supported


The XTI functions are defined as follows:

extern int t_accept(int, int, const struct t_call *); extern void *t_alloc(int, int, int); extern int t_bind(int, const struct t_bind *, struct t_bind *); extern int t_close(int); extern int t_connect(int, const struct t_call *, struct t_call *); extern int t_error(const char *); extern int t_free(void *, int); extern int t_getinfo(int, struct t_info *); extern int t_getprotaddr(int, struct t_bind *, struct t_bind *); extern int t_getstate(int); extern int t_listen(int, struct t_call *); extern int t_look(int); extern int t_open(const char *, int, struct t_info *); extern int t_optmgmt(int, const struct t_optmgmt *, struct t_optmgmt *); extern int t_rcv(int, void *, unsigned int, int *); extern int t_rcvconnect(int, struct t_call *); extern int t_rcvdis(int, struct t_discon *); extern int t_rcvrel(int); extern int t_rcvreldata(int, struct t_discon *); extern int t_rcvudata(int, struct t_unitdata *, int *); extern int t_rcvuderr(int, struct t_uderr *); extern int t_rcvv(int, struct t_iovec *, unsigned int, int *); extern int t_rcvvudata(int, struct t_unitdata *, struct t_iovec *, unsigned int, int *); extern int t_snd(int, const void *, unsigned int, int); extern int t_snddis(int, const struct t_call *); extern int t_sndrel(int); extern int t_sndreldata(int, const struct t_discon *); extern int t_sndudata(int, const struct t_unitdata *); extern int t_sndv(int, const struct t_iovec *, unsigned int, int); extern int t_sndvudata(int, const struct t_unitdata *, const struct t_iovec *, unsigned int); extern const char *t_strerror(int); extern int t_sync(int); extern int t_sysconf(const int); extern int t_unbind(int);

Structure type t_info is defined for protocol-specific service limits. It has the following members.

Member Type Contents
addr t_scalar_t maximum size of the transport protocol address
options t_scalar_t maximum number of bytes of protocol-specific options
tsdu t_scalar_t maximum size of a TSDU
etsdu t_scalar_t maximum size of ETSDU
connect t_scalar_t maximum amount of data allowed on connection establishment functions
discon t_scalar_t maximum data allowed on t_rcvdis, t_snddis, t_rcvreldata and t_sndreldata functions
servtype t_scalar_t service type supported by transport provider
flags t_scalar_t other information about the transport provider


The following integer symbolic constants are defined with distinct values for service types:

Symbol Service
T_COTS connection-mode transport service
T_COTS_ORD connection-mode with orderly release
T_CLTS connectionless-mode transport service

The following symbols are defined with values that are bitwise-distinct bit masks for the flags field of a structure of type structt_info, giving other information about the transport provider:

Symbol Information
T_ORDRELDATA supports orderly release data
T_SENDZERO supports zero length TSDUs

Structure type netbuf is defined with the following members:

Member Type Contents
maxlen unsigned int maximum length of data in octets
len unsigned int length of data in octets
buf void * data

Structure type t_opthdr is defined with the following members:

Member Type Contents
len t_uscalar_t total length of option:
    sizeof (struct t_opthdr) +
    length of value in bytes
level t_uscalar_t protocol affected
name t_uscalar_t option name
status t_uscalar_t status value

Structure type t_bind is defined with the following members:

Member Type Contents
addr struct netbuf protocol address
qlen unsigned int maximum number of outstanding connection indications


Structure type t_optmgmt is defined with the following members:

Member Type Contents
opt struct netbuf options
flags t_scalar_t actions

Structure type t_discon is defined with the following members:

Member Type Contents
udata struct netbuf user data
reason int reason code
sequence int sequence number

Structure type t_call is defined with the following members:

Member Type Contents
addr struct netbuf address
opt struct netbuf options
udata struct netbuf user data
sequence int sequence number

Structure type t_unitdata is defined with the following members:

Member Type Contents
addr struct netbuf address
opt struct netbuf options
udata struct netbuf user data

Structure type t_uderr is defined with the following members:

Member Type Contents
addr struct netbuf address
opt struct netbuf options
error t_scalar_t error code

Structure type t_iovec is defined with the following members:

Member Type Contents
iov_base void * data
iov_len size_t length in bytes


The following symbolic integer constant is defined with a value of at least 16 for the maximum number of buffers that can be passed to t_rcvv(),t_rcvvudata(),t_sndv()ort_sndvudata():

T_IOV_MAX

The following integer symbolic constants are defined with distinct values to indicate structure types when dynamically allocating structures via t_alloc ().

Symbol Structure Type
T_BIND struct t_bind
T_OPTMGMT struct t_optmgmt
T_CALL struct t_call
T_DIS struct t_discon
T_UNITDATA struct t_unitdata
T_UDERROR struct t_uderr
T_INFO struct t_info

The following symbols are defined with values that are bit masks that specify which fields of the above structures should be allocated by t_alloc(). The value of T_ALL is the bitmask with all bits set. The other values are bitwise distinct.

Symbol Value Field
T_ADDR 0x01 address
T_OPT 0x02 options
T_UDATA 0x04 user data
T_ALL 0xffff all the above fields supported

The following symbolic integer constants are defined with distinct values, representing the states described in States and Events in XTI:

Symbol State
T_UNBND unbound
T_IDLE idle
T_OUTCON outgoing connection pending
T_INCON incoming connection pending
T_DATAXFER data transfer
T_OUTREL outgoing release pending
T_INREL incoming release pending


The following symbolic integer constants are defined. The values of T_YES and T_NO are distinct. The values of T_INFINITE and T_INVALID are distinct and are both less than zero. Their definitions are protected by parentheses to ensure that they are interpreted correctly when the symbols are used in expressions:

T_NO
T_NULL
T_ABSREQ
T_INFINITE
T_INVALID

The following symbolic integer constant is defined for the name of system variable T_IOV_MAX:


_SC_T_IOV_MAX

The following symbolic integer constants are defined:


T_UNSPEC
T_ALLOPT

The values of T_UNSPEC, T_ALLOPT and the values of all constants defined to identify protocol levels and options are all different. The value of T_UNSPEC is applicable to any integer type.

Macros T_OPT_FIRSTHDR(nbp), T_OPT_NEXTHDR(nbp, tohp), and T_OPT_DATA(tohp), as specified on the man page for t_optmgmt(), are defined.

Integer symbolic constant XTI_GENERIC is defined for the protocol level of XTI.

The following t_uscalar_t integer symbolic constants are defined with distinct values for XTI-level options:

Symbol Meaning
XTI_DEBUG enable debugging
XTI_LINGER linger on close if data present
XTI_RCVBUF receive buffer size
XTI_RCVLOWAT receive low-water mark
XTI_SNDBUF send buffer size
XTI_SNDLOWAT send low-water mark

Structure type t_linger is defined with the following members:

Member Type Contents
l_onoff t_scalar_t option on/off
l_linger t_scalar_t linger time


SEE ALSO

t_accept(), t_alloc(), t_bind(), t_close(), t_connect(), t_error(), t_free(), t_getinfo(), t_getprotaddr(), t_getstate(), t_listen(), t_look(), t_open(), t_optmgmt(), t_rcv(), t_rcvconnect(), t_rcvdis(), t_rcvrel(), t_rcvreldata(), t_rcvudata(), t_rcvuderr(), t_rcvv(), t_rcvvudata(), t_snd(), t_snddis(), t_sndrel(), t_sndreldata(), t_sndudata(), t_sndv(), t_sndvudata(), t_strerror(), t_sync(), t_sysconf(), t_unbind(), <xti_inet.h>, <xti_osi.h>.

CHANGE HISTORY

First released in Issue 5.2.


Footnotes

1.
To forestall portability problems, it is recommended that applications should not use values larger than 2**32 -1.

Contents Next section Index