clnt.h (177633) | clnt.h (180025) |
---|---|
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 177633 2008-03-26 15:23:12Z dfr $ | 50 * $FreeBSD: head/sys/rpc/clnt.h 180025 2008-06-26 10:21:54Z 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 */ 59 60#ifndef _RPC_CLNT_H_ 61#define _RPC_CLNT_H_ 62#include <rpc/clnt_stat.h> 63#include <sys/cdefs.h> 64#ifdef _KERNEL | 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 */ 59 60#ifndef _RPC_CLNT_H_ 61#define _RPC_CLNT_H_ 62#include <rpc/clnt_stat.h> 63#include <sys/cdefs.h> 64#ifdef _KERNEL |
65#include <sys/refcount.h> |
|
65#include <rpc/netconfig.h> 66#else 67#include <netconfig.h> 68#endif 69#include <sys/un.h> 70 71/* 72 * Well-known IPV6 RPC broadcast address. --- 31 unchanged lines hidden (view full) --- 104 } RE_lb; /* life boot & debugging only */ 105 } ru; 106#define re_errno ru.RE_errno 107#define re_why ru.RE_why 108#define re_vers ru.RE_vers 109#define re_lb ru.RE_lb 110}; 111 | 66#include <rpc/netconfig.h> 67#else 68#include <netconfig.h> 69#endif 70#include <sys/un.h> 71 72/* 73 * Well-known IPV6 RPC broadcast address. --- 31 unchanged lines hidden (view full) --- 105 } RE_lb; /* life boot & debugging only */ 106 } ru; 107#define re_errno ru.RE_errno 108#define re_why ru.RE_why 109#define re_vers ru.RE_vers 110#define re_lb ru.RE_lb 111}; 112 |
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 *); |
|
112 113/* | 119 120/* |
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 */ 128}; 129#endif 130 131/* |
|
114 * Client rpc handle. 115 * Created by individual implementations 116 * Client is responsible for initializing auth, see e.g. auth_none.c. 117 */ 118typedef struct __rpc_client { | 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 */ |
|
119 AUTH *cl_auth; /* authenticator */ 120 struct clnt_ops { 121 /* call remote procedure */ 122 enum clnt_stat (*cl_call)(struct __rpc_client *, | 139 AUTH *cl_auth; /* authenticator */ 140 struct clnt_ops { 141 /* call remote procedure */ 142 enum clnt_stat (*cl_call)(struct __rpc_client *, |
123 rpcproc_t, xdrproc_t, void *, xdrproc_t, 124 void *, struct timeval); | 143 struct rpc_callextra *, rpcproc_t, xdrproc_t, void *, 144 xdrproc_t, void *, struct timeval); |
125 /* abort a call */ 126 void (*cl_abort)(struct __rpc_client *); 127 /* get specific error code */ 128 void (*cl_geterr)(struct __rpc_client *, 129 struct rpc_err *); 130 /* frees results */ 131 bool_t (*cl_freeres)(struct __rpc_client *, 132 xdrproc_t, void *); 133 /* destroy this structure */ 134 void (*cl_destroy)(struct __rpc_client *); 135 /* the ioctl() of rpc */ 136 bool_t (*cl_control)(struct __rpc_client *, u_int, 137 void *); 138 } *cl_ops; | 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 *); 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 */ 161 struct clnt_ops { 162 /* call remote procedure */ 163 enum clnt_stat (*cl_call)(struct __rpc_client *, 164 rpcproc_t, xdrproc_t, void *, xdrproc_t, 165 void *, struct timeval); 166 /* abort a call */ 167 void (*cl_abort)(struct __rpc_client *); 168 /* get specific error code */ 169 void (*cl_geterr)(struct __rpc_client *, 170 struct rpc_err *); 171 /* frees results */ 172 bool_t (*cl_freeres)(struct __rpc_client *, 173 xdrproc_t, void *); 174 /* destroy this structure */ 175 void (*cl_destroy)(struct __rpc_client *); 176 /* the ioctl() of rpc */ 177 bool_t (*cl_control)(struct __rpc_client *, u_int, 178 void *); 179 } *cl_ops; 180#endif |
|
139 void *cl_private; /* private stuff */ 140 char *cl_netid; /* network token */ 141 char *cl_tp; /* device name */ 142} CLIENT; 143 | 181 void *cl_private; /* private stuff */ 182 char *cl_netid; /* network token */ 183 char *cl_tp; /* device name */ 184} CLIENT; 185 |
144 | |
145/* 146 * Timers used for the pseudo-transport protocol when using datagrams 147 */ 148struct rpc_timers { 149 u_short rt_srtt; /* smoothed round-trip time */ 150 u_short rt_deviate; /* estimated deviation */ 151 u_long rt_rtxcur; /* current (backed-off) rto */ 152}; 153 154/* 155 * Feedback values used for possible congestion and rate control 156 */ | 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 */ |
157#define FEEDBACK_REXMIT1 1 /* first retransmit */ 158#define FEEDBACK_OK 2 /* no retransmits */ | 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 */ |
159 160/* Used to set version of portmapper used in broadcast */ 161 162#define CLCR_SET_LOWVERS 3 163#define CLCR_GET_LOWVERS 4 164 165#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */ 166 167/* 168 * client side rpc interface ops 169 * 170 * Parameter types are: 171 * 172 */ 173 | 202 203/* Used to set version of portmapper used in broadcast */ 204 205#define CLCR_SET_LOWVERS 3 206#define CLCR_GET_LOWVERS 4 207 208#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */ 209 210/* 211 * client side rpc interface ops 212 * 213 * Parameter types are: 214 * 215 */ 216 |
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 |
|
174/* 175 * enum clnt_stat | 224/* 225 * 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) \ 237 ((*(rh)->cl_ops->cl_call)(rh, ext, proc, xargs, \ 238 argsp, xres, resp, secs)) 239#endif 240 241/* 242 * enum clnt_stat |
|
176 * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout) 177 * CLIENT *rh; 178 * rpcproc_t proc; 179 * xdrproc_t xargs; 180 * void *argsp; 181 * xdrproc_t xres; 182 * void *resp; 183 * struct timeval timeout; 184 */ | 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 */ |
185#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ 186 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \ | 252#ifdef _KERNEL 253#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ 254 ((*(rh)->cl_ops->cl_call)(rh, NULL, proc, xargs, \ |
187 argsp, xres, resp, secs)) | 255 argsp, xres, resp, secs)) |
188#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ 189 ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, \ | 256#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ 257 ((*(rh)->cl_ops->cl_call)(rh, NULL, proc, xargs, \ |
190 argsp, xres, resp, secs)) | 258 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 |
|
191 192/* 193 * void 194 * CLNT_ABORT(rh); 195 * CLIENT *rh; 196 */ 197#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh)) 198#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) --- 58 unchanged lines hidden (view full) --- 257/* 258 * Kernel control operations. The default msleep string is "rpcrecv", 259 * and sleeps are non-interruptible by default. 260 */ 261#define CLSET_WAITCHAN 21 /* set string to use in msleep call */ 262#define CLGET_WAITCHAN 22 /* get string used in msleep call */ 263#define CLSET_INTERRUPTIBLE 23 /* set interruptible flag */ 264#define CLGET_INTERRUPTIBLE 24 /* set interruptible flag */ | 267 268/* 269 * void 270 * CLNT_ABORT(rh); 271 * CLIENT *rh; 272 */ 273#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh)) 274#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) --- 58 unchanged lines hidden (view full) --- 333/* 334 * Kernel control operations. The default msleep string is "rpcrecv", 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 */ |
|
265#endif 266 267 268/* 269 * void 270 * CLNT_DESTROY(rh); 271 * CLIENT *rh; 272 */ --- 256 unchanged lines hidden (view full) --- 529extern struct rpc_createerr rpc_createerr; 530#else 531__BEGIN_DECLS 532extern struct rpc_createerr *__rpc_createerr(void); 533__END_DECLS 534#define rpc_createerr (*(__rpc_createerr())) 535#endif 536 | 343#endif 344 345 346/* 347 * void 348 * CLNT_DESTROY(rh); 349 * CLIENT *rh; 350 */ --- 256 unchanged lines hidden (view full) --- 607extern struct rpc_createerr rpc_createerr; 608#else 609__BEGIN_DECLS 610extern struct rpc_createerr *__rpc_createerr(void); 611__END_DECLS 612#define rpc_createerr (*(__rpc_createerr())) 613#endif 614 |
615#ifndef _KERNEL |
|
537/* 538 * The simplified interface: 539 * enum clnt_stat 540 * rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype) 541 * const char *host; 542 * const rpcprog_t prognum; 543 * const rpcvers_t versnum; 544 * const rpcproc_t procnum; --- 62 unchanged lines hidden (view full) --- 607 const resultproc_t, const char *); 608extern enum clnt_stat rpc_broadcast_exp(const rpcprog_t, const rpcvers_t, 609 const rpcproc_t, const xdrproc_t, 610 caddr_t, const xdrproc_t, caddr_t, 611 const resultproc_t, const int, 612 const int, const char *); 613__END_DECLS 614 | 616/* 617 * The simplified interface: 618 * enum clnt_stat 619 * rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype) 620 * const char *host; 621 * const rpcprog_t prognum; 622 * const rpcvers_t versnum; 623 * const rpcproc_t procnum; --- 62 unchanged lines hidden (view full) --- 686 const resultproc_t, const char *); 687extern enum clnt_stat rpc_broadcast_exp(const rpcprog_t, const rpcvers_t, 688 const rpcproc_t, const xdrproc_t, 689 caddr_t, const xdrproc_t, caddr_t, 690 const resultproc_t, const int, 691 const int, const char *); 692__END_DECLS 693 |
615#ifndef _KERNEL | |
616/* For backward compatibility */ 617#include <rpc/clnt_soc.h> 618#endif 619 620#endif /* !_RPC_CLNT_H_ */ | 694/* For backward compatibility */ 695#include <rpc/clnt_soc.h> 696#endif 697 698#endif /* !_RPC_CLNT_H_ */ |