xref: /titanic_44/usr/src/uts/common/rpc/rpc_com.h (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
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 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
26 /* All Rights Reserved */
27 /*
28  * Portions of this source code were derived from Berkeley
29  * 4.3 BSD under license from the Regents of the University of
30  * California.
31  */
32 
33 /*
34  * rpc_com.h, Common definitions for both the server and client side.
35  * All for the topmost layer of rpc
36  *
37  */
38 
39 #ifndef _RPC_RPC_COM_H
40 #define	_RPC_RPC_COM_H
41 
42 #pragma ident	"%Z%%M%	%I%	%E% SMI"
43 
44 #include <sys/types.h>
45 #include <rpc/types.h>
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 /*
52  * File descriptor to be used on xxx_create calls to get default descriptor
53  */
54 #define	RPC_ANYSOCK	-1
55 #define	RPC_ANYFD	RPC_ANYSOCK
56 /*
57  * The max size of the transport, if the size cannot be determined
58  * by other means.
59  */
60 #define	RPC_MAXDATASIZE 9000
61 #define	RPC_MAXADDRSIZE 1024
62 
63 /*
64  * Maximum size of universal address for INET/INET6 addressing.
65  * Computed as INET6_ADDRSTRLEN + (strlen(".255.255") for port)
66  */
67 #define	RPC_INET6_MAXUADDRSIZE 54
68 
69 /*
70  * The type of user of the STREAMS module rpcmod.
71  */
72 #define	RPC_CLIENT	1
73 #define	RPC_SERVER	2
74 #define	RPC_TEST	3
75 
76 #ifdef __STDC__
77 extern uint_t __rpc_get_t_size(t_scalar_t, t_scalar_t);
78 extern uint_t __rpc_get_a_size(t_scalar_t);
79 extern int __rpc_dtbsize(void);
80 extern struct netconfig *__rpcfd_to_nconf(int, int);
81 extern int __rpc_matchserv(int, unsigned int);
82 extern  int  __rpc_get_default_domain(char **);
83 extern int __rpc_tli_set_options(int, int, int, int); /* internal use only */
84 #else
85 extern uint_t __rpc_get_t_size();
86 extern uint_t __rpc_get_a_size();
87 extern int __rpc_dtbsize();
88 extern struct netconfig *__rpcfd_to_nconf();
89 extern int __rpc_matchserv();
90 extern  int __rpc_get_default_domain();
91 extern int __rpc_tli_set_options(); /* internal use only */
92 #endif
93 
94 #ifndef _KERNEL
95 
96 #ifdef __STDC__
97 bool_t rpc_control(int, void *);
98 #else
99 bool_t rpc_control();
100 #endif
101 
102 /*
103  * rpc_control commands
104  */
105 #define	RPC_SVC_MTMODE_SET	1	/* set MT mode */
106 #define	RPC_SVC_MTMODE_GET	2	/* get MT mode */
107 #define	RPC_SVC_THRMAX_SET	3	/* set maximum number of threads */
108 #define	RPC_SVC_THRMAX_GET	4	/* get maximum number of threads */
109 #define	RPC_SVC_THRTOTAL_GET	5	/* get total number of threads */
110 #define	RPC_SVC_THRCREATES_GET	6	/* get total threads created */
111 #define	RPC_SVC_THRERRORS_GET	7	/* get total thread create errors */
112 #define	RPC_SVC_USE_POLLFD	10	/* unlimit fd used beyond 1024 */
113 #define	RPC_SVC_CONNMAXREC_SET	11	/* set COT maximum record size */
114 #define	RPC_SVC_CONNMAXREC_GET	12	/* get COT maximum record size */
115 /* EXCLBIND private interface start - for internal use only */
116 #define	__RPC_SVC_EXCLBIND_SET  13	/* set udp/tcp exclusive port access */
117 #define	__RPC_SVC_EXCLBIND_GET  14	/* get udp/tcp exclusive port access */
118 /* EXCLBIND private interface end  - for internal use only */
119 
120 /* set inter record timeout for COTS RPC */
121 #define	RPC_SVC_IRTIMEOUT_SET	15
122 
123 #endif /* !_KERNEL */
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif /* _RPC_RPC_COM_H */
130