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 2005 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 27 /* All Rights Reserved */ 28 /* 29 * Portions of this source code were derived from Berkeley 30 * 4.3 BSD under license from the Regents of the University of 31 * California. 32 */ 33 34 /* 35 * rpc_com.h, Common definitions for both the server and client side. 36 * All for the topmost layer of rpc 37 * 38 */ 39 40 #ifndef _RPC_RPC_COM_H 41 #define _RPC_RPC_COM_H 42 43 #pragma ident "%Z%%M% %I% %E% SMI" 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_CLNT_MINFD_SET 8 /* set min fd used for a clnt handle */ 114 #define __RPC_CLNT_MINFD_GET 9 /* get min fd used for a clnt handle */ 115 #define RPC_SVC_USE_POLLFD 10 /* unlimit fd used beyond 1024 */ 116 #define RPC_SVC_CONNMAXREC_SET 11 /* set COT maximum record size */ 117 #define RPC_SVC_CONNMAXREC_GET 12 /* get COT maximum record size */ 118 /* EXCLBIND private interface start - for internal use only */ 119 #define __RPC_SVC_EXCLBIND_SET 13 /* set udp/tcp exclusive port access */ 120 #define __RPC_SVC_EXCLBIND_GET 14 /* get udp/tcp exclusive port access */ 121 /* EXCLBIND private interface end - for internal use only */ 122 123 /* set inter record timeout for COTS RPC */ 124 #define RPC_SVC_IRTIMEOUT_SET 15 125 126 #endif /* !_KERNEL */ 127 128 #ifdef __cplusplus 129 } 130 #endif 131 132 #endif /* _RPC_RPC_COM_H */ 133