xref: /titanic_50/usr/src/lib/libbc/inc/include/nettli/tcp_tli.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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 /*
23  * Copyright (c) 1988,2001 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_TCP_TLI_
28 #define	_TCP_TLI_
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * TLI automaton state definitions.
38  *
39  * They are expressed as bit masks to facilitate testing whether the
40  * current automaton state is contained in a given set of states.
41  */
42 #define	TL_UNINIT	0x0000	/* uninitialized */
43 #define	TL_UNBND	0x0002	/* unbound */
44 #define	TL_IDLE		0x0004	/* no connection established */
45 /*
46  * outgoing connection pending for active user
47  */
48 #define	TL_OUTCON	0x0008
49 /*
50  * incoming connection pending for passive user
51  */
52 #define	TL_INCON	0x0010
53 #define	TL_DATAXFER	0x0020	/* data transfer */
54 /*
55  * outgoing orderly release (waiting for orderly release indication)
56  */
57 #define	TL_OUTREL	0x0040
58 /*
59  * incoming orderly release (waiting to send orderly release request)
60  */
61 #define	TL_INREL	0x0080
62 /*
63  * pseudo-state indicating disallowed transition (may end up unnecessary)
64  */
65 #define	TL_ERROR	0x0100
66 
67 /*
68  * Max buffer size for each uio operation in tcptli_Ercv()
69  */
70 #define	TT_BUFSIZE	2048
71 
72 /*
73  * Send and Recv size for socket operations
74  */
75 #define	TT_SENDSIZE	24 * 1024
76 #define	TT_RECVSIZE	24 * 1024
77 
78 /*
79  * Max number of uio vectors for sosend and soreceive
80  */
81 #define	TT_MAXUIO	10
82 
83 /*
84  * Flag to indicate that only part of the data buffer got sent
85  */
86 #define	TT_INCOMPLETESEND	201
87 
88 /*
89  * Protocol options (socket options) supported by T_OPTMGMT_REQ
90  */
91 struct	tt_soopt {
92 	int	tts_reuseaddr;	/* reuse a bound address */
93 	int	tts_keepalive;	/* keep connection alive */
94 	int	tts_sendsize;	/* socket send size */
95 	int	tts_recvsize;	/* socket recv size */
96 };
97 
98 #define	TTS_BUFSIZE	4096	/* default socket send/recv size */
99 #define	TTS_DFLT_REUSEADDR	1
100 #define	TTS_DFLT_KEEPALIVE	1
101 
102 #ifdef	__cplusplus
103 }
104 #endif
105 
106 #endif	/* _TCP_TLI_ */
107