1RPC(3)                     Linux Programmer's Manual                    RPC(3)
2
3
4

NAME

6       rpc - library routines for remote procedure calls
7

SYNOPSIS AND DESCRIPTION

9       These  routines  allow  C programs to make procedure calls on other ma‐
10       chines across the network.  First, the client calls a procedure to send
11       a  data  packet  to the server.  Upon receipt of the packet, the server
12       calls a dispatch routine to perform the  requested  service,  and  then
13       sends back a reply.  Finally, the procedure call returns to the client.
14
15       To take use of these routines, include the header file <rpc/rpc.h>.
16
17       The prototypes below make use of the following types:
18
19           typedef int bool_t;
20
21           typedef bool_t (*xdrproc_t)(XDR *, void *, ...);
22
23           typedef bool_t (*resultproc_t)(caddr_t resp,
24                                          struct sockaddr_in *raddr);
25
26       See the header files for the declarations of the AUTH, CLIENT, SVCXPRT,
27       and XDR types.
28
29       void auth_destroy(AUTH *auth);
30
31              A macro that destroys the authentication information  associated
32              with auth.  Destruction usually involves deallocation of private
33              data structures.  The use of auth  is  undefined  after  calling
34              auth_destroy().
35
36       AUTH *authnone_create(void);
37
38              Create  and  return  an  RPC  authentication  handle that passes
39              nonusable authentication information with each remote  procedure
40              call.  This is the default authentication used by RPC.
41
42       AUTH *authunix_create(char *host, uid_t uid, gid_t gid,
43                             int len, gid_t *aup_gids);
44
45              Create and return an RPC authentication handle that contains au‐
46              thentication information.  The parameter host is the name of the
47              machine  on which the information was created; uid is the user's
48              user ID; gid is the user's current group ID;  len  and  aup_gids
49              refer  to  a  counted array of groups to which the user belongs.
50              It is easy to impersonate a user.
51
52       AUTH *authunix_create_default(void);
53
54              Calls authunix_create() with the appropriate parameters.
55
56       int callrpc(char *host, unsigned long prognum,
57                   unsigned long versnum, unsigned long procnum,
58                   xdrproc_t inproc, const char *in,
59                   xdrproc_t outproc, char *out);
60
61              Call the remote procedure associated with prognum, versnum,  and
62              procnum  on  the machine, host.  The parameter in is the address
63              of the procedure's argument(s), and out is the address of  where
64              to place the result(s); inproc is used to encode the procedure's
65              parameters, and outproc is used to decode  the  procedure's  re‐
66              sults.   This  routine returns zero if it succeeds, or the value
67              of enum clnt_stat cast to an integer if it fails.   The  routine
68              clnt_perrno()  is  handy  for  translating failure statuses into
69              messages.
70
71              Warning: calling remote procedures with this routine uses UDP/IP
72              as  a  transport; see clntudp_create() for restrictions.  You do
73              not have control of timeouts or authentication using  this  rou‐
74              tine.
75
76       enum clnt_stat clnt_broadcast(unsigned long prognum,
77                            unsigned long versnum, unsigned long procnum,
78                            xdrproc_t inproc, char *in,
79                            xdrproc_t outproc, char *out,
80                            resultproc_t eachresult);
81
82              Like  callrpc(), except the call message is broadcast to all lo‐
83              cally connected broadcast nets.  Each time  it  receives  a  re‐
84              sponse, this routine calls eachresult(), whose form is:
85
86                  eachresult(char *out, struct sockaddr_in *addr);
87
88              where  out is the same as out passed to clnt_broadcast(), except
89              that the remote procedure's output is decoded there; addr points
90              to the address of the machine that sent the results.  If eachre‐
91              sult() returns zero, clnt_broadcast() waits  for  more  replies;
92              otherwise it returns with appropriate status.
93
94              Warning:  broadcast  sockets  are limited in size to the maximum
95              transfer unit of the data link.  For  ethernet,  this  value  is
96              1500 bytes.
97
98       enum clnt_stat clnt_call(CLIENT *clnt, unsigned long procnum,
99                           xdrproc_t inproc, char *in,
100                           xdrproc_t outproc, char *out,
101                           struct timeval tout);
102
103              A  macro that calls the remote procedure procnum associated with
104              the client handle, clnt, which is obtained with  an  RPC  client
105              creation routine such as clnt_create().  The parameter in is the
106              address of the procedure's argument(s), and out is  the  address
107              of  where  to  place the result(s); inproc is used to encode the
108              procedure's parameters, and outproc is used to decode the proce‐
109              dure's  results;  tout  is  the time allowed for results to come
110              back.
111
112       clnt_destroy(CLIENT *clnt);
113
114              A macro that destroys the client's RPC handle.  Destruction usu‐
115              ally involves deallocation of private data structures, including
116              clnt itself.  Use of clnt is undefined  after  calling  clnt_de‐
117              stroy().   If  the  RPC library opened the associated socket, it
118              will close it also.  Otherwise, the socket remains open.
119
120       CLIENT *clnt_create(const char *host, unsigned long prog,
121                           unsigned long vers, const char *proto);
122
123              Generic client creation routine.  host identifies  the  name  of
124              the  remote  host  where the server is located.  proto indicates
125              which kind of transport protocol to  use.   The  currently  sup‐
126              ported values for this field are “udp” and “tcp”.  Default time‐
127              outs are set, but can be modified using clnt_control().
128
129              Warning: using UDP has its shortcomings.   Since  UDP-based  RPC
130              messages  can  hold  only  up  to 8 Kbytes of encoded data, this
131              transport cannot be used for procedures that  take  large  argu‐
132              ments or return huge results.
133
134       bool_t clnt_control(CLIENT *cl, int req, char *info);
135
136              A  macro  used to change or retrieve various information about a
137              client object.  req indicates the type of operation, and info is
138              a  pointer  to  the information.  For both UDP and TCP, the sup‐
139              ported values of req and their argument types and what  they  do
140              are:
141
142                  CLSET_TIMEOUT  struct timeval // set total timeout
143                  CLGET_TIMEOUT  struct timeval // get total timeout
144
145              Note:  if  you set the timeout using clnt_control(), the timeout
146              parameter passed to clnt_call() will be ignored  in  all  future
147              calls.
148
149                  CLGET_SERVER_ADDR  struct sockaddr_in
150                                  // get server's address
151
152              The following operations are valid for UDP only:
153
154                  CLSET_RETRY_TIMEOUT  struct timeval // set the retry timeout
155                  CLGET_RETRY_TIMEOUT  struct timeval // get the retry timeout
156
157              The  retry  timeout  is  the  time  that "UDP RPC" waits for the
158              server to reply before retransmitting the request.
159
160       clnt_freeres(CLIENT * clnt, xdrproc_t outproc, char *out);
161
162              A macro that frees any data allocated by the RPC/XDR system when
163              it decoded the results of an RPC call.  The parameter out is the
164              address of the results, and outproc is the XDR routine  describ‐
165              ing  the  results.  This routine returns one if the results were
166              successfully freed, and zero otherwise.
167
168       void clnt_geterr(CLIENT *clnt, struct rpc_err *errp);
169
170              A macro that copies the error structure out of the client handle
171              to the structure at address errp.
172
173       void clnt_pcreateerror(const char *s);
174
175              Print  a  message  to standard error indicating why a client RPC
176              handle could not be created.   The  message  is  prepended  with
177              string  s  and a colon.  Used when a clnt_create(), clntraw_cre‐
178              ate(), clnttcp_create(), or clntudp_create() call fails.
179
180       void clnt_perrno(enum clnt_stat stat);
181
182              Print a message to standard error corresponding to the condition
183              indicated by stat.  Used after callrpc().
184
185       clnt_perror(CLIENT *clnt, const char *s);
186
187              Print  a  message  to  standard error indicating why an RPC call
188              failed; clnt is the handle used to do the call.  The message  is
189              prepended with string s and a colon.  Used after clnt_call().
190
191       char *clnt_spcreateerror(const char *s);
192
193              Like  clnt_pcreateerror(),  except  that it returns a string in‐
194              stead of printing to the standard error.
195
196              Bugs: returns pointer to static data that is overwritten on each
197              call.
198
199       char *clnt_sperrno(enum clnt_stat stat);
200
201              Take the same arguments as clnt_perrno(), but instead of sending
202              a message to the standard  error  indicating  why  an  RPC  call
203              failed, return a pointer to a string which contains the message.
204              The string ends with a NEWLINE.
205
206              clnt_sperrno() is used instead of clnt_perrno() if  the  program
207              does not have a standard error (as a program running as a server
208              quite likely does not), or if the programmer does not  want  the
209              message to be output with printf(3), or if a message format dif‐
210              ferent than that supported  by  clnt_perrno()  is  to  be  used.
211              Note: unlike clnt_sperror() and clnt_spcreateerror(), clnt_sper‐
212              rno() returns pointer to static data, but the  result  will  not
213              get overwritten on each call.
214
215       char *clnt_sperror(CLIENT *rpch, const char *s);
216
217              Like clnt_perror(), except that (like clnt_sperrno()) it returns
218              a string instead of printing to standard error.
219
220              Bugs: returns pointer to static data that is overwritten on each
221              call.
222
223       CLIENT *clntraw_create(unsigned long prognum, unsigned long versnum);
224
225              This  routine  creates  a  toy RPC client for the remote program
226              prognum, version versnum.  The transport used to  pass  messages
227              to the service is actually a buffer within the process's address
228              space, so the corresponding RPC server should live in  the  same
229              address  space;  see svcraw_create().  This allows simulation of
230              RPC and acquisition of RPC overheads, such as round trip  times,
231              without  any  kernel interference.  This routine returns NULL if
232              it fails.
233
234       CLIENT *clnttcp_create(struct sockaddr_in *addr,
235                       unsigned long prognum, unsigned long versnum,
236                       int *sockp, unsigned int sendsz, unsigned int recvsz);
237
238              This routine creates  an  RPC  client  for  the  remote  program
239              prognum, version versnum; the client uses TCP/IP as a transport.
240              The remote program is located at  Internet  address  *addr.   If
241              addr->sin_port  is  zero, then it is set to the actual port that
242              the remote program is listening on (the remote  portmap  service
243              is  consulted  for  this information).  The parameter sockp is a
244              socket; if it is RPC_ANYSOCK, then this routine opens a new  one
245              and sets sockp.  Since TCP-based RPC uses buffered I/O, the user
246              may specify the size of the send and receive  buffers  with  the
247              parameters sendsz and recvsz; values of zero choose suitable de‐
248              faults.  This routine returns NULL if it fails.
249
250       CLIENT *clntudp_create(struct sockaddr_in *addr,
251                       unsigned long prognum, unsigned long versnum,
252                       struct timeval wait, int *sockp);
253
254              This routine creates  an  RPC  client  for  the  remote  program
255              prognum, version versnum; the client uses use UDP/IP as a trans‐
256              port.  The remote program is located at Internet  address  addr.
257              If  addr->sin_port  is  zero, then it is set to actual port that
258              the remote program is listening on (the remote  portmap  service
259              is  consulted  for  this information).  The parameter sockp is a
260              socket; if it is RPC_ANYSOCK, then this routine opens a new  one
261              and  sets  sockp.  The UDP transport resends the call message in
262              intervals of wait time until a response is received or until the
263              call  times  out.   The  total  time for the call to time out is
264              specified by clnt_call().
265
266              Warning: since UDP-based RPC messages can  hold  only  up  to  8
267              Kbytes of encoded data, this transport cannot be used for proce‐
268              dures that take large arguments or return huge results.
269
270       CLIENT *clntudp_bufcreate(struct sockaddr_in *addr,
271                   unsigned long prognum, unsigned long versnum,
272                   struct timeval wait, int *sockp,
273                   unsigned int sendsize, unsigned int recosize);
274
275              This routine creates  an  RPC  client  for  the  remote  program
276              prognum,  on versnum; the client uses use UDP/IP as a transport.
277              The remote program is located  at  Internet  address  addr.   If
278              addr->sin_port  is  zero, then it is set to actual port that the
279              remote program is listening on (the remote  portmap  service  is
280              consulted  for  this  information).   The  parameter  sockp is a
281              socket; if it is RPC_ANYSOCK, then this routine opens a new  one
282              and  sets  sockp.  The UDP transport resends the call message in
283              intervals of wait time until a response is received or until the
284              call  times  out.   The  total  time for the call to time out is
285              specified by clnt_call().
286
287              This allows the user to specify  the  maximum  packet  size  for
288              sending and receiving UDP-based RPC messages.
289
290       void get_myaddress(struct sockaddr_in *addr);
291
292              Stuff  the  machine's  IP address into *addr, without consulting
293              the library routines that deal with /etc/hosts.  The port number
294              is always set to htons(PMAPPORT).
295
296       struct pmaplist *pmap_getmaps(struct sockaddr_in *addr);
297
298              A user interface to the portmap service, which returns a list of
299              the current RPC program-to-port mappings on the host located  at
300              IP  address  *addr.   This routine can return NULL.  The command
301              rpcinfo -p uses this routine.
302
303       unsigned short pmap_getport(struct sockaddr_in *addr,
304                           unsigned long prognum, unsigned long versnum,
305                           unsigned int protocol);
306
307              A user interface to the portmap service, which returns the  port
308              number  on  which  waits  a service that supports program number
309              prognum, version versnum, and speaks the transport protocol  as‐
310              sociated  with  protocol.   The value of protocol is most likely
311              IPPROTO_UDP or IPPROTO_TCP.  A return value of zero  means  that
312              the mapping does not exist or that the RPC system failed to con‐
313              tact the remote portmap service.  In the latter case, the global
314              variable rpc_createerr contains the RPC status.
315
316       enum clnt_stat pmap_rmtcall(struct sockaddr_in *addr,
317                           unsigned long prognum, unsigned long versnum,
318                           unsigned long procnum,
319                           xdrproc_t inproc, char *in,
320                           xdrproc_t outproc, char *out,
321                           struct timeval tout, unsigned long *portp);
322
323              A user interface to the portmap service, which instructs portmap
324              on the host at IP address *addr to make an RPC call on your  be‐
325              half  to a procedure on that host.  The parameter *portp will be
326              modified to the program's port number if the procedure succeeds.
327              The  definitions  of other parameters are discussed in callrpc()
328              and clnt_call().  This procedure should be used for a “ping” and
329              nothing else.  See also clnt_broadcast().
330
331       bool_t pmap_set(unsigned long prognum, unsigned long versnum,
332                       int protocol, unsigned short port);
333
334              A  user  interface  to  the portmap service, which establishes a
335              mapping between the triple [prognum,versnum,protocol]  and  port
336              on the machine's portmap service.  The value of protocol is most
337              likely IPPROTO_UDP or IPPROTO_TCP.  This routine returns one  if
338              it  succeeds,  zero otherwise.  Automatically done by svc_regis‐
339              ter().
340
341       bool_t pmap_unset(unsigned long prognum, unsigned long versnum);
342
343              A user interface to the portmap service, which destroys all map‐
344              ping between the triple [prognum,versnum,*] and ports on the ma‐
345              chine's portmap service.  This routine returns one  if  it  suc‐
346              ceeds, zero otherwise.
347
348       int registerrpc(unsigned long prognum, unsigned long versnum,
349                       unsigned long procnum, char *(*procname)(char *),
350                       xdrproc_t inproc, xdrproc_t outproc);
351
352              Register  procedure procname with the RPC service package.  If a
353              request arrives for program prognum, version versnum, and proce‐
354              dure  procnum,  procname is called with a pointer to its parame‐
355              ter(s); procname should return  a  pointer  to  its  static  re‐
356              sult(s);  inproc  is used to decode the parameters while outproc
357              is used to encode the results.  This routine returns zero if the
358              registration succeeded, -1 otherwise.
359
360              Warning:  remote procedures registered in this form are accessed
361              using the UDP/IP transport;  see  svcudp_create()  for  restric‐
362              tions.
363
364       struct rpc_createerr rpc_createerr;
365
366              A  global variable whose value is set by any RPC client creation
367              routine that does not succeed.  Use the routine  clnt_pcreateer‐
368              ror() to print the reason why.
369
370       void svc_destroy(SVCXPRT *xprt);
371
372              A  macro  that  destroys the RPC service transport handle, xprt.
373              Destruction usually involves deallocation of private data struc‐
374              tures,  including  xprt  itself.  Use of xprt is undefined after
375              calling this routine.
376
377       fd_set svc_fdset;
378
379              A global variable reflecting the RPC service  side's  read  file
380              descriptor  bit  mask;  it is suitable as a parameter to the se‐
381              lect(2) system call.  This is of interest only if a service  im‐
382              plementor  does their own asynchronous event processing, instead
383              of calling svc_run().  This variable is read-only (do  not  pass
384              its  address  to  select(2)!),  yet it may change after calls to
385              svc_getreqset() or any creation routines.
386
387       int svc_fds;
388
389              Similar to svc_fdset, but limited to 32 file descriptors.   This
390              interface is obsoleted by svc_fdset.
391
392       svc_freeargs(SVCXPRT *xprt, xdrproc_t inproc, char *in);
393
394              A macro that frees any data allocated by the RPC/XDR system when
395              it  decoded  the  arguments  to  a   service   procedure   using
396              svc_getargs().   This routine returns 1 if the results were suc‐
397              cessfully freed, and zero otherwise.
398
399       svc_getargs(SVCXPRT *xprt, xdrproc_t inproc, char *in);
400
401              A macro that decodes the arguments of an RPC request  associated
402              with  the  RPC service transport handle, xprt.  The parameter in
403              is the address where the arguments will be placed; inproc is the
404              XDR  routine used to decode the arguments.  This routine returns
405              one if decoding succeeds, and zero otherwise.
406
407       struct sockaddr_in *svc_getcaller(SVCXPRT *xprt);
408
409              The approved way of getting the network address of the caller of
410              a  procedure  associated  with the RPC service transport handle,
411              xprt.
412
413       void svc_getreqset(fd_set *rdfds);
414
415              This routine is of interest only if a service  implementor  does
416              not  call  svc_run(), but instead implements custom asynchronous
417              event processing.  It is called when the select(2)  system  call
418              has  determined  that  an  RPC  request  has arrived on some RPC
419              socket(s); rdfds is the resultant read file descriptor bit mask.
420              The  routine  returns when all sockets associated with the value
421              of rdfds have been serviced.
422
423       void svc_getreq(int rdfds);
424
425              Similar to svc_getreqset(), but limited to 32 file  descriptors.
426              This interface is obsoleted by svc_getreqset().
427
428       bool_t svc_register(SVCXPRT *xprt, unsigned long prognum,
429                           unsigned long versnum,
430                           void (*dispatch)(struct svc_req *, SVCXPRT *),
431                           unsigned long protocol);
432
433              Associates  prognum and versnum with the service dispatch proce‐
434              dure, dispatch.  If protocol is zero, the service is not  regis‐
435              tered  with the portmap service.  If protocol is nonzero, then a
436              mapping   of   the    triple    [prognum,versnum,protocol]    to
437              xprt->xp_port  is  established  with  the  local portmap service
438              (generally protocol is zero, IPPROTO_UDP or  IPPROTO_TCP).   The
439              procedure dispatch has the following form:
440
441                  dispatch(struct svc_req *request, SVCXPRT *xprt);
442
443              The  svc_register() routine returns one if it succeeds, and zero
444              otherwise.
445
446       void svc_run(void);
447
448              This routine never returns.  It waits for RPC  requests  to  ar‐
449              rive,  and calls the appropriate service procedure using svc_ge‐
450              treq() when one arrives.  This procedure is usually waiting  for
451              a select(2) system call to return.
452
453       bool_t svc_sendreply(SVCXPRT *xprt, xdrproc_t outproc, char *out);
454
455              Called  by an RPC service's dispatch routine to send the results
456              of a remote procedure call.  The parameter xprt is the request's
457              associated transport handle; outproc is the XDR routine which is
458              used to encode the results; and out is the address  of  the  re‐
459              sults.  This routine returns one if it succeeds, zero otherwise.
460
461       void svc_unregister(unsigned long prognum, unsigned long versnum);
462
463              Remove  all  mapping of the double [prognum,versnum] to dispatch
464              routines, and of the triple [prognum,versnum,*] to port number.
465
466       void svcerr_auth(SVCXPRT *xprt, enum auth_stat why);
467
468              Called by a service dispatch routine that refuses to  perform  a
469              remote procedure call due to an authentication error.
470
471       void svcerr_decode(SVCXPRT *xprt);
472
473              Called  by  a  service dispatch routine that cannot successfully
474              decode its parameters.  See also svc_getargs().
475
476       void svcerr_noproc(SVCXPRT *xprt);
477
478              Called by a service dispatch routine that does not implement the
479              procedure number that the caller requests.
480
481       void svcerr_noprog(SVCXPRT *xprt);
482
483              Called  when  the desired program is not registered with the RPC
484              package.  Service implementors usually do not need this routine.
485
486       void svcerr_progvers(SVCXPRT *xprt, unsigned long low_vers,
487                            unsigned long high_vers);
488
489              Called when the desired version of a program is  not  registered
490              with  the RPC package.  Service implementors usually do not need
491              this routine.
492
493       void svcerr_systemerr(SVCXPRT *xprt);
494
495              Called by a service dispatch routine when it  detects  a  system
496              error not covered by any particular protocol.  For example, if a
497              service can no longer allocate storage, it may  call  this  rou‐
498              tine.
499
500       void svcerr_weakauth(SVCXPRT *xprt);
501
502              Called  by  a service dispatch routine that refuses to perform a
503              remote procedure call due to insufficient authentication parame‐
504              ters.  The routine calls svcerr_auth(xprt, AUTH_TOOWEAK).
505
506       SVCXPRT *svcfd_create(int fd, unsigned int sendsize,
507                             unsigned int recvsize);
508
509              Create a service on top of any open file descriptor.  Typically,
510              this file descriptor is a connected socket for a stream protocol
511              such  as TCP.  sendsize and recvsize indicate sizes for the send
512              and receive buffers.  If they are zero, a reasonable default  is
513              chosen.
514
515       SVCXPRT *svcraw_create(void);
516
517              This  routine  creates  a toy RPC service transport, to which it
518              returns a pointer.  The transport is really a buffer within  the
519              process's  address space, so the corresponding RPC client should
520              live in the same address space; see clntraw_create().  This rou‐
521              tine  allows  simulation of RPC and acquisition of RPC overheads
522              (such as round trip times),  without  any  kernel  interference.
523              This routine returns NULL if it fails.
524
525       SVCXPRT *svctcp_create(int sock, unsigned int send_buf_size,
526                              unsigned int recv_buf_size);
527
528              This  routine  creates  a TCP/IP-based RPC service transport, to
529              which it returns a pointer.  The transport  is  associated  with
530              the  socket  sock, which may be RPC_ANYSOCK, in which case a new
531              socket is created.  If the socket is not bound to  a  local  TCP
532              port,  then  this  routine  binds it to an arbitrary port.  Upon
533              completion, xprt->xp_sock is the transport's socket  descriptor,
534              and  xprt->xp_port is the transport's port number.  This routine
535              returns NULL if it fails.  Since  TCP-based  RPC  uses  buffered
536              I/O,  users  may  specify  the  size  of buffers; values of zero
537              choose suitable defaults.
538
539       SVCXPRT *svcudp_bufcreate(int sock, unsigned int sendsize,
540                                 unsigned int recosize);
541
542              This routine creates a UDP/IP-based RPC  service  transport,  to
543              which  it  returns  a pointer.  The transport is associated with
544              the socket sock, which may be RPC_ANYSOCK, in which case  a  new
545              socket  is  created.   If the socket is not bound to a local UDP
546              port, then this routine binds it to  an  arbitrary  port.   Upon
547              completion,  xprt->xp_sock is the transport's socket descriptor,
548              and xprt->xp_port is the transport's port number.  This  routine
549              returns NULL if it fails.
550
551              This  allows  the  user  to  specify the maximum packet size for
552              sending and receiving UDP-based RPC messages.
553
554       SVCXPRT *svcudp_create(int sock);
555
556              This call is equivalent to svcudp_bufcreate(sock,SZ,SZ) for some
557              default size SZ.
558
559       bool_t xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar);
560
561              Used  for  encoding  RPC reply messages.  This routine is useful
562              for users who wish to generate RPC-style messages without  using
563              the RPC package.
564
565       bool_t xdr_authunix_parms(XDR *xdrs, struct authunix_parms *aupp);
566
567              Used  for  describing  UNIX credentials.  This routine is useful
568              for users who wish to generate these credentials  without  using
569              the RPC authentication package.
570
571       void xdr_callhdr(XDR *xdrs, struct rpc_msg *chdr);
572
573              Used  for  describing RPC call header messages.  This routine is
574              useful for users who wish to generate RPC-style messages without
575              using the RPC package.
576
577       bool_t xdr_callmsg(XDR *xdrs, struct rpc_msg *cmsg);
578
579              Used  for  describing RPC call messages.  This routine is useful
580              for users who wish to generate RPC-style messages without  using
581              the RPC package.
582
583       bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap);
584
585              Used  for  describing  RPC  authentication information messages.
586              This routine is useful for users who wish to generate  RPC-style
587              messages without using the RPC package.
588
589       bool_t xdr_pmap(XDR *xdrs, struct pmap *regs);
590
591              Used  for  describing  parameters to various portmap procedures,
592              externally.  This routine is useful for users who wish to gener‐
593              ate these parameters without using the pmap interface.
594
595       bool_t xdr_pmaplist(XDR *xdrs, struct pmaplist **rp);
596
597              Used  for  describing a list of port mappings, externally.  This
598              routine is useful for users who wish to generate  these  parame‐
599              ters without using the pmap interface.
600
601       bool_t xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr);
602
603              Used  for describing RPC reply messages.  This routine is useful
604              for users who wish to generate RPC-style messages without  using
605              the RPC package.
606
607       bool_t xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg);
608
609              Used  for describing RPC reply messages.  This routine is useful
610              for users who wish to generate RPC style messages without  using
611              the RPC package.
612
613       void xprt_register(SVCXPRT *xprt);
614
615              After  RPC  service  transport  handles are created, they should
616              register themselves with the RPC service package.  This  routine
617              modifies the global variable svc_fds.  Service implementors usu‐
618              ally do not need this routine.
619
620       void xprt_unregister(SVCXPRT *xprt);
621
622              Before an RPC service transport handle is destroyed,  it  should
623              unregister  itself  with  the RPC service package.  This routine
624              modifies the global variable svc_fds.  Service implementors usu‐
625              ally do not need this routine.
626

