xref: /onnv-gate/usr/src/uts/common/rpc/rpc_com.h (revision 1914:8a8c5f225b1b)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*1914Scasper  * Common Development and Distribution License (the "License").
6*1914Scasper  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*1914Scasper  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
260Sstevel@tonic-gate /* All Rights Reserved */
270Sstevel@tonic-gate /*
280Sstevel@tonic-gate  * Portions of this source code were derived from Berkeley
290Sstevel@tonic-gate  * 4.3 BSD under license from the Regents of the University of
300Sstevel@tonic-gate  * California.
310Sstevel@tonic-gate  */
320Sstevel@tonic-gate 
330Sstevel@tonic-gate /*
340Sstevel@tonic-gate  * rpc_com.h, Common definitions for both the server and client side.
350Sstevel@tonic-gate  * All for the topmost layer of rpc
360Sstevel@tonic-gate  *
370Sstevel@tonic-gate  */
380Sstevel@tonic-gate 
390Sstevel@tonic-gate #ifndef _RPC_RPC_COM_H
400Sstevel@tonic-gate #define	_RPC_RPC_COM_H
410Sstevel@tonic-gate 
420Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
430Sstevel@tonic-gate 
440Sstevel@tonic-gate #include <sys/types.h>
450Sstevel@tonic-gate #include <rpc/types.h>
460Sstevel@tonic-gate 
470Sstevel@tonic-gate #ifdef __cplusplus
480Sstevel@tonic-gate extern "C" {
490Sstevel@tonic-gate #endif
500Sstevel@tonic-gate 
510Sstevel@tonic-gate /*
520Sstevel@tonic-gate  * File descriptor to be used on xxx_create calls to get default descriptor
530Sstevel@tonic-gate  */
540Sstevel@tonic-gate #define	RPC_ANYSOCK	-1
550Sstevel@tonic-gate #define	RPC_ANYFD	RPC_ANYSOCK
560Sstevel@tonic-gate /*
570Sstevel@tonic-gate  * The max size of the transport, if the size cannot be determined
580Sstevel@tonic-gate  * by other means.
590Sstevel@tonic-gate  */
600Sstevel@tonic-gate #define	RPC_MAXDATASIZE 9000
610Sstevel@tonic-gate #define	RPC_MAXADDRSIZE 1024
620Sstevel@tonic-gate 
630Sstevel@tonic-gate /*
640Sstevel@tonic-gate  * Maximum size of universal address for INET/INET6 addressing.
650Sstevel@tonic-gate  * Computed as INET6_ADDRSTRLEN + (strlen(".255.255") for port)
660Sstevel@tonic-gate  */
670Sstevel@tonic-gate #define	RPC_INET6_MAXUADDRSIZE 54
680Sstevel@tonic-gate 
690Sstevel@tonic-gate /*
700Sstevel@tonic-gate  * The type of user of the STREAMS module rpcmod.
710Sstevel@tonic-gate  */
720Sstevel@tonic-gate #define	RPC_CLIENT	1
730Sstevel@tonic-gate #define	RPC_SERVER	2
740Sstevel@tonic-gate #define	RPC_TEST	3
750Sstevel@tonic-gate 
760Sstevel@tonic-gate #ifdef __STDC__
770Sstevel@tonic-gate extern uint_t __rpc_get_t_size(t_scalar_t, t_scalar_t);
780Sstevel@tonic-gate extern uint_t __rpc_get_a_size(t_scalar_t);
790Sstevel@tonic-gate extern int __rpc_dtbsize(void);
800Sstevel@tonic-gate extern struct netconfig *__rpcfd_to_nconf(int, int);
810Sstevel@tonic-gate extern int __rpc_matchserv(int, unsigned int);
820Sstevel@tonic-gate extern  int  __rpc_get_default_domain(char **);
830Sstevel@tonic-gate extern int __rpc_tli_set_options(int, int, int, int); /* internal use only */
840Sstevel@tonic-gate #else
850Sstevel@tonic-gate extern uint_t __rpc_get_t_size();
860Sstevel@tonic-gate extern uint_t __rpc_get_a_size();
870Sstevel@tonic-gate extern int __rpc_dtbsize();
880Sstevel@tonic-gate extern struct netconfig *__rpcfd_to_nconf();
890Sstevel@tonic-gate extern int __rpc_matchserv();
900Sstevel@tonic-gate extern  int __rpc_get_default_domain();
910Sstevel@tonic-gate extern int __rpc_tli_set_options(); /* internal use only */
920Sstevel@tonic-gate #endif
930Sstevel@tonic-gate 
940Sstevel@tonic-gate #ifndef _KERNEL
950Sstevel@tonic-gate 
960Sstevel@tonic-gate #ifdef __STDC__
970Sstevel@tonic-gate bool_t rpc_control(int, void *);
980Sstevel@tonic-gate #else
990Sstevel@tonic-gate bool_t rpc_control();
1000Sstevel@tonic-gate #endif
1010Sstevel@tonic-gate 
1020Sstevel@tonic-gate /*
1030Sstevel@tonic-gate  * rpc_control commands
1040Sstevel@tonic-gate  */
1050Sstevel@tonic-gate #define	RPC_SVC_MTMODE_SET	1	/* set MT mode */
1060Sstevel@tonic-gate #define	RPC_SVC_MTMODE_GET	2	/* get MT mode */
1070Sstevel@tonic-gate #define	RPC_SVC_THRMAX_SET	3	/* set maximum number of threads */
1080Sstevel@tonic-gate #define	RPC_SVC_THRMAX_GET	4	/* get maximum number of threads */
1090Sstevel@tonic-gate #define	RPC_SVC_THRTOTAL_GET	5	/* get total number of threads */
1100Sstevel@tonic-gate #define	RPC_SVC_THRCREATES_GET	6	/* get total threads created */
1110Sstevel@tonic-gate #define	RPC_SVC_THRERRORS_GET	7	/* get total thread create errors */
1120Sstevel@tonic-gate #define	RPC_SVC_USE_POLLFD	10	/* unlimit fd used beyond 1024 */
1130Sstevel@tonic-gate #define	RPC_SVC_CONNMAXREC_SET	11	/* set COT maximum record size */
1140Sstevel@tonic-gate #define	RPC_SVC_CONNMAXREC_GET	12	/* get COT maximum record size */
1150Sstevel@tonic-gate /* EXCLBIND private interface start - for internal use only */
1160Sstevel@tonic-gate #define	__RPC_SVC_EXCLBIND_SET  13	/* set udp/tcp exclusive port access */
1170Sstevel@tonic-gate #define	__RPC_SVC_EXCLBIND_GET  14	/* get udp/tcp exclusive port access */
1180Sstevel@tonic-gate /* EXCLBIND private interface end  - for internal use only */
1190Sstevel@tonic-gate 
1200Sstevel@tonic-gate /* set inter record timeout for COTS RPC */
1210Sstevel@tonic-gate #define	RPC_SVC_IRTIMEOUT_SET	15
1220Sstevel@tonic-gate 
1230Sstevel@tonic-gate #endif /* !_KERNEL */
1240Sstevel@tonic-gate 
1250Sstevel@tonic-gate #ifdef __cplusplus
1260Sstevel@tonic-gate }
1270Sstevel@tonic-gate #endif
1280Sstevel@tonic-gate 
1290Sstevel@tonic-gate #endif /* _RPC_RPC_COM_H */
130