xref: /titanic_41/usr/src/uts/common/rpc/rpc_com.h (revision 62c3776affc53153ce74e14a6e7ce91950c28102)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 /*
26  * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
27  */
28 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
29 /* All Rights Reserved */
30 /*
31  * Portions of this source code were derived from Berkeley
32  * 4.3 BSD under license from the Regents of the University of
33  * California.
34  */
35 
36 /*
37  * rpc_com.h, Common definitions for both the server and client side.
38  * All for the topmost layer of rpc
39  *
40  */
41 
42 #ifndef _RPC_RPC_COM_H
43 #define	_RPC_RPC_COM_H
44 
45 #include <sys/types.h>
46 #include <rpc/types.h>
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 /*
53  * File descriptor to be used on xxx_create calls to get default descriptor
54  */
55 #define	RPC_ANYSOCK	-1
56 #define	RPC_ANYFD	RPC_ANYSOCK
57 /*
58  * The max size of the transport, if the size cannot be determined
59  * by other means.
60  */
61 #define	RPC_MAXDATASIZE 9000
62 #define	RPC_MAXADDRSIZE 1024
63 
64 /*
65  * Maximum size of universal address for INET/INET6 addressing.
66  * Computed as INET6_ADDRSTRLEN + (strlen(".255.255") for port)
67  */
68 #define	RPC_INET6_MAXUADDRSIZE 54
69 
70 /*
71  * The type of user of the STREAMS module rpcmod.
72  */
73 #define	RPC_CLIENT	1
74 #define	RPC_SERVER	2
75 #define	RPC_TEST	3
76 
77 #ifdef __STDC__
78 extern uint_t __rpc_get_t_size(t_scalar_t, t_scalar_t);
79 extern uint_t __rpc_get_a_size(t_scalar_t);
80 extern int __rpc_dtbsize(void);
81 extern struct netconfig *__rpcfd_to_nconf(int, int);
82 extern int __rpc_matchserv(int, unsigned int);
83 extern  int  __rpc_get_default_domain(char **);
84 extern int __rpc_tli_set_options(int, int, int, int); /* internal use only */
85 #else
86 extern uint_t __rpc_get_t_size();
87 extern uint_t __rpc_get_a_size();
88 extern int __rpc_dtbsize();
89 extern struct netconfig *__rpcfd_to_nconf();
90 extern int __rpc_matchserv();
91 extern  int __rpc_get_default_domain();
92 extern int __rpc_tli_set_options(); /* internal use only */
93 #endif
94 
95 #ifndef _KERNEL
96 
97 #ifdef __STDC__
98 bool_t rpc_control(int, void *);
99 #else
100 bool_t rpc_control();
101 #endif
102 
103 /*
104  * rpc_control commands
105  */
106 #define	RPC_SVC_MTMODE_SET	1	/* set MT mode */
107 #define	RPC_SVC_MTMODE_GET	2	/* get MT mode */
108 #define	RPC_SVC_THRMAX_SET	3	/* set maximum number of threads */
109 #define	RPC_SVC_THRMAX_GET	4	/* get maximum number of threads */
110 #define	RPC_SVC_THRTOTAL_GET	5	/* get total number of threads */
111 #define	RPC_SVC_THRCREATES_GET	6	/* get total threads created */
112 #define	RPC_SVC_THRERRORS_GET	7	/* get total thread create errors */
113 #define	RPC_SVC_USE_POLLFD	10	/* unlimit fd used beyond 1024 */
114 #define	RPC_SVC_CONNMAXREC_SET	11	/* set COT maximum record size */
115 #define	RPC_SVC_CONNMAXREC_GET	12	/* get COT maximum record size */
116 /* EXCLBIND private interface start - for internal use only */
117 #define	__RPC_SVC_EXCLBIND_SET  13	/* set udp/tcp exclusive port access */
118 #define	__RPC_SVC_EXCLBIND_GET  14	/* get udp/tcp exclusive port access */
119 /* EXCLBIND private interface end  - for internal use only */
120 
121 /* set inter record timeout for COTS RPC */
122 #define	RPC_SVC_IRTIMEOUT_SET	15
123 
124 /* private interface for maximum number of outstanding connection indications */
125 #define	__RPC_SVC_LSTNBKLOG_SET	16	/* set listen backlog */
126 #define	__RPC_SVC_LSTNBKLOG_GET	17	/* get listen backlog */
127 
128 #endif /* !_KERNEL */
129 
130 #ifdef __cplusplus
131 }
132 #endif
133 
134 #endif /* _RPC_RPC_COM_H */
135