clnt.h revision 93032
174462Salfred/*	$NetBSD: clnt.h,v 1.14 2000/06/02 22:57:55 fvdl Exp $	*/
274462Salfred
31839Swollman/*
41839Swollman * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
51839Swollman * unrestricted use provided that this legend is included on all tape
61839Swollman * media and as a part of the software program in whole or part.  Users
71839Swollman * may copy or modify Sun RPC without charge, but are not authorized
81839Swollman * to license or distribute it to anyone else except as part of a product or
91839Swollman * program developed by the user.
108858Srgrimes *
111839Swollman * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
1213771Smpp * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
131839Swollman * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
148858Srgrimes *
151839Swollman * Sun RPC is provided with no support and without any obligation on the
161839Swollman * part of Sun Microsystems, Inc. to assist in its use, correction,
171839Swollman * modification or enhancement.
188858Srgrimes *
191839Swollman * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
201839Swollman * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
211839Swollman * OR ANY PART THEREOF.
228858Srgrimes *
231839Swollman * In no event will Sun Microsystems, Inc. be liable for any lost revenue
241839Swollman * or profits or other special, indirect and consequential damages, even if
251839Swollman * Sun has been advised of the possibility of such damages.
268858Srgrimes *
271839Swollman * Sun Microsystems, Inc.
281839Swollman * 2550 Garcia Avenue
291839Swollman * Mountain View, California  94043
301903Swollman *
3174462Salfred *	from: @(#)clnt.h 1.31 94/04/29 SMI
321903Swollman *	from: @(#)clnt.h	2.1 88/07/29 4.0 RPCSRC
3350473Speter * $FreeBSD: head/include/rpc/clnt.h 93032 2002-03-23 17:24:55Z imp $
341839Swollman */
351839Swollman
361839Swollman/*
371839Swollman * clnt.h - Client side remote procedure call interface.
381839Swollman *
391839Swollman * Copyright (C) 1984, Sun Microsystems, Inc.
401839Swollman */
411839Swollman
421903Swollman#ifndef _RPC_CLNT_H_
431903Swollman#define _RPC_CLNT_H_
4474462Salfred#include <rpc/clnt_stat.h>
451903Swollman#include <sys/cdefs.h>
4674462Salfred#include <netconfig.h>
4726211Swpaul#include <sys/un.h>
481839Swollman
491839Swollman/*
5074462Salfred * Well-known IPV6 RPC broadcast address.
511839Swollman */
5274462Salfred#define RPCB_MULTICAST_ADDR "ff02::202"
531839Swollman
5474462Salfred/*
5574462Salfred * the following errors are in general unrecoverable.  The caller
5674462Salfred * should give up rather than retry.
5774462Salfred */
5874462Salfred#define IS_UNRECOVERABLE_RPC(s) (((s) == RPC_AUTHERROR) || \
5974462Salfred	((s) == RPC_CANTENCODEARGS) || \
6074462Salfred	((s) == RPC_CANTDECODERES) || \
6174462Salfred	((s) == RPC_VERSMISMATCH) || \
6274462Salfred	((s) == RPC_PROCUNAVAIL) || \
6374462Salfred	((s) == RPC_PROGUNAVAIL) || \
6474462Salfred	((s) == RPC_PROGVERSMISMATCH) || \
6574462Salfred	((s) == RPC_CANTDECODEARGS))
661839Swollman
671839Swollman/*
681839Swollman * Error info.
691839Swollman */
701839Swollmanstruct rpc_err {
711839Swollman	enum clnt_stat re_status;
721839Swollman	union {
7313771Smpp		int RE_errno;		/* related system error */
741839Swollman		enum auth_stat RE_why;	/* why the auth error occurred */
751839Swollman		struct {
7674462Salfred			rpcvers_t low;	/* lowest version supported */
7774462Salfred			rpcvers_t high;	/* highest version supported */
781839Swollman		} RE_vers;
791839Swollman		struct {		/* maybe meaningful if RPC_FAILED */
8021059Speter			int32_t s1;
8121059Speter			int32_t s2;
821839Swollman		} RE_lb;		/* life boot & debugging only */
831839Swollman	} ru;
841839Swollman#define	re_errno	ru.RE_errno
851839Swollman#define	re_why		ru.RE_why
861839Swollman#define	re_vers		ru.RE_vers
871839Swollman#define	re_lb		ru.RE_lb
881839Swollman};
891839Swollman
901839Swollman
911839Swollman/*
921839Swollman * Client rpc handle.
9374462Salfred * Created by individual implementations
941839Swollman * Client is responsible for initializing auth, see e.g. auth_none.c.
951839Swollman */
9621059Spetertypedef struct __rpc_client {
971839Swollman	AUTH	*cl_auth;			/* authenticator */
981839Swollman	struct clnt_ops {
9921059Speter		/* call remote procedure */
10093032Simp		enum clnt_stat	(*cl_call)(struct __rpc_client *,
10174462Salfred				    rpcproc_t, xdrproc_t, caddr_t, xdrproc_t,
10293032Simp					caddr_t, struct timeval);
10321059Speter		/* abort a call */
10493032Simp		void		(*cl_abort)(struct __rpc_client *);
10521059Speter		/* get specific error code */
10693032Simp		void		(*cl_geterr)(struct __rpc_client *,
10793032Simp					struct rpc_err *);
10821059Speter		/* frees results */
10993032Simp		bool_t		(*cl_freeres)(struct __rpc_client *,
11093032Simp					xdrproc_t, caddr_t);
11121059Speter		/* destroy this structure */
11293032Simp		void		(*cl_destroy)(struct __rpc_client *);
11321059Speter		/* the ioctl() of rpc */
11493032Simp		bool_t          (*cl_control)(struct __rpc_client *, u_int,
11593032Simp				    char *);
1161839Swollman	} *cl_ops;
11774462Salfred	void 			*cl_private;	/* private stuff */
11874462Salfred	char			*cl_netid;	/* network token */
11974462Salfred	char			*cl_tp;		/* device name */
1201839Swollman} CLIENT;
1211839Swollman
1221839Swollman
1231839Swollman/*
12474462Salfred * Timers used for the pseudo-transport protocol when using datagrams
12574462Salfred */
12674462Salfredstruct rpc_timers {
12774462Salfred	u_short		rt_srtt;	/* smoothed round-trip time */
12874462Salfred	u_short		rt_deviate;	/* estimated deviation */
12974462Salfred	u_long		rt_rtxcur;	/* current (backed-off) rto */
13074462Salfred};
13174462Salfred
13274462Salfred/*
13374462Salfred * Feedback values used for possible congestion and rate control
13474462Salfred */
13574462Salfred#define FEEDBACK_REXMIT1	1	/* first retransmit */
13674462Salfred#define FEEDBACK_OK		2	/* no retransmits */
13774462Salfred
13874462Salfred/* Used to set version of portmapper used in broadcast */
13974462Salfred
14074462Salfred#define CLCR_SET_LOWVERS	3
14174462Salfred#define CLCR_GET_LOWVERS	4
14274462Salfred
14374462Salfred#define RPCSMALLMSGSIZE 400	/* a more reasonable packet size */
14474462Salfred
14574462Salfred/*
1461839Swollman * client side rpc interface ops
1471839Swollman *
1481839Swollman * Parameter types are:
1491839Swollman *
1501839Swollman */
1511839Swollman
1521839Swollman/*
1531839Swollman * enum clnt_stat
1541839Swollman * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
1551839Swollman * 	CLIENT *rh;
15674462Salfred *	rpcproc_t proc;
1571839Swollman *	xdrproc_t xargs;
1581839Swollman *	caddr_t argsp;
1591839Swollman *	xdrproc_t xres;
1601839Swollman *	caddr_t resp;
1611839Swollman *	struct timeval timeout;
1621839Swollman */
16374462Salfred#define	CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
16474462Salfred	((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
16574462Salfred		(caddr_t)(void *)argsp,	xres, (caddr_t)(void *)resp, secs))
16674462Salfred#define	clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
16774462Salfred	((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
16874462Salfred		(caddr_t)(void *)argsp, xres, (caddr_t)(void *)resp, secs))
1691839Swollman
1701839Swollman/*
1711839Swollman * void
1721839Swollman * CLNT_ABORT(rh);
1731839Swollman * 	CLIENT *rh;
1741839Swollman */
1751839Swollman#define	CLNT_ABORT(rh)	((*(rh)->cl_ops->cl_abort)(rh))
1761839Swollman#define	clnt_abort(rh)	((*(rh)->cl_ops->cl_abort)(rh))
1771839Swollman
1781839Swollman/*
1791839Swollman * struct rpc_err
1801839Swollman * CLNT_GETERR(rh);
1811839Swollman * 	CLIENT *rh;
1821839Swollman */
1831839Swollman#define	CLNT_GETERR(rh,errp)	((*(rh)->cl_ops->cl_geterr)(rh, errp))
1841839Swollman#define	clnt_geterr(rh,errp)	((*(rh)->cl_ops->cl_geterr)(rh, errp))
1851839Swollman
1861839Swollman
1871839Swollman/*
1881839Swollman * bool_t
1891839Swollman * CLNT_FREERES(rh, xres, resp);
1901839Swollman * 	CLIENT *rh;
1911839Swollman *	xdrproc_t xres;
1921839Swollman *	caddr_t resp;
1931839Swollman */
1941839Swollman#define	CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
1951839Swollman#define	clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
1961839Swollman
1971839Swollman/*
1981839Swollman * bool_t
1991839Swollman * CLNT_CONTROL(cl, request, info)
2001839Swollman *      CLIENT *cl;
2011839Swollman *      u_int request;
2021839Swollman *      char *info;
2031839Swollman */
2041839Swollman#define	CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
2051839Swollman#define	clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
2061839Swollman
2071839Swollman/*
20874462Salfred * control operations that apply to both udp and tcp transports
2091839Swollman */
21074462Salfred#define CLSET_TIMEOUT		1	/* set timeout (timeval) */
21174462Salfred#define CLGET_TIMEOUT		2	/* get timeout (timeval) */
21274462Salfred#define CLGET_SERVER_ADDR	3	/* get server's address (sockaddr) */
21374462Salfred#define CLGET_FD		6	/* get connections file descriptor */
21474462Salfred#define CLGET_SVC_ADDR		7	/* get server's address (netbuf) */
21574462Salfred#define CLSET_FD_CLOSE		8	/* close fd while clnt_destroy */
21674462Salfred#define CLSET_FD_NCLOSE		9	/* Do not close fd while clnt_destroy */
21774462Salfred#define CLGET_XID 		10	/* Get xid */
21874462Salfred#define CLSET_XID		11	/* Set xid */
21974462Salfred#define CLGET_VERS		12	/* Get version number */
22074462Salfred#define CLSET_VERS		13	/* Set version number */
22174462Salfred#define CLGET_PROG		14	/* Get program number */
22274462Salfred#define CLSET_PROG		15	/* Set program number */
22374462Salfred#define CLSET_SVC_ADDR		16	/* get server's address (netbuf) */
22474462Salfred#define CLSET_PUSH_TIMOD	17	/* push timod if not already present */
22574462Salfred#define CLSET_POP_TIMOD		18	/* pop timod */
2261839Swollman/*
22774462Salfred * Connectionless only control operations
2281839Swollman */
2291839Swollman#define CLSET_RETRY_TIMEOUT 4   /* set retry timeout (timeval) */
2301839Swollman#define CLGET_RETRY_TIMEOUT 5   /* get retry timeout (timeval) */
23174879Swpaul#define CLSET_ASYNC		19
23278678Siedowse#define CLSET_CONNECT		20	/* Use connect() for UDP. (int) */
2331839Swollman
2341839Swollman/*
2351839Swollman * void
2361839Swollman * CLNT_DESTROY(rh);
2371839Swollman * 	CLIENT *rh;
2381839Swollman */
2391839Swollman#define	CLNT_DESTROY(rh)	((*(rh)->cl_ops->cl_destroy)(rh))
2401839Swollman#define	clnt_destroy(rh)	((*(rh)->cl_ops->cl_destroy)(rh))
2411839Swollman
2421839Swollman
2431839Swollman/*
24413771Smpp * RPCTEST is a test program which is accessible on every rpc
2451839Swollman * transport/port.  It is used for testing, performance evaluation,
2461839Swollman * and network administration.
2471839Swollman */
2481839Swollman
24974462Salfred#define RPCTEST_PROGRAM		((rpcprog_t)1)
25074462Salfred#define RPCTEST_VERSION		((rpcvers_t)1)
25174462Salfred#define RPCTEST_NULL_PROC	((rpcproc_t)2)
25274462Salfred#define RPCTEST_NULL_BATCH_PROC	((rpcproc_t)3)
2531839Swollman
2541839Swollman/*
2551839Swollman * By convention, procedure 0 takes null arguments and returns them
2561839Swollman */
2571839Swollman
25874462Salfred#define NULLPROC ((rpcproc_t)0)
2591839Swollman
2601839Swollman/*
2611839Swollman * Below are the client handle creation routines for the various
2628858Srgrimes * implementations of client side rpc.  They can return NULL if a
2631839Swollman * creation failure occurs.
2641839Swollman */
2651839Swollman
2661839Swollman/*
26774462Salfred * Generic client creation routine. Supported protocols are those that
26874462Salfred * belong to the nettype namespace (/etc/netconfig).
2691839Swollman * CLIENT *
27074462Salfred * clnt_create(host, prog, vers, prot);
27174462Salfred *	const char *host; 	-- hostname
27274462Salfred *	const rpcprog_t prog;	-- program number
27374462Salfred *	const rpcvers_t vers;	-- version number
27474462Salfred *	const char *prot;	-- protocol
2751839Swollman */
2761903Swollman__BEGIN_DECLS
27793032Simpextern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t,
27893032Simp			   const char *);
27974462Salfred/*
28074462Salfred *
28174462Salfred * 	const char *hostname;			-- hostname
28274462Salfred *	const rpcprog_t prog;			-- program number
28374462Salfred *	const rpcvers_t vers;			-- version number
28474462Salfred *	const char *nettype;			-- network type
28574462Salfred */
2861839Swollman
2871839Swollman/*
28874462Salfred * Generic client creation routine. Supported protocols are which belong
28974462Salfred * to the nettype name space.
2901839Swollman */
29193032Simpextern CLIENT *clnt_create_vers(const char *, const rpcprog_t, rpcvers_t *,
29293032Simp				const rpcvers_t, const rpcvers_t,
29393032Simp				const char *);
29474462Salfred/*
29574462Salfred *	const char *host;		-- hostname
29674462Salfred *	const rpcprog_t prog;		-- program number
29774462Salfred *	rpcvers_t *vers_out;		-- servers highest available version
29874462Salfred *	const rpcvers_t vers_low;	-- low version number
29974462Salfred *	const rpcvers_t vers_high;	-- high version number
30074462Salfred *	const char *nettype;		-- network type
30174462Salfred */
3021839Swollman
3031839Swollman
3041839Swollman/*
30574462Salfred * Generic client creation routine. It takes a netconfig structure
30674462Salfred * instead of nettype
3071839Swollman */
30893032Simpextern CLIENT *clnt_tp_create(const char *, const rpcprog_t,
30993032Simp			      const rpcvers_t, const struct netconfig *);
31074462Salfred/*
31174462Salfred *	const char *hostname;			-- hostname
31274462Salfred *	const rpcprog_t prog;			-- program number
31374462Salfred *	const rpcvers_t vers;			-- version number
31474462Salfred *	const struct netconfig *netconf; 	-- network config structure
31574462Salfred */
3161839Swollman
31774462Salfred/*
31874462Salfred * Generic TLI create routine. Only provided for compatibility.
31974462Salfred */
3201903Swollman
32193032Simpextern CLIENT *clnt_tli_create(const int, const struct netconfig *,
32293032Simp			       const struct netbuf *, const rpcprog_t,
32393032Simp			       const rpcvers_t, const u_int, const u_int);
3241839Swollman/*
32574462Salfred *	const register int fd;		-- fd
32674462Salfred *	const struct netconfig *nconf;	-- netconfig structure
32774462Salfred *	const struct netbuf *svcaddr;		-- servers address
32874462Salfred *	const u_long prog;			-- program number
32974462Salfred *	const u_long vers;			-- version number
33074462Salfred *	const u_int sendsz;			-- send size
33174462Salfred *	const u_int recvsz;			-- recv size
3321839Swollman */
3331839Swollman
33474462Salfred/*
33574462Salfred * Low level clnt create routine for connectionful transports, e.g. tcp.
33674462Salfred */
33793032Simpextern CLIENT *clnt_vc_create(const int, const struct netbuf *,
33893032Simp			      const rpcprog_t, const rpcvers_t,
33993032Simp			      const u_int, const u_int);
34074462Salfred/*
34184487Swpaul * Added for compatibility to old rpc 4.0. Obsoleted by clnt_vc_create().
34284487Swpaul */
34393032Simpextern CLIENT *clntunix_create(struct sockaddr_un *,
34493032Simp			       u_long, u_long, int *, u_int, u_int);
34584487Swpaul/*
34674462Salfred *	const int fd;				-- open file descriptor
34774462Salfred *	const struct netbuf *svcaddr;		-- servers address
34874462Salfred *	const rpcprog_t prog;			-- program number
34974462Salfred *	const rpcvers_t vers;			-- version number
35074462Salfred *	const u_int sendsz;			-- buffer recv size
35174462Salfred *	const u_int recvsz;			-- buffer send size
35274462Salfred */
3531903Swollman
3541839Swollman/*
35574462Salfred * Low level clnt create routine for connectionless transports, e.g. udp.
35674462Salfred */
35793032Simpextern CLIENT *clnt_dg_create(const int, const struct netbuf *,
35893032Simp			      const rpcprog_t, const rpcvers_t,
35993032Simp			      const u_int, const u_int);
36074462Salfred/*
36174462Salfred *	const int fd;				-- open file descriptor
36274462Salfred *	const struct netbuf *svcaddr;		-- servers address
36374462Salfred *	const rpcprog_t program;		-- program number
36474462Salfred *	const rpcvers_t version;		-- version number
36574462Salfred *	const u_int sendsz;			-- buffer recv size
36674462Salfred *	const u_int recvsz;			-- buffer send size
36774462Salfred */
36874462Salfred
36974462Salfred/*
37074462Salfred * Memory based rpc (for speed check and testing)
37126211Swpaul * CLIENT *
37274462Salfred * clnt_raw_create(prog, vers)
37326211Swpaul *	u_long prog;
37474462Salfred *	u_long vers;
37526211Swpaul */
37693032Simpextern CLIENT *clnt_raw_create(rpcprog_t, rpcvers_t);
37774462Salfred
37826211Swpaul__END_DECLS
37926211Swpaul
38026211Swpaul
38126211Swpaul/*
3821839Swollman * Print why creation failed
3831839Swollman */
3841903Swollman__BEGIN_DECLS
38593032Simpextern void clnt_pcreateerror(const char *);			/* stderr */
38693032Simpextern char *clnt_spcreateerror(const char *);			/* string */
3871903Swollman__END_DECLS
3881839Swollman
3891839Swollman/*
3901839Swollman * Like clnt_perror(), but is more verbose in its output
3918858Srgrimes */
3921903Swollman__BEGIN_DECLS
39393032Simpextern void clnt_perrno(enum clnt_stat);		/* stderr */
39493032Simpextern char *clnt_sperrno(enum clnt_stat);		/* string */
3951903Swollman__END_DECLS
3961839Swollman
3971839Swollman/*
3981839Swollman * Print an English error message, given the client error code
3991839Swollman */
4001903Swollman__BEGIN_DECLS
40193032Simpextern void clnt_perror(CLIENT *, const char *);	 	/* stderr */
40293032Simpextern char *clnt_sperror(CLIENT *, const char *);		/* string */
4031903Swollman__END_DECLS
4041839Swollman
4051903Swollman
4068858Srgrimes/*
4071839Swollman * If a creation fails, the following allows the user to figure out why.
4081839Swollman */
4091839Swollmanstruct rpc_createerr {
4101839Swollman	enum clnt_stat cf_stat;
4111839Swollman	struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
4121839Swollman};
4131839Swollman
41474462Salfred#ifdef _THREAD_SAFE
41574462Salfred__BEGIN_DECLS
41693032Simpextern struct rpc_createerr	*__rpc_createerr(void);
41774462Salfred__END_DECLS
41874462Salfred#define rpc_createerr		(*(__rpc_createerr()))
41974462Salfred#else
4201839Swollmanextern struct rpc_createerr rpc_createerr;
42174462Salfred#endif /* _THREAD_SAFE */
4221839Swollman
42374462Salfred/*
42474462Salfred * The simplified interface:
42574462Salfred * enum clnt_stat
42674462Salfred * rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype)
42774462Salfred *	const char *host;
42874462Salfred *	const rpcprog_t prognum;
42974462Salfred *	const rpcvers_t versnum;
43074462Salfred *	const rpcproc_t procnum;
43174462Salfred *	const xdrproc_t inproc, outproc;
43274462Salfred *	const char *in;
43374462Salfred *	char *out;
43474462Salfred *	const char *nettype;
43574462Salfred */
43674462Salfred__BEGIN_DECLS
43793032Simpextern enum clnt_stat rpc_call(const char *, const rpcprog_t,
43893032Simp			       const rpcvers_t, const rpcproc_t,
43993032Simp			       const xdrproc_t, const char *,
44093032Simp			       const xdrproc_t, char *, const char *);
44174462Salfred__END_DECLS
4421839Swollman
44374462Salfred/*
44474462Salfred * RPC broadcast interface
44574462Salfred * The call is broadcasted to all locally connected nets.
44674462Salfred *
44774462Salfred * extern enum clnt_stat
44874462Salfred * rpc_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp,
44974462Salfred *			eachresult, nettype)
45074462Salfred *	const rpcprog_t		prog;		-- program number
45174462Salfred *	const rpcvers_t		vers;		-- version number
45274462Salfred *	const rpcproc_t		proc;		-- procedure number
45374462Salfred *	const xdrproc_t	xargs;		-- xdr routine for args
45474462Salfred *	caddr_t		argsp;		-- pointer to args
45574462Salfred *	const xdrproc_t	xresults;	-- xdr routine for results
45674462Salfred *	caddr_t		resultsp;	-- pointer to results
45774462Salfred *	const resultproc_t	eachresult;	-- call with each result
45874462Salfred *	const char		*nettype;	-- Transport type
45974462Salfred *
46074462Salfred * For each valid response received, the procedure eachresult is called.
46174462Salfred * Its form is:
46274462Salfred *		done = eachresult(resp, raddr, nconf)
46374462Salfred *			bool_t done;
46474462Salfred *			caddr_t resp;
46574462Salfred *			struct netbuf *raddr;
46674462Salfred *			struct netconfig *nconf;
46774462Salfred * where resp points to the results of the call and raddr is the
46874462Salfred * address if the responder to the broadcast.  nconf is the transport
46974462Salfred * on which the response was received.
47074462Salfred *
47174462Salfred * extern enum clnt_stat
47274462Salfred * rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
47374462Salfred *			eachresult, inittime, waittime, nettype)
47474462Salfred *	const rpcprog_t		prog;		-- program number
47574462Salfred *	const rpcvers_t		vers;		-- version number
47674462Salfred *	const rpcproc_t		proc;		-- procedure number
47774462Salfred *	const xdrproc_t	xargs;		-- xdr routine for args
47874462Salfred *	caddr_t		argsp;		-- pointer to args
47974462Salfred *	const xdrproc_t	xresults;	-- xdr routine for results
48074462Salfred *	caddr_t		resultsp;	-- pointer to results
48174462Salfred *	const resultproc_t	eachresult;	-- call with each result
48274462Salfred *	const int 		inittime;	-- how long to wait initially
48374462Salfred *	const int 		waittime;	-- maximum time to wait
48474462Salfred *	const char		*nettype;	-- Transport type
48574462Salfred */
4861839Swollman
48793032Simptypedef bool_t (*resultproc_t)(caddr_t, ...);
48874462Salfred
48974462Salfred__BEGIN_DECLS
49093032Simpextern enum clnt_stat rpc_broadcast(const rpcprog_t, const rpcvers_t,
49193032Simp				    const rpcproc_t, const xdrproc_t,
49293032Simp				    caddr_t, const xdrproc_t, caddr_t,
49393032Simp				    const resultproc_t, const char *);
49493032Simpextern enum clnt_stat rpc_broadcast_exp(const rpcprog_t, const rpcvers_t,
49593032Simp					const rpcproc_t, const xdrproc_t,
49693032Simp					caddr_t, const xdrproc_t, caddr_t,
49793032Simp					const resultproc_t, const int,
49893032Simp					const int, const char *);
49974462Salfred__END_DECLS
50074462Salfred
50174462Salfred/* For backward compatibility */
50274462Salfred#include <rpc/clnt_soc.h>
50374462Salfred
50474462Salfred#endif /* !_RPC_CLNT_H_ */
505