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
23 /*
24 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
26 */
27
28 #ifndef _TX_H
29 #define _TX_H
30
31 #pragma ident "%Z%%M% %I% %E% SMI"
32
33 #include <sys/uio.h>
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 /*
40 * This file contains declarations local to the TLI/XTI implmentation
41 */
42
43 /*
44 * Look buffer list
45 * Could be multiple buffers for MT case
46 */
47 struct _ti_lookbufs {
48 struct _ti_lookbufs *tl_next; /* next in list */
49 int tl_lookclen; /* "look" ctl part length */
50 char *tl_lookcbuf; /* pointer to "look" ctl */
51 int tl_lookdlen; /* "look" data length */
52 char *tl_lookdbuf; /* pointer to "look" data */
234 * Band definitions for data flow.
235 */
236 #define TI_NORMAL 0
237 #define TI_EXPEDITED 1
238
239 /*
240 * Bogus states from tiuser.h
241 */
242 #define T_FAKE 8 /* fake state used when state */
243 /* cannot be determined */
244
245 /*
246 * Flags for t_getname() from tiuser.h
247 * Note: This routine's counterpart in XTI is substatnially modified
248 * (i.e. t_getprotaddr() and does not use these flags)
249 */
250 #define LOCALNAME 0
251 #define REMOTENAME 1
252
253 /*
254 * Obsolete error event for t_look() in TLI, still needed for compatibility
255 * to broken apps that are affected (e.g nfsd,lockd) if real error returned.
256 */
257 #define T_ERROR 0x0020
258
259 /*
260 * GENERAL UTILITY MACROS
261 */
262 #define A_CNT(arr) (sizeof (arr)/sizeof (arr[0]))
263 #define A_END(arr) (&arr[A_CNT(arr)])
264 #define A_LAST(arr) (&arr[A_CNT(arr)-1])
265
266 /*
267 * Following macro compares a signed size obtained from TPI primitive
268 * to unsigned size of buffer where it needs to go into passed using
269 * the "struct netbuf" type.
270 * Since many programs are buggy and forget to initialize "netbuf" or
271 * (while unlikely!) allocated buffer can legally even be larger than
272 * max signed integer, we use the following macro to do unsigned comparison
273 * after verifying that signed quantity is positive.
274 */
275 #define TLEN_GT_NLEN(tpilen, netbuflen) \
276 (((tpilen) > 0) && ((unsigned int)(tpilen) > (netbuflen)))
277
278
279 /*
|
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
23 /*
24 * Copyright 2014 Gary Mills
25 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 #ifndef _TX_H
30 #define _TX_H
31
32 #include <sys/uio.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 /*
39 * This file contains declarations local to the TLI/XTI implmentation
40 */
41
42 /*
43 * Look buffer list
44 * Could be multiple buffers for MT case
45 */
46 struct _ti_lookbufs {
47 struct _ti_lookbufs *tl_next; /* next in list */
48 int tl_lookclen; /* "look" ctl part length */
49 char *tl_lookcbuf; /* pointer to "look" ctl */
50 int tl_lookdlen; /* "look" data length */
51 char *tl_lookdbuf; /* pointer to "look" data */
233 * Band definitions for data flow.
234 */
235 #define TI_NORMAL 0
236 #define TI_EXPEDITED 1
237
238 /*
239 * Bogus states from tiuser.h
240 */
241 #define T_FAKE 8 /* fake state used when state */
242 /* cannot be determined */
243
244 /*
245 * Flags for t_getname() from tiuser.h
246 * Note: This routine's counterpart in XTI is substatnially modified
247 * (i.e. t_getprotaddr() and does not use these flags)
248 */
249 #define LOCALNAME 0
250 #define REMOTENAME 1
251
252 /*
253 * GENERAL UTILITY MACROS
254 */
255 #define A_CNT(arr) (sizeof (arr)/sizeof (arr[0]))
256 #define A_END(arr) (&arr[A_CNT(arr)])
257 #define A_LAST(arr) (&arr[A_CNT(arr)-1])
258
259 /*
260 * Following macro compares a signed size obtained from TPI primitive
261 * to unsigned size of buffer where it needs to go into passed using
262 * the "struct netbuf" type.
263 * Since many programs are buggy and forget to initialize "netbuf" or
264 * (while unlikely!) allocated buffer can legally even be larger than
265 * max signed integer, we use the following macro to do unsigned comparison
266 * after verifying that signed quantity is positive.
267 */
268 #define TLEN_GT_NLEN(tpilen, netbuflen) \
269 (((tpilen) > 0) && ((unsigned int)(tpilen) > (netbuflen)))
270
271
272 /*
|