1t_sndudata(3NSL)     Networking Services Library Functions    t_sndudata(3NSL)
2
3
4

NAME

6       t_sndudata - send a data unit
7

SYNOPSIS

9       #include <xti.h>
10
11
12
13
14       int t_sndudata(int fd, const struct t_unitdata *unitdata);
15
16

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  con‐
57       trol restriction by means of either t_look(3NSL) or the EM interface.
58
59
60       If  the  amount  of  data  specified  in udata exceeds the TSDU size as
61       returned in the tsdu field of the  info  argument  of  t_open(3NSL)  or
62       t_getinfo(3NSL), a TBADDATA error will be generated. If t_sndudata() is
63       called before the destination user has activated its transport endpoint
64       (see t_bind(3NSL)), the data unit may be discarded.
65
66
67       If  it is not possible for the transport provider to immediately detect
68       the conditions that cause  the  errors  TBADDADDR  and  TBADOPT,  these
69       errors  will  alternatively  be  returned  by t_rcvuderr. Therefore, an
70       application must be prepared to receive these errors in both  of  these
71       ways.
72
73
74       If  the  call  is  interrupted,  t_sndudata() will return EINTR and the
75       datagram will not be sent.
76

RETURN VALUES

78       Upon successful completion, a value of  0 is  returned.   Otherwise,  a
79       value of  -1 is returned and t_errno is set to indicate an error.
80

VALID STATES

82       T_IDLE.
83

ERRORS

85       On failure, t_errno is set to one of the following:
86
87       TBADADDR       The  specified protocol address was in an incorrect for‐
88                      mat or contained illegal information.
89
90
91       TBADDATA       Illegal amount of data.  A  single  send  was  attempted
92                      specifying  a  TSDU  greater  than that specified in the
93                      info argument, or a send of a zero byte TSDU is not sup‐
94                      ported by the provider.
95
96
97       TBADF          The specified file descriptor does not refer to a trans‐
98                      port endpoint.
99
100
101       TBADOPT        The specified options were in  an  incorrect  format  or
102                      contained illegal information.
103
104
105       TFLOW          O_NONBLOCK  was set, but the flow control mechanism pre‐
106                      vented the transport provider from accepting any data at
107                      this time.
108
109
110       TLOOK          An  asynchronous  event  has  occurred on this transport
111                      endpoint.
112
113
114       TNOTSUPPORT    This function is not supported by the underlying  trans‐
115                      port provider.
116
117
118       TOUTSTATE      The  communications endpoint referenced by  fd is not in
119                      one of the states in which a call to  this  function  is
120                      valid.
121
122
123       TPROTO         This  error  indicates  that a communication problem has
124                      been detected between XTI and the transport provider for
125                      which there is no other suitable XTI error (t_errno).
126
127
128       TSYSERR        A  system  error  has  occurred during execution of this
129                      function.
130
131

TLI COMPATIBILITY

133       The XTI and TLI interface definitions have common names but use differ‐
134       ent  header files. This, and other semantic differences between the two
135       interfaces are described in the subsections below.
136
137   Interface Header
138       The XTI interfaces use the header file, xti.h.  TLI  interfaces  should
139       not use this header.  They should use the header:
140         #include <tiuser.h>
141
142   Error Description Values
143       The  t_errno  values that can be set by the XTI interface and cannot be
144       set by the TLI interface are:
145         TPROTO
146         TBADADDR
147         TBADOPT
148         TLOOK
149         TOUTSTATE
150
151   Notes
152       Whenever this function fails with t_error set to TFLOW, O_NONBLOCK must
153       have been set.
154
155   Option Buffers
156       The format of the options in an opt buffer is dictated by the transport
157       provider. Unlike the XTI interface, the TLI interface does not fix  the
158       buffer format.
159

ATTRIBUTES

161       See attributes(5)  for descriptions of the following attributes:
162
163
164
165
166       ┌─────────────────────────────┬─────────────────────────────┐
167       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
168       ├─────────────────────────────┼─────────────────────────────┤
169       │MT Level                     │Safe                         │
170       └─────────────────────────────┴─────────────────────────────┘
171

SEE ALSO

173       fcntl(2),  t_alloc(3NSL), t_bind(3NSL), t_error(3NSL), t_getinfo(3NSL),
174       t_look(3NSL),   t_open(3NSL),    t_rcvudata(3NSL),    t_rcvuderr(3NSL),
175       attributes(5)
176
177
178
179SunOS 5.11                        7 May 1998                  t_sndudata(3NSL)
Impressum