1 .\" Copyright 1989 AT&T
2 .\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
3 .\" $NetBSD: rpc_svc_calls.3,v 1.1 2000/06/02 23:11:13 fvdl Exp $
8 .Nm svc_dg_enablecache ,
13 .Nm svc_getreq_common ,
16 .Nm svc_getrpccaller ,
20 .Nd library routines for RPC servers
26 .Fn svc_dg_enablecache "SVCXPRT *xprt" "const unsigned cache_size"
30 .Fn svc_freeargs "const SVCXPRT *xprt" "const xdrproc_t inproc" "caddr_t in"
32 .Fn svc_getargs "const SVCXPRT *xprt" "const xdrproc_t inproc" "caddr_t in"
34 .Fn svc_getreq_common "const int fd"
36 .Fn svc_getreq_poll "struct pollfd *pfdp" "const int pollretval"
38 .Fn svc_getreqset "fd_set * rdfds"
40 .Fn svc_getrpccaller "const SVCXPRT *xprt"
41 .Ft "struct cmsgcred *"
42 .Fn __svc_getcallercreds "const SVCXPRT *xprt"
43 .Vt struct pollfd svc_pollset[FD_SETSIZE];
47 .Fn svc_sendreply "SVCXPRT *xprt" "xdrproc_t outproc" "void *out"
49 These routines are part of the
51 library which allows C language programs to make procedure
52 calls on other machines across the network.
54 These routines are associated with the server side of the
56 Some of them are called by the server side dispatch function,
60 are called when the server is initiated.
62 .\" In the current implementation, the service transport handle,
64 .\" contains a single data area for decoding arguments and encoding results.
65 .\" Therefore, this structure cannot be freely shared between threads that call
66 .\" functions that do this.
67 .\" Routines on this page that are affected by this
68 .\" restriction are marked as unsafe for MT applications.
72 for the definition of the
75 .Bl -tag -width __svc_getcallercreds()
76 .It Fn svc_dg_enablecache
77 This function allocates a duplicate request cache for the
83 Once enabled, there is no way to disable caching.
84 This routine returns 0 if space necessary for a cache of the given size
85 was successfully allocated, and 1 otherwise.
87 This function, when called by any of the RPC server procedure or
92 As currently implemented,
97 If RPC server activity is to be resumed,
98 services must be reregistered with the RPC library
99 either through one of the
106 has global scope and ends all RPC server activity.
108 .Vt fd_set Va svc_fdset
110 A global variable reflecting the
111 RPC server's read file descriptor bit mask; it is suitable as an argument
115 This is only of interest
116 if service implementors do not call
118 but rather do their own asynchronous event processing.
119 This variable is read-only (do not pass its address to
121 yet it may change after calls to
123 or any creation routines.
125 A function macro that frees any data allocated by the
126 RPC/XDR system when it decoded the arguments to a service procedure
131 if the results were successfully
136 A function macro that decodes the arguments of an
137 RPC request associated with the RPC
138 service transport handle
143 is the address where the arguments will be placed;
146 routine used to decode the arguments.
149 if decoding succeeds, and
152 .It Fn svc_getreq_common
153 This routine is called to handle a request on the given
155 .It Fn svc_getreq_poll
156 This routine is only of interest if a service implementor
159 but instead implements custom asynchronous event processing.
162 has determined that an RPC request has arrived on some RPC
165 is the return value from
171 structures on which the
174 It is assumed to be an array large enough to
175 contain the maximal number of descriptors allowed.
177 This routine is only of interest if a service implementor
180 but instead implements custom asynchronous event processing.
183 has determined that an RPC
184 request has arrived on some RPC file descriptors;
186 is the resultant read file descriptor bit mask.
187 The routine returns when all file descriptors
188 associated with the value of
191 .It Fn svc_getrpccaller
192 The approved way of getting the network address of the caller
193 of a procedure associated with the
194 RPC service transport handle
196 .It Fn __svc_getcallercreds
198 this macro is specific to
200 and thus not portable.
201 This macro returns a pointer to a
203 structure, defined in
205 identifying the calling client.
206 This only works if the client is
207 calling the server over an
211 .Vt struct pollfd Va svc_pollset[FD_SETSIZE] ;
216 structures derived from
218 It is suitable as an argument to the
225 is made in the current implementation in
227 Service implementors who do not call
229 and who wish to use this array must perform this derivation themselves.
231 This routine never returns.
233 requests to arrive, and calls the appropriate service
237 This procedure is usually waiting for the
239 system call to return.
241 Called by an RPC service's dispatch routine to send the results of a
242 remote procedure call.
246 is the request's associated transport handle;
249 routine which is used to encode the results; and
251 is the address of the results.
262 .Xr rpc_svc_create 3 ,