Deleted Added
full compact
clnt.h (180025) clnt.h (184588)
1/* $NetBSD: clnt.h,v 1.14 2000/06/02 22:57:55 fvdl Exp $ */
2
3/*
4 * The contents of this file are subject to the Sun Standards
5 * License Version 1.0 the (the "License";) You may not use
6 * this file except in compliance with the License. You may
7 * obtain a copy of the License at lib/libc/rpc/LICENSE
8 *

--- 33 unchanged lines hidden (view full) ---

42 * Sun has been advised of the possibility of such damages.
43 *
44 * Sun Microsystems, Inc.
45 * 2550 Garcia Avenue
46 * Mountain View, California 94043
47 *
48 * from: @(#)clnt.h 1.31 94/04/29 SMI
49 * from: @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC
1/* $NetBSD: clnt.h,v 1.14 2000/06/02 22:57:55 fvdl Exp $ */
2
3/*
4 * The contents of this file are subject to the Sun Standards
5 * License Version 1.0 the (the "License";) You may not use
6 * this file except in compliance with the License. You may
7 * obtain a copy of the License at lib/libc/rpc/LICENSE
8 *

--- 33 unchanged lines hidden (view full) ---

42 * Sun has been advised of the possibility of such damages.
43 *
44 * Sun Microsystems, Inc.
45 * 2550 Garcia Avenue
46 * Mountain View, California 94043
47 *
48 * from: @(#)clnt.h 1.31 94/04/29 SMI
49 * from: @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC
50 * $FreeBSD: head/sys/rpc/clnt.h 180025 2008-06-26 10:21:54Z dfr $
50 * $FreeBSD: head/sys/rpc/clnt.h 184588 2008-11-03 10:38:00Z dfr $
51 */
52
53/*
54 * clnt.h - Client side remote procedure call interface.
55 *
56 * Copyright (c) 1986-1991,1994-1999 by Sun Microsystems, Inc.
57 * All rights reserved.
58 */

--- 54 unchanged lines hidden (view full) ---

113#ifdef _KERNEL
114/*
115 * Functions of this type may be used to receive notification when RPC
116 * calls have to be re-transmitted etc.
117 */
118typedef void rpc_feedback(int cmd, int procnum, void *);
119
120/*
51 */
52
53/*
54 * clnt.h - Client side remote procedure call interface.
55 *
56 * Copyright (c) 1986-1991,1994-1999 by Sun Microsystems, Inc.
57 * All rights reserved.
58 */

--- 54 unchanged lines hidden (view full) ---

113#ifdef _KERNEL
114/*
115 * Functions of this type may be used to receive notification when RPC
116 * calls have to be re-transmitted etc.
117 */
118typedef void rpc_feedback(int cmd, int procnum, void *);
119
120/*
121 * Timers used for the pseudo-transport protocol when using datagrams
122 */
123struct rpc_timers {
124 u_short rt_srtt; /* smoothed round-trip time */
125 u_short rt_deviate; /* estimated deviation */
126 u_long rt_rtxcur; /* current (backed-off) rto */
127};
128
129/*
121 * A structure used with CLNT_CALL_EXT to pass extra information used
122 * while processing an RPC call.
123 */
124struct rpc_callextra {
125 AUTH *rc_auth; /* auth handle to use for this call */
126 rpc_feedback *rc_feedback; /* callback for retransmits etc. */
127 void *rc_feedback_arg; /* argument for callback */
130 * A structure used with CLNT_CALL_EXT to pass extra information used
131 * while processing an RPC call.
132 */
133struct rpc_callextra {
134 AUTH *rc_auth; /* auth handle to use for this call */
135 rpc_feedback *rc_feedback; /* callback for retransmits etc. */
136 void *rc_feedback_arg; /* argument for callback */
137 struct rpc_timers *rc_timers; /* optional RTT timers */
138 struct rpc_err rc_err; /* detailed call status */
128};
129#endif
130
131/*
132 * Client rpc handle.
133 * Created by individual implementations
134 * Client is responsible for initializing auth, see e.g. auth_none.c.
135 */
136typedef struct __rpc_client {
137#ifdef _KERNEL
138 volatile u_int cl_refs; /* reference count */
139 AUTH *cl_auth; /* authenticator */
140 struct clnt_ops {
141 /* call remote procedure */
142 enum clnt_stat (*cl_call)(struct __rpc_client *,
139};
140#endif
141
142/*
143 * Client rpc handle.
144 * Created by individual implementations
145 * Client is responsible for initializing auth, see e.g. auth_none.c.
146 */
147typedef struct __rpc_client {
148#ifdef _KERNEL
149 volatile u_int cl_refs; /* reference count */
150 AUTH *cl_auth; /* authenticator */
151 struct clnt_ops {
152 /* call remote procedure */
153 enum clnt_stat (*cl_call)(struct __rpc_client *,
143 struct rpc_callextra *, rpcproc_t, xdrproc_t, void *,
144 xdrproc_t, void *, struct timeval);
154 struct rpc_callextra *, rpcproc_t,
155 struct mbuf *, struct mbuf **, struct timeval);
145 /* abort a call */
146 void (*cl_abort)(struct __rpc_client *);
147 /* get specific error code */
148 void (*cl_geterr)(struct __rpc_client *,
149 struct rpc_err *);
150 /* frees results */
151 bool_t (*cl_freeres)(struct __rpc_client *,
152 xdrproc_t, void *);
156 /* abort a call */
157 void (*cl_abort)(struct __rpc_client *);
158 /* get specific error code */
159 void (*cl_geterr)(struct __rpc_client *,
160 struct rpc_err *);
161 /* frees results */
162 bool_t (*cl_freeres)(struct __rpc_client *,
163 xdrproc_t, void *);
164 /* close the connection and terminate pending RPCs */
165 void (*cl_close)(struct __rpc_client *);
153 /* destroy this structure */
154 void (*cl_destroy)(struct __rpc_client *);
155 /* the ioctl() of rpc */
156 bool_t (*cl_control)(struct __rpc_client *, u_int,
157 void *);
158 } *cl_ops;
159#else
160 AUTH *cl_auth; /* authenticator */

--- 17 unchanged lines hidden (view full) ---

178 void *);
179 } *cl_ops;
180#endif
181 void *cl_private; /* private stuff */
182 char *cl_netid; /* network token */
183 char *cl_tp; /* device name */
184} CLIENT;
185
166 /* destroy this structure */
167 void (*cl_destroy)(struct __rpc_client *);
168 /* the ioctl() of rpc */
169 bool_t (*cl_control)(struct __rpc_client *, u_int,
170 void *);
171 } *cl_ops;
172#else
173 AUTH *cl_auth; /* authenticator */

