17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5004388ebScasper * Common Development and Distribution License (the "License"). 6004388ebScasper * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22004388ebScasper * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 25*361f55a5SMarcel Telka /* 26*361f55a5SMarcel Telka * Copyright 2014 Nexenta Systems, Inc. All rights reserved. 27*361f55a5SMarcel Telka */ 287c478bd9Sstevel@tonic-gate /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 297c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 307c478bd9Sstevel@tonic-gate /* 317c478bd9Sstevel@tonic-gate * Portions of this source code were derived from Berkeley 327c478bd9Sstevel@tonic-gate * 4.3 BSD under license from the Regents of the University of 337c478bd9Sstevel@tonic-gate * California. 347c478bd9Sstevel@tonic-gate */ 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate /* 377c478bd9Sstevel@tonic-gate * rpc_com.h, Common definitions for both the server and client side. 387c478bd9Sstevel@tonic-gate * All for the topmost layer of rpc 397c478bd9Sstevel@tonic-gate * 407c478bd9Sstevel@tonic-gate */ 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate #ifndef _RPC_RPC_COM_H 437c478bd9Sstevel@tonic-gate #define _RPC_RPC_COM_H 447c478bd9Sstevel@tonic-gate 457c478bd9Sstevel@tonic-gate #include <sys/types.h> 467c478bd9Sstevel@tonic-gate #include <rpc/types.h> 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate #ifdef __cplusplus 497c478bd9Sstevel@tonic-gate extern "C" { 507c478bd9Sstevel@tonic-gate #endif 517c478bd9Sstevel@tonic-gate 527c478bd9Sstevel@tonic-gate /* 537c478bd9Sstevel@tonic-gate * File descriptor to be used on xxx_create calls to get default descriptor 547c478bd9Sstevel@tonic-gate */ 557c478bd9Sstevel@tonic-gate #define RPC_ANYSOCK -1 567c478bd9Sstevel@tonic-gate #define RPC_ANYFD RPC_ANYSOCK 577c478bd9Sstevel@tonic-gate /* 587c478bd9Sstevel@tonic-gate * The max size of the transport, if the size cannot be determined 597c478bd9Sstevel@tonic-gate * by other means. 607c478bd9Sstevel@tonic-gate */ 617c478bd9Sstevel@tonic-gate #define RPC_MAXDATASIZE 9000 627c478bd9Sstevel@tonic-gate #define RPC_MAXADDRSIZE 1024 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate /* 657c478bd9Sstevel@tonic-gate * Maximum size of universal address for INET/INET6 addressing. 667c478bd9Sstevel@tonic-gate * Computed as INET6_ADDRSTRLEN + (strlen(".255.255") for port) 677c478bd9Sstevel@tonic-gate */ 687c478bd9Sstevel@tonic-gate #define RPC_INET6_MAXUADDRSIZE 54 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gate /* 717c478bd9Sstevel@tonic-gate * The type of user of the STREAMS module rpcmod. 727c478bd9Sstevel@tonic-gate */ 737c478bd9Sstevel@tonic-gate #define RPC_CLIENT 1 747c478bd9Sstevel@tonic-gate #define RPC_SERVER 2 757c478bd9Sstevel@tonic-gate #define RPC_TEST 3 767c478bd9Sstevel@tonic-gate 777c478bd9Sstevel@tonic-gate #ifdef __STDC__ 787c478bd9Sstevel@tonic-gate extern uint_t __rpc_get_t_size(t_scalar_t, t_scalar_t); 797c478bd9Sstevel@tonic-gate extern uint_t __rpc_get_a_size(t_scalar_t); 807c478bd9Sstevel@tonic-gate extern int __rpc_dtbsize(void); 817c478bd9Sstevel@tonic-gate extern struct netconfig *__rpcfd_to_nconf(int, int); 827c478bd9Sstevel@tonic-gate extern int __rpc_matchserv(int, unsigned int); 837c478bd9Sstevel@tonic-gate extern int __rpc_get_default_domain(char **); 847c478bd9Sstevel@tonic-gate extern int __rpc_tli_set_options(int, int, int, int); /* internal use only */ 857c478bd9Sstevel@tonic-gate #else 867c478bd9Sstevel@tonic-gate extern uint_t __rpc_get_t_size(); 877c478bd9Sstevel@tonic-gate extern uint_t __rpc_get_a_size(); 887c478bd9Sstevel@tonic-gate extern int __rpc_dtbsize(); 897c478bd9Sstevel@tonic-gate extern struct netconfig *__rpcfd_to_nconf(); 907c478bd9Sstevel@tonic-gate extern int __rpc_matchserv(); 917c478bd9Sstevel@tonic-gate extern int __rpc_get_default_domain(); 927c478bd9Sstevel@tonic-gate extern int __rpc_tli_set_options(); /* internal use only */ 937c478bd9Sstevel@tonic-gate #endif 947c478bd9Sstevel@tonic-gate 957c478bd9Sstevel@tonic-gate #ifndef _KERNEL 967c478bd9Sstevel@tonic-gate 977c478bd9Sstevel@tonic-gate #ifdef __STDC__ 987c478bd9Sstevel@tonic-gate bool_t rpc_control(int, void *); 997c478bd9Sstevel@tonic-gate #else 1007c478bd9Sstevel@tonic-gate bool_t rpc_control(); 1017c478bd9Sstevel@tonic-gate #endif 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gate /* 1047c478bd9Sstevel@tonic-gate * rpc_control commands 1057c478bd9Sstevel@tonic-gate */ 1067c478bd9Sstevel@tonic-gate #define RPC_SVC_MTMODE_SET 1 /* set MT mode */ 1077c478bd9Sstevel@tonic-gate #define RPC_SVC_MTMODE_GET 2 /* get MT mode */ 1087c478bd9Sstevel@tonic-gate #define RPC_SVC_THRMAX_SET 3 /* set maximum number of threads */ 1097c478bd9Sstevel@tonic-gate #define RPC_SVC_THRMAX_GET 4 /* get maximum number of threads */ 1107c478bd9Sstevel@tonic-gate #define RPC_SVC_THRTOTAL_GET 5 /* get total number of threads */ 1117c478bd9Sstevel@tonic-gate #define RPC_SVC_THRCREATES_GET 6 /* get total threads created */ 1127c478bd9Sstevel@tonic-gate #define RPC_SVC_THRERRORS_GET 7 /* get total thread create errors */ 1137c478bd9Sstevel@tonic-gate #define RPC_SVC_USE_POLLFD 10 /* unlimit fd used beyond 1024 */ 1147c478bd9Sstevel@tonic-gate #define RPC_SVC_CONNMAXREC_SET 11 /* set COT maximum record size */ 1157c478bd9Sstevel@tonic-gate #define RPC_SVC_CONNMAXREC_GET 12 /* get COT maximum record size */ 1167c478bd9Sstevel@tonic-gate /* EXCLBIND private interface start - for internal use only */ 1177c478bd9Sstevel@tonic-gate #define __RPC_SVC_EXCLBIND_SET 13 /* set udp/tcp exclusive port access */ 1187c478bd9Sstevel@tonic-gate #define __RPC_SVC_EXCLBIND_GET 14 /* get udp/tcp exclusive port access */ 1197c478bd9Sstevel@tonic-gate /* EXCLBIND private interface end - for internal use only */ 1207c478bd9Sstevel@tonic-gate 1217c478bd9Sstevel@tonic-gate /* set inter record timeout for COTS RPC */ 1227c478bd9Sstevel@tonic-gate #define RPC_SVC_IRTIMEOUT_SET 15 1237c478bd9Sstevel@tonic-gate 124*361f55a5SMarcel Telka /* private interface for maximum number of outstanding connection indications */ 125*361f55a5SMarcel Telka #define __RPC_SVC_LSTNBKLOG_SET 16 /* set listen backlog */ 126*361f55a5SMarcel Telka #define __RPC_SVC_LSTNBKLOG_GET 17 /* get listen backlog */ 127*361f55a5SMarcel Telka 1287c478bd9Sstevel@tonic-gate #endif /* !_KERNEL */ 1297c478bd9Sstevel@tonic-gate 1307c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1317c478bd9Sstevel@tonic-gate } 1327c478bd9Sstevel@tonic-gate #endif 1337c478bd9Sstevel@tonic-gate 1347c478bd9Sstevel@tonic-gate #endif /* _RPC_RPC_COM_H */ 135