1 .\" @(#)rpc_svc_calls.3n 1.28 93/05/10 SMI; from SVr4
2 .\" Copyright 1989 AT&T
3 .\" @(#)rpc_svc_calls 1.5 89/07/25 SMI;
4 .\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
5 .\" $NetBSD: rpc_svc_calls.3,v 1.1 2000/06/02 23:11:13 fvdl Exp $
6 .\" $FreeBSD: src/lib/libc/rpc/rpc_svc_calls.3,v 1.8 2003/09/08 19:57:15 ru Exp $
11 .Nm svc_dg_enablecache ,
16 .Nm svc_getreq_common ,
19 .Nm svc_getrpccaller ,
23 .Nd library routines for RPC servers
29 .Fn svc_dg_enablecache "SVCXPRT *xprt" "const unsigned cache_size"
33 .Fn svc_freeargs "const SVCXPRT *xprt" "const xdrproc_t inproc" "caddr_t in"
35 .Fn svc_getargs "const SVCXPRT *xprt" "const xdrproc_t inproc" "caddr_t in"
37 .Fn svc_getreq_common "const int fd"
39 .Fn svc_getreq_poll "struct pollfd *pfdp" "const int pollretval"
41 .Fn svc_getreqset "fd_set * rdfds"
43 .Fn svc_getrpccaller "const SVCXPRT *xprt"
44 .Ft "struct cmsgcred *"
45 .Fn __svc_getcallercreds "const SVCXPRT *xprt"
46 .Vt struct pollfd svc_pollset[FD_SETSIZE];
50 .Fn svc_sendreply "SVCXPRT *xprt" "xdrproc_t outproc" "char *out"
52 These routines are part of the
54 library which allows C language programs to make procedure
55 calls on other machines across the network.
57 These routines are associated with the server side of the
59 Some of them are called by the server side dispatch function,
63 are called when the server is initiated.
65 .\" In the current implementation, the service transport handle,
67 .\" contains a single data area for decoding arguments and encoding results.
68 .\" Therefore, this structure cannot be freely shared between threads that call
69 .\" functions that do this.
70 .\" Routines on this page that are affected by this
71 .\" restriction are marked as unsafe for MT applications.
75 for the definition of the
78 .Bl -tag -width __svc_getcallercreds()
79 .It Fn svc_dg_enablecache
80 This function allocates a duplicate request cache for the
86 Once enabled, there is no way to disable caching.
87 This routine returns 0 if space necessary for a cache of the given size
88 was successfully allocated, and 1 otherwise.
90 This function, when called by any of the RPC server procedure or
95 As currently implemented,
100 If RPC server activity is to be resumed,
101 services must be reregistered with the RPC library
102 either through one of the
109 has global scope and ends all RPC server activity.
111 .Vt fd_set Va svc_fdset
113 A global variable reflecting the
114 RPC server's read file descriptor bit mask; it is suitable as an argument
118 This is only of interest
119 if service implementors do not call
121 but rather do their own asynchronous event processing.
122 This variable is read-only (do not pass its address to
124 yet it may change after calls to
126 or any creation routines.
128 A function macro that frees any data allocated by the
129 RPC/XDR system when it decoded the arguments to a service procedure
134 if the results were successfully
139 A function macro that decodes the arguments of an
140 RPC request associated with the RPC
141 service transport handle
146 is the address where the arguments will be placed;
149 routine used to decode the arguments.
152 if decoding succeeds, and
155 .It Fn svc_getreq_common
156 This routine is called to handle a request on the given
158 .It Fn svc_getreq_poll
159 This routine is only of interest if a service implementor
162 but instead implements custom asynchronous event processing.
165 has determined that an RPC request has arrived on some RPC
168 is the return value from
174 structures on which the
177 It is assumed to be an array large enough to
178 contain the maximal number of descriptors allowed.
180 This routine is only of interest if a service implementor
183 but instead implements custom asynchronous event processing.
186 has determined that an RPC
187 request has arrived on some RPC file descriptors;
189 is the resultant read file descriptor bit mask.
190 The routine returns when all file descriptors
191 associated with the value of
194 .It Fn svc_getrpccaller
195 The approved way of getting the network address of the caller
196 of a procedure associated with the
197 RPC service transport handle
199 .It Fn __svc_getcallercreds
201 this macro is specific to
203 and thus not portable.
204 This macro returns a pointer to a
206 structure, defined in
208 identifying the calling client.
209 This only works if the client is
210 calling the server over an
214 .Vt struct pollfd Va svc_pollset[FD_SETSIZE] ;
219 structures derived from
221 It is suitable as an argument to the
228 is made in the current implementation in
230 Service implementors who do not call
232 and who wish to use this array must perform this derivation themselves.
234 This routine never returns.
236 requests to arrive, and calls the appropriate service
240 This procedure is usually waiting for the
242 system call to return.
244 Called by an RPC service's dispatch routine to send the results of a
245 remote procedure call.
249 is the request's associated transport handle;
252 routine which is used to encode the results; and
254 is the address of the results.
265 .Xr rpc_svc_create 3 ,