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.10 2005/11/23 16:44:23 ru Exp $
12 .Nm svc_dg_enablecache ,
17 .Nm svc_getreq_common ,
20 .Nm svc_getrpccaller ,
24 .Nd library routines for RPC servers
30 .Fn svc_dg_enablecache "SVCXPRT *xprt" "const unsigned cache_size"
34 .Fn svc_freeargs "const SVCXPRT *xprt" "const xdrproc_t inproc" "caddr_t in"
36 .Fn svc_getargs "const SVCXPRT *xprt" "const xdrproc_t inproc" "caddr_t in"
38 .Fn svc_getreq_common "const int fd"
40 .Fn svc_getreq_poll "struct pollfd *pfdp" "const int pollretval"
42 .Fn svc_getreqset "fd_set * rdfds"
44 .Fn svc_getrpccaller "const SVCXPRT *xprt"
45 .Ft "struct cmsgcred *"
46 .Fn __svc_getcallercreds "const SVCXPRT *xprt"
47 .Vt struct pollfd svc_pollset[FD_SETSIZE];
51 .Fn svc_sendreply "SVCXPRT *xprt" "xdrproc_t outproc" "void *out"
53 These routines are part of the
55 library which allows C language programs to make procedure
56 calls on other machines across the network.
58 These routines are associated with the server side of the
60 Some of them are called by the server side dispatch function,
64 are called when the server is initiated.
66 .\" In the current implementation, the service transport handle,
68 .\" contains a single data area for decoding arguments and encoding results.
69 .\" Therefore, this structure cannot be freely shared between threads that call
70 .\" functions that do this.
71 .\" Routines on this page that are affected by this
72 .\" restriction are marked as unsafe for MT applications.
76 for the definition of the
79 .Bl -tag -width __svc_getcallercreds()
80 .It Fn svc_dg_enablecache
81 This function allocates a duplicate request cache for the
87 Once enabled, there is no way to disable caching.
88 This routine returns 0 if space necessary for a cache of the given size
89 was successfully allocated, and 1 otherwise.
91 This function, when called by any of the RPC server procedure or
96 As currently implemented,
101 If RPC server activity is to be resumed,
102 services must be reregistered with the RPC library
103 either through one of the
110 has global scope and ends all RPC server activity.
112 .Vt fd_set Va svc_fdset
114 A global variable reflecting the
115 RPC server's read file descriptor bit mask; it is suitable as an argument
119 This is only of interest
120 if service implementors do not call
122 but rather do their own asynchronous event processing.
123 This variable is read-only (do not pass its address to
125 yet it may change after calls to
127 or any creation routines.
129 A function macro that frees any data allocated by the
130 RPC/XDR system when it decoded the arguments to a service procedure
135 if the results were successfully
140 A function macro that decodes the arguments of an
141 RPC request associated with the RPC
142 service transport handle
147 is the address where the arguments will be placed;
150 routine used to decode the arguments.
153 if decoding succeeds, and
156 .It Fn svc_getreq_common
157 This routine is called to handle a request on the given
159 .It Fn svc_getreq_poll
160 This routine is only of interest if a service implementor
163 but instead implements custom asynchronous event processing.
166 has determined that an RPC request has arrived on some RPC
169 is the return value from
175 structures on which the
178 It is assumed to be an array large enough to
179 contain the maximal number of descriptors allowed.
181 This routine is only of interest if a service implementor
184 but instead implements custom asynchronous event processing.
187 has determined that an RPC
188 request has arrived on some RPC file descriptors;
190 is the resultant read file descriptor bit mask.
191 The routine returns when all file descriptors
192 associated with the value of
195 .It Fn svc_getrpccaller
196 The approved way of getting the network address of the caller
197 of a procedure associated with the
198 RPC service transport handle
200 .It Fn __svc_getcallercreds
202 this macro is specific to
204 and thus not portable.
205 This macro returns a pointer to a
207 structure, defined in
209 identifying the calling client.
210 This only works if the client is
211 calling the server over an
215 .Vt struct pollfd Va svc_pollset[FD_SETSIZE] ;
220 structures derived from
222 It is suitable as an argument to the
229 is made in the current implementation in
231 Service implementors who do not call
233 and who wish to use this array must perform this derivation themselves.
235 This routine never returns.
237 requests to arrive, and calls the appropriate service
241 This procedure is usually waiting for the
243 system call to return.
245 Called by an RPC service's dispatch routine to send the results of a
246 remote procedure call.
250 is the request's associated transport handle;
253 routine which is used to encode the results; and
255 is the address of the results.
266 .Xr rpc_svc_create 3 ,