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.12 2010/03/22 19:30:54 joerg Exp $
10 .Nm svc_dg_enablecache ,
15 .Nm svc_getreq_common ,
18 .Nm svc_getrpccaller ,
22 .Nd library routines for RPC servers
28 .Fn svc_dg_enablecache "SVCXPRT *xprt" "const unsigned cache_size"
32 .Fn svc_freeargs "const SVCXPRT *xprt" "const xdrproc_t inproc" "caddr_t in"
34 .Fn svc_getargs "const SVCXPRT *xprt" "const xdrproc_t inproc" "caddr_t in"
36 .Fn svc_getreq_common "const int fd"
38 .Fn svc_getreq_poll "struct pollfd *pfdp" "const int pollretval"
40 .Fn svc_getreqset "fd_set * rdfds"
42 .Fn svc_getrpccaller "const SVCXPRT *xprt"
43 .Ft "struct sockcred *"
44 .Fn __svc_getcallercreds "const SVCXPRT *xprt"
45 .Vt struct pollfd svc_pollset[FD_SETSIZE];
49 .Fn svc_sendreply "const SVCXPRT *xprt" "const xdrproc_t outproc" "const caddr_t *out"
51 These routines are part of the
53 library which allows C language programs to make procedure
54 calls on other machines across the network.
56 These routines are associated with the server side of the
58 Some of them are called by the server side dispatch function,
62 are called when the server is initiated.
64 .\" In the current implementation, the service transport handle,
66 .\" contains a single data area for decoding arguments and encoding results.
67 .\" Therefore, this structure cannot be freely shared between threads that call
68 .\" functions that do this. Routines on this page that are affected by this
69 .\" restriction are marked as unsafe for MT applications.
73 for the definition of the
77 .Bl -tag -width __svc_getcallercreds()
78 .It Fn svc_dg_enablecache
79 This function allocates a duplicate request cache for the
85 Once enabled, there is no way to disable caching.
86 This routine returns 0 if space necessary for a cache of the given size
87 was successfully allocated, and 1 otherwise.
89 This function when called by any of the RPC server procedure or
94 As currently implemented,
99 If RPC server activity is to be resumed,
100 services must be reregistered with the RPC library
101 either through one of the
106 has global scope and ends all RPC server activity.
107 .Ft "fd_set svc_fdset"
108 A global variable reflecting the
109 RPC server's read file descriptor bit mask; it is suitable as a parameter
113 This is only of interest
114 if service implementors do not call
116 but rather do their own asynchronous event processing.
117 This variable is read-only (do not pass its address to
119 yet it may change after calls to
121 or any creation routines.
124 A function macro that frees any data allocated by the
125 RPC/XDR system when it decoded the arguments to a service procedure
130 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
142 is the address where the arguments will be placed;
145 routine used to decode the arguments.
148 if decoding succeeds, and
151 .It Fn svc_getreq_common
152 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.
178 This routine is only of interest if a service implementor
181 but instead implements custom asynchronous event processing.
184 has determined that an RPC
185 request has arrived on some RPC file descriptors;
187 is the resultant read file descriptor bit mask.
188 The routine returns when all file descriptors
189 associated with the value of
193 .It Fn svc_getrpccaller
194 The approved way of getting the network address of the caller
195 of a procedure associated with the
196 RPC service transport handle
199 .It Fn __svc_getcallercreds
200 .Em Warning: this macro is specific to
202 .Em and thus not portable.
203 This macro returns a pointer to a sockcred structure, defined in
205 identifying the calling client.
206 This only works if the client is calling the server over an
209 .It Fa struct pollfd svc_pollset[FD_SETSIZE];
213 structures derived from
215 It is suitable as a parameter to the
222 is made in the current implementation in
224 Service implementors who do not call
226 and who wish to use this array must perform this derivation themselves.
229 This routine never returns.
231 requests to arrive, and calls the appropriate service
235 This procedure is usually waiting for the
237 system call to return.
240 Called by an RPC service's dispatch routine to send the results of a
241 remote procedure call.
244 is the request's associated transport handle;
247 routine which is used to encode the results; and
249 is the address of the results.
259 .Xr rpc_svc_create 3 ,