Print this page
remove support for non-ANSI compilation
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]
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
19 19 *
20 20 * CDDL HEADER END
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 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
30 + *
29 31 * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
30 32 * Use is subject to license terms.
31 33 * Copyright 2014 Gary Mills
32 34 */
33 35
34 36 #ifndef _SYS_TIUSER_H
35 37 #define _SYS_TIUSER_H
36 38
37 39 #include <sys/types.h>
38 40 /*
39 41 * The following include file has declarations needed by both the kernel
40 42 * level transport providers and the user level library.
41 43 */
42 44 #include <sys/tpicommon.h>
43 45
44 46 #ifdef __cplusplus
45 47 extern "C" {
46 48 #endif
47 49
48 50
49 51 /*
50 52 * The following are the events returned by t_look
51 53 */
52 54 #define T_LISTEN 0x0001 /* connection indication received */
53 55 #define T_CONNECT 0x0002 /* connect confirmation received */
54 56 #define T_DATA 0x0004 /* normal data received */
55 57 #define T_EXDATA 0x0008 /* expedited data received */
56 58 #define T_DISCONNECT 0x0010 /* disconnect received */
57 59 #define T_UDERR 0x0040 /* data gram error indication */
58 60 #define T_ORDREL 0x0080 /* orderly release indication */
59 61 #define T_EVENTS 0x00ff /* event mask */
60 62
61 63 /*
62 64 * Flags for data primitives.
63 65 */
64 66 #define T_MORE 0x001 /* more data */
65 67 #define T_EXPEDITED 0x002 /* expedited data */
66 68
67 69
68 70 /*
69 71 * protocol specific service limits
70 72 */
71 73
72 74 struct t_info {
73 75 t_scalar_t addr; /* size of protocol address */
74 76 t_scalar_t options; /* size of protocol options */
75 77 t_scalar_t tsdu; /* size of max transport service data unit */
76 78 t_scalar_t etsdu; /* size of max expedited tsdu */
77 79 t_scalar_t connect; /* max data for connection primitives */
78 80 t_scalar_t discon; /* max data for disconnect primitives */
79 81 t_scalar_t servtype; /* provider service type */
80 82 };
81 83
82 84 /*
83 85 * netbuf structure
84 86 */
85 87
86 88 struct netbuf {
87 89 unsigned int maxlen;
88 90 unsigned int len;
89 91 char *buf;
90 92 };
91 93
92 94 #ifdef _SYSCALL32
93 95 struct netbuf32 {
94 96 uint32_t maxlen;
95 97 uint32_t len;
96 98 caddr32_t buf;
97 99 };
98 100 #endif /* _SYSCALL32 */
99 101
100 102 /*
101 103 * t_bind - format of the address and options arguments of bind
102 104 */
103 105
104 106 struct t_bind {
105 107 struct netbuf addr;
106 108 unsigned int qlen;
107 109 };
108 110
109 111 /*
110 112 * options management
111 113 */
112 114 struct t_optmgmt {
113 115 struct netbuf opt;
114 116 t_scalar_t flags;
115 117 };
116 118
117 119 /*
118 120 * disconnect structure
119 121 */
120 122 struct t_discon {
121 123 struct netbuf udata; /* user data */
122 124 int reason; /* reason code */
123 125 int sequence; /* sequence number */
124 126 };
125 127
126 128 /*
127 129 * call structure
128 130 */
129 131 struct t_call {
130 132 struct netbuf addr; /* address */
131 133 struct netbuf opt; /* options */
132 134 struct netbuf udata; /* user data */
133 135 int sequence; /* sequence number */
134 136 };
135 137
136 138 /*
137 139 * data gram structure
138 140 */
139 141 struct t_unitdata {
140 142 struct netbuf addr; /* address */
141 143 struct netbuf opt; /* options */
142 144 struct netbuf udata; /* user data */
143 145 };
144 146
145 147 /*
146 148 * unitdata error
147 149 */
148 150 struct t_uderr {
149 151 struct netbuf addr; /* address */
150 152 struct netbuf opt; /* options */
151 153 t_scalar_t error; /* error code */
152 154 };
153 155
154 156 /*
155 157 * The following are structure types used when dynamically
156 158 * allocating the above structures via t_structalloc().
157 159 */
158 160 #define T_BIND 1 /* struct t_bind */
159 161 #define T_OPTMGMT 2 /* struct t_optmgmt */
160 162 #define T_CALL 3 /* struct t_call */
161 163 #define T_DIS 4 /* struct t_discon */
162 164 #define T_UNITDATA 5 /* struct t_unitdata */
163 165 #define T_UDERROR 6 /* struct t_uderr */
164 166 #define T_INFO 7 /* struct t_info */
165 167
166 168 /*
167 169 * The following bits specify which fields of the above
168 170 * structures should be allocated by t_structalloc().
169 171 */
170 172 #define T_ADDR 0x01 /* address */
171 173 #define T_OPT 0x02 /* options */
172 174 #define T_UDATA 0x04 /* user data */
173 175 #define T_ALL 0x07 /* all the above */
174 176
175 177 /*
176 178 * the following are the states for the user
177 179 */
178 180
179 181 #define T_UNINIT 0 /* uninitialized */
180 182 #define T_UNBND 1 /* unbound */
181 183 #define T_IDLE 2 /* idle */
182 184 #define T_OUTCON 3 /* outgoing connection pending */
183 185 #define T_INCON 4 /* incoming connection pending */
184 186 #define T_DATAXFER 5 /* data transfer */
↓ open down ↓ |
146 lines elided |
↑ open up ↑ |
185 187 #define T_OUTREL 6 /* outgoing release pending */
186 188 #define T_INREL 7 /* incoming release pending */
187 189 #define T_BADSTATE 8 /* illegal state */
188 190
189 191 /*
190 192 * Flags for t_getname.
191 193 */
192 194 #define LOCALNAME 0
193 195 #define REMOTENAME 1
194 196
195 -#if defined(__STDC__)
196 -
197 197 extern int t_accept(int fildes, int resfd, struct t_call *call);
198 198 extern char *t_alloc(int fildes, int struct_type, int fields);
199 199 extern int t_bind(int fildes, struct t_bind *req, struct t_bind *ret);
200 200 extern int t_close(int fildes);
201 201 extern int t_connect(int fildes, struct t_call *sndcall,
202 202 struct t_call *rcvcall);
203 203 extern void t_error(const char *errmsg);
204 204 extern int t_free(char *ptr, int struct_type);
205 205 extern int t_getinfo(int fildes, struct t_info *info);
206 206 extern int t_getname(int fildes, struct netbuf *name, int type);
207 207 extern int t_getstate(int fildes);
208 208 extern int t_listen(int fildes, struct t_call *call);
209 209 extern int t_look(int fildes);
210 210 extern int t_open(const char *path, int oflag, struct t_info *info);
211 211 extern int t_optmgmt(int fildes, struct t_optmgmt *req,
212 212 struct t_optmgmt *ret);
213 213 extern int t_rcv(int fildes, char *buf, unsigned nbytes, int *flags);
214 214 extern int t_rcvconnect(int fildes, struct t_call *call);
215 215 extern int t_rcvdis(int fildes, struct t_discon *discon);
216 216 extern int t_rcvrel(int fildes);
217 217 extern int t_rcvudata(int fildes, struct t_unitdata *unitdata, int *flags);
218 218 extern int t_rcvuderr(int fildes, struct t_uderr *uderr);
219 219 extern int t_snd(int fildes, char *buf, unsigned nbytes, int flags);
220 220 extern int t_snddis(int fildes, struct t_call *call);
221 221 extern int t_sndrel(int fildes);
222 222 extern int t_sndudata(int fildes, struct t_unitdata *unitdata);
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
223 223 extern char *t_strerror(int errnum);
224 224 extern int t_sync(int fildes);
225 225 extern int t_unbind(int fildes);
226 226
227 227 /*
228 228 * N.B.: this interface is deprecated. Use t_strerror() instead.
229 229 */
230 230 extern char *t_errlist[];
231 231 extern int t_nerr;
232 232
233 -#endif /* __STDC__ */
234 -
235 233 #ifdef __cplusplus
236 234 }
237 235 #endif
238 236
239 237 #endif /* _SYS_TIUSER_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX