xref: /illumos-gate/usr/src/uts/common/sys/timod.h (revision b4203d757c7c247e39c94c09a94021a3a8121062)
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 1998 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved	*/
29 
30 #ifndef _SYS_TIMOD_H
31 #define	_SYS_TIMOD_H
32 
33 #include <sys/types.h>
34 #include <sys/stream.h>
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /* Timod ioctls */
41 #define		TIMOD 		('T'<<8)
42 #define		TI_GETINFO	(TIMOD|140)
43 #define		TI_OPTMGMT	(TIMOD|141)
44 #define		TI_BIND		(TIMOD|142)
45 #define		TI_UNBIND	(TIMOD|143)
46 #define		TI_GETMYNAME	(TIMOD|144)
47 #define		TI_GETPEERNAME	(TIMOD|145)
48 #define		TI_SETMYNAME	(TIMOD|146)
49 #define		TI_SETPEERNAME	(TIMOD|147)
50 #define		TI_SYNC		(TIMOD|148)
51 #define		TI_GETADDRS	(TIMOD|149)
52 #define		TI_CAPABILITY	(TIMOD|150)
53 
54 /*
55  * There are two ioctls to get information from the kernel. One is TI_SYNC
56  * and it should be only used to exchange information between the library and
57  * timod. It should not request any TPI information. The second ioctl is
58  * TI_CAPABILITY which is extensible ioctl for getting all the information from
59  * transport provider.
60  */
61 
62 /* sent with TI_SYNC */
63 struct ti_sync_req {
64 	uint32_t	tsr_flags;
65 	/* can grow at the end */
66 };
67 
68 /*
69  * For use with tsr_flags
70  * TSRF_INFO_REQ is obsolete and shouldn't be used in new code. Use
71  * TI_CAPABILITY ioctl instead.
72  */
73 #define	TSRF_INFO_REQ		0x1 /* get info about transport endpoint */
74 #define	TSRF_IS_EXP_IN_RCVBUF	0x2 /* look for exp ind in rcvbuf */
75 #define	TSRF_QLEN_REQ		0x4 /* get qlen from timod */
76 
77 /* returned by TI_SYNC  */
78 struct ti_sync_ack {
79 	/*
80 	 * - initial part derived from and matches T_info_ack
81 	 * - returned when TSRF_INFO_REQ is set on request
82 	 */
83 	t_scalar_t	PRIM_type;
84 	t_scalar_t	TSDU_size;
85 	t_scalar_t	ETSDU_size;
86 	t_scalar_t	CDATA_size;
87 	t_scalar_t	DDATA_size;
88 	t_scalar_t	ADDR_size;
89 	t_scalar_t	OPT_size;
90 	t_scalar_t	TIDU_size;
91 	t_scalar_t	SERV_type;
92 	t_scalar_t	CURRENT_state;
93 	t_scalar_t	PROVIDER_flag;
94 
95 	/*
96 	 * endpoint qlen backlog, returned when TSRF_INFO_REQ is set on request
97 	 */
98 	t_uscalar_t	tsa_qlen;
99 
100 	/*
101 	 * misc flags info - bits set based on what is requested.
102 	 */
103 	uint32_t tsa_flags;
104 	/* can grow at the end */
105 };
106 
107 /*
108  * Flag bits for use with tsa_flags
109  */
110 
111 /*
112  * TSAF_EXP_QUEUED:
113  * 	set/clear significant when TSRF_IS_EXP_IN_RCVBUF is set on request
114  */
115 #define	TSAF_EXP_QUEUED	0x1
116 
117 #ifdef	__cplusplus
118 }
119 #endif
120 
121 #endif	/* _SYS_TIMOD_H */
122