ATTRIBUTES

628       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
629       tributes(7).
630
631       ┌────────────────────────────────────────────┬───────────────┬─────────┐
632Interface                                   Attribute     Value   
633       ├────────────────────────────────────────────┼───────────────┼─────────┤
634auth_destroy(), authnone_create(),          │ Thread safety │ MT-Safe │
635authunix_create(),                          │               │         │
636authunix_create_default(), callrpc(),       │               │         │
637clnt_broadcast(), clnt_call(),              │               │         │
638clnt_destroy(), clnt_create(),              │               │         │
639clnt_control(), clnt_freeres(),             │               │         │
640clnt_geterr(), clnt_pcreateerror(),         │               │         │
641clnt_perrno(), clnt_perror(),               │               │         │
642clnt_spcreateerror(), clnt_sperrno(),       │               │         │
643clnt_sperror(), clntraw_create(),           │               │         │
644clnttcp_create(), clntudp_create(),         │               │         │
645clntudp_bufcreate(), get_myaddress(),       │               │         │
646pmap_getmaps(), pmap_getport(),             │               │         │
647pmap_rmtcall(), pmap_set(), pmap_unset(),   │               │         │
648registerrpc(), svc_destroy(),               │               │         │
649svc_freeargs(), svc_getargs(),              │               │         │
650svc_getcaller(), svc_getreqset(),           │               │         │
651svc_getreq(), svc_register(), svc_run(),    │               │         │
652svc_sendreply(), svc_unregister(),          │               │         │
653svcerr_auth(), svcerr_decode(),             │               │         │
654svcerr_noproc(), svcerr_noprog(),           │               │         │
655svcerr_progvers(), svcerr_systemerr(),      │               │         │
656svcerr_weakauth(), svcfd_create(),          │               │         │
657svcraw_create(), svctcp_create(),           │               │         │
658svcudp_bufcreate(), svcudp_create(),        │               │         │
659xdr_accepted_reply(), xdr_authunix_parms(), │               │         │
660xdr_callhdr(), xdr_callmsg(),               │               │         │
661xdr_opaque_auth(), xdr_pmap(),              │               │         │
662xdr_pmaplist(), xdr_rejected_reply(),       │               │         │
663xdr_replymsg(), xprt_register(),            │               │         │
664xprt_unregister()                           │               │         │
665       └────────────────────────────────────────────┴───────────────┴─────────┘
666

SEE ALSO

668       xdr(3)
669
670       The following manuals:
671              Remote Procedure Calls: Protocol Specification
672              Remote Procedure Call Programming Guide
673              rpcgen Programming Guide
674
675       RPC: Remote Procedure Call Protocol Specification,  RFC 1050,  Sun  Mi‐
676       crosystems, Inc., USC-ISI.
677

COLOPHON

679       This  page  is  part of release 5.13 of the Linux man-pages project.  A
680       description of the project, information about reporting bugs,  and  the
681       latest     version     of     this    page,    can    be    found    at
682       https://www.kernel.org/doc/man-pages/.
683
684
685
686                                  2021-03-22                            RPC(3)
Impressum