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