/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* onc720 src/oncplus/usr/include/tirpc/rpc/clnt_soc.h 1.5.1.2            */
/*                                                                        */
/* Licensed Materials - Property of IBM                                   */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 1996,2012              */
/* All Rights Reserved                                                    */
/*                                                                        */
/* US Government Users Restricted Rights - Use, duplication or            */
/* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.      */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
/*
 * Copyright (c) 1984 - 1991 by Sun Microsystems, Inc.
 */

/*
 * clnt.h - Client side remote procedure call interface.
 */

#ifndef _RPC_CLNT_SOC_H
#define	_RPC_CLNT_SOC_H

/* #pragma ident	"@(#)clnt_soc.h	1.15	97/04/14 SMI" */

/* derived from clnt_soc.h 1.3 88/12/17 SMI 	*/

/*
 * All the following declarations are only for backward compatibility
 * with SUNOS 4.0.
 */

#include <sys/socket.h>
#include <netinet/in.h>
#include <rpc/xdr.h>

#ifdef	__cplusplus
extern "C" {
#endif

#define	UDPMSGSIZE	8800	/* rpc imposed limit on udp msg size */

/*
 * callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
 *	char *host;
 *	u_long prognum, versnum, procnum;
 *	xdrproc_t inproc, outproc;
 *	char *in, *out;
 */
extern int callrpc(char *, u_long, u_long, u_long, xdrproc_t, char *,
		   xdrproc_t, char *);


/*
 * TCP based rpc
 * CLIENT *
 * clnttcp_create(raddr, prog, vers, fdp, sendsz, recvsz)
 *	struct sockaddr_in *raddr;
 *	rpcprog_t prog;
 *	rpcvers_t version;
 *	int *fdp;
 *	uint_t sendsz;
 *	uint_t recvsz;
 */
extern CLIENT *clnttcp_create(struct sockaddr_in *, rpcprog_t, rpcvers_t,
			      int *, uint_t, uint_t);
extern CLIENT *clnttcp6_create(struct sockaddr_in6 *, rpcprog_t, rpcvers_t,
			       int *, uint_t, uint_t);


/*
 * UDP based rpc.
 * CLIENT *
 * clntudp_create(raddr, program, version, wait, fdp)
 *	struct sockaddr_in *raddr;
 *	rpcprog_t program;
 *	rpcvers_t version;
 *	struct timeval wait;
 *	int *fdp;
 *
 * Same as above, but you specify max packet sizes.
 * CLIENT *
 * clntudp_bufcreate(raddr, program, version, wait, fdp, sendsz, recvsz)
 *	struct sockaddr_in *raddr;
 *	rpcprog_t program;
 *	rpcvers_t version;
 *	struct timeval wait;
 *	int *fdp;
 *	uint_t sendsz;
 *	uint_t recvsz;
 *
 */
extern CLIENT *clntudp_create(struct sockaddr_in *, rpcprog_t, rpcvers_t,
			      struct timeval, int *);
extern CLIENT *clntudp6_create(struct sockaddr_in6 *, rpcprog_t, rpcvers_t,
			       struct timeval, int *);
extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, rpcprog_t, rpcvers_t,
				 struct timeval, int *, uint_t, uint_t);
extern CLIENT *clntudp6_bufcreate(struct sockaddr_in6 *, rpcprog_t, rpcvers_t,
				  struct timeval, int *, uint_t, uint_t);

/*
 * Memory based rpc (for speed check and testing)
 * CLIENT *
 * clntraw_create(prog, vers)
 *	u_long prog;
 *	u_long vers;
 */
extern CLIENT *clntraw_create(u_long, u_long);

/*
 * get the local host's IP address without consulting
 * name service library functions
 * void
 * get_myaddress(addr)
 * 	struct sockaddr_in  *addr;
 */
extern void get_myaddress(struct sockaddr_in *);

/*
 * get the local host's IPv6 IP address without consulting
 * name service library functions
 * void
 * get_myaddress6(addr)
 * 	struct sockaddr_in6  *addr;
 */
extern void get_myaddress6(struct sockaddr_in6 *);

/*
 * get the port number on the host for the rpc program,version and proto
 * void
 * getrpcport(host, prognum, versnum, proto)
 * 	char *host;
 *	int  prognum;
 *	int  versnum;
 *	int  proto;
 */
extern u_short getrpcport(char *, int, int, int);

#ifdef	__cplusplus
}
#endif

#endif /* _RPC_CLNT_SOC_H */