NAME
librpc - library of RPC/XDR functions

SYNOPSIS
cc [ flags ] files [ libraries -lrpc ]

DESCRIPTION
Functions implementing remote procedure call (RPC) and external
data representation (XDR) may be found in the library librpc. The
link editor ld(1) searches this library under the ‘-lrpc’ option.

FILES
/usr/lib/librpc.a -lrpc

SEE ALSO
For a detailed explanation of RPC and XDR, see the following
sections in the Programmer’s Reference Manual: "Remote Procedure
Call Programming Guide", "Remote Procedure Call Protocol
Specification", and "External Data Representation Protocol
Specification".
intro(3)

LIST OF FUNCTIONS
auth_destroy(auth)
destroy authentication information

authnone_create()
create authentication handle with no info

authunix_create(host, uid, gid, len, aup_gids)
create authentication handle with UNIX info

authunix_create_default()
calls authunix_create() with the appropriate parameters

callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
sends remote procedure call message

clnt_broadcast(prognum, versnum, procnum, inproc, in, outproc, out,

broadcasts remote procedure call message

clnt_call(clnt, procnum, inproc, in, outproc, out, tout)
call client’s remote procedure

clnt_destroy(clnt)
destroy client’s RPC handle

clnt_freeres(clnt, outproc, out)
free any data allocated by the RPC/XDR system

clnt_geterr(clnt, errp)
copy client’s error structure

clnt_pcreateerror(s)
print error message concerning failure to create client RPC
handle

clnt_perrno(stat)
print error message corresponding to stat

clnt_perror(clnt, s)
print error message concerning RPC call failure

clntraw_create(prognum, versnum)
create a toy RPC client for the remote program prognum,
version versnum

clnttcp_create(addr, prognum, versnum, sockp, sendsz, recvsz)
create an RPC client for the remote program prognum, version
versnum; TCP/IP transport

clntudp_create(addr, prognum, versnum, wait, sockp)
create an RPC client for the remote program prognum, version
versnum; UDP/IP transport

get_myaddress(addr)
get machine’s IP address without consulting /etc/hosts

pmap_getmaps(addr)
get list of current RPC program-to-port mappings

pmap_getport(addr, prognum, versnum, protocol)
get port number associated with program

pmap_rmtcall(addr, prognum, versnum, procnum,
make RPC call via portmap on remote host

pmap_set(prognum, versnum, protocol, port)
establish a mapping between the triple
[prognum,versnum,protocol] and port on the machine’s portmap
service

pmap_unset(prognum, versnum)
destroys all mappings between the triple [prognum,versnum,*]
and ports on the machine’s portmap service.

registerrpc(prognum, versnum, procnum, procname, inproc, outproc)
register procedure with the RPC service package

struct rpc_createerr rpc_createerr;
A global variable whose value is set by any RPC client
creation routine that does not succeed

svc_destroy(xprt)
destroy RPC service transport handle
int svc_fds; A global variable
reflecting the RPC service side’s read file descriptor bit
mask

svc_freeargs(xprt, inproc, in)
free any data allocated during argument decode via
svc_getargs()

svc_getargs(xprt, inproc, in)
decode arguments of an RPC request

svc_getcaller(xprt)
get the network address of the procedure caller

svc_getreq(rdfds)
This routine is only of interest if a service implementor does
not call svc_run(), but instead implements custom asynchronous
event processing. svc_register(xprt, prognum, versnum,
dispatch, protocol) associates prognum and versnum with the
service dispatch procedure, dispatch

svc_run()
RPC request dispatcher (uses svc_getreq)

svc_sendreply(xprt, outproc, out)
send results of a remote procedure call

svc_unregister(prognum, versnum)
Removes all mapping of the double [prognum,versnum] to
dispatch routines, and of the triple [prognum,versnum,*] to
port number.

svcerr_auth(xprt, why)
error notification: authentication error

svcerr_decode(xprt)
error notification: parameter decode failure

svcerr_noproc(xprt)
error notification: unimplemented procedure

svcerr_noprog(xprt)
error notification: unregistered program

svcerr_progvers(xprt)
error notification: unregistered program version

svcerr_systemerr(xprt)
error notification: system error

svcerr_weakauth(xprt)
error notification: insufficient (but correct) authentication
parameters

svcraw_create()
create a toy RPC service transport

svctcp_create(sock, send_buf_size, recv_buf_size)
create a TCP/IP-based RPC service transport

svcudp_create(sock)
create a UDP/IP-based RPC service transport

xdr_accepted_reply(xdrs, ar)
Used for describing RPC messages, externally. This routine is
useful for users who wish to generate RPC-style messages
without using the RPC package.

xdr_array(xdrs, arrp, sizep, maxsize, elsize, elproc)
A filter primitive that translates between arrays and their
corresponding external representations.

xdr_authunix_parms(xdrs, aupp)
Used for describing UNIX credentials, externally.

xdr_bool(xdrs, bp)
A filter primitive that translates between booleans (C
integers) and their external representations.

xdr_bytes(xdrs, sp, sizep, maxsize)
A filter primitive that translates between counted byte
strings and their external representations.

xdr_callhdr(xdrs, chdr)
Used for describing RPC messages, externally. This routine is
useful for users who wish to generate RPC-style messages
without using the RPC package.

xdr_callmsg(xdrs, cmsg)
Used for describing RPC messages, externally. This routine is
useful for users who wish to generate RPC-style messages
without using the RPC package.

xdr_destroy(xdrs)
destroy an XDR stream

xdr_double(xdrs, dp)
A filter primitive that translates between C double precision
numbers and their external representations.

xdr_enum(xdrs, ep)
A filter primitive that translates between C enums (actually
integers) and their external representations.

xdr_float(xdrs, fp)
A filter primitive that translates between C floats and their
external representations.

xdr_getpos(xdrs)
get current byte position within XDR stream

xdr_inline(xdrs, len)
A macro that invokes the in-line routine associated with the
XDR stream, xdrs.

xdr_int(xdrs, ip)
A filter primitive that translates between C integers and
their external representations.

xdr_long(xdrs, lp)
A filter primitive that translates between C long integers and
their external representations.

xdr_opaque(xdrs, cp, cnt)
A filter primitive that translates between fixed size opaque
data and its external representation.

xdr_opaque_auth(xdrs, ap)
Used for describing RPC messages, externally. This routine is
useful for users who wish to generate RPC-style messages
without using the RPC package.

xdr_pmap(xdrs, regs)
Used for describing parameters to various portmap procedures,
externally. This routine is useful for users who wish to
generate these parameters without using the pmap interface.

xdr_pmaplist(xdrs, rp)
Used for describing a list of port mappings, externally. This
routine is useful for users who wish to generate these
parameters without using the pmap interface.

xdr_reference(xdrs, pp, size, proc)
A primitive that provides pointer chasing within structures.

xdr_rejected_reply(xdrs, rr)
Used for describing RPC messages, externally. This routine is
useful for users who wish to generate RPC-style messages
without using the RPC package.

xdr_replymsg(xdrs, rmsg)
Used for describing RPC messages, externally. This routine is
useful for users who wish to generate RPC style messages
without using the RPC package.

xdr_setpos(xdrs, pos)
set current byte position within XDR stream

xdr_short(xdrs, sp)
A filter primitive that translates between C short integers
and their external representations.

xdr_string(xdrs, sp, maxsize)
A filter primitive that translates between C strings and their
corresponding external representations.

xdr_u_int(xdrs, up)
A filter primitive that translates between C unsigned integers
and their external representations.

xdr_u_long(xdrs, ulp)
A filter primitive that translates between C unsigned long
integers and their external representations.

xdr_u_short(xdrs, usp)
A filter primitive that translates between C unsigned short
integers and their external representations.

xdr_union(xdrs, dscmp, unp, choices, dfault)
A filter primitive that translates between a discriminated C
union and its corresponding external representation.

xdr_void()
always returns one

xdr_wrapstring(xdrs, sp)
A primitive that calls xdr_string(xdrs,sp,MAXUNSIGNED); where
MAXUNSIGNED is the maximum value of an unsigned integer. This
is handy because the RPC package passes only two parameters
XDR routines, whereas xdr_string(), one of the most frequently
used primitives, requires three parameters.

xdrmem_create(xdrs, addr, size, op)
initialize an XDR stream

xdrrec_create(xdrs, sendsize, recvsize, handle, readit, writeit)
initialize an XDR stream

xdrrec_endofrecord(xdrs, sendnow)
mark data in output buffer as a completed record

xdrrec_eof(xdrs)
consume remainder of current record, and indicate whether end
of stream

xdrrec_skiprecord(xdrs)
discard remainder of current record

xdrstdio_create(xdrs, file, op)
initialize an XDR stream

xprt_register(xprt)
register RPC service transport handle with the RPC service
package

xprt_unregister(xprt)
unregister RPC service transport handle with the RPC service
package

AUTHOR
Sun Microsystems, Inc.