4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
22 /* from S5R3 sys/tihdr.h 10.2" */
24 #pragma ident "%Z%%M% %I% %E% SMI"
26 /* Copyright (c) 1984 AT&T */
27 /* All Rights Reserved */
30 /* #ident "@(#)kern-port:sys/tihdr.h 10.2" */
33 * The following is all the information
34 * needed by the Transport Service Interface.
37 #ifndef _nettli_tihdr_h
38 #define _nettli_tihdr_h
41 * The following are the definitions of the Transport
42 * Service Interface primitives.
46 * Primitives that are initiated by the transport user.
48 #define T_CONN_REQ 0 /* connection request */
49 #define T_CONN_RES 1 /* connection response */
50 #define T_DISCON_REQ 2 /* disconnect request */
51 #define T_DATA_REQ 3 /* data request */
52 #define T_EXDATA_REQ 4 /* expedited data request */
53 #define T_INFO_REQ 5 /* information request */
54 #define T_BIND_REQ 6 /* bind request */
55 #define T_UNBIND_REQ 7 /* unbind request */
56 #define T_UNITDATA_REQ 8 /* unitdata request */
57 #define T_OPTMGMT_REQ 9 /* manage options req */
58 #define T_ORDREL_REQ 10 /* orderly release req */
61 * Primitives that are initiated by the transport provider.
64 #define T_CONN_IND 11 /* connection indication */
65 #define T_CONN_CON 12 /* connection confirmation */
66 #define T_DISCON_IND 13 /* disconnect indication */
67 #define T_DATA_IND 14 /* data indication */
68 #define T_EXDATA_IND 15 /* expeditied data indication */
69 #define T_INFO_ACK 16 /* information acknowledgment */
70 #define T_BIND_ACK 17 /* bind acknowledment */
71 #define T_ERROR_ACK 18 /* error acknowledgment */
72 #define T_OK_ACK 19 /* ok acknowledgment */
73 #define T_UNITDATA_IND 20 /* unitdata indication */
74 #define T_UDERROR_IND 21 /* unitdata error indication */
75 #define T_OPTMGMT_ACK 22 /* manage options ack */
76 #define T_ORDREL_IND 23 /* orderly release ind */
79 * The following are the events that drive the state machine
81 /* Initialization events */
82 #define TE_BIND_REQ 0 /* bind request */
83 #define TE_UNBIND_REQ 1 /* unbind request */
84 #define TE_OPTMGMT_REQ 2 /* manage options req */
85 #define TE_BIND_ACK 3 /* bind acknowledment */
86 #define TE_OPTMGMT_ACK 4 /* manage options ack */
87 #define TE_ERROR_ACK 5 /* error acknowledgment */
88 #define TE_OK_ACK1 6 /* ok ack seqcnt == 0 */
89 #define TE_OK_ACK2 7 /* ok ack seqcnt == 1, q == resq */
90 #define TE_OK_ACK3 8 /* ok ack seqcnt == 1, q != resq */
91 #define TE_OK_ACK4 9 /* ok ack seqcnt > 1 */
93 /* Connection oriented events */
94 #define TE_CONN_REQ 10 /* connection request */
95 #define TE_CONN_RES 11 /* connection response */
96 #define TE_DISCON_REQ 12 /* disconnect request */
97 #define TE_DATA_REQ 13 /* data request */
98 #define TE_EXDATA_REQ 14 /* expedited data request */
99 #define TE_ORDREL_REQ 15 /* orderly release req */
100 #define TE_CONN_IND 16 /* connection indication */
101 #define TE_CONN_CON 17 /* connection confirmation */
102 #define TE_DATA_IND 18 /* data indication */
103 #define TE_EXDATA_IND 19 /* expedited data indication */
104 #define TE_ORDREL_IND 20 /* orderly release ind */
105 #define TE_DISCON_IND1 21 /* disconnect indication seq == 0 */
106 #define TE_DISCON_IND2 22 /* disconnect indication seq == 1 */
107 #define TE_DISCON_IND3 23 /* disconnect indication seq > 1 */
108 #define TE_PASS_CONN 24 /* pass connection */
110 /* Unit data events */
111 #define TE_UNITDATA_REQ 25 /* unitdata request */
112 #define TE_UNITDATA_IND 26 /* unitdata indication */
113 #define TE_UDERROR_IND 27 /* unitdata error indication */
115 #define TE_NOEVENTS 28
117 * The following are the possible states of the Transport
121 #define TS_UNBND 0 /* unbound */
122 #define TS_WACK_BREQ 1 /* waiting ack of BIND_REQ */
123 #define TS_WACK_UREQ 2 /* waiting ack of UNBIND_REQ */
124 #define TS_IDLE 3 /* idle */
125 #define TS_WACK_OPTREQ 4 /* wait ack options request */
126 #define TS_WACK_CREQ 5 /* waiting ack of CONN_REQ */
127 #define TS_WCON_CREQ 6 /* waiting confirm of CONN_REQ */
128 #define TS_WRES_CIND 7 /* waiting response of CONN_IND */
129 #define TS_WACK_CRES 8 /* waiting ack of CONN_RES */
130 #define TS_DATA_XFER 9 /* data transfer */
131 #define TS_WIND_ORDREL 10 /* releasing rd but not wr */
132 #define TS_WREQ_ORDREL 11 /* wait to release wr but not rd*/
133 #define TS_WACK_DREQ6 12 /* waiting ack of DISCON_REQ */
134 #define TS_WACK_DREQ7 13 /* waiting ack of DISCON_REQ */
135 #define TS_WACK_DREQ9 14 /* waiting ack of DISCON_REQ */
136 #define TS_WACK_DREQ10 15 /* waiting ack of DISCON_REQ */
137 #define TS_WACK_DREQ11 16 /* waiting ack of DISCON_REQ */
139 #define TS_NOSTATES 17
143 * The following structure definitions define the format of the
144 * stream message block of the above primitives.
145 * (everything is declared long to ensure proper alignment
146 * across different machines)
149 /* connection request */
152 long PRIM_type
; /* always T_CONN_REQ */
153 long DEST_length
; /* dest addr length */
154 long DEST_offset
; /* dest addr offset */
155 long OPT_length
; /* options length */
156 long OPT_offset
; /* options offset */
159 /* connect response */
162 long PRIM_type
; /* always T_CONN_RES */
163 void *QUEUE_ptr
; /* responding queue ptr */
164 long OPT_length
; /* options length */
165 long OPT_offset
; /* options offset */
166 long SEQ_number
; /* sequence number */
169 /* disconnect request */
171 struct T_discon_req
{
172 long PRIM_type
; /* always T_DISCON_REQ */
173 long SEQ_number
; /* sequnce number */
179 long PRIM_type
; /* always T_DATA_REQ */
180 long MORE_flag
; /* more data */
183 /* expedited data request */
185 struct T_exdata_req
{
186 long PRIM_type
; /* always T_EXDATA_REQ */
187 long MORE_flag
; /* more data */
190 /* information request */
193 long PRIM_type
; /* always T_INFO_REQ */
199 long PRIM_type
; /* always T_BIND_REQ */
200 long ADDR_length
; /* addr length */
201 long ADDR_offset
; /* addr offset */
202 unsigned long CONIND_number
; /*connect indications requested */
207 struct T_unbind_req
{
208 long PRIM_type
; /* always T_UNBIND_REQ */
211 /* unitdata request */
213 struct T_unitdata_req
{
214 long PRIM_type
; /* always T_UNITDATA_REQ */
215 long DEST_length
; /* dest addr length */
216 long DEST_offset
; /* dest addr offset */
217 long OPT_length
; /* options length */
218 long OPT_offset
; /* options offset */
221 /* manage options request */
223 struct T_optmgmt_req
{
224 long PRIM_type
; /* always T_OPTMGMT_REQ */
225 long OPT_length
; /* options length */
226 long OPT_offset
; /* options offset */
227 long MGMT_flags
; /* options flags */
230 /* orderly release request */
232 struct T_ordrel_req
{
233 long PRIM_type
; /* always T_ORDREL_REQ */
236 /* connect indication */
239 long PRIM_type
; /* always T_CONN_IND */
240 long SRC_length
; /* src addr length */
241 long SRC_offset
; /* src addr offset */
242 long OPT_length
; /* option length */
243 long OPT_offset
; /* option offset */
244 long SEQ_number
; /* sequnce number */
247 /* connect confirmation */
250 long PRIM_type
; /* always T_CONN_CON */
251 long RES_length
; /* responding addr length */
252 long RES_offset
; /* responding addr offset */
253 long OPT_length
; /* option length */
254 long OPT_offset
; /* option offset */
257 /* disconnect indication */
259 struct T_discon_ind
{
260 long PRIM_type
; /* always T_DISCON_IND */
261 long DISCON_reason
; /* disconnect reason */
262 long SEQ_number
; /* sequnce number */
265 /* data indication */
268 long PRIM_type
; /* always T_DATA_IND */
269 long MORE_flag
; /* more data */
272 /* expedited data indication */
274 struct T_exdata_ind
{
275 long PRIM_type
; /* always T_EXDATA_IND */
276 long MORE_type
; /* more data */
279 /* information acknowledgment */
282 long PRIM_type
; /* always T_INFO_ACK */
283 long TSDU_size
; /* max TSDU size */
284 long ETSDU_size
; /* max ETSDU size */
285 long CDATA_size
; /* max connect data size */
286 long DDATA_size
; /* max discon data size */
287 long ADDR_size
; /* address size */
288 long OPT_size
; /* options size */
289 long TIDU_size
; /* max TIDU size */
290 long SERV_type
; /* provider service type */
291 long CURRENT_state
; /* current state */
294 /* bind acknowledgment */
297 long PRIM_type
; /* always T_BIND_ACK */
298 long ADDR_length
; /* addr length */
299 long ADDR_offset
; /* addr offset */
300 unsigned long CONIND_number
; /* connect ind to be queued */
303 /* error acknowledgment */
306 long PRIM_type
; /* always T_ERROR_ACK */
307 long ERROR_prim
; /* primitive in error */
308 long TLI_error
; /* TLI error code */
309 long UNIX_error
; /* UNIX error code */
312 /* ok acknowledgment */
315 long PRIM_type
; /* always T_OK_ACK */
316 long CORRECT_prim
; /* correct primitive */
319 /* unitdata indication */
321 struct T_unitdata_ind
{
322 long PRIM_type
; /* always T_UNITDATA_IND */
323 long SRC_length
; /* source addr length */
324 long SRC_offset
; /* source addr offset */
325 long OPT_length
; /* options length */
326 long OPT_offset
; /* options offset */
329 /* unitdata error indication */
331 struct T_uderror_ind
{
332 long PRIM_type
; /* always T_UDERROR_IND */
333 long DEST_length
; /* dest addr length */
334 long DEST_offset
; /* dest addr offset */
335 long OPT_length
; /* options length */
336 long OPT_offset
; /* options offset */
337 long ERROR_type
; /* error type */
340 /* manage options ack */
342 struct T_optmgmt_ack
{
343 long PRIM_type
; /* always T_OPTMGMT_ACK */
344 long OPT_length
; /* options length */
345 long OPT_offset
; /* options offset */
346 long MGMT_flags
; /* managment flags */
349 /* orderly release indication */
351 struct T_ordrel_ind
{
352 long PRIM_type
; /* always T_ORDREL_IND */
356 * The following is a union of the primitives
359 long type
; /* primitive type */
360 struct T_conn_req conn_req
; /* connect request */
361 struct T_conn_res conn_res
; /* connect response */
362 struct T_discon_req discon_req
; /* disconnect request */
363 struct T_data_req data_req
; /* data request */
364 struct T_exdata_req exdata_req
; /* expedited data req */
365 struct T_info_req info_req
; /* information req */
366 struct T_bind_req bind_req
; /* bind request */
367 struct T_unbind_req unbind_req
; /* unbind request */
368 struct T_unitdata_req unitdata_req
; /* unitdata requset */
369 struct T_optmgmt_req optmgmt_req
; /* manage opt req */
370 struct T_ordrel_req ordrel_req
; /* orderly rel req */
371 struct T_conn_ind conn_ind
; /* connect indication */
372 struct T_conn_con conn_con
; /* connect corfirm */
373 struct T_discon_ind discon_ind
; /* discon indication */
374 struct T_data_ind data_ind
; /* data indication */
375 struct T_exdata_ind exdata_ind
; /* expedited data ind */
376 struct T_info_ack info_ack
; /* info ack */
377 struct T_bind_ack bind_ack
; /* bind ack */
378 struct T_error_ack error_ack
; /* error ack */
379 struct T_ok_ack ok_ack
; /* ok ack */
380 struct T_unitdata_ind unitdata_ind
; /* unitdata ind */
381 struct T_uderror_ind uderror_ind
; /* unitdata error ind */
382 struct T_optmgmt_ack optmgmt_ack
; /* manage opt ack */
383 struct T_ordrel_ind ordrel_ind
; /* orderly rel ind */
386 #endif /*!_nettli_tihdr_h*/