{
    "content": [
        {
            "type": "text",
            "text": "# rpc_soc(3) (man)\n\n## NAME\n\nrpcsoc, authdestroy, authnonecreate, authunixcreate, authunixcreatedefault, callrpc, clntbroadcast, clntcall, clntcontrol, clntcreate, clntdestroy, clntfreeres, clntgeterr, clntpcreateerror, clntperrno, clntperror, clntspcreateerror, clntsperrno, clntsperror, clntrawcreate, clnttcpcreate, clntudpbufcreate, clntudpcreate, clntunixcreate, getmyaddress, pmapgetmaps, pmapgetport, pmaprmtcall, pmapset, pmapunset, registerrpc, rpccreateerr, svcdestroy, svcfds, svcfdset, svcgetargs, svcgetcaller, svcgetreq, svcgetreqset, svcregister, svcrun, svcsendreply, svcunregister, svcerrauth, svcerrdecode, svcerrnoproc, svcerrnoprog, svcerrprogvers, svcerrsystemerr, svcerrweakauth, svcfdcreate, svcunixfdcreate, svcrawcreate, svcunixcreate, xdracceptedreply, xdrauthunixparms, xdrcallhdr, xdrcallmsg, xdropaqueauth, xdrpmap, xdrpmaplist, xdrrejectedreply, xdrreplymsg, xprtregister, xprtunregister — library rou‐ tines for remote procedure calls\n\n## DESCRIPTION\n\nThe svc*() and clnt*() functions described in this page are the old, TS-RPC interface to the\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS** (1 subsections)\n- **DESCRIPTION** (1 subsections)\n- **AVAILABILITY**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "rpc_soc",
        "section": "3",
        "mode": "man",
        "summary": "rpcsoc, authdestroy, authnonecreate, authunixcreate, authunixcreatedefault, callrpc, clntbroadcast, clntcall, clntcontrol, clntcreate, clntdestroy, clntfreeres, clntgeterr, clntpcreateerror, clntperrno, clntperror, clntspcreateerror, clntsperrno, clntsperror, clntrawcreate, clnttcpcreate, clntudpbufcreate, clntudpcreate, clntunixcreate, getmyaddress, pmapgetmaps, pmapgetport, pmaprmtcall, pmapset, pmapunset, registerrpc, rpccreateerr, svcdestroy, svcfds, svcfdset, svcgetargs, svcgetcaller, svcgetreq, svcgetreqset, svcregister, svcrun, svcsendreply, svcunregister, svcerrauth, svcerrdecode, svcerrnoproc, svcerrnoprog, svcerrprogvers, svcerrsystemerr, svcerrweakauth, svcfdcreate, svcunixfdcreate, svcrawcreate, svcunixcreate, xdracceptedreply, xdrauthunixparms, xdrcallhdr, xdrcallmsg, xdropaqueauth, xdrpmap, xdrpmaplist, xdrrejectedreply, xdrreplymsg, xprtregister, xprtunregister — library rou‐ tines for remote procedure calls",
        "synopsis": "",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "rpcsecure",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/rpcsecure/3/json"
            },
            {
                "name": "xdr",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/xdr/3/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "#include <rpc/rpc.h>",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 1,
                "subsections": [
                    {
                        "name": "XDR and RPC library, and exist for backward compatibility.  The new interface is described in",
                        "lines": 571
                    }
                ]
            },
            {
                "name": "AVAILABILITY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 11,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "rpcsoc, authdestroy, authnonecreate, authunixcreate, authunixcreatedefault, callrpc,\nclntbroadcast, clntcall, clntcontrol, clntcreate, clntdestroy, clntfreeres, clntgeterr,\nclntpcreateerror, clntperrno, clntperror, clntspcreateerror, clntsperrno, clntsperror,\nclntrawcreate, clnttcpcreate, clntudpbufcreate, clntudpcreate, clntunixcreate,\ngetmyaddress, pmapgetmaps, pmapgetport, pmaprmtcall, pmapset, pmapunset, registerrpc,\nrpccreateerr, svcdestroy, svcfds, svcfdset, svcgetargs, svcgetcaller, svcgetreq,\nsvcgetreqset, svcregister, svcrun, svcsendreply, svcunregister, svcerrauth,\nsvcerrdecode, svcerrnoproc, svcerrnoprog, svcerrprogvers, svcerrsystemerr,\nsvcerrweakauth, svcfdcreate, svcunixfdcreate, svcrawcreate, svcunixcreate,\nxdracceptedreply, xdrauthunixparms, xdrcallhdr, xdrcallmsg, xdropaqueauth, xdrpmap,\nxdrpmaplist, xdrrejectedreply, xdrreplymsg, xprtregister, xprtunregister — library rou‐\ntines for remote procedure calls\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "",
                "subsections": [
                    {
                        "name": "#include <rpc/rpc.h>",
                        "content": "See DESCRIPTION for function declarations.\n"
                    }
                ]
            },
            "DESCRIPTION": {
                "content": "The svc*() and clnt*() functions described in this page are the old, TS-RPC interface to the",
                "subsections": [
                    {
                        "name": "XDR and RPC library, and exist for backward compatibility.  The new interface is described in",
                        "content": "the pages referenced from rpc(3).\n\nThese routines allow C programs to make procedure calls on other machines across the network.\nFirst, the client calls a procedure to send a data packet to the server.  Upon receipt of the\npacket, the server calls a dispatch routine to perform the requested service, and then sends\nback a reply.  Finally, the procedure call returns to the client.\n\nRoutines that are used for Secure RPC (DES authentication) are described in rpcsecure(3).  Se‐\ncure RPC can be used only if DES encryption is available.\n\nvoid\nauthdestroy(AUTH *auth)\n\nA macro that destroys the authentication information associated with auth.  Destruction\nusually involves deallocation of private data structures.  The use of auth is undefined\nafter calling authdestroy().\n\nAUTH *\nauthnonecreate()\n\nCreate and return an RPC authentication handle that passes nonusable authentication in‐\nformation with each remote procedure call.  This is the default authentication used by\nRPC.\n\nAUTH *\nauthunixcreate(char *host, int uid, int gid, int len, int *aupgids)\n\nCreate and return an RPC authentication handle that contains UNIX authentication infor‐\nmation.  The host argument is the name of the machine on which the information was cre‐\nated; uid is the user's user ID; gid is the user's current group ID; len and aupgids\nrefer to a counted array of groups to which the user belongs.  It is easy to imperson‐\nate a user.\n\nAUTH *\nauthunixcreatedefault()\n\nCalls authunixcreate() with the appropriate arguments.\n\nint callrpc(char *host, ulong prognum, ulong versnum, ulong procnum, xdrproct inproc,\nvoid *in, xdrproct outproc, void *out)\n\nCall the remote procedure associated with prognum, versnum, and procnum on the machine\nhost.  The in argument is the address of the procedure's argument(s), and out is the\naddress of where to place the result(s); inproc is used to encode the procedure's argu‐\nments, and outproc is used to decode the procedure's results.  This routine returns\nzero if it succeeds, or the value of enum clntstat cast to an integer if it fails.\nThe routine clntperrno() is handy for translating failure statuses into messages.\n\nWarning: calling remote procedures with this routine uses UDP/IP as a transport; see\nclntudpcreate() for restrictions.  You do not have control of timeouts or authentica‐\ntion using this routine.\n\nenum clntstat\nclntbroadcast(ulong prognum, ulong versnum, ulong procnum, xdrproct inproc, char *in,\nxdrproct outproc, char *out, boolt (*eachresult)(caddrt, struct sockaddrin *))\n\nLike callrpc(), except the call message is broadcast to all locally connected broadcast\nnets.  Each time it receives a response, this routine calls eachresult(), whose form\nis:\n\nboolt eachresult(caddrt out, struct sockaddrin *addr)\n\nwhere out is the same as out passed to clntbroadcast(), except that the remote proce‐\ndure's output is decoded there; addr points to the address of the machine that sent the\nresults.  If eachresult() returns zero, clntbroadcast() waits for more replies; other‐\nwise it returns with appropriate status.\n\nWarning: broadcast sockets are limited in size to the maximum transfer unit of the data\nlink.  For ethernet, this value is 1500 bytes.\n\nenum clntstat\nclntcall(CLIENT *clnt, ulong procnum, xdrproct inproc, char *in, xdrproct outproc,\nchar *out, struct timeval tout)\n\nA macro that calls the remote procedure procnum associated with the client handle,\nclnt, which is obtained with an RPC client creation routine such as clntcreate().  The\nin argument is the address of the procedure's argument(s), and out is the address of\nwhere to place the result(s); inproc is used to encode the procedure's arguments, and\noutproc is used to decode the procedure's results; tout is the time allowed for results\nto come back.\n\nvoid clntdestroy(CLIENT *clnt)\n\nA macro that destroys the client's RPC handle.  Destruction usually involves dealloca‐\ntion of private data structures, including clnt itself.  Use of clnt is undefined after\ncalling clntdestroy().  If the RPC library opened the associated socket, it will close\nit also.  Otherwise, the socket remains open.\n\nCLIENT *\nclntcreate(char *host, ulong prog, ulong vers, char *proto)\n\nGeneric client creation routine.  The host argument identifies the name of the remote\nhost where the server is located.  The proto argument indicates which kind of transport\nprotocol to use.  The currently supported values for this field are \"udp\" and \"tcp\".\nDefault timeouts are set, but can be modified using clntcontrol().\n\nWarning: Using UDP has its shortcomings.  Since UDP-based RPC messages can only hold up\nto 8 Kbytes of encoded data, this transport cannot be used for procedures that take\nlarge arguments or return huge results.\n\nboolt\nclntcontrol(CLIENT *cl, uint req, char *info)\n\nA macro used to change or retrieve various information about a client object.  The req\nargument indicates the type of operation, and info is a pointer to the information.\nFor both UDP and TCP, the supported values of req and their argument types and what\nthey do are:\n\nCLSETTIMEOUT          struct timeval        set total timeout\nCLGETTIMEOUT          struct timeval        get total timeout\n\nNote: if you set the timeout using clntcontrol(), the timeout argument passed to\nclntcall() will be ignored in all future calls.\n\nCLGETSERVERADDR      struct sockaddrin    get server's address\n\nThe following operations are valid for UDP only:\n\nCLSETRETRYTIMEOUT    struct timeval        set the retry timeout\nCLGETRETRYTIMEOUT    struct timeval        get the retry timeout\n\nThe retry timeout is the time that UDP RPC waits for the server to reply before re‐\ntransmitting the request.\n\nboolt clntfreeres(CLIENT *clnt, xdrproct outproc, char *out)\n\nA macro that frees any data allocated by the RPC/XDR system when it decoded the results\nof an RPC call.  The out argument is the address of the results, and outproc is the XDR\nroutine describing the results.  This routine returns one if the results were success‐\nfully freed, and zero otherwise.\n\nvoid\nclntgeterr(CLIENT *clnt, struct rpcerr *errp)\n\nA macro that copies the error structure out of the client handle to the structure at\naddress errp.\n\nvoid\nclntpcreateerror(char *s)\n\nprints a message to standard error indicating why a client RPC handle could not be cre‐\nated.  The message is prepended with string s and a colon.  A newline is appended at\nthe end of the message.  Used when a clntcreate(), clntrawcreate(), clnttcpcreate(),\nor clntudpcreate() call fails.\n\nvoid\nclntperrno(enum clntstat stat)\n\nPrint a message to standard error corresponding to the condition indicated by stat.  A\nnewline is appended at the end of the message.  Used after callrpc().\n\nvoid clntperror(CLIENT *clnt, char *s)\n\nPrint a message to standard error indicating why an RPC call failed; clnt is the handle\nused to do the call.  The message is prepended with string s and a colon.  A newline is\nappended at the end of the message.  Used after clntcall().\n\nchar *\nclntspcreateerror(char *s)\n\nLike clntpcreateerror(), except that it returns a string instead of printing to the\nstandard error.\n\nBugs: returns pointer to static data that is overwritten on each call.\n\nchar *\nclntsperrno(enum clntstat stat)\n\nTake the same arguments as clntperrno(), but instead of sending a message to the stan‐\ndard error indicating why an RPC call failed, return a pointer to a string which con‐\ntains the message.\n\nThe clntsperrno() function is used instead of clntperrno() if the program does not\nhave a standard error (as a program running as a server quite likely does not), or if\nthe programmer does not want the message to be output with printf(), or if a message\nformat different from that supported by clntperrno() is to be used.\n\nNote: unlike clntsperror() and clntspcreateerror(), clntsperrno() returns pointer to\nstatic data, but the result will not get overwritten on each call.\n\nchar *\nclntsperror(CLIENT *rpch, char *s)\n\nLike clntperror(), except that (like clntsperrno()) it returns a string instead of\nprinting to standard error.\n\nBugs: returns pointer to static data that is overwritten on each call.\n\nCLIENT *\nclntrawcreate(ulong prognum, ulong versnum)\n\nThis routine creates a toy RPC client for the remote program prognum, version versnum.\nThe transport used to pass messages to the service is actually a buffer within the\nprocess's address space, so the corresponding RPC server should live in the same ad‐\ndress space; see svcrawcreate().  This allows simulation of RPC and acquisition of RPC\noverheads, such as round trip times, without any kernel interference.  This routine re‐\nturns NULL if it fails.\n\nCLIENT *\nclnttcpcreate(struct sockaddrin *addr, ulong prognum, ulong versnum, int *sockp,\nuint sendsz, uint recvsz)\n\nThis routine creates an RPC client for the remote program prognum, version versnum; the\nclient uses TCP/IP as a transport.  The remote program is located at Internet address\naddr.  If addr->sinport is zero, then it is set to the actual port that the remote\nprogram is listening on (the remote rpcbind(8) service is consulted for this informa‐\ntion).  The sockp argument is a socket; if it is RPCANYSOCK, then this routine opens a\nnew one and sets sockp.  Since TCP-based RPC uses buffered I/O, the user may specify\nthe size of the send and receive buffers with the sendsz and recvsz arguments; values\nof zero choose suitable defaults.  This routine returns NULL if it fails.\n\nCLIENT *\nclntudpcreate(struct sockaddrin *addr, ulong prognum, ulong versnum, struct timeval wait,\nint *sockp)\n\nThis routine creates an RPC client for the remote program prognum, version versnum; the\nclient uses UDP/IP as a transport.  The remote program is located at Internet address\naddr.  If addr->sinport is zero, then it is set to actual port that the remote program\nis listening on (the remote rpcbind(8) service is consulted for this information).  The\nsockp argument is a socket; if it is RPCANYSOCK, then this routine opens a new one and\nsets sockp.  The UDP transport resends the call message in intervals of wait time until\na response is received or until the call times out.  The total time for the call to\ntime out is specified by clntcall().\n\nWarning: since UDP-based RPC messages can only hold up to 8 Kbytes of encoded data,\nthis transport cannot be used for procedures that take large arguments or return huge\nresults.\n\nCLIENT *\nclntudpbufcreate(struct sockaddrin *addr, ulong prognum, ulong versnum,\nstruct timeval wait, int *sockp, unsigned int sendsize, unsigned int recosize)\n\nThis routine creates an RPC client for the remote program prognum, on versnum; the\nclient uses UDP/IP as a transport.  The remote program is located at Internet address\naddr.  If addr->sinport is zero, then it is set to actual port that the remote program\nis listening on (the remote rpcbind(8) service is consulted for this information).  The\nsockp argument is a socket; if it is RPCANYSOCK, then this routine opens a new one and\nsets sockp.  The UDP transport resends the call message in intervals of wait time until\na response is received or until the call times out.  The total time for the call to\ntime out is specified by clntcall().\n\nThis allows the user to specify the maximum packet size for sending and receiving\nUDP-based RPC messages.\n\nCLIENT *\nclntunixcreate(struct sockaddrun *raddr, ulong prognum, ulong versnum, int *sockp,\nuint sendsz, uint recvsz)\n\nThis routine creates an RPC client for the local program prognum, version versnum; the\nclient uses UNIX-domain sockets as a transport.  The local program is located at the\n*raddr.  The sockp argument is a socket; if it is RPCANYSOCK, then this routine opens\na new one and sets sockp.  Since UNIX-based RPC uses buffered I/O, the user may specify\nthe size of the send and receive buffers with the sendsz and recvsz arguments; values\nof zero choose suitable defaults.  This routine returns NULL if it fails.\n\nint\ngetmyaddress(struct sockaddrin *addr)\n\nStuff the machine's IP address into addr, without consulting the library routines that\ndeal with /etc/hosts.  The port number is always set to htons(PMAPPORT).  Returns zero\non success, non-zero on failure.\n\nstruct pmaplist *\npmapgetmaps(struct sockaddrin *addr)\n\nA user interface to the rpcbind(8) service, which returns a list of the current RPC\nprogram-to-port mappings on the host located at IP address addr.  This routine can re‐\nturn NULL.  The command “rpcinfo -p” uses this routine.\n\nushort\npmapgetport(struct sockaddrin *addr, ulong prognum, ulong versnum, ulong protocol)\n\nA user interface to the rpcbind(8) service, which returns the port number on which\nwaits a service that supports program number prognum, version versnum, and speaks the\ntransport protocol associated with protocol.  The value of protocol is most likely\nIPPROTOUDP or IPPROTOTCP.  A return value of zero means that the mapping does not ex‐\nist or that the RPC system failed to contact the remote rpcbind(8) service.  In the\nlatter case, the global variable rpccreateerr contains the RPC status.\n\nenum clntstat\npmaprmtcall(struct sockaddrin *addr, ulong prognum, ulong versnum, ulong procnum,\nxdrproct inproc, char *in, xdrproct outproc, char *out, struct timeval tout,\nulong *portp)\n\nA user interface to the rpcbind(8) service, which instructs rpcbind(8) on the host at\nIP address addr to make an RPC call on your behalf to a procedure on that host.  The\nportp argument will be modified to the program's port number if the procedure succeeds.\nThe definitions of other arguments are discussed in callrpc() and clntcall().  This\nprocedure should be used for a “ping” and nothing else.  See also clntbroadcast().\n\nboolt pmapset(ulong prognum, ulong versnum, ulong protocol, ushort port)\n\nA user interface to the rpcbind(8) service, which establishes a mapping between the\ntriple (prognum, versnum, protocol) and port on the machine's rpcbind(8) service.  The\nvalue of protocol is most likely IPPROTOUDP or IPPROTOTCP.  This routine returns one\nif it succeeds, zero otherwise.  Automatically done by svcregister().\n\nboolt pmapunset(ulong prognum, ulong versnum)\n\nA user interface to the rpcbind(8) service, which destroys all mapping between the\ntriple (prognum, versnum, *) and ports on the machine's rpcbind(8) service.  This rou‐\ntine returns one if it succeeds, zero otherwise.\n\nboolt registerrpc(ulong prognum, ulong versnum, ulong procnum, char *(*procname)(void),\nxdrproct inproc, xdrproct outproc)\n\nRegister procedure procname with the RPC service package.  If a request arrives for\nprogram prognum, version versnum, and procedure procnum, procname is called with a\npointer to its argument(s); progname should return a pointer to its static result(s);\ninproc is used to decode the arguments while outproc is used to encode the results.\nThis routine returns zero if the registration succeeded, -1 otherwise.\n\nWarning: remote procedures registered in this form are accessed using the UDP/IP trans‐\nport; see svcudpcreate() for restrictions.\n\nstruct rpccreateerr rpccreateerr;\n\nA global variable whose value is set by any RPC client creation routine that does not\nsucceed.  Use the routine clntpcreateerror() to print the reason why.\n\nboolt svcdestroy(SVCXPRT * xprt)\n\nA macro that destroys the RPC service transport handle, xprt.  Destruction usually in‐\nvolves deallocation of private data structures, including xprt itself.  Use of xprt is\nundefined after calling this routine.\n\nfdset svcfdset;\n\nA global variable reflecting the RPC service side's read file descriptor bit mask; it\nis suitable as a template argument to the select(2) system call.  This is only of in‐\nterest if a service implementor does not call svcrun(), but rather does his own asyn‐\nchronous event processing.  This variable is read-only (do not pass its address to\nselect(2)!), yet it may change after calls to svcgetreqset() or any creation routines.\nAs well, note that if the process has descriptor limits which are extended beyond\nFDSETSIZE, this variable will only be usable for the first FDSETSIZE descriptors.\n\nint svcfds;\n\nSimilar to svcfdset, but limited to 32 descriptors.  This interface is obsoleted by\nsvcfdset.\n\nboolt svcfreeargs(SVCXPRT *xprt, xdrproct inproc, char *in)\n\nA macro that frees any data allocated by the RPC/XDR system when it decoded the argu‐\nments to a service procedure using svcgetargs().  This routine returns 1 if the re‐\nsults were successfully freed, and zero otherwise.\n\nboolt svcgetargs(SVCXPRT *xprt, xdrproct inproc, char *in)\n\nA macro that decodes the arguments of an RPC request associated with the RPC service\ntransport handle, xprt.  The in argument is the address where the arguments will be\nplaced; inproc is the XDR routine used to decode the arguments.  This routine returns\none if decoding succeeds, and zero otherwise.\n\nstruct sockaddrin *\nsvcgetcaller(SVCXPRT *xprt)\n\nThe approved way of getting the network address of the caller of a procedure associated\nwith the RPC service transport handle, xprt.\n\nvoid svcgetreqset(fdset *rdfds)\n\nThis routine is only of interest if a service implementor does not call svcrun(), but\ninstead implements custom asynchronous event processing.  It is called when the\nselect(2) system call has determined that an RPC request has arrived on some RPC\nsocket(s); rdfds is the resultant read file descriptor bit mask.  The routine returns\nwhen all sockets associated with the value of rdfds have been serviced.\n\nvoid svcgetreq(int rdfds)\n\nSimilar to svcgetreqset(), but limited to 32 descriptors.  This interface is obsoleted\nby svcgetreqset().\n\nboolt svcregister(SVCXPRT *xprt, ulong prognum, ulong versnum,\nvoid (*dispatch)(struct svcreq *, SVCXPRT *), int protocol)\n\nAssociates prognum and versnum with the service dispatch procedure, dispatch().  If\nprotocol is zero, the service is not registered with the rpcbind(8) service.  If\nprotocol is non-zero, then a mapping of the triple (prognum, versnum, protocol) to\nxprt->xpport is established with the local rpcbind(8) service (generally protocol is\nzero, IPPROTOUDP or IPPROTOTCP).  The procedure dispatch() has the following form:\n\nboolt dispatch(struct svcreq *request, SVCXPRT *xprt)\n\nThe svcregister() routine returns one if it succeeds, and zero otherwise.\n\nsvcrun()\n\nThis routine never returns.  It waits for RPC requests to arrive, and calls the appro‐\npriate service procedure using svcgetreq() when one arrives.  This procedure is usu‐\nally waiting for a select(2) system call to return.\n\nboolt svcsendreply(SVCXPRT *xprt, xdrproct outproc, char *out)\n\nCalled by an RPC service's dispatch routine to send the results of a remote procedure\ncall.  The xprt argument is the request's associated transport handle; outproc is the\nXDR routine which is used to encode the results; and out is the address of the results.\nThis routine returns one if it succeeds, zero otherwise.\n\nvoid\nsvcunregister(ulong prognum, ulong versnum)\n\nRemove all mapping of the double (prognum, versnum) to dispatch routines, and of the\ntriple (prognum, versnum, *) to port number.\n\nvoid\nsvcerrauth(SVCXPRT *xprt, enum authstat why)\n\nCalled by a service dispatch routine that refuses to perform a remote procedure call\ndue to an authentication error.\n\nvoid\nsvcerrdecode(SVCXPRT *xprt)\n\nCalled by a service dispatch routine that cannot successfully decode its arguments.\nSee also svcgetargs().\n\nvoid\nsvcerrnoproc(SVCXPRT *xprt)\n\nCalled by a service dispatch routine that does not implement the procedure number that\nthe caller requests.\n\nvoid\nsvcerrnoprog(SVCXPRT *xprt)\n\nCalled when the desired program is not registered with the RPC package.  Service imple‐\nmentors usually do not need this routine.\n\nvoid\nsvcerrprogvers(SVCXPRT *xprt, ulong lowvers, ulong highvers)\n\nCalled when the desired version of a program is not registered with the RPC package.\nService implementors usually do not need this routine.\n\nvoid\nsvcerrsystemerr(SVCXPRT *xprt)\n\nCalled by a service dispatch routine when it detects a system error not covered by any\nparticular protocol.  For example, if a service can no longer allocate storage, it may\ncall this routine.\n\nvoid\nsvcerrweakauth(SVCXPRT *xprt)\n\nCalled by a service dispatch routine that refuses to perform a remote procedure call\ndue to insufficient authentication arguments.  The routine calls svcerrauth(xprt,\nAUTHTOOWEAK).\n\nSVCXPRT *\nsvcrawcreate(void)\n\nThis routine creates a toy RPC service transport, to which it returns a pointer.  The\ntransport is really a buffer within the process's address space, so the corresponding\nRPC client should live in the same address space; see clntrawcreate().  This routine\nallows simulation of RPC and acquisition of RPC overheads (such as round trip times),\nwithout any kernel interference.  This routine returns NULL if it fails.\n\nSVCXPRT *\nsvctcpcreate(int sock, uint sendbufsize, uint recvbufsize)\n\nThis routine creates a TCP/IP-based RPC service transport, to which it returns a\npointer.  The transport is associated with the socket sock, which may be RPCANYSOCK,\nin which case a new socket is created.  If the socket is not bound to a local TCP port,\nthen this routine binds it to an arbitrary port.  Upon completion, xprt->xpfd is the\ntransport's socket descriptor, and xprt->xpport is the transport's port number.  This\nroutine returns NULL if it fails.  Since TCP-based RPC uses buffered I/O, users may\nspecify the size of buffers; values of zero choose suitable defaults.\n\nSVCXPRT *\nsvcunixcreate(int sock, uint sendbufsize, uint recvbufsize, char *path)\n\nThis routine creates a UNIX-based RPC service transport, to which it returns a pointer.\nThe transport is associated with the socket sock, which may be RPCANYSOCK, in which\ncase a new socket is created.  The *path argument is a variable-length file system\npathname of at most 104 characters.  This file is not removed when the socket is\nclosed.  The unlink(2) system call must be used to remove the file.  Upon completion,\nxprt->xpfd is the transport's socket descriptor.  This routine returns NULL if it\nfails.  Since UNIX-based RPC uses buffered I/O, users may specify the size of buffers;\nvalues of zero choose suitable defaults.\n\nSVCXPRT *\nsvcunixfdcreate(int fd, uint sendsize, uint recvsize)\n\nCreate a service on top of any open descriptor.  The sendsize and recvsize arguments\nindicate sizes for the send and receive buffers.  If they are zero, a reasonable de‐\nfault is chosen.\n\nSVCXPRT *\nsvcfdcreate(int fd, uint sendsize, uint recvsize)\n\nCreate a service on top of any open descriptor.  Typically, this descriptor is a con‐\nnected socket for a stream protocol such as TCP.  The sendsize and recvsize arguments\nindicate sizes for the send and receive buffers.  If they are zero, a reasonable de‐\nfault is chosen.\n\nSVCXPRT *\nsvcudpbufcreate(int sock, uint sendsize, uint recvsize)\n\nThis routine creates a UDP/IP-based RPC service transport, to which it returns a\npointer.  The transport is associated with the socket sock, which may be RPCANYSOCK,\nin which case a new socket is created.  If the socket is not bound to a local UDP port,\nthen this routine binds it to an arbitrary port.  Upon completion, xprt->xpfd is the\ntransport's socket descriptor, and xprt->xpport is the transport's port number.  This\nroutine returns NULL if it fails.\n\nThis allows the user to specify the maximum packet size for sending and receiving\nUDP-based RPC messages.\n\nboolt xdracceptedreply(XDR *xdrs, struct acceptedreply *ar)\n\nUsed for encoding RPC reply messages.  This routine is useful for users who wish to\ngenerate RPC-style messages without using the RPC package.\n\nboolt xdrauthunixparms(XDR *xdrs, struct authunixparms *aupp)\n\nUsed for describing UNIX credentials.  This routine is useful for users who wish to\ngenerate these credentials without using the RPC authentication package.\n\nvoid\nboolt xdrcallhdr(XDR *xdrs, struct rpcmsg *chdr)\n\nUsed for describing RPC call header messages.  This routine is useful for users who\nwish to generate RPC-style messages without using the RPC package.\n\nboolt xdrcallmsg(XDR *xdrs, struct rpcmsg *cmsg)\n\nUsed for describing RPC call messages.  This routine is useful for users who wish to\ngenerate RPC-style messages without using the RPC package.\n\nboolt xdropaqueauth(XDR *xdrs, struct opaqueauth *ap)\n\nUsed for describing RPC authentication information messages.  This routine is useful\nfor users who wish to generate RPC-style messages without using the RPC package.\n\nstruct pmap;\nboolt xdrpmap(XDR *xdrs, struct pmap *regs)\n\nUsed for describing arguments to various rpcbind(8) procedures, externally.  This rou‐\ntine is useful for users who wish to generate these arguments without using the\npmap*() interface.\n\nboolt xdrpmaplist(XDR *xdrs, struct pmaplist rp)\n\nUsed for describing a list of port mappings, externally.  This routine is useful for\nusers who wish to generate these arguments without using the pmap*() interface.\n\nboolt xdrrejectedreply(XDR *xdrs, struct rejectedreply *rr)\n\nUsed for describing RPC reply messages.  This routine is useful for users who wish to\ngenerate RPC-style messages without using the RPC package.\n\nboolt xdrreplymsg(XDR *xdrs, struct rpcmsg *rmsg)\n\nUsed for describing RPC reply messages.  This routine is useful for users who wish to\ngenerate RPC style messages without using the RPC package.\n\nvoid\nxprtregister(SVCXPRT *xprt)\n\nAfter RPC service transport handles are created, they should register themselves with\nthe RPC service package.  This routine modifies the global variable svcfds.  Service\nimplementors usually do not need this routine.\n\nvoid\nxprtunregister(SVCXPRT *xprt)\n\nBefore an RPC service transport handle is destroyed, it should unregister itself with\nthe RPC service package.  This routine modifies the global variable svcfds.  Service\nimplementors usually do not need this routine.\n"
                    }
                ]
            },
            "AVAILABILITY": {
                "content": "These functions are part of libtirpc.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "rpcsecure(3), xdr(3)\n\nRemote Procedure Calls: Protocol Specification.\n\nRemote Procedure Call Programming Guide.\n\nrpcgen Programming Guide.\n\nRPC: Remote Procedure Call Protocol Specification, Sun Microsystems, Inc., USC-ISI, RFC1050.\n\nBSD                            February 16, 1988                           BSD",
                "subsections": []
            }
        }
    }
}