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

NAME

6       t_open - establish a transport endpoint
7

SYNOPSIS

9       #include <xti.h>
10       #include <fcntl.h>
11
12
13
14
15       int t_open(const char *name, int oflag, struct t_info *info);
16
17

DESCRIPTION

19       This  routine  is part of the XTI interfaces which evolved from the TLI
20       interfaces. XTI represents the future evolution  of  these  interfaces.
21       However,  TLI  interfaces are supported for compatibility. When using a
22       TLI routine that has the same name as an  XTI  routine,  the   tiuser.h
23       header  file must be used.  Refer to the  TLI COMPATIBILITY section for
24       a description of differences between the two interfaces.
25
26
27       The t_open() function must be called as the first step in the  initial‐
28       ization  of a transport endpoint. This function establishes a transport
29       endpoint by supplying a transport provider identifier that indicates  a
30       particular transport provider, that is, transport protocol, and return‐
31       ing a file descriptor that identifies that endpoint.
32
33
34       The argument name points to a transport provider identifier  and  oflag
35       identifies  any  open  flags, as in open(2). The argument oflag is con‐
36       structed from  O_RDWR optionally bitwise inclusive-OR'ed  with   O_NON‐
37       BLOCK.  These  flags  are  defined  by  the  header <fcntl.h>. The file
38       descriptor returned by t_open() will be used by  all  subsequent  func‐
39       tions to identify the particular local transport endpoint.
40
41
42       This  function  also  returns  various  default  characteristics of the
43       underlying transport protocol by setting fields in  the  t_info  struc‐
44       ture.  This  argument  points  to a t_info which contains the following
45       members:
46
47         t_scalar_t addr;        /* max size of the transport protocol address */
48         t_scalar_t options;     /* max number of bytes of  */
49                                      /* protocol-specific options  */
50         t_scalar_t tsdu;        /* max size of a transport service data  */
51                                      /* unit (TSDU)  */
52         t_scalar_t etsdu;       /* max size of an expedited transport  */
53                                      /* service data unit (ETSDU)  */
54         t_scalar_t connect;     /* max amount of data allowed on  */
55                                 /* connection establishment functions  */
56         t_scalar_t discon;      /* max amount of data allowed on  */
57                                 /* t_snddis() and t_rcvdis() functions  */
58         t_scalar_t servtype;    /* service type supported by the  */
59                                      /* transport provider  */
60         t_scalar_t flags;       /* other info about the transport provider  */
61
62
63
64       The values of the fields have the following meanings:
65
66       addr        A value greater than zero (T_NULL)  indicates  the  maximum
67                   size  of  a  transport  protocol  address and a value of -2
68                   (T_INVALID) specifies that the transport provider does  not
69                   provide user access to transport protocol addresses.
70
71
72       options     A  value  greater  than zero (T_NULL) indicates the maximum
73                   number of bytes of protocol-specific options  supported  by
74                   the  provider, and a value of -2 (T_INVALID) specifies that
75                   the  transport  provider  does  not  support  user-settable
76                   options.
77
78
79       tsdu        A  value  greater  than  zero (T_NULL specifies the maximum
80                   size of a transport service data unit (TSDU);  a  value  of
81                   zero  (T_NULL)  specifies  that the transport provider does
82                   not support the concept of TSDU, although it  does  support
83                   the  sending  of  a  data stream with no logical boundaries
84                   preserved across a connection; a value of  -1  (T_INFINITE)
85                   specifies that there is no limit to the size of a TSDU; and
86                   a value of -2 (T_INVALID) specifies that  the  transfer  of
87                   normal data is not supported by the transport provider.
88
89
90       etsdu       A  value  greater  than zero (T_NULL) specifies the maximum
91                   size of an expedited transport service data unit (ETSDU); a
92                   value   of  zero  (T_NULL)  specifies  that  the  transport
93                   provider does not support the concept of ETSDU, although it
94                   does  support  the sending of an expedited data stream with
95                   no logical boundaries  preserved  across  a  connection;  a
96                   value  of -1 (T_INFINITE)  specifies that there is no limit
97                   on the size of an ETSDU; and  a  value  of  -2  (T_INVALID)
98                   specifies  that  the transfer of expedited data is not sup‐
99                   ported by the transport provider. Note that  the  semantics
100                   of  expedited  data  may  be  quite different for different
101                   transport providers.
102
103
104       connect     A value greater than zero (T_NULL)  specifies  the  maximum
105                   amount  of  data  that  may  be  associated with connection
106                   establishment functions, and  a  value  of  -2  (T_INVALID)
107                   specifies  that  the transport provider does not allow data
108                   to be sent with connection establishment functions.
109
110
111       discon      If the  T_ORDRELDATA bit in flags is clear, a value greater
112                   than  zero  (T_NULL)  specifies  the maximum amount of data
113                   that  may  be  associated  with  the   t_snddis(3NSL)   and
114                   t_rcvdis(3NSL)  functions,  and  a  value of -2 (T_INVALID)
115                   specifies that the transport provider does not  allow  data
116                   to  be  sent  with  the  abortive release functions. If the
117                   T_ORDRELDATA bit is set in flags, a value greater than zero
118                   (T_NULL) specifies the maximum number of octets that may be
119                   associated with the t_sndreldata(), t_rcvreldata(),  t_snd‐
120                   dis(3NSL) and  t_rcvdis(3NSL) functions.
121
122
123       servtype    This  field  specifies  the  service  type supported by the
124                   transport provider, as described below.
125
126
127       flags       This is a bit field used to specify other information about
128                   the   communications provider.  If the  T_ORDRELDATA bit is
129                   set, the communications provider supports user data  to  be
130                   sent with an orderly release. If the  T_SENDZERO bit is set
131                   in flags, this indicates the underlying transport  provider
132                   supports the sending of zero-length TSDUs.
133
134
135
136       If  a transport user is concerned with protocol independence, the above
137       sizes may be accessed to determine how large the  buffers  must  be  to
138       hold  each piece of information. Alternatively, the t_alloc(3NSL) func‐
139       tion may be used to allocate these buffers. An error will result  if  a
140       transport user exceeds the allowed data size on any function.
141
142
143       The  servtype  field  of  info specifies one of the following values on
144       return:
145
146       T_COTS         The transport provider supports a  connection-mode  ser‐
147                      vice  but  does not support the optional orderly release
148                      facility.
149
150
151       T_COTS_ORD     The transport provider supports a  connection-mode  ser‐
152                      vice with the optional orderly release facility.
153
154
155       T_CLTS         The  transport  provider  supports a connectionless-mode
156                      service. For this service type, t_open() will return  -2
157                      (T_INVALID) for etsdu, connect and discon.
158
159
160
161       A  single transport endpoint may support only one of the above services
162       at one time.
163
164
165       If info is set to a null pointer by the  transport  user,  no  protocol
166       information is returned by t_open().
167

RETURN VALUES

169       A valid file descriptor is returned upon successful completion.  Other‐
170       wise, a value of -1 is returned and  t_errno  is  set  to  indicate  an
171       error.
172

VALID STATES

174       T_UNINIT.
175

ERRORS

177       On failure, t_errno is set to the following:
178
179       TBADFLAG    An invalid flag is specified.
180
181
182       TBADNAME    Invalid transport provider name.
183
184
185       TPROTO      This  error indicates that a communication problem has been
186                   detected between XTI and the transport provider  for  which
187                   there is no other suitable XTI error (t_errno).
188
189
190       TSYSERR     A  system error has occurred during execution of this func‐
191                   tion.
192
193

TLI COMPATIBILITY

195       The XTI and TLI interface definitions have common names but use differ‐
196       ent  header  files. This and other semantic differences between the two
197       interfaces are described in the subsections below.
198
199   Interface Header
200       The XTI interfaces use the xti.h TLI interfaces  should  not  use  this
201       header.  They should use the header:
202         #include <tiuser.h>
203
204   Error Description Values
205       The  t_errno values TPROTO and TBADNAME can be set by the XTI interface
206       but cannot be set by the TLI interface.
207
208   Notes
209       For TLI , the t_info structure referenced by info lacks  the  following
210       structure member:
211
212         t_scalar_t flags;    /* other info about the transport provider */
213
214
215
216       This member was added to struct t_info in the XTI interfaces.
217
218
219       When  a  value  of -1 is observed as the return value in various t_info
220       structure members, it signifies that the transport provider can  handle
221       an  infinite  length  buffer  for  a  corresponding  attribute, such as
222       address data, option data, TSDU (octet size), ETSDU (octet size),  con‐
223       nection  data, and disconnection data. The corresponding structure mem‐
224       bers are addr, options, tsdu, estdu, connect, and discon, respectively.
225

ATTRIBUTES

227       See attributes(5)  for descriptions of the following attributes:
228
229
230
231
232       ┌─────────────────────────────┬─────────────────────────────┐
233       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
234       ├─────────────────────────────┼─────────────────────────────┤
235       │MT Level                     │Safe                         │
236       └─────────────────────────────┴─────────────────────────────┘
237

SEE ALSO

239       open(2), attributes(5)
240
241
242
243SunOS 5.11                        7 May 1998                      t_open(3NSL)
Impressum