xref: /illumos-gate/usr/src/uts/common/rpc/rpc_com.h (revision e8d3efa1c56e5f2b5368600a2baeb7b1d54a07f8)
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 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 
85 #ifndef _KERNEL
86 
87 bool_t rpc_control(int, void *);
88 
89 /*
90  * rpc_control commands
91  */
92 #define	RPC_SVC_MTMODE_SET	1	/* set MT mode */
93 #define	RPC_SVC_MTMODE_GET	2	/* get MT mode */
94 #define	RPC_SVC_THRMAX_SET	3	/* set maximum number of threads */
95 #define	RPC_SVC_THRMAX_GET	4	/* get maximum number of threads */
96 #define	RPC_SVC_THRTOTAL_GET	5	/* get total number of threads */
97 #define	RPC_SVC_THRCREATES_GET	6	/* get total threads created */
98 #define	RPC_SVC_THRERRORS_GET	7	/* get total thread create errors */
99 #define	RPC_SVC_USE_POLLFD	10	/* unlimit fd used beyond 1024 */
100 #define	RPC_SVC_CONNMAXREC_SET	11	/* set COT maximum record size */
101 #define	RPC_SVC_CONNMAXREC_GET	12	/* get COT maximum record size */
102 /* EXCLBIND private interface start - for internal use only */
103 #define	__RPC_SVC_EXCLBIND_SET  13	/* set udp/tcp exclusive port access */
104 #define	__RPC_SVC_EXCLBIND_GET  14	/* get udp/tcp exclusive port access */
105 /* EXCLBIND private interface end  - for internal use only */
106 
107 /* set inter record timeout for COTS RPC */
108 #define	RPC_SVC_IRTIMEOUT_SET	15
109 
110 /* private interface for maximum number of outstanding connection indications */
111 #define	__RPC_SVC_LSTNBKLOG_SET	16	/* set listen backlog */
112 #define	__RPC_SVC_LSTNBKLOG_GET	17	/* get listen backlog */
113 
114 #endif /* !_KERNEL */
115 
116 #ifdef __cplusplus
117 }
118 #endif
119 
120 #endif /* _RPC_RPC_COM_H */
121