--- 17 unchanged lines hidden (view full) ---

191 void *);
192 } *cl_ops;
193#endif
194 void *cl_private; /* private stuff */
195 char *cl_netid; /* network token */
196 char *cl_tp; /* device name */
197} CLIENT;
198
186/*
187 * Timers used for the pseudo-transport protocol when using datagrams
188 */
189struct rpc_timers {
190 u_short rt_srtt; /* smoothed round-trip time */
191 u_short rt_deviate; /* estimated deviation */
192 u_long rt_rtxcur; /* current (backed-off) rto */
193};
194
195/*
196 * Feedback values used for possible congestion and rate control
197 */
198#define FEEDBACK_OK 1 /* no retransmits */
199#define FEEDBACK_REXMIT1 2 /* first retransmit */
200#define FEEDBACK_REXMIT2 3 /* second and subsequent retransmit */
201#define FEEDBACK_RECONNECT 4 /* client reconnect */
202

--- 14 unchanged lines hidden (view full) ---

217#ifdef _KERNEL
218#define CLNT_ACQUIRE(rh) \
219 refcount_acquire(&(rh)->cl_refs)
220#define CLNT_RELEASE(rh) \
221 if (refcount_release(&(rh)->cl_refs)) \
222 CLNT_DESTROY(rh)
223
224/*
199/*
200 * Feedback values used for possible congestion and rate control
201 */
202#define FEEDBACK_OK 1 /* no retransmits */
203#define FEEDBACK_REXMIT1 2 /* first retransmit */
204#define FEEDBACK_REXMIT2 3 /* second and subsequent retransmit */
205#define FEEDBACK_RECONNECT 4 /* client reconnect */
206

--- 14 unchanged lines hidden (view full) ---

