/*
 * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
 */

/*
 * rpc_com.h, Common definitions for both the server and client side.
 * All for the topmost layer of rpc
 *
 */

#ifndef _RPC_RPCCOM_H
#define	_RPC_RPCCOM_H

/* #pragma ident	"@(#)rpc_com.h	1.15	94/01/18 SMI" */
#ifndef _KERNEL
#include <rpc/types.h>
#else
#include "../h/rw_lock.h"
#endif /* _KERNEL */

#ifdef __cplusplus
extern "C" {
#endif

/*
 * File descriptor to be used on xxx_create calls to get default descriptor
 */
#define	RPC_ANYSOCK	-1
#define	RPC_ANYFD	RPC_ANYSOCK
/*
 * The max size of the transport, if the size cannot be determined
 * by other means.
 */
#define	RPC_MAXDATASIZE 9000
#define	RPC_MAXADDRSIZE 1024

/*
 * The type of user of the STREAMS module rpcmod.
 */
#define	RPC_CLIENT	1
#define	RPC_SERVER	2
#define	RPC_TEST	3

#if defined(__STDC__) || defined(__cplusplus)
extern u_int __rpc_get_t_size(int, int32_t);
extern u_int __rpc_get_a_size(int32_t);
extern int __rpc_dtbsize(void);
extern struct netconfig *  __rpcfd_to_nconf(int, int);
extern int __rpc_matchserv(int, unsigned long);
extern  int  __rpc_get_default_domain(char **);
#else
extern u_int __rpc_get_t_size();
extern u_int __rpc_get_a_size();
extern int __rpc_dtbsize();
extern struct netconfig * __rpcfd_to_nconf();
extern int __rpc_matchserv();
extern  int __rpc_get_default_domain();
#endif

#ifndef _KERNEL

#if defined(__STDC__) || defined(__cplusplus)
bool_t rpc_control(int, void *);
#else
bool_t rpc_control();
#endif

/*
 * rpc_control commands
 */
#define	RPC_SVC_MTMODE_SET	1	/* set MT mode */
#define	RPC_SVC_MTMODE_GET	2	/* get MT mode */
#define	RPC_SVC_THRMAX_SET	3	/* set maximum number of threads */
#define	RPC_SVC_THRMAX_GET	4	/* get maximum number of threads */
#define	RPC_SVC_THRTOTAL_GET	5	/* get total number of threads */
#define	RPC_SVC_THRCREATES_GET	6	/* get total threads created */
#define	RPC_SVC_THRERRORS_GET	7	/* get total thread create errors */

#endif /* !_KERNEL */


#ifdef __cplusplus
}
#endif

#endif /* _RPC_RPCCOM_H */
