]>
Commit | Line | Data |
---|---|---|
2297bf0e MK |
1 | .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) |
2 | .\" | |
6d1cd1d7 | 3 | .\" %%%LICENSE_START(BSD_ONELINE_CDROM) |
cc3832e9 | 4 | .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) |
8ff7380d | 5 | .\" %%%LICENSE_END |
cc3832e9 | 6 | .\" |
fea681da | 7 | .\" @(#)rpc.3n 2.4 88/08/08 4.0 RPCSRC; from 1.19 88/06/24 SMI |
e5d79c81 | 8 | .\" |
9a06b299 | 9 | .\" 2007-12-30, mtk, Convert function prototypes to modern C syntax |
e5d79c81 | 10 | .\" |
4b8c67d9 | 11 | .TH RPC 3 2017-09-15 "" "Linux Programmer's Manual" |
fea681da MK |
12 | .SH NAME |
13 | rpc \- library routines for remote procedure calls | |
47297adb | 14 | .SH SYNOPSIS AND DESCRIPTION |
fea681da MK |
15 | These routines allow C programs to make procedure |
16 | calls on other machines across the network. | |
9a06b299 | 17 | First, the client calls a procedure to send a data packet to the server. |
fea681da | 18 | Upon receipt of the packet, the server calls a dispatch routine |
9a06b299 | 19 | to perform the requested service, and then sends back a reply. |
fea681da | 20 | Finally, the procedure call returns to the client. |
57734e82 | 21 | .\" .LP |
9a06b299 | 22 | .\" We don't have an rpc_secure.3 page at the moment -- MTK, 19 Sep 05 |
57734e82 MK |
23 | .\" Routines that are used for Secure RPC (DES authentication) are described in |
24 | .\" .BR rpc_secure (3). | |
25 | .\" Secure RPC can be used only if DES encryption is available. | |
dd3568a1 | 26 | .PP |
9a06b299 MK |
27 | To take use of these routines, include the header file |
28 | .IR "<rpc/rpc.h>" . | |
633af52d | 29 | |
9a06b299 | 30 | The prototypes below make use of the following types: |
dbfe9c70 | 31 | .PP |
9a06b299 | 32 | .in +4n |
b8302363 | 33 | .EX |
a2ce40b6 | 34 | .BI "typedef int " bool_t ; |
dbfe9c70 | 35 | .PP |
a2ce40b6 | 36 | .BI "typedef bool_t (*" xdrproc_t ") (XDR *, void *, ...);" |
dbfe9c70 | 37 | .PP |
a2ce40b6 MK |
38 | .BI "typedef bool_t (*" resultproc_t ") (caddr_t " resp , |
39 | .BI " struct sockaddr_in *" raddr ); | |
b8302363 | 40 | .EE |
633af52d | 41 | .in |
dd3568a1 | 42 | .PP |
9a06b299 MK |
43 | See the header files for the declarations of the |
44 | .IR AUTH , | |
45 | .IR CLIENT , | |
46 | .IR SVCXPRT , | |
47 | and | |
48 | .IR XDR | |
49 | types. | |
dd3568a1 | 50 | .PP |
fea681da | 51 | .nf |
9a06b299 | 52 | .BI "void auth_destroy(AUTH *" auth ); |
fea681da | 53 | .fi |
fea681da MK |
54 | .IP |
55 | A macro that destroys the authentication information associated with | |
56 | .IR auth . | |
9a06b299 | 57 | Destruction usually involves deallocation of private data structures. |
c13182ef | 58 | The use of |
fea681da MK |
59 | .I auth |
60 | is undefined after calling | |
63aa9df0 | 61 | .BR auth_destroy (). |
dd3568a1 | 62 | .PP |
fea681da | 63 | .nf |
9a06b299 | 64 | .BI "AUTH *authnone_create(void);" |
fea681da | 65 | .fi |
fea681da | 66 | .IP |
9a06b299 | 67 | Create and return an RPC |
24b74457 | 68 | authentication handle that passes nonusable authentication |
c13182ef | 69 | information with each remote procedure call. |
9a06b299 | 70 | This is the default authentication used by RPC. |
dd3568a1 | 71 | .PP |
fea681da | 72 | .nf |
9a06b299 MK |
73 | .BI "AUTH *authunix_create(char *" host ", int " uid ", int " gid , |
74 | .BI " int " len ", int *" aup_gids ); | |
fea681da | 75 | .fi |
fea681da | 76 | .IP |
9a06b299 | 77 | Create and return an RPC authentication handle that contains |
fea681da MK |
78 | authentication information. |
79 | The parameter | |
80 | .I host | |
9a06b299 | 81 | is the name of the machine on which the information was created; |
fea681da | 82 | .I uid |
9a06b299 | 83 | is the user's user ID; |
fea681da | 84 | .I gid |
9a06b299 | 85 | is the user's current group ID; |
fea681da MK |
86 | .I len |
87 | and | |
88 | .I aup_gids | |
89 | refer to a counted array of groups to which the user belongs. | |
90 | It is easy to impersonate a user. | |
dd3568a1 | 91 | .PP |
fea681da | 92 | .nf |
9a06b299 | 93 | .BI "AUTH *authunix_create_default(void);" |
fea681da | 94 | .fi |
fea681da MK |
95 | .IP |
96 | Calls | |
63aa9df0 | 97 | .BR authunix_create () |
fea681da | 98 | with the appropriate parameters. |
dd3568a1 | 99 | .PP |
fea681da | 100 | .nf |
a49d636c | 101 | .BI "int callrpc(char *" host ", unsigned long " prognum , |
9a06b299 | 102 | .BI " unsigned long " versnum ", unsigned long " procnum , |
39a22d92 MK |
103 | .BI " xdrproc_t " inproc ", char *" in , |
104 | .BI " xdrproc_t " outproc ", char *" out ); | |
fea681da | 105 | .fi |
fea681da MK |
106 | .IP |
107 | Call the remote procedure associated with | |
108 | .IR prognum , | |
109 | .IR versnum , | |
110 | and | |
111 | .I procnum | |
112 | on the machine, | |
113 | .IR host . | |
114 | The parameter | |
115 | .I in | |
116 | is the address of the procedure's argument(s), and | |
117 | .I out | |
118 | is the address of where to place the result(s); | |
119 | .I inproc | |
120 | is used to encode the procedure's parameters, and | |
121 | .I outproc | |
122 | is used to decode the procedure's results. | |
123 | This routine returns zero if it succeeds, or the value of | |
124 | .B "enum clnt_stat" | |
125 | cast to an integer if it fails. | |
126 | The routine | |
63aa9df0 | 127 | .BR clnt_perrno () |
fea681da MK |
128 | is handy for translating failure statuses into messages. |
129 | .IP | |
130 | Warning: calling remote procedures with this routine | |
9a06b299 | 131 | uses UDP/IP as a transport; see |
63aa9df0 | 132 | .BR clntudp_create () |
fea681da | 133 | for restrictions. |
9a06b299 | 134 | You do not have control of timeouts or authentication using this routine. |
dd3568a1 | 135 | .PP |
fea681da | 136 | .nf |
9a06b299 MK |
137 | .BI "enum clnt_stat clnt_broadcast(unsigned long " prognum , |
138 | .BI " unsigned long " versnum ", unsigned long " procnum , | |
39a22d92 MK |
139 | .BI " xdrproc_t " inproc ", char *" in , |
140 | .BI " xdrproc_t " outproc ", char *" out , | |
9a06b299 | 141 | .BI " resultproc_t " eachresult ); |
fea681da | 142 | .fi |
fea681da MK |
143 | .IP |
144 | Like | |
63aa9df0 | 145 | .BR callrpc (), |
fea681da | 146 | except the call message is broadcast to all locally |
c13182ef | 147 | connected broadcast nets. |
9a06b299 | 148 | Each time it receives a response, this routine calls |
63aa9df0 | 149 | .BR eachresult (), |
fea681da MK |
150 | whose form is: |
151 | .IP | |
9a06b299 | 152 | .in +4n |
b8302363 | 153 | .EX |
9a06b299 | 154 | .BI "eachresult(char *" out ", struct sockaddr_in *" addr ); |
b8302363 | 155 | .EE |
9a06b299 | 156 | .in |
fea681da MK |
157 | .IP |
158 | where | |
159 | .I out | |
160 | is the same as | |
161 | .I out | |
162 | passed to | |
63aa9df0 | 163 | .BR clnt_broadcast (), |
fea681da MK |
164 | except that the remote procedure's output is decoded there; |
165 | .I addr | |
166 | points to the address of the machine that sent the results. | |
167 | If | |
63aa9df0 | 168 | .BR eachresult () |
fea681da | 169 | returns zero, |
63aa9df0 | 170 | .BR clnt_broadcast () |
9a06b299 | 171 | waits for more replies; otherwise it returns with appropriate status. |
fea681da MK |
172 | .IP |
173 | Warning: broadcast sockets are limited in size to the | |
c13182ef | 174 | maximum transfer unit of the data link. |
9a06b299 | 175 | For ethernet, this value is 1500 bytes. |
dd3568a1 | 176 | .PP |
fea681da | 177 | .nf |
9a06b299 | 178 | .BI "enum clnt_stat clnt_call(CLIENT *" clnt ", unsigned long " procnum , |
39a22d92 MK |
179 | .BI " xdrproc_t " inproc ", char *" in , |
180 | .BI " xdrproc_t " outproc ", char *" out , | |
181 | .BI " struct timeval " tout ); | |
fea681da | 182 | .fi |
fea681da MK |
183 | .IP |
184 | A macro that calls the remote procedure | |
185 | .I procnum | |
186 | associated with the client handle, | |
187 | .IR clnt , | |
9a06b299 | 188 | which is obtained with an RPC client creation routine such as |
63aa9df0 | 189 | .BR clnt_create (). |
fea681da MK |
190 | The parameter |
191 | .I in | |
192 | is the address of the procedure's argument(s), and | |
193 | .I out | |
194 | is the address of where to place the result(s); | |
195 | .I inproc | |
196 | is used to encode the procedure's parameters, and | |
197 | .I outproc | |
198 | is used to decode the procedure's results; | |
199 | .I tout | |
200 | is the time allowed for results to come back. | |
dd3568a1 | 201 | .PP |
fea681da | 202 | .nf |
9a06b299 | 203 | .BI "clnt_destroy(CLIENT *" clnt ); |
fea681da | 204 | .fi |
fea681da | 205 | .IP |
9a06b299 | 206 | A macro that destroys the client's RPC handle. |
c13182ef | 207 | Destruction usually involves deallocation |
fea681da MK |
208 | of private data structures, including |
209 | .I clnt | |
c13182ef MK |
210 | itself. |
211 | Use of | |
fea681da MK |
212 | .I clnt |
213 | is undefined after calling | |
63aa9df0 | 214 | .BR clnt_destroy (). |
9a06b299 | 215 | If the RPC library opened the associated socket, it will close it also. |
fea681da | 216 | Otherwise, the socket remains open. |
dd3568a1 | 217 | .PP |
fea681da | 218 | .nf |
9a06b299 MK |
219 | .BI "CLIENT *clnt_create(char *" host ", unsigned long " prog , |
220 | .BI " unsigned long " vers ", char *" proto ); | |
fea681da | 221 | .fi |
fea681da MK |
222 | .IP |
223 | Generic client creation routine. | |
224 | .I host | |
9a06b299 | 225 | identifies the name of the remote host where the server is located. |
fea681da | 226 | .I proto |
c13182ef MK |
227 | indicates which kind of transport protocol to use. |
228 | The currently supported values for this field are \(lqudp\(rq | |
fea681da MK |
229 | and \(lqtcp\(rq. |
230 | Default timeouts are set, but can be modified using | |
63aa9df0 | 231 | .BR clnt_control (). |
fea681da | 232 | .IP |
f64cc745 | 233 | Warning: using UDP has its shortcomings. |
33a0ccb2 | 234 | Since UDP-based RPC messages can hold only up to 8 Kbytes of encoded data, |
fea681da MK |
235 | this transport cannot be used for procedures that take |
236 | large arguments or return huge results. | |
dd3568a1 | 237 | .PP |
fea681da | 238 | .nf |
9a06b299 | 239 | .BI "bool_t clnt_control(CLIENT *" cl ", int " req ", char *" info ); |
fea681da | 240 | .fi |
fea681da MK |
241 | .IP |
242 | A macro used to change or retrieve various information | |
243 | about a client object. | |
244 | .I req | |
245 | indicates the type of operation, and | |
246 | .I info | |
c13182ef | 247 | is a pointer to the information. |
9a06b299 | 248 | For both UDP and TCP, the supported values of |
fea681da MK |
249 | .I req |
250 | and their argument types and what they do are: | |
251 | .IP | |
bf337635 | 252 | .in +4n |
b8302363 | 253 | .EX |
9a06b299 MK |
254 | \fBCLSET_TIMEOUT\fP \fIstruct timeval\fP // set total timeout |
255 | \fBCLGET_TIMEOUT\fP \fIstruct timeval\fP // get total timeout | |
b8302363 | 256 | .EE |
bf337635 | 257 | .in |
fea681da MK |
258 | .IP |
259 | Note: if you set the timeout using | |
63aa9df0 | 260 | .BR clnt_control (), |
fea681da | 261 | the timeout parameter passed to |
63aa9df0 | 262 | .BR clnt_call () |
fea681da MK |
263 | will be ignored in all future calls. |
264 | .IP | |
bf337635 | 265 | .in +4n |
b8302363 | 266 | .EX |
9a06b299 | 267 | \fBCLGET_SERVER_ADDR\fP \fIstruct sockaddr_in \fP // get server's address |
b8302363 | 268 | .EE |
bf337635 | 269 | .in |
fea681da | 270 | .IP |
9a06b299 | 271 | The following operations are valid for UDP only: |
fea681da | 272 | .IP |
bf337635 | 273 | .in +4n |
b8302363 | 274 | .EX |
9a06b299 MK |
275 | \fBCLSET_RETRY_TIMEOUT\fP \fIstruct timeval\fP // set the retry timeout |
276 | \fBCLGET_RETRY_TIMEOUT\fP \fIstruct timeval\fP // get the retry timeout | |
b8302363 | 277 | .EE |
bf337635 | 278 | .in |
fea681da | 279 | .IP |
9a06b299 | 280 | The retry timeout is the time that "UDP RPC" |
fea681da MK |
281 | waits for the server to reply before |
282 | retransmitting the request. | |
dd3568a1 | 283 | .PP |
fea681da | 284 | .nf |
9a06b299 | 285 | .BI "clnt_freeres(CLIENT * " clnt ", xdrproc_t " outproc ", char *" out ); |
fea681da | 286 | .fi |
fea681da | 287 | .IP |
9a06b299 MK |
288 | A macro that frees any data allocated by the RPC/XDR |
289 | system when it decoded the results of an RPC call. | |
c13182ef | 290 | The parameter |
fea681da MK |
291 | .I out |
292 | is the address of the results, and | |
293 | .I outproc | |
9a06b299 MK |
294 | is the XDR routine describing the results. |
295 | This routine returns one if the results were successfully freed, | |
fea681da | 296 | and zero otherwise. |
dd3568a1 | 297 | .PP |
fea681da | 298 | .nf |
9a06b299 | 299 | .BI "void clnt_geterr(CLIENT *" clnt ", struct rpc_err *" errp ); |
fea681da | 300 | .fi |
fea681da MK |
301 | .IP |
302 | A macro that copies the error structure out of the client | |
9a06b299 | 303 | handle to the structure at address |
fea681da | 304 | .IR errp . |
dd3568a1 | 305 | .PP |
fea681da | 306 | .nf |
9a06b299 | 307 | .BI "void clnt_pcreateerror(char *" s ); |
fea681da | 308 | .fi |
fea681da | 309 | .IP |
9a06b299 | 310 | Print a message to standard error indicating why a client RPC |
fea681da MK |
311 | handle could not be created. |
312 | The message is prepended with string | |
313 | .I s | |
314 | and a colon. | |
315 | Used when a | |
63aa9df0 MK |
316 | .BR clnt_create (), |
317 | .BR clntraw_create (), | |
318 | .BR clnttcp_create (), | |
fea681da | 319 | or |
63aa9df0 | 320 | .BR clntudp_create () |
fea681da | 321 | call fails. |
dd3568a1 | 322 | .PP |
fea681da | 323 | .nf |
9a06b299 | 324 | .BI "void clnt_perrno(enum clnt_stat " stat ); |
fea681da | 325 | .fi |
fea681da MK |
326 | .IP |
327 | Print a message to standard error corresponding | |
328 | to the condition indicated by | |
329 | .IR stat . | |
330 | Used after | |
63aa9df0 | 331 | .BR callrpc (). |
dd3568a1 | 332 | .PP |
fea681da | 333 | .nf |
9a06b299 | 334 | .BI "clnt_perror(CLIENT *" clnt ", char *" s ); |
fea681da | 335 | .fi |
fea681da | 336 | .IP |
9a06b299 | 337 | Print a message to standard error indicating why an RPC call failed; |
fea681da MK |
338 | .I clnt |
339 | is the handle used to do the call. | |
340 | The message is prepended with string | |
341 | .I s | |
342 | and a colon. | |
343 | Used after | |
63aa9df0 | 344 | .BR clnt_call (). |
dd3568a1 | 345 | .PP |
fea681da | 346 | .nf |
9a06b299 | 347 | .BI "char *clnt_spcreateerror(char *" s ); |
fea681da | 348 | .fi |
fea681da MK |
349 | .IP |
350 | Like | |
63aa9df0 | 351 | .BR clnt_pcreateerror (), |
9a06b299 | 352 | except that it returns a string instead of printing to the standard error. |
fea681da | 353 | .IP |
9a06b299 | 354 | Bugs: returns pointer to static data that is overwritten on each call. |
dd3568a1 | 355 | .PP |
fea681da | 356 | .nf |
9a06b299 | 357 | .BI "char *clnt_sperrno(enum clnt_stat " stat ); |
fea681da | 358 | .fi |
fea681da MK |
359 | .IP |
360 | Take the same arguments as | |
63aa9df0 | 361 | .BR clnt_perrno (), |
9a06b299 MK |
362 | but instead of sending a message to the standard error indicating why an RPC |
363 | call failed, return a pointer to a string which contains the message. | |
364 | The string ends with a NEWLINE. | |
fea681da | 365 | .IP |
63aa9df0 | 366 | .BR clnt_sperrno () |
fea681da | 367 | is used instead of |
63aa9df0 | 368 | .BR clnt_perrno () |
fea681da | 369 | if the program does not have a standard error (as a program |
9a06b299 | 370 | running as a server quite likely does not), or if the programmer |
fea681da | 371 | does not want the message to be output with |
9daa4fb9 | 372 | .BR printf (3), |
fea681da | 373 | or if a message format different than that supported by |
63aa9df0 | 374 | .BR clnt_perrno () |
fea681da MK |
375 | is to be used. |
376 | Note: unlike | |
63aa9df0 | 377 | .BR clnt_sperror () |
fea681da | 378 | and |
33ec0e54 | 379 | .BR clnt_spcreateerror (), |
63aa9df0 | 380 | .BR clnt_sperrno () |
fea681da MK |
381 | returns pointer to static data, but the |
382 | result will not get overwritten on each call. | |
dd3568a1 | 383 | .PP |
fea681da | 384 | .nf |
9a06b299 | 385 | .BI "char *clnt_sperror(CLIENT *" rpch ", char *" s ); |
fea681da | 386 | .fi |
fea681da MK |
387 | .IP |
388 | Like | |
63aa9df0 | 389 | .BR clnt_perror (), |
fea681da | 390 | except that (like |
63aa9df0 | 391 | .BR clnt_sperrno ()) |
fea681da MK |
392 | it returns a string instead of printing to standard error. |
393 | .IP | |
9a06b299 | 394 | Bugs: returns pointer to static data that is overwritten on each call. |
dd3568a1 | 395 | .PP |
fea681da | 396 | .nf |
9a06b299 MK |
397 | .BI "CLIENT *clntraw_create(unsigned long " prognum \ |
398 | ", unsigned long " versnum ); | |
fea681da | 399 | .fi |
fea681da | 400 | .IP |
9a06b299 | 401 | This routine creates a toy RPC client for the remote program |
fea681da MK |
402 | .IR prognum , |
403 | version | |
404 | .IR versnum . | |
405 | The transport used to pass messages to the service is | |
406 | actually a buffer within the process's address space, so the | |
9a06b299 | 407 | corresponding RPC server should live in the same address space; see |
63aa9df0 | 408 | .BR svcraw_create (). |
9a06b299 MK |
409 | This allows simulation of RPC and acquisition of RPC |
410 | overheads, such as round trip times, without any kernel interference. | |
411 | This routine returns NULL if it fails. | |
dd3568a1 | 412 | .PP |
fea681da | 413 | .nf |
9a06b299 MK |
414 | .BI "CLIENT *clnttcp_create(struct sockaddr_in *" addr , |
415 | .BI " unsigned long " prognum ", unsigned long " versnum , | |
416 | .BI " int *" sockp ", unsigned int " sendsz \ | |
417 | ", unsigned int " recvsz ); | |
fea681da | 418 | .fi |
fea681da | 419 | .IP |
9a06b299 | 420 | This routine creates an RPC client for the remote program |
fea681da MK |
421 | .IR prognum , |
422 | version | |
423 | .IR versnum ; | |
9a06b299 MK |
424 | the client uses TCP/IP as a transport. |
425 | The remote program is located at Internet address | |
fea681da MK |
426 | .IR *addr . |
427 | If | |
d6115148 | 428 | .\"The following inline font conversion is necessary for the hyphen indicator |
c6fa0841 | 429 | .I addr\->sin_port |
fea681da MK |
430 | is zero, then it is set to the actual port that the remote |
431 | program is listening on (the remote | |
432 | .B portmap | |
c13182ef MK |
433 | service is consulted for this information). |
434 | The parameter | |
fea681da MK |
435 | .I sockp |
436 | is a socket; if it is | |
066cb3d6 | 437 | .BR RPC_ANYSOCK , |
fea681da MK |
438 | then this routine opens a new one and sets |
439 | .IR sockp . | |
9a06b299 | 440 | Since TCP-based RPC uses buffered I/O, |
fea681da MK |
441 | the user may specify the size of the send and receive buffers |
442 | with the parameters | |
443 | .I sendsz | |
444 | and | |
445 | .IR recvsz ; | |
446 | values of zero choose suitable defaults. | |
9a06b299 | 447 | This routine returns NULL if it fails. |
dd3568a1 | 448 | .PP |
fea681da | 449 | .nf |
a49d636c | 450 | .BI "CLIENT *clntudp_create(struct sockaddr_in *" addr , |
9a06b299 MK |
451 | .BI " unsigned long " prognum ", unsigned long " versnum , |
452 | .BI " struct timeval " wait ", int *" sockp ); | |
fea681da | 453 | .fi |
fea681da | 454 | .IP |
9a06b299 | 455 | This routine creates an RPC client for the remote program |
fea681da MK |
456 | .IR prognum , |
457 | version | |
458 | .IR versnum ; | |
9a06b299 MK |
459 | the client uses use UDP/IP as a transport. |
460 | The remote program is located at Internet address | |
fea681da MK |
461 | .IR addr . |
462 | If | |
c6fa0841 | 463 | .I addr\->sin_port |
fea681da MK |
464 | is zero, then it is set to actual port that the remote |
465 | program is listening on (the remote | |
466 | .B portmap | |
c13182ef MK |
467 | service is consulted for this information). |
468 | The parameter | |
fea681da MK |
469 | .I sockp |
470 | is a socket; if it is | |
066cb3d6 | 471 | .BR RPC_ANYSOCK , |
fea681da MK |
472 | then this routine opens a new one and sets |
473 | .IR sockp . | |
9a06b299 | 474 | The UDP transport resends the call message in intervals of |
d9a10d9d | 475 | .I wait |
9a06b299 | 476 | time until a response is received or until the call times out. |
fea681da | 477 | The total time for the call to time out is specified by |
63aa9df0 | 478 | .BR clnt_call (). |
fea681da | 479 | .IP |
33a0ccb2 | 480 | Warning: since UDP-based RPC messages can hold only up to 8 Kbytes |
fea681da MK |
481 | of encoded data, this transport cannot be used for procedures |
482 | that take large arguments or return huge results. | |
dd3568a1 | 483 | .PP |
9a06b299 MK |
484 | .nf |
485 | .BI "CLIENT *clntudp_bufcreate(struct sockaddr_in *" addr , | |
486 | .BI " unsigned long " prognum ", unsigned long " versnum , | |
487 | .BI " struct timeval " wait ", int *" sockp , | |
488 | .BI " unsigned int " sendsize ", unsigned int "recosize ); | |
489 | .fi | |
490 | .IP | |
491 | This routine creates an RPC client for the remote program | |
fea681da MK |
492 | .IR prognum , |
493 | on | |
494 | .IR versnum ; | |
9a06b299 MK |
495 | the client uses use UDP/IP as a transport. |
496 | The remote program is located at Internet address | |
fea681da MK |
497 | .IR addr . |
498 | If | |
c6fa0841 | 499 | .I addr\->sin_port |
fea681da MK |
500 | is zero, then it is set to actual port that the remote |
501 | program is listening on (the remote | |
502 | .B portmap | |
c13182ef MK |
503 | service is consulted for this information). |
504 | The parameter | |
fea681da MK |
505 | .I sockp |
506 | is a socket; if it is | |
066cb3d6 | 507 | .BR RPC_ANYSOCK , |
fea681da | 508 | then this routine opens a new one and sets |
a3c5b73c | 509 | .IR sockp . |
9a06b299 | 510 | The UDP transport resends the call message in intervals of |
d9a10d9d | 511 | .I wait |
9a06b299 | 512 | time until a response is received or until the call times out. |
fea681da | 513 | The total time for the call to time out is specified by |
63aa9df0 | 514 | .BR clnt_call (). |
fea681da | 515 | .IP |
9a06b299 MK |
516 | This allows the user to specify the maximum packet |
517 | size for sending and receiving UDP-based RPC messages. | |
dd3568a1 | 518 | .PP |
fea681da | 519 | .nf |
9a06b299 | 520 | .BI "void get_myaddress(struct sockaddr_in *" addr ); |
fea681da | 521 | .fi |
fea681da | 522 | .IP |
9a06b299 | 523 | Stuff the machine's IP address into |
fea681da MK |
524 | .IR *addr , |
525 | without consulting the library routines that deal with | |
8478ee02 | 526 | .IR /etc/hosts . |
fea681da | 527 | The port number is always set to |
066cb3d6 | 528 | .BR htons(PMAPPORT) . |
dd3568a1 | 529 | .PP |
fea681da | 530 | .nf |
9a06b299 | 531 | .BI "struct pmaplist *pmap_getmaps(struct sockaddr_in *" addr ); |
fea681da | 532 | .fi |
fea681da MK |
533 | .IP |
534 | A user interface to the | |
535 | .B portmap | |
9a06b299 MK |
536 | service, which returns a list of the current RPC |
537 | program-to-port mappings on the host located at IP address | |
fea681da | 538 | .IR *addr . |
9a06b299 | 539 | This routine can return NULL. |
fea681da | 540 | The command |
2d986c92 | 541 | .IR "rpcinfo\ \-p" |
fea681da | 542 | uses this routine. |
dd3568a1 | 543 | .PP |
fea681da | 544 | .nf |
9a06b299 MK |
545 | .BI "unsigned short pmap_getport(struct sockaddr_in *" addr , |
546 | .BI " unsigned long " prognum ", unsigned long " versnum , | |
547 | .BI " unsigned int " protocol ); | |
fea681da | 548 | .fi |
fea681da MK |
549 | .IP |
550 | A user interface to the | |
551 | .B portmap | |
552 | service, which returns the port number | |
553 | on which waits a service that supports program number | |
554 | .IR prognum , | |
555 | version | |
556 | .IR versnum , | |
557 | and speaks the transport protocol associated with | |
558 | .IR protocol . | |
559 | The value of | |
560 | .I protocol | |
561 | is most likely | |
9a06b299 | 562 | .B IPPROTO_UDP |
c13182ef | 563 | or |
066cb3d6 | 564 | .BR IPPROTO_TCP . |
fea681da | 565 | A return value of zero means that the mapping does not exist |
9a06b299 | 566 | or that the RPC system failed to contact the remote |
fea681da | 567 | .B portmap |
c13182ef MK |
568 | service. |
569 | In the latter case, the global variable | |
9a06b299 MK |
570 | .I rpc_createerr |
571 | contains the RPC status. | |
dd3568a1 | 572 | .PP |
fea681da | 573 | .nf |
9a06b299 MK |
574 | .BI "enum clnt_stat pmap_rmtcall(struct sockaddr_in *" addr , |
575 | .BI " unsigned long " prognum ", unsigned long " versnum , | |
39a22d92 MK |
576 | .BI " unsigned long " procnum , |
577 | .BI " xdrproc_t " inproc ", char *" in , | |
578 | .BI " xdrproc_t " outproc ", char *" out , | |
9a06b299 | 579 | .BI " struct timeval " tout ", unsigned long *" portp ); |
fea681da | 580 | .fi |
fea681da MK |
581 | .IP |
582 | A user interface to the | |
583 | .B portmap | |
584 | service, which instructs | |
585 | .B portmap | |
9a06b299 | 586 | on the host at IP address |
fea681da | 587 | .I *addr |
9a06b299 | 588 | to make an RPC call on your behalf to a procedure on that host. |
fea681da MK |
589 | The parameter |
590 | .I *portp | |
9a06b299 | 591 | will be modified to the program's port number if the procedure succeeds. |
c13182ef | 592 | The definitions of other parameters are discussed |
fea681da | 593 | in |
63aa9df0 | 594 | .BR callrpc () |
fea681da | 595 | and |
63aa9df0 | 596 | .BR clnt_call (). |
9a06b299 | 597 | This procedure should be used for a \(lqping\(rq and nothing else. |
fea681da | 598 | See also |
63aa9df0 | 599 | .BR clnt_broadcast (). |
dd3568a1 | 600 | .PP |
fea681da | 601 | .nf |
9a06b299 MK |
602 | .BI "bool_t pmap_set(unsigned long " prognum ", unsigned long " versnum , |
603 | .BI " unsigned int " protocol ", unsigned short " port ); | |
fea681da | 604 | .fi |
fea681da MK |
605 | .IP |
606 | A user interface to the | |
607 | .B portmap | |
608 | service, which establishes a mapping between the triple | |
c6fa0841 | 609 | .RI [ prognum , versnum , protocol ] |
fea681da MK |
610 | and |
611 | .I port | |
612 | on the machine's | |
613 | .B portmap | |
c13182ef MK |
614 | service. |
615 | The value of | |
fea681da MK |
616 | .I protocol |
617 | is most likely | |
9a06b299 | 618 | .B IPPROTO_UDP |
c13182ef | 619 | or |
066cb3d6 | 620 | .BR IPPROTO_TCP . |
fea681da MK |
621 | This routine returns one if it succeeds, zero otherwise. |
622 | Automatically done by | |
63aa9df0 | 623 | .BR svc_register (). |
dd3568a1 | 624 | .PP |
fea681da | 625 | .nf |
9a06b299 | 626 | .BI "bool_t pmap_unset(unsigned long " prognum ", unsigned long " versnum ); |
fea681da | 627 | .fi |
fea681da MK |
628 | .IP |
629 | A user interface to the | |
630 | .B portmap | |
631 | service, which destroys all mapping between the triple | |
c6fa0841 | 632 | .RI [ prognum , versnum , * ] |
fea681da MK |
633 | and |
634 | .B ports | |
635 | on the machine's | |
636 | .B portmap | |
c13182ef | 637 | service. |
9a06b299 | 638 | This routine returns one if it succeeds, zero otherwise. |
dd3568a1 | 639 | .PP |
fea681da | 640 | .nf |
9a06b299 | 641 | .BI "int registerrpc(unsigned long " prognum ", unsigned long " versnum , |
da8cb51e | 642 | .BI " unsigned long " procnum ", char *(*" procname ")(char *)," |
9a06b299 | 643 | .BI " xdrproc_t " inproc ", xdrproc_t " outproc ); |
fea681da | 644 | .fi |
fea681da MK |
645 | .IP |
646 | Register procedure | |
647 | .I procname | |
9a06b299 | 648 | with the RPC service package. |
c13182ef | 649 | If a request arrives for program |
fea681da MK |
650 | .IR prognum , |
651 | version | |
652 | .IR versnum , | |
653 | and procedure | |
654 | .IR procnum , | |
655 | .I procname | |
656 | is called with a pointer to its parameter(s); | |
69f32fc0 | 657 | .I procname |
fea681da MK |
658 | should return a pointer to its static result(s); |
659 | .I inproc | |
660 | is used to decode the parameters while | |
661 | .I outproc | |
662 | is used to encode the results. | |
9a06b299 | 663 | This routine returns zero if the registration succeeded, \-1 otherwise. |
fea681da MK |
664 | .IP |
665 | Warning: remote procedures registered in this form | |
9a06b299 | 666 | are accessed using the UDP/IP transport; see |
63aa9df0 | 667 | .BR svcudp_create () |
fea681da | 668 | for restrictions. |
dd3568a1 | 669 | .PP |
fea681da | 670 | .nf |
9a06b299 | 671 | .BI "struct rpc_createerr " rpc_createerr ; |
fea681da | 672 | .fi |
fea681da | 673 | .IP |
9a06b299 | 674 | A global variable whose value is set by any RPC client creation routine |
c13182ef MK |
675 | that does not succeed. |
676 | Use the routine | |
63aa9df0 | 677 | .BR clnt_pcreateerror () |
fea681da | 678 | to print the reason why. |
dd3568a1 | 679 | .PP |
fea681da | 680 | .nf |
9a06b299 | 681 | .BI "void svc_destroy(SVCXPRT *" xprt ); |
fea681da | 682 | .fi |
fea681da | 683 | .IP |
9a06b299 | 684 | A macro that destroys the RPC service transport handle, |
fea681da MK |
685 | .IR xprt . |
686 | Destruction usually involves deallocation | |
687 | of private data structures, including | |
688 | .I xprt | |
c13182ef MK |
689 | itself. |
690 | Use of | |
fea681da MK |
691 | .I xprt |
692 | is undefined after calling this routine. | |
dd3568a1 | 693 | .PP |
fea681da | 694 | .nf |
9a06b299 | 695 | .BI "fd_set " svc_fdset ; |
fea681da | 696 | .fi |
fea681da | 697 | .IP |
9a06b299 MK |
698 | A global variable reflecting the RPC service side's |
699 | read file descriptor bit mask; it is suitable as a parameter to the | |
9daa4fb9 | 700 | .BR select (2) |
c13182ef | 701 | system call. |
886ea57d MK |
702 | This is of interest only if a service implementor does their own |
703 | asynchronous event processing, instead of calling | |
704 | .BR svc_run (). | |
fea681da | 705 | This variable is read-only (do not pass its address to |
9daa4fb9 | 706 | .BR select (2)!), |
fea681da | 707 | yet it may change after calls to |
63aa9df0 | 708 | .BR svc_getreqset () |
fea681da | 709 | or any creation routines. |
dd3568a1 | 710 | .PP |
fea681da | 711 | .nf |
9a06b299 | 712 | .BI "int " svc_fds ; |
fea681da | 713 | .fi |
fea681da MK |
714 | .IP |
715 | Similar to | |
716 | .BR svc_fdset , | |
d9cb0d7d | 717 | but limited to 32 file descriptors. |
c13182ef | 718 | This interface is obsoleted by |
fea681da | 719 | .BR svc_fdset . |
dd3568a1 | 720 | .PP |
fea681da | 721 | .nf |
9a06b299 | 722 | .BI "svc_freeargs(SVCXPRT *" xprt ", xdrproc_t " inproc ", char *" in ); |
fea681da | 723 | .fi |
fea681da | 724 | .IP |
9a06b299 MK |
725 | A macro that frees any data allocated by the RPC/XDR |
726 | system when it decoded the arguments to a service procedure using | |
63aa9df0 | 727 | .BR svc_getargs (). |
9a06b299 | 728 | This routine returns 1 if the results were successfully freed, |
fea681da | 729 | and zero otherwise. |
dd3568a1 | 730 | .PP |
fea681da | 731 | .nf |
9a06b299 | 732 | .BI "svc_getargs(SVCXPRT *" xprt ", xdrproc_t " inproc ", char *" in ); |
fea681da | 733 | .fi |
fea681da | 734 | .IP |
9a06b299 MK |
735 | A macro that decodes the arguments of an RPC request |
736 | associated with the RPC service transport handle, | |
fea681da MK |
737 | .IR xprt . |
738 | The parameter | |
739 | .I in | |
740 | is the address where the arguments will be placed; | |
741 | .I inproc | |
9a06b299 MK |
742 | is the XDR routine used to decode the arguments. |
743 | This routine returns one if decoding succeeds, and zero otherwise. | |
dd3568a1 | 744 | .PP |
fea681da | 745 | .nf |
9a06b299 | 746 | .BI "struct sockaddr_in *svc_getcaller(SVCXPRT *" xprt ); |
fea681da | 747 | .fi |
fea681da MK |
748 | .IP |
749 | The approved way of getting the network address of the caller | |
9a06b299 | 750 | of a procedure associated with the RPC service transport handle, |
fea681da | 751 | .IR xprt . |
dd3568a1 | 752 | .PP |
fea681da | 753 | .nf |
9a06b299 | 754 | .BI "void svc_getreqset(fd_set *" rdfds ); |
fea681da | 755 | .fi |
fea681da | 756 | .IP |
33a0ccb2 | 757 | This routine is of interest only if a service implementor does not call |
63aa9df0 | 758 | .BR svc_run (), |
fea681da MK |
759 | but instead implements custom asynchronous event processing. |
760 | It is called when the | |
9daa4fb9 | 761 | .BR select (2) |
9a06b299 MK |
762 | system call has determined that an RPC request has arrived on some |
763 | RPC socket(s); | |
fea681da MK |
764 | .I rdfds |
765 | is the resultant read file descriptor bit mask. | |
9a06b299 | 766 | The routine returns when all sockets associated with the value of |
fea681da MK |
767 | .I rdfds |
768 | have been serviced. | |
dd3568a1 | 769 | .PP |
fea681da | 770 | .nf |
9a06b299 | 771 | .BI "void svc_getreq(int " rdfds ); |
fea681da | 772 | .fi |
fea681da MK |
773 | .IP |
774 | Similar to | |
63aa9df0 | 775 | .BR svc_getreqset (), |
d9cb0d7d | 776 | but limited to 32 file descriptors. |
c13182ef | 777 | This interface is obsoleted by |
63aa9df0 | 778 | .BR svc_getreqset (). |
dd3568a1 | 779 | .PP |
fea681da | 780 | .nf |
9a06b299 MK |
781 | .BI "bool_t svc_register(SVCXPRT *" xprt ", unsigned long " prognum , |
782 | .BI " unsigned long " versnum , | |
783 | .BI " void (*" dispatch ")(svc_req *, SVCXPRT *)," | |
784 | .BI " unsigned long " protocol ); | |
fea681da | 785 | .fi |
fea681da MK |
786 | .IP |
787 | Associates | |
788 | .I prognum | |
789 | and | |
790 | .I versnum | |
791 | with the service dispatch procedure, | |
792 | .IR dispatch . | |
793 | If | |
794 | .I protocol | |
795 | is zero, the service is not registered with the | |
796 | .B portmap | |
c13182ef MK |
797 | service. |
798 | If | |
fea681da | 799 | .I protocol |
c7094399 | 800 | is nonzero, then a mapping of the triple |
c6fa0841 | 801 | .RI [ prognum , versnum , protocol ] |
fea681da | 802 | to |
c6fa0841 | 803 | .I xprt\->xp_port |
fea681da MK |
804 | is established with the local |
805 | .B portmap | |
806 | service (generally | |
807 | .I protocol | |
808 | is zero, | |
9a06b299 | 809 | .B IPPROTO_UDP |
c13182ef | 810 | or |
9a06b299 | 811 | .BR IPPROTO_TCP ). |
fea681da MK |
812 | The procedure |
813 | .I dispatch | |
814 | has the following form: | |
e646a1ba | 815 | .IP |
11d4a2cf | 816 | .in +4n |
e646a1ba | 817 | .EX |
11d4a2cf | 818 | dispatch(struct svc_req *request, SVCXPRT *xprt); |
b8302363 | 819 | .EE |
11d4a2cf | 820 | .in |
fea681da MK |
821 | .IP |
822 | The | |
63aa9df0 | 823 | .BR svc_register () |
fea681da | 824 | routine returns one if it succeeds, and zero otherwise. |
dd3568a1 | 825 | .PP |
fea681da | 826 | .nf |
9a06b299 | 827 | .B "void svc_run(void);" |
fea681da | 828 | .fi |
fea681da | 829 | .IP |
c13182ef | 830 | This routine never returns. |
9a06b299 | 831 | It waits for RPC requests to arrive, and calls the appropriate service |
fea681da | 832 | procedure using |
63aa9df0 | 833 | .BR svc_getreq () |
c13182ef MK |
834 | when one arrives. |
835 | This procedure is usually waiting for a | |
9daa4fb9 | 836 | .BR select (2) |
fea681da | 837 | system call to return. |
dd3568a1 | 838 | .PP |
fea681da | 839 | .nf |
9a06b299 MK |
840 | .BI "bool_t svc_sendreply(SVCXPRT *" xprt ", xdrproc_t " outproc \ |
841 | ", char *" out ); | |
fea681da | 842 | .fi |
fea681da | 843 | .IP |
9a06b299 | 844 | Called by an RPC service's dispatch routine to send the results of a |
c13182ef MK |
845 | remote procedure call. |
846 | The parameter | |
fea681da MK |
847 | .I xprt |
848 | is the request's associated transport handle; | |
849 | .I outproc | |
9a06b299 | 850 | is the XDR routine which is used to encode the results; and |
fea681da MK |
851 | .I out |
852 | is the address of the results. | |
853 | This routine returns one if it succeeds, zero otherwise. | |
dd3568a1 | 854 | .PP |
fea681da | 855 | .nf |
9a06b299 | 856 | .BI "void svc_unregister(unsigned long " prognum ", unsigned long " versnum ); |
fea681da | 857 | .fi |
fea681da MK |
858 | .IP |
859 | Remove all mapping of the double | |
860 | .RI [ prognum , versnum ] | |
861 | to dispatch routines, and of the triple | |
c6fa0841 | 862 | .RI [ prognum , versnum , * ] |
fea681da | 863 | to port number. |
dd3568a1 | 864 | .PP |
fea681da | 865 | .nf |
9a06b299 | 866 | .BI "void svcerr_auth(SVCXPRT *" xprt ", enum auth_stat " why ); |
fea681da | 867 | .fi |
fea681da MK |
868 | .IP |
869 | Called by a service dispatch routine that refuses to perform | |
870 | a remote procedure call due to an authentication error. | |
dd3568a1 | 871 | .PP |
fea681da | 872 | .nf |
9a06b299 | 873 | .BI "void svcerr_decode(SVCXPRT *" xprt ); |
fea681da | 874 | .fi |
fea681da MK |
875 | .IP |
876 | Called by a service dispatch routine that cannot successfully | |
c13182ef MK |
877 | decode its parameters. |
878 | See also | |
63aa9df0 | 879 | .BR svc_getargs (). |
dd3568a1 | 880 | .PP |
fea681da | 881 | .nf |
9a06b299 | 882 | .BI "void svcerr_noproc(SVCXPRT *" xprt ); |
fea681da | 883 | .fi |
fea681da MK |
884 | .IP |
885 | Called by a service dispatch routine that does not implement | |
886 | the procedure number that the caller requests. | |
dd3568a1 | 887 | .PP |
fea681da | 888 | .nf |
9a06b299 | 889 | .BI "void svcerr_noprog(SVCXPRT *" xprt ); |
fea681da | 890 | .fi |
fea681da | 891 | .IP |
9a06b299 | 892 | Called when the desired program is not registered with the RPC package. |
c13182ef | 893 | Service implementors usually do not need this routine. |
dd3568a1 | 894 | .PP |
fea681da | 895 | .nf |
9a06b299 | 896 | .BI "void svcerr_progvers(SVCXPRT *" xprt ); |
fea681da | 897 | .fi |
fea681da MK |
898 | .IP |
899 | Called when the desired version of a program is not registered | |
9a06b299 | 900 | with the RPC package. |
c13182ef | 901 | Service implementors usually do not need this routine. |
dd3568a1 | 902 | .PP |
fea681da | 903 | .nf |
9a06b299 | 904 | .BI "void svcerr_systemerr(SVCXPRT *" xprt ); |
fea681da | 905 | .fi |
fea681da MK |
906 | .IP |
907 | Called by a service dispatch routine when it detects a system | |
9a06b299 | 908 | error not covered by any particular protocol. |
fea681da MK |
909 | For example, if a service can no longer allocate storage, |
910 | it may call this routine. | |
dd3568a1 | 911 | .PP |
fea681da | 912 | .nf |
9a06b299 | 913 | .BI "void svcerr_weakauth(SVCXPRT *" xprt ); |
fea681da | 914 | .fi |
fea681da MK |
915 | .IP |
916 | Called by a service dispatch routine that refuses to perform | |
9a06b299 | 917 | a remote procedure call due to insufficient authentication parameters. |
c13182ef | 918 | The routine calls |
066cb3d6 | 919 | .BR "svcerr_auth(xprt, AUTH_TOOWEAK)" . |
dd3568a1 | 920 | .PP |
fea681da | 921 | .nf |
9a06b299 MK |
922 | .BI "SVCXPRT *svcfd_create(int " fd ", unsigned int " sendsize , |
923 | .BI " unsigned int " recvsize ); | |
fea681da | 924 | .fi |
fea681da | 925 | .IP |
d9cb0d7d MK |
926 | Create a service on top of any open file descriptor. |
927 | Typically, this file descriptor is a connected socket for a stream protocol such | |
9a06b299 | 928 | as TCP. |
fea681da MK |
929 | .I sendsize |
930 | and | |
931 | .I recvsize | |
c13182ef | 932 | indicate sizes for the send and receive buffers. |
9a06b299 | 933 | If they are zero, a reasonable default is chosen. |
dd3568a1 | 934 | .PP |
fea681da | 935 | .nf |
9a06b299 | 936 | .BI "SVCXPRT *svcraw_create(void);" |
fea681da | 937 | .fi |
fea681da | 938 | .IP |
9a06b299 | 939 | This routine creates a toy RPC |
c13182ef MK |
940 | service transport, to which it returns a pointer. |
941 | The transport is really a buffer within the process's address space, | |
9a06b299 | 942 | so the corresponding RPC client should live in the same address space; see |
63aa9df0 | 943 | .BR clntraw_create (). |
9a06b299 MK |
944 | This routine allows simulation of RPC and acquisition of RPC |
945 | overheads (such as round trip times), without any kernel interference. | |
946 | This routine returns NULL if it fails. | |
dd3568a1 | 947 | .PP |
fea681da | 948 | .nf |
9a06b299 MK |
949 | .BI "SVCXPRT *svctcp_create(int " sock ", unsigned int " send_buf_size , |
950 | .BI " unsigned int " recv_buf_size ); | |
fea681da | 951 | .fi |
fea681da | 952 | .IP |
9a06b299 | 953 | This routine creates a TCP/IP-based RPC |
fea681da MK |
954 | service transport, to which it returns a pointer. |
955 | The transport is associated with the socket | |
956 | .IR sock , | |
957 | which may be | |
066cb3d6 | 958 | .BR RPC_ANYSOCK , |
fea681da | 959 | in which case a new socket is created. |
9a06b299 | 960 | If the socket is not bound to a local TCP |
c13182ef MK |
961 | port, then this routine binds it to an arbitrary port. |
962 | Upon completion, | |
c6fa0841 | 963 | .I xprt\->xp_sock |
fea681da | 964 | is the transport's socket descriptor, and |
c6fa0841 | 965 | .I xprt\->xp_port |
fea681da | 966 | is the transport's port number. |
9a06b299 MK |
967 | This routine returns NULL if it fails. |
968 | Since TCP-based RPC uses buffered I/O, | |
fea681da MK |
969 | users may specify the size of buffers; values of zero |
970 | choose suitable defaults. | |
dd3568a1 | 971 | .PP |
fea681da | 972 | .nf |
9a06b299 MK |
973 | .BI "SVCXPRT *svcudp_bufcreate(int " sock ", unsigned int " sendsize , |
974 | .BI " unsigned int " recosize ); | |
fea681da | 975 | .fi |
fea681da | 976 | .IP |
9a06b299 | 977 | This routine creates a UDP/IP-based RPC |
fea681da MK |
978 | service transport, to which it returns a pointer. |
979 | The transport is associated with the socket | |
980 | .IR sock , | |
981 | which may be | |
066cb3d6 | 982 | .BR RPC_ANYSOCK , |
fea681da | 983 | in which case a new socket is created. |
9a06b299 | 984 | If the socket is not bound to a local UDP |
c13182ef MK |
985 | port, then this routine binds it to an arbitrary port. |
986 | Upon completion, | |
c6fa0841 | 987 | .I xprt\->xp_sock |
fea681da | 988 | is the transport's socket descriptor, and |
c6fa0841 | 989 | .I xprt\->xp_port |
fea681da | 990 | is the transport's port number. |
9a06b299 | 991 | This routine returns NULL if it fails. |
fea681da | 992 | .IP |
c13182ef | 993 | This allows the user to specify the maximum packet size for sending and |
9a06b299 | 994 | receiving UDP-based RPC messages. |
dd3568a1 | 995 | .PP |
fea681da | 996 | .nf |
9a06b299 | 997 | .BI "SVCXPRT *svcudp_create(int " sock ); |
fea681da | 998 | .fi |
fea681da MK |
999 | .IP |
1000 | This call is equivalent to | |
c6fa0841 MK |
1001 | .I svcudp_bufcreate(sock,SZ,SZ) |
1002 | for some default size | |
1003 | .IR SZ . | |
dd3568a1 | 1004 | .PP |
fea681da | 1005 | .nf |
9a06b299 | 1006 | .BI "bool_t xdr_accepted_reply(XDR *" xdrs ", struct accepted_reply *" ar ); |
fea681da | 1007 | .fi |
fea681da | 1008 | .IP |
9a06b299 | 1009 | Used for encoding RPC reply messages. |
c13182ef | 1010 | This routine is useful for users who wish to generate |
9a06b299 | 1011 | RPC-style messages without using the RPC package. |
dd3568a1 | 1012 | .PP |
fea681da | 1013 | .nf |
9a06b299 | 1014 | .BI "bool_t xdr_authunix_parms(XDR *" xdrs ", struct authunix_parms *" aupp ); |
fea681da | 1015 | .fi |
fea681da | 1016 | .IP |
008f1ecc | 1017 | Used for describing UNIX credentials. |
c13182ef | 1018 | This routine is useful for users |
9a06b299 | 1019 | who wish to generate these credentials without using the RPC |
fea681da | 1020 | authentication package. |
dd3568a1 | 1021 | .PP |
fea681da | 1022 | .nf |
9a06b299 | 1023 | .BI "void xdr_callhdr(XDR *" xdrs ", struct rpc_msg *" chdr ); |
fea681da | 1024 | .fi |
fea681da | 1025 | .IP |
9a06b299 | 1026 | Used for describing RPC call header messages. |
fea681da | 1027 | This routine is useful for users who wish to generate |
9a06b299 | 1028 | RPC-style messages without using the RPC package. |
dd3568a1 | 1029 | .PP |
fea681da | 1030 | .nf |
9a06b299 | 1031 | .BI "bool_t xdr_callmsg(XDR *" xdrs ", struct rpc_msg *" cmsg ); |
fea681da | 1032 | .fi |
fea681da | 1033 | .IP |
9a06b299 MK |
1034 | Used for describing RPC call messages. |
1035 | This routine is useful for users who wish to generate RPC-style | |
1036 | messages without using the RPC package. | |
dd3568a1 | 1037 | .PP |
fea681da | 1038 | .nf |
9a06b299 | 1039 | .BI "bool_t xdr_opaque_auth(XDR *" xdrs ", struct opaque_auth *" ap ); |
fea681da | 1040 | .fi |
fea681da | 1041 | .IP |
9a06b299 | 1042 | Used for describing RPC authentication information messages. |
fea681da | 1043 | This routine is useful for users who wish to generate |
9a06b299 | 1044 | RPC-style messages without using the RPC package. |
dd3568a1 | 1045 | .PP |
fea681da | 1046 | .nf |
9a06b299 | 1047 | .BI "bool_t xdr_pmap(XDR *" xdrs ", struct pmap *" regs ); |
fea681da | 1048 | .fi |
fea681da MK |
1049 | .IP |
1050 | Used for describing parameters to various | |
1051 | .B portmap | |
1052 | procedures, externally. | |
1053 | This routine is useful for users who wish to generate | |
1054 | these parameters without using the | |
1055 | .B pmap | |
1056 | interface. | |
dd3568a1 | 1057 | .PP |
fea681da | 1058 | .nf |
9a06b299 | 1059 | .BI "bool_t xdr_pmaplist(XDR *" xdrs ", struct pmaplist **" rp ); |
fea681da | 1060 | .fi |
fea681da MK |
1061 | .IP |
1062 | Used for describing a list of port mappings, externally. | |
1063 | This routine is useful for users who wish to generate | |
1064 | these parameters without using the | |
1065 | .B pmap | |
1066 | interface. | |
dd3568a1 | 1067 | .PP |
fea681da | 1068 | .nf |
9a06b299 | 1069 | .BI "bool_t xdr_rejected_reply(XDR *" xdrs ", struct rejected_reply *" rr ); |
fea681da | 1070 | .fi |
fea681da | 1071 | .IP |
9a06b299 | 1072 | Used for describing RPC reply messages. |
fea681da | 1073 | This routine is useful for users who wish to generate |
9a06b299 | 1074 | RPC-style messages without using the RPC package. |
dd3568a1 | 1075 | .PP |
fea681da | 1076 | .nf |
9a06b299 | 1077 | .BI "bool_t xdr_replymsg(XDR *" xdrs ", struct rpc_msg *" rmsg ); |
fea681da | 1078 | .fi |
fea681da | 1079 | .IP |
9a06b299 | 1080 | Used for describing RPC reply messages. |
fea681da | 1081 | This routine is useful for users who wish to generate |
9a06b299 | 1082 | RPC style messages without using the RPC package. |
dd3568a1 | 1083 | .PP |
fea681da | 1084 | .nf |
9a06b299 | 1085 | .BI "void xprt_register(SVCXPRT *" xprt ); |
fea681da | 1086 | .fi |
fea681da | 1087 | .IP |
9a06b299 MK |
1088 | After RPC service transport handles are created, |
1089 | they should register themselves with the RPC service package. | |
fea681da | 1090 | This routine modifies the global variable |
26d4d0d6 | 1091 | .IR svc_fds . |
fea681da | 1092 | Service implementors usually do not need this routine. |
dd3568a1 | 1093 | .PP |
fea681da | 1094 | .nf |
9a06b299 | 1095 | .BI "void xprt_unregister(SVCXPRT *" xprt ); |
fea681da | 1096 | .fi |
fea681da | 1097 | .IP |
9a06b299 MK |
1098 | Before an RPC service transport handle is destroyed, |
1099 | it should unregister itself with the RPC service package. | |
fea681da | 1100 | This routine modifies the global variable |
9a06b299 | 1101 | .IR svc_fds . |
fea681da | 1102 | Service implementors usually do not need this routine. |
7d30e395 ZL |
1103 | .SH ATTRIBUTES |
1104 | For an explanation of the terms used in this section, see | |
1105 | .BR attributes (7). | |
74714ea8 | 1106 | .ad l |
7d30e395 ZL |
1107 | .TS |
1108 | allbox; | |
1109 | lbw35 lb lb | |
1110 | l l l. | |
1111 | Interface Attribute Value | |
1112 | T{ | |
1113 | .BR auth_destroy (), | |
1114 | .BR authnone_create (), | |
1115 | .br | |
1116 | .BR authunix_create (), | |
1117 | .br | |
1118 | .BR authunix_create_default (), | |
1119 | .br | |
1120 | .BR callrpc (), | |
1121 | .BR clnt_broadcast (), | |
1122 | .br | |
1123 | .BR clnt_call (), | |
1124 | .BR clnt_destroy (), | |
1125 | .br | |
1126 | .BR clnt_create (), | |
1127 | .BR clnt_control (), | |
1128 | .br | |
1129 | .BR clnt_freeres (), | |
1130 | .BR clnt_geterr (), | |
1131 | .br | |
1132 | .BR clnt_pcreateerror (), | |
1133 | .BR clnt_perrno (), | |
1134 | .br | |
1135 | .BR clnt_perror (), | |
1136 | .br | |
1137 | .BR clnt_spcreateerror (), | |
1138 | .br | |
1139 | .BR clnt_sperrno (), | |
1140 | .BR clnt_sperror (), | |
1141 | .br | |
1142 | .BR clntraw_create (), | |
1143 | .BR clnttcp_create (), | |
1144 | .br | |
1145 | .BR clntudp_create (), | |
1146 | .br | |
1147 | .BR clntudp_bufcreate (), | |
1148 | .br | |
1149 | .BR get_myaddress (), | |
1150 | .BR pmap_getmaps (), | |
1151 | .br | |
1152 | .BR pmap_getport (), | |
1153 | .BR pmap_rmtcall (), | |
1154 | .br | |
1155 | .BR pmap_set (), | |
1156 | .BR pmap_unset (), | |
1157 | .br | |
1158 | .BR registerrpc (), | |
1159 | .BR svc_destroy (), | |
1160 | .br | |
1161 | .BR svc_freeargs (), | |
1162 | .BR svc_getargs (), | |
1163 | .br | |
1164 | .BR svc_getcaller (), | |
1165 | .BR svc_getreqset (), | |
1166 | .br | |
1167 | .BR svc_getreq (), | |
1168 | .BR svc_register (), | |
1169 | .br | |
1170 | .BR svc_run (), | |
1171 | .BR svc_sendreply (), | |
1172 | .br | |
1173 | .BR svc_unregister (), | |
1174 | .BR svcerr_auth (), | |
1175 | .br | |
1176 | .BR svcerr_decode (), | |
1177 | .BR svcerr_noproc (), | |
1178 | .br | |
1179 | .BR svcerr_noprog (), | |
1180 | .BR svcerr_progvers (), | |
1181 | .br | |
1182 | .BR svcerr_systemerr (), | |
1183 | .BR svcerr_weakauth (), | |
1184 | .br | |
1185 | .BR svcfd_create (), | |
1186 | .BR svcraw_create (), | |
1187 | .br | |
1188 | .BR svctcp_create (), | |
1189 | .br | |
1190 | .BR svcudp_bufcreate (), | |
1191 | .br | |
1192 | .BR svcudp_create (), | |
1193 | .BR xdr_accepted_reply (), | |
1194 | .br | |
1195 | .BR xdr_authunix_parms (), | |
1196 | .br | |
1197 | .BR xdr_callhdr (), | |
1198 | .br | |
1199 | .BR xdr_callmsg (), | |
1200 | .BR xdr_opaque_auth (), | |
1201 | .br | |
1202 | .BR xdr_pmap (), | |
1203 | .BR xdr_pmaplist (), | |
1204 | .br | |
1205 | .BR xdr_rejected_reply (), | |
1206 | .br | |
1207 | .BR xdr_replymsg (), | |
1208 | .br | |
1209 | .BR xprt_register (), | |
1210 | .BR xprt_unregister () | |
1211 | T} Thread safety MT-Safe | |
1212 | .TE | |
74714ea8 | 1213 | .ad |
47297adb | 1214 | .SH SEE ALSO |
57734e82 MK |
1215 | .\" We don't have an rpc_secure.3 page in the set at the moment -- MTK, 19 Sep 05 |
1216 | .\" .BR rpc_secure (3), | |
fea681da | 1217 | .BR xdr (3) |
847e0d88 | 1218 | .PP |
fea681da MK |
1219 | The following manuals: |
1220 | .RS | |
fea681da MK |
1221 | Remote Procedure Calls: Protocol Specification |
1222 | .br | |
1223 | Remote Procedure Call Programming Guide | |
1224 | .br | |
1225 | rpcgen Programming Guide | |
1226 | .br | |
fea681da | 1227 | .RE |
847e0d88 | 1228 | .PP |
066cb3d6 | 1229 | .IR "RPC: Remote Procedure Call Protocol Specification" , |
d2d293ba MK |
1230 | RFC\ 1050, Sun Microsystems, Inc., |
1231 | USC-ISI. |