xref: /onnv-gate/usr/src/lib/libbc/inc/include/rpc/clnt.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
23*0Sstevel@tonic-gate 
24*0Sstevel@tonic-gate /*
25*0Sstevel@tonic-gate  * clnt.h - Client side remote procedure call interface.
26*0Sstevel@tonic-gate  *
27*0Sstevel@tonic-gate  * Copyright (C) 1984, Sun Microsystems, Inc.
28*0Sstevel@tonic-gate  */
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #ifndef _rpc_clnt_h
31*0Sstevel@tonic-gate #define	_rpc_clnt_h
32*0Sstevel@tonic-gate 
33*0Sstevel@tonic-gate /*
34*0Sstevel@tonic-gate  * Rpc calls return an enum clnt_stat.  This should be looked at more,
35*0Sstevel@tonic-gate  * since each implementation is required to live with this (implementation
36*0Sstevel@tonic-gate  * independent) list of errors.
37*0Sstevel@tonic-gate  */
38*0Sstevel@tonic-gate enum clnt_stat {
39*0Sstevel@tonic-gate 	RPC_SUCCESS=0,			/* call succeeded */
40*0Sstevel@tonic-gate 	/*
41*0Sstevel@tonic-gate 	 * local errors
42*0Sstevel@tonic-gate 	 */
43*0Sstevel@tonic-gate 	RPC_CANTENCODEARGS=1,		/* can't encode arguments */
44*0Sstevel@tonic-gate 	RPC_CANTDECODERES=2,		/* can't decode results */
45*0Sstevel@tonic-gate 	RPC_CANTSEND=3,			/* failure in sending call */
46*0Sstevel@tonic-gate 	RPC_CANTRECV=4,			/* failure in receiving result */
47*0Sstevel@tonic-gate 	RPC_TIMEDOUT=5,			/* call timed out */
48*0Sstevel@tonic-gate 	RPC_INTR=18,			/* call interrupted */
49*0Sstevel@tonic-gate 	/*
50*0Sstevel@tonic-gate 	 * remote errors
51*0Sstevel@tonic-gate 	 */
52*0Sstevel@tonic-gate 	RPC_VERSMISMATCH=6,		/* rpc versions not compatible */
53*0Sstevel@tonic-gate 	RPC_AUTHERROR=7,		/* authentication error */
54*0Sstevel@tonic-gate 	RPC_PROGUNAVAIL=8,		/* program not available */
55*0Sstevel@tonic-gate 	RPC_PROGVERSMISMATCH=9,		/* program version mismatched */
56*0Sstevel@tonic-gate 	RPC_PROCUNAVAIL=10,		/* procedure unavailable */
57*0Sstevel@tonic-gate 	RPC_CANTDECODEARGS=11,		/* decode arguments error */
58*0Sstevel@tonic-gate 	RPC_SYSTEMERROR=12,		/* generic "other problem" */
59*0Sstevel@tonic-gate 
60*0Sstevel@tonic-gate 	/*
61*0Sstevel@tonic-gate 	 * callrpc & clnt_create errors
62*0Sstevel@tonic-gate 	 */
63*0Sstevel@tonic-gate 	RPC_UNKNOWNHOST=13,		/* unknown host name */
64*0Sstevel@tonic-gate 	RPC_UNKNOWNPROTO=17,		/* unkown protocol */
65*0Sstevel@tonic-gate 
66*0Sstevel@tonic-gate 	/*
67*0Sstevel@tonic-gate 	 * _ create errors
68*0Sstevel@tonic-gate 	 */
69*0Sstevel@tonic-gate 	RPC_PMAPFAILURE=14,		/* the pmapper failed in its call */
70*0Sstevel@tonic-gate 	RPC_PROGNOTREGISTERED=15,	/* remote program is not registered */
71*0Sstevel@tonic-gate 	/*
72*0Sstevel@tonic-gate 	 * unspecified error
73*0Sstevel@tonic-gate 	 */
74*0Sstevel@tonic-gate 	RPC_FAILED=16
75*0Sstevel@tonic-gate };
76*0Sstevel@tonic-gate 
77*0Sstevel@tonic-gate 
78*0Sstevel@tonic-gate /*
79*0Sstevel@tonic-gate  * Error info.
80*0Sstevel@tonic-gate  */
81*0Sstevel@tonic-gate struct rpc_err {
82*0Sstevel@tonic-gate 	enum clnt_stat re_status;
83*0Sstevel@tonic-gate 	union {
84*0Sstevel@tonic-gate 		int RE_errno;		/* realated system error */
85*0Sstevel@tonic-gate 		enum auth_stat RE_why;	/* why the auth error occurred */
86*0Sstevel@tonic-gate 		struct {
87*0Sstevel@tonic-gate 			u_long low;	/* lowest verion supported */
88*0Sstevel@tonic-gate 			u_long high;	/* highest verion supported */
89*0Sstevel@tonic-gate 		} RE_vers;
90*0Sstevel@tonic-gate 		struct {		/* maybe meaningful if RPC_FAILED */
91*0Sstevel@tonic-gate 			long s1;
92*0Sstevel@tonic-gate 			long s2;
93*0Sstevel@tonic-gate 		} RE_lb;		/* life boot & debugging only */
94*0Sstevel@tonic-gate 	} ru;
95*0Sstevel@tonic-gate #define	re_errno	ru.RE_errno
96*0Sstevel@tonic-gate #define	re_why		ru.RE_why
97*0Sstevel@tonic-gate #define	re_vers		ru.RE_vers
98*0Sstevel@tonic-gate #define	re_lb		ru.RE_lb
99*0Sstevel@tonic-gate };
100*0Sstevel@tonic-gate 
101*0Sstevel@tonic-gate 
102*0Sstevel@tonic-gate /*
103*0Sstevel@tonic-gate  * Client rpc handle.
104*0Sstevel@tonic-gate  * Created by individual implementations, see e.g. rpc_udp.c.
105*0Sstevel@tonic-gate  * Client is responsible for initializing auth, see e.g. auth_none.c.
106*0Sstevel@tonic-gate  */
107*0Sstevel@tonic-gate typedef struct {
108*0Sstevel@tonic-gate 	AUTH	*cl_auth;			/* authenticator */
109*0Sstevel@tonic-gate 	struct clnt_ops {
110*0Sstevel@tonic-gate 		enum clnt_stat	(*cl_call)();	/* call remote procedure */
111*0Sstevel@tonic-gate 		void		(*cl_abort)();	/* abort a call */
112*0Sstevel@tonic-gate 		void		(*cl_geterr)();	/* get specific error code */
113*0Sstevel@tonic-gate 		bool_t		(*cl_freeres)(); /* frees results */
114*0Sstevel@tonic-gate 		void		(*cl_destroy)(); /* destroy this structure */
115*0Sstevel@tonic-gate 		bool_t		(*cl_control)(); /* the ioctl() of rpc */
116*0Sstevel@tonic-gate 	} *cl_ops;
117*0Sstevel@tonic-gate 	caddr_t			cl_private;	/* private stuff */
118*0Sstevel@tonic-gate } CLIENT;
119*0Sstevel@tonic-gate 
120*0Sstevel@tonic-gate 
121*0Sstevel@tonic-gate /*
122*0Sstevel@tonic-gate  * client side rpc interface ops
123*0Sstevel@tonic-gate  *
124*0Sstevel@tonic-gate  * Parameter types are:
125*0Sstevel@tonic-gate  *
126*0Sstevel@tonic-gate  */
127*0Sstevel@tonic-gate 
128*0Sstevel@tonic-gate /*
129*0Sstevel@tonic-gate  * enum clnt_stat
130*0Sstevel@tonic-gate  * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
131*0Sstevel@tonic-gate  * 	CLIENT *rh;
132*0Sstevel@tonic-gate  *	u_long proc;
133*0Sstevel@tonic-gate  *	xdrproc_t xargs;
134*0Sstevel@tonic-gate  *	caddr_t argsp;
135*0Sstevel@tonic-gate  *	xdrproc_t xres;
136*0Sstevel@tonic-gate  *	caddr_t resp;
137*0Sstevel@tonic-gate  *	struct timeval timeout;
138*0Sstevel@tonic-gate  */
139*0Sstevel@tonic-gate #define	CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs)	\
140*0Sstevel@tonic-gate 	((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
141*0Sstevel@tonic-gate #define	clnt_call(rh, proc, xargs, argsp, xres, resp, secs)	\
142*0Sstevel@tonic-gate 	((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
143*0Sstevel@tonic-gate 
144*0Sstevel@tonic-gate /*
145*0Sstevel@tonic-gate  * void
146*0Sstevel@tonic-gate  * CLNT_ABORT(rh);
147*0Sstevel@tonic-gate  * 	CLIENT *rh;
148*0Sstevel@tonic-gate  */
149*0Sstevel@tonic-gate #define	CLNT_ABORT(rh)	((*(rh)->cl_ops->cl_abort)(rh))
150*0Sstevel@tonic-gate #define	clnt_abort(rh)	((*(rh)->cl_ops->cl_abort)(rh))
151*0Sstevel@tonic-gate 
152*0Sstevel@tonic-gate /*
153*0Sstevel@tonic-gate  * struct rpc_err
154*0Sstevel@tonic-gate  * CLNT_GETERR(rh);
155*0Sstevel@tonic-gate  * 	CLIENT *rh;
156*0Sstevel@tonic-gate  */
157*0Sstevel@tonic-gate #define	CLNT_GETERR(rh, errp)	((*(rh)->cl_ops->cl_geterr)(rh, errp))
158*0Sstevel@tonic-gate #define	clnt_geterr(rh, errp)	((*(rh)->cl_ops->cl_geterr)(rh, errp))
159*0Sstevel@tonic-gate 
160*0Sstevel@tonic-gate 
161*0Sstevel@tonic-gate /*
162*0Sstevel@tonic-gate  * bool_t
163*0Sstevel@tonic-gate  * CLNT_FREERES(rh, xres, resp);
164*0Sstevel@tonic-gate  * 	CLIENT *rh;
165*0Sstevel@tonic-gate  *	xdrproc_t xres;
166*0Sstevel@tonic-gate  *	caddr_t resp;
167*0Sstevel@tonic-gate  */
168*0Sstevel@tonic-gate #define	CLNT_FREERES(rh, xres, resp) ((*(rh)->cl_ops->cl_freeres)\
169*0Sstevel@tonic-gate 	(rh, xres, resp))
170*0Sstevel@tonic-gate #define	clnt_freeres(rh, xres, resp) ((*(rh)->cl_ops->cl_freeres)\
171*0Sstevel@tonic-gate 	(rh, xres, resp))
172*0Sstevel@tonic-gate 
173*0Sstevel@tonic-gate /*
174*0Sstevel@tonic-gate  * bool_t
175*0Sstevel@tonic-gate  * CLNT_CONTROL(cl, request, info)
176*0Sstevel@tonic-gate  *	CLIENT *cl;
177*0Sstevel@tonic-gate  *	u_int request;
178*0Sstevel@tonic-gate  *	char *info;
179*0Sstevel@tonic-gate  */
180*0Sstevel@tonic-gate #define	CLNT_CONTROL(cl, rq, in) ((*(cl)->cl_ops->cl_control)(cl, rq, in))
181*0Sstevel@tonic-gate #define	clnt_control(cl, rq, in) ((*(cl)->cl_ops->cl_control)(cl, rq, in))
182*0Sstevel@tonic-gate 
183*0Sstevel@tonic-gate /*
184*0Sstevel@tonic-gate  * control operations that apply to both udp and tcp transports
185*0Sstevel@tonic-gate  */
186*0Sstevel@tonic-gate #define	CLSET_TIMEOUT		1   /* set timeout (timeval) */
187*0Sstevel@tonic-gate #define	CLGET_TIMEOUT		2   /* get timeout (timeval) */
188*0Sstevel@tonic-gate #define	CLGET_SERVER_ADDR	3   /* get server's address (sockaddr) */
189*0Sstevel@tonic-gate #define	CLGET_FD		6   /* get connections file descriptor */
190*0Sstevel@tonic-gate #define	CLSET_FD_CLOSE		8   /* close fd while clnt_destroy */
191*0Sstevel@tonic-gate #define	CLSET_FD_NCLOSE		9   /* Do not close fd while clnt_destroy */
192*0Sstevel@tonic-gate /*
193*0Sstevel@tonic-gate  * udp only control operations
194*0Sstevel@tonic-gate  */
195*0Sstevel@tonic-gate #define	CLSET_RETRY_TIMEOUT 4   /* set retry timeout (timeval) */
196*0Sstevel@tonic-gate #define	CLGET_RETRY_TIMEOUT 5   /* get retry timeout (timeval) */
197*0Sstevel@tonic-gate 
198*0Sstevel@tonic-gate /*
199*0Sstevel@tonic-gate  * void
200*0Sstevel@tonic-gate  * CLNT_DESTROY(rh);
201*0Sstevel@tonic-gate  * 	CLIENT *rh;
202*0Sstevel@tonic-gate  */
203*0Sstevel@tonic-gate #define	CLNT_DESTROY(rh)	((*(rh)->cl_ops->cl_destroy)(rh))
204*0Sstevel@tonic-gate #define	clnt_destroy(rh)	((*(rh)->cl_ops->cl_destroy)(rh))
205*0Sstevel@tonic-gate 
206*0Sstevel@tonic-gate 
207*0Sstevel@tonic-gate /*
208*0Sstevel@tonic-gate  * RPCTEST is a test program which is accessable on every rpc
209*0Sstevel@tonic-gate  * transport/port.  It is used for testing, performance evaluation,
210*0Sstevel@tonic-gate  * and network administration.
211*0Sstevel@tonic-gate  */
212*0Sstevel@tonic-gate 
213*0Sstevel@tonic-gate #define	RPCTEST_PROGRAM		((u_long)1)
214*0Sstevel@tonic-gate #define	RPCTEST_VERSION		((u_long)1)
215*0Sstevel@tonic-gate #define	RPCTEST_NULL_PROC	((u_long)2)
216*0Sstevel@tonic-gate #define	RPCTEST_NULL_BATCH_PROC	((u_long)3)
217*0Sstevel@tonic-gate 
218*0Sstevel@tonic-gate /*
219*0Sstevel@tonic-gate  * By convention, procedure 0 takes null arguments and returns them
220*0Sstevel@tonic-gate  */
221*0Sstevel@tonic-gate 
222*0Sstevel@tonic-gate #define	NULLPROC ((u_long)0)
223*0Sstevel@tonic-gate 
224*0Sstevel@tonic-gate /*
225*0Sstevel@tonic-gate  * Below are the client handle creation routines for the various
226*0Sstevel@tonic-gate  * implementations of client side rpc.  They can return NULL if a
227*0Sstevel@tonic-gate  * creation failure occurs.
228*0Sstevel@tonic-gate  */
229*0Sstevel@tonic-gate 
230*0Sstevel@tonic-gate #ifndef KERNEL
231*0Sstevel@tonic-gate /*
232*0Sstevel@tonic-gate  * Memory based rpc (for speed check and testing)
233*0Sstevel@tonic-gate  * CLIENT *
234*0Sstevel@tonic-gate  * clntraw_create(prog, vers)
235*0Sstevel@tonic-gate  *	u_long prog;
236*0Sstevel@tonic-gate  *	u_long vers;
237*0Sstevel@tonic-gate  */
238*0Sstevel@tonic-gate extern CLIENT *clntraw_create();
239*0Sstevel@tonic-gate 
240*0Sstevel@tonic-gate 
241*0Sstevel@tonic-gate /*
242*0Sstevel@tonic-gate  * Generic client creation routine. Supported protocols are "udp" and "tcp"
243*0Sstevel@tonic-gate  */
244*0Sstevel@tonic-gate extern CLIENT *
245*0Sstevel@tonic-gate clnt_create(/*host, prog, vers, prot*/); /*
246*0Sstevel@tonic-gate 	char *host; 	-- hostname
247*0Sstevel@tonic-gate 	u_long prog;	-- program number
248*0Sstevel@tonic-gate 	u_long vers;	-- version number
249*0Sstevel@tonic-gate 	char *prot;	-- protocol
250*0Sstevel@tonic-gate */
251*0Sstevel@tonic-gate 
252*0Sstevel@tonic-gate /*
253*0Sstevel@tonic-gate  * Generic client creation routine. Supported protocols are "udp" and "tcp"
254*0Sstevel@tonic-gate  */
255*0Sstevel@tonic-gate extern CLIENT *
256*0Sstevel@tonic-gate clnt_create_vers(/*host, prog, vers_out, vers_low, vers_high, prot*/);
257*0Sstevel@tonic-gate /*
258*0Sstevel@tonic-gate 	char *host; 	-- hostname
259*0Sstevel@tonic-gate 	u_long prog;	-- program number
260*0Sstevel@tonic-gate 	u_long *vers_out;	-- servers best  version number
261*0Sstevel@tonic-gate 	u_long vers_low;	-- low version number
262*0Sstevel@tonic-gate 	u_long vers_high;	-- high version number
263*0Sstevel@tonic-gate 	char *prot;	-- protocol
264*0Sstevel@tonic-gate */
265*0Sstevel@tonic-gate 
266*0Sstevel@tonic-gate 
267*0Sstevel@tonic-gate 
268*0Sstevel@tonic-gate /*
269*0Sstevel@tonic-gate  * TCP based rpc
270*0Sstevel@tonic-gate  * CLIENT *
271*0Sstevel@tonic-gate  * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
272*0Sstevel@tonic-gate  *	struct sockaddr_in *raddr;
273*0Sstevel@tonic-gate  *	u_long prog;
274*0Sstevel@tonic-gate  *	u_long version;
275*0Sstevel@tonic-gate  *	register int *sockp;
276*0Sstevel@tonic-gate  *	u_int sendsz;
277*0Sstevel@tonic-gate  *	u_int recvsz;
278*0Sstevel@tonic-gate  */
279*0Sstevel@tonic-gate extern CLIENT *clnttcp_create();
280*0Sstevel@tonic-gate 
281*0Sstevel@tonic-gate /*
282*0Sstevel@tonic-gate  * UDP based rpc.
283*0Sstevel@tonic-gate  * CLIENT *
284*0Sstevel@tonic-gate  * clntudp_create(raddr, program, version, wait, sockp)
285*0Sstevel@tonic-gate  *	struct sockaddr_in *raddr;
286*0Sstevel@tonic-gate  *	u_long program;
287*0Sstevel@tonic-gate  *	u_long version;
288*0Sstevel@tonic-gate  *	struct timeval wait;
289*0Sstevel@tonic-gate  *	int *sockp;
290*0Sstevel@tonic-gate  *
291*0Sstevel@tonic-gate  * Same as above, but you specify max packet sizes.
292*0Sstevel@tonic-gate  * CLIENT *
293*0Sstevel@tonic-gate  * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
294*0Sstevel@tonic-gate  *	struct sockaddr_in *raddr;
295*0Sstevel@tonic-gate  *	u_long program;
296*0Sstevel@tonic-gate  *	u_long version;
297*0Sstevel@tonic-gate  *	struct timeval wait;
298*0Sstevel@tonic-gate  *	int *sockp;
299*0Sstevel@tonic-gate  *	u_int sendsz;
300*0Sstevel@tonic-gate  *	u_int recvsz;
301*0Sstevel@tonic-gate  */
302*0Sstevel@tonic-gate extern CLIENT *clntudp_create();
303*0Sstevel@tonic-gate extern CLIENT *clntudp_bufcreate();
304*0Sstevel@tonic-gate 
305*0Sstevel@tonic-gate /*
306*0Sstevel@tonic-gate  * Print why creation failed
307*0Sstevel@tonic-gate  */
308*0Sstevel@tonic-gate void clnt_pcreateerror(/* char *msg */);	/* stderr */
309*0Sstevel@tonic-gate char *clnt_spcreateerror(/* char *msg */);	/* string */
310*0Sstevel@tonic-gate 
311*0Sstevel@tonic-gate /*
312*0Sstevel@tonic-gate  * Like clnt_perror(), but is more verbose in its output
313*0Sstevel@tonic-gate  */
314*0Sstevel@tonic-gate void clnt_perrno(/* enum clnt_stat num */);	/* stderr */
315*0Sstevel@tonic-gate 
316*0Sstevel@tonic-gate /*
317*0Sstevel@tonic-gate  * Print an English error message, given the client error code
318*0Sstevel@tonic-gate  */
319*0Sstevel@tonic-gate void clnt_perror(/* CLIENT *clnt, char *msg */); 	/* stderr */
320*0Sstevel@tonic-gate char *clnt_sperror(/* CLIENT *clnt, char *msg */);	/* string */
321*0Sstevel@tonic-gate 
322*0Sstevel@tonic-gate /*
323*0Sstevel@tonic-gate  * If a creation fails, the following allows the user to figure out why.
324*0Sstevel@tonic-gate  */
325*0Sstevel@tonic-gate struct rpc_createerr {
326*0Sstevel@tonic-gate 	enum clnt_stat cf_stat;
327*0Sstevel@tonic-gate 	struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
328*0Sstevel@tonic-gate };
329*0Sstevel@tonic-gate 
330*0Sstevel@tonic-gate extern struct rpc_createerr rpc_createerr;
331*0Sstevel@tonic-gate 
332*0Sstevel@tonic-gate 
333*0Sstevel@tonic-gate #endif /* !KERNEL */
334*0Sstevel@tonic-gate 
335*0Sstevel@tonic-gate /*
336*0Sstevel@tonic-gate  * Copy error message to buffer.
337*0Sstevel@tonic-gate  */
338*0Sstevel@tonic-gate char *clnt_sperrno(/* enum clnt_stat num */);	/* string */
339*0Sstevel@tonic-gate 
340*0Sstevel@tonic-gate 
341*0Sstevel@tonic-gate #ifdef KERNEL
342*0Sstevel@tonic-gate /*
343*0Sstevel@tonic-gate  * Kernel udp based rpc
344*0Sstevel@tonic-gate  * CLIENT *
345*0Sstevel@tonic-gate  * clntkudp_create(addr, pgm, vers)
346*0Sstevel@tonic-gate  *	struct sockaddr_in *addr;
347*0Sstevel@tonic-gate  *	u_long pgm;
348*0Sstevel@tonic-gate  *	u_long vers;
349*0Sstevel@tonic-gate  */
350*0Sstevel@tonic-gate extern CLIENT *clntkudp_create();
351*0Sstevel@tonic-gate #endif
352*0Sstevel@tonic-gate 
353*0Sstevel@tonic-gate /*
354*0Sstevel@tonic-gate  * Timers used for the pseudo-transport protocol when using datagrams
355*0Sstevel@tonic-gate  */
356*0Sstevel@tonic-gate struct rpc_timers {
357*0Sstevel@tonic-gate 	u_short		rt_srtt;	/* smoothed round-trip time */
358*0Sstevel@tonic-gate 	u_short		rt_deviate;	/* estimated deviation */
359*0Sstevel@tonic-gate 	u_long		rt_rtxcur;	/* current (backed-off) rto */
360*0Sstevel@tonic-gate };
361*0Sstevel@tonic-gate 
362*0Sstevel@tonic-gate /*
363*0Sstevel@tonic-gate  * Feedback values used for possible congestion and rate control
364*0Sstevel@tonic-gate  */
365*0Sstevel@tonic-gate #define	FEEDBACK_REXMIT1	1	/* first retransmit */
366*0Sstevel@tonic-gate #define	FEEDBACK_OK		2	/* no retransmits */
367*0Sstevel@tonic-gate 
368*0Sstevel@tonic-gate #define	UDPMSGSIZE	8800	/* rpc imposed limit on udp msg size */
369*0Sstevel@tonic-gate #define	RPCSMALLMSGSIZE	400	/* a more reasonable packet size */
370*0Sstevel@tonic-gate 
371*0Sstevel@tonic-gate #ifdef	KERNEL
372*0Sstevel@tonic-gate /*
373*0Sstevel@tonic-gate  *	Alloc_xid presents an interface which kernel RPC clients
374*0Sstevel@tonic-gate  *	should use to allocate their XIDs.  Its implementation
375*0Sstevel@tonic-gate  *	may change over time (for example, to allow sharing of
376*0Sstevel@tonic-gate  *	XIDs between the kernel and user-level applications, so
377*0Sstevel@tonic-gate  *	all XID allocation should be done by calling alloc_xid().
378*0Sstevel@tonic-gate  */
379*0Sstevel@tonic-gate extern u_long	clntxid;
380*0Sstevel@tonic-gate #define	alloc_xid()	(clntxid++)
381*0Sstevel@tonic-gate #endif
382*0Sstevel@tonic-gate 
383*0Sstevel@tonic-gate #endif /*!_rpc_clnt_h*/
384