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/tiuser.h 10.2.1.1" */
24 #pragma ident "%Z%%M% %I% %E% SMI"
26 /* Copyright (c) 1984 AT&T */
27 /* All Rights Reserved */
30 /* #ident "@(#)kern-port:sys/tiuser.h 10.2.1.1" */
32 #ifndef _nettli_tiuser_h
33 #define _nettli_tiuser_h
36 * The following are the error codes needed by both the kernel
37 * level transport providers and the user level library.
39 #define TBADADDR 1 /* incorrect addr format */
40 #define TBADOPT 2 /* incorrect option format */
41 #define TACCES 3 /* incorrect permissions */
42 #define TBADF 4 /* illegal transport fd */
43 #define TNOADDR 5 /* couldn't allocate addr */
44 #define TOUTSTATE 6 /* out of state */
45 #define TBADSEQ 7 /* bad call sequnce number */
46 #define TSYSERR 8 /* system error */
47 #define TLOOK 9 /* event requires attention */
48 #define TBADDATA 10 /* illegal amount of data */
49 #define TBUFOVFLW 11 /* buffer not large enough */
50 #define TFLOW 12 /* flow control */
51 #define TNODATA 13 /* no data */
52 #define TNODIS 14 /* discon_ind not found on q */
53 #define TNOUDERR 15 /* unitdata error not found */
54 #define TBADFLAG 16 /* bad flags */
55 #define TNOREL 17 /* no ord rel found on q */
56 #define TNOTSUPPORT 18 /* primitive not supported */
57 #define TSTATECHNG 19 /* state is in process of changing */
60 * The following are the events returned by t_look
62 #define T_LISTEN 0x0001 /* connection indication received */
63 #define T_CONNECT 0x0002 /* connect confirmation received */
64 #define T_DATA 0x0004 /* normal data received */
65 #define T_EXDATA 0x0008 /* expedited data received */
66 #define T_DISCONNECT 0x0010 /* disconnect received */
67 #define T_ERROR 0x0020 /* fatal error occurred */
68 #define T_UDERR 0x0040 /* data gram error indication */
69 #define T_ORDREL 0x0080 /* orderly release indication */
70 #define T_EVENTS 0x00ff /* event mask */
73 * The following are the flag definitions needed by the
74 * user level library routines.
77 #define T_MORE 0x001 /* more data */
78 #define T_EXPEDITED 0x002 /* expedited data */
79 #define T_NEGOTIATE 0x004 /* set opts */
80 #define T_CHECK 0x008 /* check opts */
81 #define T_DEFAULT 0x010 /* get default opts */
82 #define T_SUCCESS 0x020 /* successful */
83 #define T_FAILURE 0x040 /* failure */
86 * protocol specific service limits
90 long addr
; /* size of protocol address */
91 long options
; /* size of protocol options */
92 long tsdu
; /* size of max transport service data unit */
93 long etsdu
; /* size of max expedited tsdu */
94 long connect
; /* max data for connection primitives */
95 long discon
; /* max data for disconnect primitives */
96 long servtype
; /* provider service type */
100 * Service type defines
102 #define T_COTS 01 /* connection oriented transport service */
103 #define T_COTS_ORD 02 /* connection oriented w/ orderly release */
104 #define T_CLTS 03 /* connectionless transport service */
117 * t_bind - format of the addres and options arguments of bind
134 * disconnect structure
137 struct netbuf udata
; /* user data */
138 int reason
; /* reason code */
139 int sequence
; /* sequence number */
146 struct netbuf addr
; /* address */
147 struct netbuf opt
; /* options */
148 struct netbuf udata
; /* user data */
149 int sequence
; /* sequence number */
153 * data gram structure
156 struct netbuf addr
; /* address */
157 struct netbuf opt
; /* options */
158 struct netbuf udata
; /* user data */
165 struct netbuf addr
; /* address */
166 struct netbuf opt
; /* options */
167 long error
; /* error code */
171 * The following are structure types used when dynamically
172 * allocating the above structures via t_structalloc().
174 #define T_BIND 1 /* struct t_bind */
175 #define T_OPTMGMT 2 /* struct t_optmgmt */
176 #define T_CALL 3 /* struct t_call */
177 #define T_DIS 4 /* struct t_discon */
178 #define T_UNITDATA 5 /* struct t_unitdata */
179 #define T_UDERROR 6 /* struct t_uderr */
180 #define T_INFO 7 /* struct t_info */
183 * The following bits specify which fields of the above
184 * structures should be allocated by t_structalloc().
186 #define T_ADDR 0x01 /* address */
187 #define T_OPT 0x02 /* options */
188 #define T_UDATA 0x04 /* user data */
189 #define T_ALL 0x07 /* all the above */
193 * the following are the states for the user
196 #define T_UNINIT 0 /* uninitialized */
197 #define T_UNBND 1 /* unbound */
198 #define T_IDLE 2 /* idle */
199 #define T_OUTCON 3 /* outgoing connection pending */
200 #define T_INCON 4 /* incoming connection pending */
201 #define T_DATAXFER 5 /* data transfer */
202 #define T_OUTREL 6 /* outgoing release pending */
203 #define T_INREL 7 /* incoming release pending */
209 #define ROUNDUP(X) ((X + 0x03)&~0x03)
212 * Macro for converting signal number to a mask suitable for
215 #define sigmask(m) (1 << ((m)-1))
217 #endif /*!_nettli_tiuser_h*/