xref: /titanic_44/usr/src/lib/libbc/inc/include/nettli/tihdr.h (revision 8eea8e29cc4374d1ee24c25a07f45af132db3499)
1 /*
2  * CDDL HEADER START
3  *
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
7  * with the License.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*	from S5R3 sys/tihdr.h	10.2" */
23 
24 #pragma ident	"%Z%%M%	%I%	%E% SMI"
25 
26 /*	Copyright (c) 1984 AT&T	*/
27 /*	  All Rights Reserved  	*/
28 
29 
30 /* #ident	"@(#)kern-port:sys/tihdr.h	10.2" */
31 
32 /*
33  * The following is all the information
34  * needed by the Transport Service Interface.
35  */
36 
37 #ifndef _nettli_tihdr_h
38 #define _nettli_tihdr_h
39 
40 /*
41  * The following are the definitions of the Transport
42  * Service Interface primitives.
43  */
44 
45 /*
46  * Primitives that are initiated by the transport user.
47  */
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    */
59 
60 /*
61  * Primitives that are initiated by the transport provider.
62  */
63 
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 	      */
77 
78 /*
79  * The following are the events that drive the state machine
80  */
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        		*/
92 
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 	      		*/
109 
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  		*/
114 
115 #define TE_NOEVENTS	28
116 /*
117  * The following are the possible states of the Transport
118  * Service Interface
119  */
120 
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    */
138 
139 #define TS_NOSTATES		17
140 
141 
142 /*
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)
147  */
148 
149 /* connection request */
150 
151 struct T_conn_req {
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     */
157 };
158 
159 /* connect response */
160 
161 struct T_conn_res {
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          */
167 };
168 
169 /* disconnect request */
170 
171 struct T_discon_req {
172 	long    PRIM_type;	/* always T_DISCON_REQ */
173 	long    SEQ_number;	/* sequnce number      */
174 };
175 
176 /* data request */
177 
178 struct T_data_req {
179 	long	PRIM_type;	/* always T_DATA_REQ */
180 	long	MORE_flag;	/* more data	     */
181 };
182 
183 /* expedited data request */
184 
185 struct T_exdata_req {
186 	long	PRIM_type;	/* always T_EXDATA_REQ */
187 	long	MORE_flag;	/* more data	       */
188 };
189 
190 /* information request */
191 
192 struct T_info_req {
193 	long	PRIM_type;	/* always T_INFO_REQ */
194 };
195 
196 /* bind request */
197 
198 struct T_bind_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 */
203 };
204 
205 /* unbind request */
206 
207 struct T_unbind_req {
208 	long	PRIM_type;	/* always T_UNBIND_REQ */
209 };
210 
211 /* unitdata request */
212 
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         */
219 };
220 
221 /* manage options request */
222 
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          */
228 };
229 
230 /* orderly release request */
231 
232 struct T_ordrel_req {
233 	long	PRIM_type;	/* always T_ORDREL_REQ */
234 };
235 
236 /* connect indication */
237 
238 struct T_conn_ind {
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    */
245 };
246 
247 /* connect confirmation */
248 
249 struct T_conn_con {
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          */
255 };
256 
257 /* disconnect indication */
258 
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       */
263 };
264 
265 /* data indication */
266 
267 struct T_data_ind {
268 	long 	PRIM_type;	/* always T_DATA_IND */
269 	long	MORE_flag;	/* more data 	     */
270 };
271 
272 /* expedited data indication */
273 
274 struct T_exdata_ind {
275 	long	PRIM_type;	/* always T_EXDATA_IND */
276 	long	MORE_type;	/* more data           */
277 };
278 
279 /* information acknowledgment */
280 
281 struct T_info_ack {
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         */
292 };
293 
294 /* bind acknowledgment */
295 
296 struct T_bind_ack {
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 */
301 };
302 
303 /* error acknowledgment */
304 
305 struct T_error_ack {
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     */
310 };
311 
312 /* ok acknowledgment */
313 
314 struct T_ok_ack {
315 	long 	PRIM_type;	/* always T_OK_ACK   */
316 	long	CORRECT_prim;	/* correct primitive */
317 };
318 
319 /* unitdata indication */
320 
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         */
327 };
328 
329 /* unitdata error indication */
330 
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	          */
338 };
339 
340 /* manage options ack */
341 
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        */
347 };
348 
349 /* orderly release indication */
350 
351 struct T_ordrel_ind {
352 	long	PRIM_type;	/* always T_ORDREL_IND */
353 };
354 
355 /*
356  * The following is a union of the primitives
357  */
358 union T_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    */
384 };
385 
386 #endif /*!_nettli_tihdr_h*/
387