Index Index for
Section 3
Index Alphabetical
listing for T
Bottom of page Bottom of
page

t_sndvudata(3)

NAME

t_sndvudata - Send a data unit from one or more non-contiguous buffers

SYNOPSIS

#include <xti.h> int t_sndvudata( int fd, struct t_unitdata *unitdata, struct t_iovec *iov, unsigned int iovcount );

LIBRARY

XTI Library (libxti.a)

STANDARDS

Interfaces documented on this reference page conform to industry standards as follows: t_sndvudata(): XNS5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags.

PARAMETERS

The following table summarizes the relevance of input and output parameters before and after t_sndvudata() is called: __________________________________________________ Parameters Before Call After Call __________________________________________________ fd y n unitdata->addr.maxlen n e unitdata->addr.len y e unitdata->addr.buf y(y) e(e) unitdata->opt.maxlen n e unitdata->opt.len y e unitdata->opt.buf o(o) e(e) unitdata->udata.maxlen n e unitdata->udata.len n e unitdata->udata.buf n e iov[0].iov_base y(y) e(e) iov[0].iov_len y e ... y(y) e(e) iov[iovcount- 1].iov_base iov[iovcount-1].iov_len y e iovcount y n __________________________________________________ Notes to Table: y This is a meaningful parameter. (y) The content of the object pointed to by y is meaningful. o This is a meaningful but optional parameter. (o) The content of the object pointed to by o is meaningful. e The parameter value after the call is the same as before the call. (e) The content of the object pointed to by e is the same as before the call. n This is not a meaningful parameter. fd Identifies the local transport endpoint through which data is sent. unitdata Points to a type t_unitdata structure used to specify a data unit being sent through the transport endpoint specified by the fd parameter. The t_unitdata structure has the following members: struct netbuf addr References a buffer for protocol address information of the remote transport user. The type netbuf structure referenced by this member is defined in the xti.h include file and has the following members: unsigned int maxlen Specifies a maximum byte length of the data buffer. unsigned int len Specifies the actual byte length of the data written to the buffer. char *buf Points to the buffer location. struct netbuf opt Identifies options that the user wants associated with this request. The user may choose not to specify what protocol options are associated with the transfer by setting the len field of opt to zero. In this case, the provider may use default options. struct netbuf udata Specifies the user data unit that is being sent to the remote transport user. (Not used) iov Points to the data to be sent. iovcount Contains the number of non-contiguous udata buffers, which is limited to T_IOV_MAX (16).

DESCRIPTION

The t_sndvudata() function is an XTI connectionless service The data to be sent is identified by iov[0] through iov[iovcount-1]. Note The limit on the total number of bytes available in all buffers passed (that is, iov(0).iov_len + ... + iov(iovcount-1).iov_len) may be constrained by implementation limits. If no other constraint applies, it will be limited by [INT_MAX]. In practice, the availability of memory to an application is likely to impose a lower limit on the amount of data that can be sent or received using scatter/gather functions. By default, t_sndvudata() operates in synchronous mode and waits if flow control restrictions prevent the data from being accepted by the local transport provider at the time of the call. However, if O_NONBLOCK is set (via t_open() or fcntl()), t_sndvudata() executes in asynchronous mode and fails under such conditions. The process can arrange to be notified of the clearance of a flow control restriction via either t_look() or the EM interface. If the amount of data specified in iov[0] through iov[iovcount-1] exceeds the TSDU size as returned in the tsdu field of the info argument of t_open() or t_getinfo(), or is zero and sending of zero octets is not supported by the underlying transport service, a [TBADDATA] error is generated. If t_sndvudata() is called before the destination user has activated its transport endpoint (see t_bind(3)), the data unit may be discarded. If the transport provider cannot immediately detect the conditions that cause the [TBADDADDR] and [TBADOPT] errors, these errors will alternatively be returned by t_rcvuderr(). An application must therefore be prepared to receive these errors in both of these ways.

ERRORS

If the t_sndvudata() function fails, t_errno may be set to one of the following values: [TBADADDR] The specified protocol address was in an incorrect format or contained illegal information. [TBADDATA] An attempt to send once, specifying a TSDU (ETSDU) greater than that specified by the current value in the info argument, or an attempt to send zero-byte TSDU (ETSDU) is not supported by the provider. The iovcount parameter is greater than T_IOV_MAX. [TBADF] File descriptor (fd) is not a valid transport endpoint. [[T_BADOPT]] The specified options were in an incorrect format or contained illegal information. [[T_FLOW]] Asynchronous mode is indicated because O_NONBLOCK was set, but the transport provider cannot accept the data because of flow-control restrictions. [TLOOK] An asynchronous event occurred on this transport endpoint and requires immediate attention. [TNOTSUPPORT] This function is not supported by the underlying transport provider. [TOUTSTATE] The communications endpoint referenced by fd is not in a valid state in which a call to this function. [TPROTO] A communication problem has been detected between XTI and the transport provider for which there is no other suitable XTI error (t_errno). [TSYSERR] A system error occurred during execution of this function.

VALID STATES

The t_sndvudata() function can be called only in the T_IDLE transport provider state.

RETURN VALUE

Upon successful completion, t_sndvudata() returns a value of 0 (zero). Otherwise, it returns a value of -1 and sets t_errno to indicate the error.

SEE ALSO

Functions: fcntl(2), t_alloc(3), t_open(3), t_rcvudata(3), t_rcvuderr(3), t_rcvvudata(3), t_sndudata(3). Standards: standards(5) Network Programmer's Guide

Index Index for
Section 3
Index Alphabetical
listing for T
Top of page Top of
page