10067 Miscellaneous man page typos Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: Volker A. Brandt <vab@bb-c.de>
1 T_SNDUDATA(3NSL) Networking Services Library Functions T_SNDUDATA(3NSL) 2 3 4 5 NAME 6 t_sndudata - send a data unit 7 8 SYNOPSIS 9 #include <xti.h> 10 11 12 13 14 int t_sndudata(int fd, const struct t_unitdata *unitdata); 15 16 17 DESCRIPTION 18 This routine is part of the XTI interfaces which evolved from the TLI 19 interfaces. XTI represents the future evolution of these interfaces. 20 However, TLI interfaces are supported for compatibility. When using a 21 TLI routine that has the same name as an XTI routine, the tiuser.h 22 header file must be used. Refer to the TLI COMPATIBILITY section for 23 a description of differences between the two interfaces. 24 25 26 This function is used in connectionless-mode to send a data unit to 27 another transport user. The argument fd identifies the local transport 28 endpoint through which data will be sent, and unitdata points to a 29 t_unitdata structure containing the following members: 30 31 struct netbuf addr; 32 struct netbuf opt; 33 struct netbuf udata; 34 35 36 37 In unitdata, addr specifies the protocol address of the destination 38 user, opt identifies options that the user wants associated with this 39 request, and udata specifies the user data to be sent. The user may 40 choose not to specify what protocol options are associated with the 41 transfer by setting the len field of opt to zero. In this case, the 42 provider uses the option values currently set for the communications 43 endpoint. 44 45 46 If the len field of udata is zero, and sending of zero octets is not 47 supported by the underlying transport service, the t_sndudata() will 48 return -1 with t_errno set to TBADDATA. 49 50 51 By default, t_sndudata() operates in synchronous mode and may wait if 52 flow control restrictions prevent the data from being accepted by the 53 local transport provider at the time the call is made. However, if 54 O_NONBLOCK is set by means of t_open(3NSL) or fcntl(2), t_sndudata() 55 will execute in asynchronous mode and will fail under such conditions. 56 The process can arrange to be notified of the clearance of a flow 57 control restriction by means of either t_look(3NSL) or the EM 58 interface. 59 60 61 If the amount of data specified in udata exceeds the TSDU size as 62 returned in the tsdu field of the info argument of t_open(3NSL) or 63 t_getinfo(3NSL), a TBADDATA error will be generated. If t_sndudata() is 64 called before the destination user has activated its transport endpoint 65 (see t_bind(3NSL)), the data unit may be discarded. 66 67 68 If it is not possible for the transport provider to immediately detect 69 the conditions that cause the errors TBADDADDR and TBADOPT, these 70 errors will alternatively be returned by t_rcvuderr. Therefore, an 71 application must be prepared to receive these errors in both of these 72 ways. 73 74 75 If the call is interrupted, t_sndudata() will return EINTR and the 76 datagram will not be sent. 77 78 RETURN VALUES 79 Upon successful completion, a value of 0 is returned. Otherwise, a 80 value of -1 is returned and t_errno is set to indicate an error. 81 82 VALID STATES 83 T_IDLE. 84 85 ERRORS 86 On failure, t_errno is set to one of the following: 87 88 TBADADDR 89 The specified protocol address was in an incorrect 90 format or contained illegal information. 91 92 93 TBADDATA 94 Illegal amount of data. A single send was attempted 95 specifying a TSDU greater than that specified in the 96 info argument, or a send of a zero byte TSDU is not 97 supported by the provider. 98 99 100 TBADF 101 The specified file descriptor does not refer to a 102 transport endpoint. 103 104 105 TBADOPT 106 The specified options were in an incorrect format or 107 contained illegal information. 108 109 110 TFLOW 111 O_NONBLOCK was set, but the flow control mechanism 112 prevented the transport provider from accepting any data 113 at this time. 114 115 116 TLOOK 117 An asynchronous event has occurred on this transport 118 endpoint. 119 120 121 TNOTSUPPORT 122 This function is not supported by the underlying 123 transport provider. 124 125 126 TOUTSTATE 127 The communications endpoint referenced by fd is not in 128 one of the states in which a call to this function is 129 valid. 130 131 132 TPROTO 133 This error indicates that a communication problem has 134 been detected between XTI and the transport provider for 135 which there is no other suitable XTI error (t_errno). 136 137 138 TSYSERR 139 A system error has occurred during execution of this 140 function. 141 142 143 TLI COMPATIBILITY 144 The XTI and TLI interface definitions have common names but use 145 different header files. This, and other semantic differences between 146 the two interfaces are described in the subsections below. 147 148 Interface Header 149 The XTI interfaces use the header file, xti.h. TLI interfaces should 150 not use this header. They should use the header: 151 #include <tiuser.h> 152 153 Error Description Values 154 The t_errno values that can be set by the XTI interface and cannot be 155 set by the TLI interface are: 156 TPROTO 157 TBADADDR 158 TBADOPT 159 TLOOK 160 TOUTSTATE 161 162 Notes 163 Whenever this function fails with t_error set to TFLOW, O_NONBLOCK must 164 have been set. 165 166 Option Buffers 167 The format of the options in an opt buffer is dictated by the transport 168 provider. Unlike the XTI interface, the TLI interface does not fix the 169 buffer format. 170 171 ATTRIBUTES 172 See attributes(5) for descriptions of the following attributes: 173 174 175 176 177 +---------------+-----------------+ 178 |ATTRIBUTE TYPE | ATTRIBUTE VALUE | 179 +---------------+-----------------+ 180 |MT Level | Safe | 181 +---------------+-----------------+ 182 183 SEE ALSO 184 fcntl(2), t_alloc(3NSL), t_bind(3NSL), t_error(3NSL), t_getinfo(3NSL), 185 t_look(3NSL), t_open(3NSL), t_rcvudata(3NSL), t_rcvuderr(3NSL), 186 attributes(5) 187 188 189 190 May 7, 1998 T_SNDUDATA(3NSL) --- EOF ---