221#ifdef _KERNEL
222#define CLNT_ACQUIRE(rh) \
223 refcount_acquire(&(rh)->cl_refs)
224#define CLNT_RELEASE(rh) \
225 if (refcount_release(&(rh)->cl_refs)) \
226 CLNT_DESTROY(rh)
227
228/*
229 * void
230 * CLNT_CLOSE(rh);
231 * CLIENT *rh;
232 */
233#define CLNT_CLOSE(rh) ((*(rh)->cl_ops->cl_close)(rh))
234
235enum clnt_stat clnt_call_private(CLIENT *, struct rpc_callextra *, rpcproc_t,
236 xdrproc_t, void *, xdrproc_t, void *, struct timeval);
237
238/*
225 * enum clnt_stat
239 * enum clnt_stat
240 * CLNT_CALL_MBUF(rh, ext, proc, mreq, mrepp, timeout)
241 * CLIENT *rh;
242 * struct rpc_callextra *ext;
243 * rpcproc_t proc;
244 * struct mbuf *mreq;
245 * struct mbuf **mrepp;
246 * struct timeval timeout;
247 *
248 * Call arguments in mreq which is consumed by the call (even if there
249 * is an error). Results returned in *mrepp.
250 */
251#define CLNT_CALL_MBUF(rh, ext, proc, mreq, mrepp, secs) \
252 ((*(rh)->cl_ops->cl_call)(rh, ext, proc, mreq, mrepp, secs))
253
254/*
255 * enum clnt_stat
226 * CLNT_CALL_EXT(rh, ext, proc, xargs, argsp, xres, resp, timeout)
227 * CLIENT *rh;
228 * struct rpc_callextra *ext;
229 * rpcproc_t proc;
230 * xdrproc_t xargs;
231 * void *argsp;
232 * xdrproc_t xres;
233 * void *resp;
234 * struct timeval timeout;
235 */
236#define CLNT_CALL_EXT(rh, ext, proc, xargs, argsp, xres, resp, secs) \
256 * CLNT_CALL_EXT(rh, ext, proc, xargs, argsp, xres, resp, timeout)
257 * CLIENT *rh;
258 * struct rpc_callextra *ext;
259 * rpcproc_t proc;
260 * xdrproc_t xargs;
261 * void *argsp;
262 * xdrproc_t xres;
263 * void *resp;
264 * struct timeval timeout;
265 */
266#define CLNT_CALL_EXT(rh, ext, proc, xargs, argsp, xres, resp, secs) \
237 ((*(rh)->cl_ops->cl_call)(rh, ext, proc, xargs, \
238 argsp, xres, resp, secs))
267 clnt_call_private(rh, ext, proc, xargs, \
268 argsp, xres, resp, secs)
239#endif
240
241/*
242 * enum clnt_stat
243 * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
244 * CLIENT *rh;
245 * rpcproc_t proc;
246 * xdrproc_t xargs;
247 * void *argsp;
248 * xdrproc_t xres;
249 * void *resp;
250 * struct timeval timeout;
251 */
252#ifdef _KERNEL
269#endif
270
271/*
272 * enum clnt_stat
273 * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
274 * CLIENT *rh;
275 * rpcproc_t proc;
276 * xdrproc_t xargs;
277 * void *argsp;
278 * xdrproc_t xres;
279 * void *resp;
280 * struct timeval timeout;
281 */
282#ifdef _KERNEL
253#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
254 ((*(rh)->cl_ops->cl_call)(rh, NULL, proc, xargs, \
255 argsp, xres, resp, secs))
256#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
257 ((*(rh)->cl_ops->cl_call)(rh, NULL, proc, xargs, \
258 argsp, xres, resp, secs))
283#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
284 clnt_call_private(rh, NULL, proc, xargs, \
285 argsp, xres, resp, secs)
286#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
287 clnt_call_private(rh, NULL, proc, xargs, \
288 argsp, xres, resp, secs)
259#else
260#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
261 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
262 argsp, xres, resp, secs))
263#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
264 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
265 argsp, xres, resp, secs))
266#endif

--- 68 unchanged lines hidden (view full) ---

335 * and sleeps are non-interruptible by default.
336 */
337#define CLSET_WAITCHAN 21 /* set string to use in msleep call */
338#define CLGET_WAITCHAN 22 /* get string used in msleep call */
339#define CLSET_INTERRUPTIBLE 23 /* set interruptible flag */
340#define CLGET_INTERRUPTIBLE 24 /* set interruptible flag */
341#define CLSET_RETRIES 25 /* set retry count for reconnect */
342#define CLGET_RETRIES 26 /* get retry count for reconnect */
289#else
290#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
291 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
292 argsp, xres, resp, secs))
293#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
294 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \
295 argsp, xres, resp, secs))
296#endif

--- 68 unchanged lines hidden (view full) ---

365 * and sleeps are non-interruptible by default.
366 */
367#define CLSET_WAITCHAN 21 /* set string to use in msleep call */
368#define CLGET_WAITCHAN 22 /* get string used in msleep call */
369#define CLSET_INTERRUPTIBLE 23 /* set interruptible flag */
370#define CLGET_INTERRUPTIBLE 24 /* set interruptible flag */
371#define CLSET_RETRIES 25 /* set retry count for reconnect */
372#define CLGET_RETRIES 26 /* get retry count for reconnect */
373#define CLSET_PRIVPORT 27 /* set privileged source port flag */
374#define CLGET_PRIVPORT 28 /* get privileged source port flag */
343#endif
344
345
346/*
347 * void
348 * CLNT_DESTROY(rh);
349 * CLIENT *rh;
350 */

--- 348 unchanged lines hidden ---
375#endif
376
377
378/*
379 * void
380 * CLNT_DESTROY(rh);
381 * CLIENT *rh;
382 */

--- 348 unchanged lines hidden ---