Print this page
3910 t_look(3NSL) should never return T_ERROR
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/tiuser.h
+++ new/usr/src/uts/common/sys/tiuser.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
↓ open down ↓ |
20 lines elided |
↑ open up ↑ |
21 21 */
22 22 /*
23 23 * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
24 24 * All Rights Reserved
25 25 *
26 26 */
27 27
28 28 /*
29 29 * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
30 30 * Use is subject to license terms.
31 + * Copyright 2014 Gary Mills
31 32 */
32 33
33 34 #ifndef _SYS_TIUSER_H
34 35 #define _SYS_TIUSER_H
35 36
36 -#pragma ident "%Z%%M% %I% %E% SMI"
37 -
38 37 #include <sys/types.h>
39 38 /*
40 39 * The following include file has declarations needed by both the kernel
41 40 * level transport providers and the user level library.
42 41 */
43 42 #include <sys/tpicommon.h>
44 43
45 44 #ifdef __cplusplus
46 45 extern "C" {
47 46 #endif
48 47
49 48
50 49 /*
51 50 * The following are the events returned by t_look
52 51 */
53 52 #define T_LISTEN 0x0001 /* connection indication received */
54 53 #define T_CONNECT 0x0002 /* connect confirmation received */
55 54 #define T_DATA 0x0004 /* normal data received */
56 55 #define T_EXDATA 0x0008 /* expedited data received */
57 56 #define T_DISCONNECT 0x0010 /* disconnect received */
58 -#define T_ERROR 0x0020 /* fatal error occurred */
59 57 #define T_UDERR 0x0040 /* data gram error indication */
60 58 #define T_ORDREL 0x0080 /* orderly release indication */
61 59 #define T_EVENTS 0x00ff /* event mask */
62 60
63 61 /*
64 62 * Flags for data primitives.
65 63 */
66 64 #define T_MORE 0x001 /* more data */
67 65 #define T_EXPEDITED 0x002 /* expedited data */
68 66
69 67
70 68 /*
71 69 * protocol specific service limits
72 70 */
73 71
74 72 struct t_info {
75 73 t_scalar_t addr; /* size of protocol address */
76 74 t_scalar_t options; /* size of protocol options */
77 75 t_scalar_t tsdu; /* size of max transport service data unit */
78 76 t_scalar_t etsdu; /* size of max expedited tsdu */
79 77 t_scalar_t connect; /* max data for connection primitives */
80 78 t_scalar_t discon; /* max data for disconnect primitives */
81 79 t_scalar_t servtype; /* provider service type */
82 80 };
83 81
84 82 /*
85 83 * netbuf structure
86 84 */
87 85
88 86 struct netbuf {
89 87 unsigned int maxlen;
90 88 unsigned int len;
91 89 char *buf;
92 90 };
93 91
94 92 #ifdef _SYSCALL32
95 93 struct netbuf32 {
96 94 uint32_t maxlen;
97 95 uint32_t len;
98 96 caddr32_t buf;
99 97 };
100 98 #endif /* _SYSCALL32 */
101 99
102 100 /*
103 101 * t_bind - format of the address and options arguments of bind
104 102 */
105 103
106 104 struct t_bind {
107 105 struct netbuf addr;
108 106 unsigned int qlen;
109 107 };
110 108
111 109 /*
112 110 * options management
113 111 */
114 112 struct t_optmgmt {
115 113 struct netbuf opt;
116 114 t_scalar_t flags;
117 115 };
118 116
119 117 /*
120 118 * disconnect structure
121 119 */
122 120 struct t_discon {
123 121 struct netbuf udata; /* user data */
124 122 int reason; /* reason code */
125 123 int sequence; /* sequence number */
126 124 };
127 125
128 126 /*
129 127 * call structure
130 128 */
131 129 struct t_call {
132 130 struct netbuf addr; /* address */
133 131 struct netbuf opt; /* options */
134 132 struct netbuf udata; /* user data */
135 133 int sequence; /* sequence number */
136 134 };
137 135
138 136 /*
139 137 * data gram structure
140 138 */
141 139 struct t_unitdata {
142 140 struct netbuf addr; /* address */
143 141 struct netbuf opt; /* options */
144 142 struct netbuf udata; /* user data */
145 143 };
146 144
147 145 /*
148 146 * unitdata error
149 147 */
150 148 struct t_uderr {
151 149 struct netbuf addr; /* address */
152 150 struct netbuf opt; /* options */
153 151 t_scalar_t error; /* error code */
154 152 };
155 153
156 154 /*
157 155 * The following are structure types used when dynamically
158 156 * allocating the above structures via t_structalloc().
159 157 */
160 158 #define T_BIND 1 /* struct t_bind */
161 159 #define T_OPTMGMT 2 /* struct t_optmgmt */
162 160 #define T_CALL 3 /* struct t_call */
163 161 #define T_DIS 4 /* struct t_discon */
164 162 #define T_UNITDATA 5 /* struct t_unitdata */
165 163 #define T_UDERROR 6 /* struct t_uderr */
166 164 #define T_INFO 7 /* struct t_info */
167 165
168 166 /*
169 167 * The following bits specify which fields of the above
170 168 * structures should be allocated by t_structalloc().
171 169 */
172 170 #define T_ADDR 0x01 /* address */
173 171 #define T_OPT 0x02 /* options */
174 172 #define T_UDATA 0x04 /* user data */
175 173 #define T_ALL 0x07 /* all the above */
176 174
177 175 /*
178 176 * the following are the states for the user
179 177 */
180 178
181 179 #define T_UNINIT 0 /* uninitialized */
182 180 #define T_UNBND 1 /* unbound */
183 181 #define T_IDLE 2 /* idle */
184 182 #define T_OUTCON 3 /* outgoing connection pending */
185 183 #define T_INCON 4 /* incoming connection pending */
186 184 #define T_DATAXFER 5 /* data transfer */
187 185 #define T_OUTREL 6 /* outgoing release pending */
188 186 #define T_INREL 7 /* incoming release pending */
189 187 #define T_BADSTATE 8 /* illegal state */
190 188
191 189 /*
192 190 * Flags for t_getname.
193 191 */
194 192 #define LOCALNAME 0
195 193 #define REMOTENAME 1
196 194
197 195 #if defined(__STDC__)
198 196
199 197 extern int t_accept(int fildes, int resfd, struct t_call *call);
200 198 extern char *t_alloc(int fildes, int struct_type, int fields);
201 199 extern int t_bind(int fildes, struct t_bind *req, struct t_bind *ret);
202 200 extern int t_close(int fildes);
203 201 extern int t_connect(int fildes, struct t_call *sndcall,
204 202 struct t_call *rcvcall);
205 203 extern void t_error(const char *errmsg);
206 204 extern int t_free(char *ptr, int struct_type);
207 205 extern int t_getinfo(int fildes, struct t_info *info);
208 206 extern int t_getname(int fildes, struct netbuf *name, int type);
209 207 extern int t_getstate(int fildes);
210 208 extern int t_listen(int fildes, struct t_call *call);
211 209 extern int t_look(int fildes);
212 210 extern int t_open(const char *path, int oflag, struct t_info *info);
213 211 extern int t_optmgmt(int fildes, struct t_optmgmt *req,
214 212 struct t_optmgmt *ret);
215 213 extern int t_rcv(int fildes, char *buf, unsigned nbytes, int *flags);
216 214 extern int t_rcvconnect(int fildes, struct t_call *call);
217 215 extern int t_rcvdis(int fildes, struct t_discon *discon);
218 216 extern int t_rcvrel(int fildes);
219 217 extern int t_rcvudata(int fildes, struct t_unitdata *unitdata, int *flags);
220 218 extern int t_rcvuderr(int fildes, struct t_uderr *uderr);
221 219 extern int t_snd(int fildes, char *buf, unsigned nbytes, int flags);
222 220 extern int t_snddis(int fildes, struct t_call *call);
223 221 extern int t_sndrel(int fildes);
224 222 extern int t_sndudata(int fildes, struct t_unitdata *unitdata);
225 223 extern char *t_strerror(int errnum);
226 224 extern int t_sync(int fildes);
227 225 extern int t_unbind(int fildes);
228 226
229 227 /*
230 228 * N.B.: this interface is deprecated. Use t_strerror() instead.
231 229 */
232 230 extern char *t_errlist[];
233 231 extern int t_nerr;
234 232
235 233 #endif /* __STDC__ */
236 234
237 235 #ifdef __cplusplus
238 236 }
239 237 #endif
240 238
241 239 #endif /* _SYS_TIUSER_H */
↓ open down ↓ |
173 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX