18360efbdSAlfred Perlstein.\" @(#)rpc.3n 2.4 88/08/08 4.0 RPCSRC; from 1.19 88/06/24 SMI 28360efbdSAlfred Perlstein.\" $NetBSD: rpc_soc.3,v 1.2 2000/06/07 13:39:43 simonb Exp $ 38360efbdSAlfred Perlstein.\" $FreeBSD$ 48360efbdSAlfred Perlstein.\" 523601548SRuslan Ermilov.Dd February 16, 1988 623601548SRuslan Ermilov.Dt RPC_SOC 3 723601548SRuslan Ermilov.Os 823601548SRuslan Ermilov.Sh NAME 923601548SRuslan Ermilov.Nm rpc_soc , 1023601548SRuslan Ermilov.Nm auth_destroy , 1123601548SRuslan Ermilov.Nm authnone_create , 1223601548SRuslan Ermilov.Nm authunix_create , 1323601548SRuslan Ermilov.Nm authunix_create_default , 1423601548SRuslan Ermilov.Nm callrpc , 1523601548SRuslan Ermilov.Nm clnt_broadcast , 1623601548SRuslan Ermilov.Nm clnt_call , 1723601548SRuslan Ermilov.Nm clnt_control , 1823601548SRuslan Ermilov.Nm clnt_create , 1923601548SRuslan Ermilov.Nm clnt_destroy , 2023601548SRuslan Ermilov.Nm clnt_freeres , 2123601548SRuslan Ermilov.Nm clnt_geterr , 2223601548SRuslan Ermilov.Nm clnt_pcreateerror , 2323601548SRuslan Ermilov.Nm clnt_perrno , 2423601548SRuslan Ermilov.Nm clnt_perror , 2523601548SRuslan Ermilov.Nm clnt_spcreateerror , 2623601548SRuslan Ermilov.Nm clnt_sperrno , 2723601548SRuslan Ermilov.Nm clnt_sperror , 2823601548SRuslan Ermilov.Nm clntraw_create , 2923601548SRuslan Ermilov.Nm clnttcp_create , 3023601548SRuslan Ermilov.Nm clntudp_bufcreate , 3123601548SRuslan Ermilov.Nm clntudp_create , 32e6f9ad07SBill Paul.Nm clntunix_create , 3323601548SRuslan Ermilov.Nm get_myaddress , 3423601548SRuslan Ermilov.Nm pmap_getmaps , 3523601548SRuslan Ermilov.Nm pmap_getport , 3623601548SRuslan Ermilov.Nm pmap_rmtcall , 3723601548SRuslan Ermilov.Nm pmap_set , 3823601548SRuslan Ermilov.Nm pmap_unset , 3923601548SRuslan Ermilov.Nm registerrpc , 4023601548SRuslan Ermilov.Nm rpc_createerr , 4123601548SRuslan Ermilov.Nm svc_destroy , 4223601548SRuslan Ermilov.Nm svc_fds , 4323601548SRuslan Ermilov.Nm svc_fdset , 4423601548SRuslan Ermilov.Nm svc_getargs , 4523601548SRuslan Ermilov.Nm svc_getcaller , 4623601548SRuslan Ermilov.Nm svc_getreq , 4723601548SRuslan Ermilov.Nm svc_getreqset , 4823601548SRuslan Ermilov.Nm svc_register , 4923601548SRuslan Ermilov.Nm svc_run , 5023601548SRuslan Ermilov.Nm svc_sendreply , 5123601548SRuslan Ermilov.Nm svc_unregister , 5223601548SRuslan Ermilov.Nm svcerr_auth , 5323601548SRuslan Ermilov.Nm svcerr_decode , 5423601548SRuslan Ermilov.Nm svcerr_noproc , 5523601548SRuslan Ermilov.Nm svcerr_noprog , 5623601548SRuslan Ermilov.Nm svcerr_progvers , 5723601548SRuslan Ermilov.Nm svcerr_systemerr , 5823601548SRuslan Ermilov.Nm svcerr_weakauth , 5923601548SRuslan Ermilov.Nm svcfd_create , 60e6f9ad07SBill Paul.Nm svcunixfd_create , 6123601548SRuslan Ermilov.Nm svcraw_create , 62e6f9ad07SBill Paul.Nm svcunix_create , 6323601548SRuslan Ermilov.Nm xdr_accepted_reply , 6423601548SRuslan Ermilov.Nm xdr_authunix_parms , 6523601548SRuslan Ermilov.Nm xdr_callhdr , 6623601548SRuslan Ermilov.Nm xdr_callmsg , 6723601548SRuslan Ermilov.Nm xdr_opaque_auth , 6823601548SRuslan Ermilov.Nm xdr_pmap , 6923601548SRuslan Ermilov.Nm xdr_pmaplist , 7023601548SRuslan Ermilov.Nm xdr_rejected_reply , 7123601548SRuslan Ermilov.Nm xdr_replymsg , 7223601548SRuslan Ermilov.Nm xprt_register , 7323601548SRuslan Ermilov.Nm xprt_unregister 7423601548SRuslan Ermilov.Nd "library routines for remote procedure calls" 7523601548SRuslan Ermilov.Sh LIBRARY 7623601548SRuslan Ermilov.Lb libc 7723601548SRuslan Ermilov.Sh SYNOPSIS 7832eef9aeSRuslan Ermilov.In rpc/rpc.h 7923601548SRuslan Ermilov.Pp 8023601548SRuslan ErmilovSee 8123601548SRuslan Ermilov.Sx DESCRIPTION 8223601548SRuslan Ermilovfor function declarations. 8323601548SRuslan Ermilov.Sh DESCRIPTION 8423601548SRuslan Ermilov.Bf -symbolic 8523601548SRuslan ErmilovThe 8623601548SRuslan Ermilov.Fn svc_* 8723601548SRuslan Ermilovand 8823601548SRuslan Ermilov.Fn clnt_* 8923601548SRuslan Ermilovfunctions described in this page are the old, TS-RPC 9023601548SRuslan Ermilovinterface to the XDR and RPC library, and exist for backward compatibility. 9123601548SRuslan ErmilovThe new interface is described in the pages 9223601548SRuslan Ermilovreferenced from 9323601548SRuslan Ermilov.Xr rpc 3 . 9423601548SRuslan Ermilov.Ef 9523601548SRuslan Ermilov.Pp 968360efbdSAlfred PerlsteinThese routines allow C programs to make procedure 978360efbdSAlfred Perlsteincalls on other machines across the network. 988360efbdSAlfred PerlsteinFirst, the client calls a procedure to send a 998360efbdSAlfred Perlsteindata packet to the server. 1008360efbdSAlfred PerlsteinUpon receipt of the packet, the server calls a dispatch routine 1018360efbdSAlfred Perlsteinto perform the requested service, and then sends back a 1028360efbdSAlfred Perlsteinreply. 1038360efbdSAlfred PerlsteinFinally, the procedure call returns to the client. 10423601548SRuslan Ermilov.Pp 10523601548SRuslan ErmilovRoutines that are used for Secure 10623601548SRuslan Ermilov.Tn RPC ( DES 10723601548SRuslan Ermilovauthentication) are described in 10823601548SRuslan Ermilov.Xr rpc_secure 3 . 10923601548SRuslan ErmilovSecure 11023601548SRuslan Ermilov.Tn RPC 11123601548SRuslan Ermilovcan be used only if 11223601548SRuslan Ermilov.Tn DES 11323601548SRuslan Ermilovencryption is available. 11423601548SRuslan Ermilov.Pp 115*c1f71e84SJoel Dahl.Bl -tag -width indent -compact 11623601548SRuslan Ermilov.It Xo 11723601548SRuslan Ermilov.Ft void 11823601548SRuslan Ermilov.Xc 11923601548SRuslan Ermilov.It Xo 12023601548SRuslan Ermilov.Fn auth_destroy "AUTH *auth" 12123601548SRuslan Ermilov.Xc 12223601548SRuslan Ermilov.Pp 1238360efbdSAlfred PerlsteinA macro that destroys the authentication information associated with 12423601548SRuslan Ermilov.Fa auth . 1258360efbdSAlfred PerlsteinDestruction usually involves deallocation of private data 12623601548SRuslan Ermilovstructures. 12723601548SRuslan ErmilovThe use of 12823601548SRuslan Ermilov.Fa auth 1298360efbdSAlfred Perlsteinis undefined after calling 13023601548SRuslan Ermilov.Fn auth_destroy . 13123601548SRuslan Ermilov.Pp 13223601548SRuslan Ermilov.It Xo 13323601548SRuslan Ermilov.Ft "AUTH *" 13423601548SRuslan Ermilov.Xc 13523601548SRuslan Ermilov.It Xo 13623601548SRuslan Ermilov.Fn authnone_create 13723601548SRuslan Ermilov.Xc 13823601548SRuslan Ermilov.Pp 1398360efbdSAlfred PerlsteinCreate and return an 14023601548SRuslan Ermilov.Tn RPC 14123601548SRuslan Ermilovauthentication handle that passes nonusable authentication 14223601548SRuslan Ermilovinformation with each remote procedure call. 14323601548SRuslan ErmilovThis is the 14423601548SRuslan Ermilovdefault authentication used by 14523601548SRuslan Ermilov.Tn RPC . 14623601548SRuslan Ermilov.Pp 14723601548SRuslan Ermilov.It Xo 14823601548SRuslan Ermilov.Ft "AUTH *" 14923601548SRuslan Ermilov.Xc 15023601548SRuslan Ermilov.It Xo 15123601548SRuslan Ermilov.Fn authunix_create "char *host" "int uid" "int gid" "int len" "int *aup_gids" 15223601548SRuslan Ermilov.Xc 15323601548SRuslan Ermilov.Pp 15423601548SRuslan ErmilovCreate and return an 15523601548SRuslan Ermilov.Tn RPC 1568360efbdSAlfred Perlsteinauthentication handle that contains 15723601548SRuslan Ermilov.Ux 1588360efbdSAlfred Perlsteinauthentication information. 1592efeeba5SRuslan ErmilovThe 16023601548SRuslan Ermilov.Fa host 1612efeeba5SRuslan Ermilovargument 1628360efbdSAlfred Perlsteinis the name of the machine on which the information was 1638360efbdSAlfred Perlsteincreated; 16423601548SRuslan Ermilov.Fa uid 16523601548SRuslan Ermilovis the user's user ID; 16623601548SRuslan Ermilov.Fa gid 16723601548SRuslan Ermilovis the user's current group ID; 16823601548SRuslan Ermilov.Fa len 1698360efbdSAlfred Perlsteinand 17023601548SRuslan Ermilov.Fa aup_gids 1718360efbdSAlfred Perlsteinrefer to a counted array of groups to which the user belongs. 1728360efbdSAlfred PerlsteinIt is easy to impersonate a user. 17323601548SRuslan Ermilov.Pp 17423601548SRuslan Ermilov.It Xo 17523601548SRuslan Ermilov.Ft "AUTH *" 17623601548SRuslan Ermilov.Xc 17723601548SRuslan Ermilov.It Xo 17823601548SRuslan Ermilov.Fn authunix_create_default 17923601548SRuslan Ermilov.Xc 18023601548SRuslan Ermilov.Pp 1818360efbdSAlfred PerlsteinCalls 18223601548SRuslan Ermilov.Fn authunix_create 1832efeeba5SRuslan Ermilovwith the appropriate arguments. 18423601548SRuslan Ermilov.Pp 18523601548SRuslan Ermilov.It Xo 186db7534cfSBruce Evans.Ft int 18723601548SRuslan Ermilov.Fo callrpc 18823601548SRuslan Ermilov.Fa "char *host" 18923601548SRuslan Ermilov.Fa "u_long prognum" 19023601548SRuslan Ermilov.Fa "u_long versnum" 19123601548SRuslan Ermilov.Fa "u_long procnum" 19223601548SRuslan Ermilov.Fa "xdrproc_t inproc" 193cc74aaddSAlfred Perlstein.Fa "void *in" 19423601548SRuslan Ermilov.Fa "xdrproc_t outproc" 195cc74aaddSAlfred Perlstein.Fa "void *out" 19623601548SRuslan Ermilov.Fc 19723601548SRuslan Ermilov.Xc 19823601548SRuslan Ermilov.Pp 1998360efbdSAlfred PerlsteinCall the remote procedure associated with 20023601548SRuslan Ermilov.Fa prognum , 20123601548SRuslan Ermilov.Fa versnum , 2028360efbdSAlfred Perlsteinand 20323601548SRuslan Ermilov.Fa procnum 20423601548SRuslan Ermilovon the machine 20523601548SRuslan Ermilov.Fa host . 2062efeeba5SRuslan ErmilovThe 20723601548SRuslan Ermilov.Fa in 2082efeeba5SRuslan Ermilovargument 2098360efbdSAlfred Perlsteinis the address of the procedure's argument(s), and 21023601548SRuslan Ermilov.Fa out 2118360efbdSAlfred Perlsteinis the address of where to place the result(s); 21223601548SRuslan Ermilov.Fa inproc 2132efeeba5SRuslan Ermilovis used to encode the procedure's arguments, and 21423601548SRuslan Ermilov.Fa outproc 2158360efbdSAlfred Perlsteinis used to decode the procedure's results. 2168360efbdSAlfred PerlsteinThis routine returns zero if it succeeds, or the value of 21723601548SRuslan Ermilov.Vt "enum clnt_stat" 2188360efbdSAlfred Perlsteincast to an integer if it fails. 2198360efbdSAlfred PerlsteinThe routine 22023601548SRuslan Ermilov.Fn clnt_perrno 2218360efbdSAlfred Perlsteinis handy for translating failure statuses into messages. 22223601548SRuslan Ermilov.Pp 2238360efbdSAlfred PerlsteinWarning: calling remote procedures with this routine 2248360efbdSAlfred Perlsteinuses 22523601548SRuslan Ermilov.Tn UDP/IP 2268360efbdSAlfred Perlsteinas a transport; see 22723601548SRuslan Ermilov.Fn clntudp_create 2288360efbdSAlfred Perlsteinfor restrictions. 2298360efbdSAlfred PerlsteinYou do not have control of timeouts or authentication using 2308360efbdSAlfred Perlsteinthis routine. 23123601548SRuslan Ermilov.Pp 23223601548SRuslan Ermilov.It Xo 23323601548SRuslan Ermilov.Ft "enum clnt_stat" 23423601548SRuslan Ermilov.Xc 23523601548SRuslan Ermilov.It Xo 23623601548SRuslan Ermilov.Fo clnt_broadcast 23723601548SRuslan Ermilov.Fa "u_long prognum" 23823601548SRuslan Ermilov.Fa "u_long versnum" 23923601548SRuslan Ermilov.Fa "u_long procnum" 24023601548SRuslan Ermilov.Fa "xdrproc_t inproc" 24123601548SRuslan Ermilov.Fa "char *in" 24223601548SRuslan Ermilov.Fa "xdrproc_t outproc" 24323601548SRuslan Ermilov.Fa "char *out" 24423601548SRuslan Ermilov.Fa "bool_t (*eachresult)(caddr_t, struct sockaddr_in *)" 24523601548SRuslan Ermilov.Fc 24623601548SRuslan Ermilov.Xc 24723601548SRuslan Ermilov.Pp 2488360efbdSAlfred PerlsteinLike 24923601548SRuslan Ermilov.Fn callrpc , 2508360efbdSAlfred Perlsteinexcept the call message is broadcast to all locally 25123601548SRuslan Ermilovconnected broadcast nets. 25223601548SRuslan ErmilovEach time it receives a 2538360efbdSAlfred Perlsteinresponse, this routine calls 25423601548SRuslan Ermilov.Fn eachresult , 2558360efbdSAlfred Perlsteinwhose form is: 25623601548SRuslan Ermilov.Bd -ragged -offset indent 25723601548SRuslan Ermilov.Ft bool_t 25823601548SRuslan Ermilov.Fn eachresult "caddr_t out" "struct sockaddr_in *addr" 25923601548SRuslan Ermilov.Ed 26023601548SRuslan Ermilov.Pp 2618360efbdSAlfred Perlsteinwhere 26223601548SRuslan Ermilov.Fa out 2638360efbdSAlfred Perlsteinis the same as 26423601548SRuslan Ermilov.Fa out 2658360efbdSAlfred Perlsteinpassed to 26623601548SRuslan Ermilov.Fn clnt_broadcast , 2678360efbdSAlfred Perlsteinexcept that the remote procedure's output is decoded there; 26823601548SRuslan Ermilov.Fa addr 2698360efbdSAlfred Perlsteinpoints to the address of the machine that sent the results. 2708360efbdSAlfred PerlsteinIf 27123601548SRuslan Ermilov.Fn eachresult 2728360efbdSAlfred Perlsteinreturns zero, 27323601548SRuslan Ermilov.Fn clnt_broadcast 2748360efbdSAlfred Perlsteinwaits for more replies; otherwise it returns with appropriate 2758360efbdSAlfred Perlsteinstatus. 27623601548SRuslan Ermilov.Pp 2778360efbdSAlfred PerlsteinWarning: broadcast sockets are limited in size to the 27823601548SRuslan Ermilovmaximum transfer unit of the data link. 27923601548SRuslan ErmilovFor ethernet, 2808360efbdSAlfred Perlsteinthis value is 1500 bytes. 28123601548SRuslan Ermilov.Pp 28223601548SRuslan Ermilov.It Xo 28323601548SRuslan Ermilov.Ft "enum clnt_stat" 28423601548SRuslan Ermilov.Xc 28523601548SRuslan Ermilov.It Xo 28623601548SRuslan Ermilov.Fo clnt_call 28723601548SRuslan Ermilov.Fa "CLIENT *clnt" 28823601548SRuslan Ermilov.Fa "u_long procnum" 28923601548SRuslan Ermilov.Fa "xdrproc_t inproc" 29023601548SRuslan Ermilov.Fa "char *in" 29123601548SRuslan Ermilov.Fa "xdrproc_t outproc" 29223601548SRuslan Ermilov.Fa "char *out" 29323601548SRuslan Ermilov.Fa "struct timeval tout" 29423601548SRuslan Ermilov.Fc 29523601548SRuslan Ermilov.Xc 29623601548SRuslan Ermilov.Pp 2978360efbdSAlfred PerlsteinA macro that calls the remote procedure 29823601548SRuslan Ermilov.Fa procnum 2998360efbdSAlfred Perlsteinassociated with the client handle, 30023601548SRuslan Ermilov.Fa clnt , 3018360efbdSAlfred Perlsteinwhich is obtained with an 30223601548SRuslan Ermilov.Tn RPC 3038360efbdSAlfred Perlsteinclient creation routine such as 30423601548SRuslan Ermilov.Fn clnt_create . 3052efeeba5SRuslan ErmilovThe 30623601548SRuslan Ermilov.Fa in 3072efeeba5SRuslan Ermilovargument 3088360efbdSAlfred Perlsteinis the address of the procedure's argument(s), and 30923601548SRuslan Ermilov.Fa out 3108360efbdSAlfred Perlsteinis the address of where to place the result(s); 31123601548SRuslan Ermilov.Fa inproc 3122efeeba5SRuslan Ermilovis used to encode the procedure's arguments, and 31323601548SRuslan Ermilov.Fa outproc 3148360efbdSAlfred Perlsteinis used to decode the procedure's results; 31523601548SRuslan Ermilov.Fa tout 3168360efbdSAlfred Perlsteinis the time allowed for results to come back. 31723601548SRuslan Ermilov.Pp 31823601548SRuslan Ermilov.It Xo 31923601548SRuslan Ermilov.Ft void 32023601548SRuslan Ermilov.Fn clnt_destroy "CLIENT *clnt" 32123601548SRuslan Ermilov.Xc 32223601548SRuslan Ermilov.Pp 3238360efbdSAlfred PerlsteinA macro that destroys the client's 32423601548SRuslan Ermilov.Tn RPC 32523601548SRuslan Ermilovhandle. 32623601548SRuslan ErmilovDestruction usually involves deallocation 3278360efbdSAlfred Perlsteinof private data structures, including 32823601548SRuslan Ermilov.Fa clnt 32923601548SRuslan Ermilovitself. 33023601548SRuslan ErmilovUse of 33123601548SRuslan Ermilov.Fa clnt 3328360efbdSAlfred Perlsteinis undefined after calling 33323601548SRuslan Ermilov.Fn clnt_destroy . 3348360efbdSAlfred PerlsteinIf the 33523601548SRuslan Ermilov.Tn RPC 3368360efbdSAlfred Perlsteinlibrary opened the associated socket, it will close it also. 3378360efbdSAlfred PerlsteinOtherwise, the socket remains open. 33823601548SRuslan Ermilov.Pp 33923601548SRuslan Ermilov.It Xo 34023601548SRuslan Ermilov.Ft CLIENT * 34123601548SRuslan Ermilov.Xc 34223601548SRuslan Ermilov.It Xo 34323601548SRuslan Ermilov.Fn clnt_create "char *host" "u_long prog" "u_long vers" "char *proto" 34423601548SRuslan Ermilov.Xc 34523601548SRuslan Ermilov.Pp 3468360efbdSAlfred PerlsteinGeneric client creation routine. 3472efeeba5SRuslan ErmilovThe 34823601548SRuslan Ermilov.Fa host 3492efeeba5SRuslan Ermilovargument 3508360efbdSAlfred Perlsteinidentifies the name of the remote host where the server 3518360efbdSAlfred Perlsteinis located. 3522efeeba5SRuslan ErmilovThe 35323601548SRuslan Ermilov.Fa proto 3542efeeba5SRuslan Ermilovargument 35523601548SRuslan Ermilovindicates which kind of transport protocol to use. 35623601548SRuslan ErmilovThe 35723601548SRuslan Ermilovcurrently supported values for this field are 35823601548SRuslan Ermilov.Qq Li udp 35923601548SRuslan Ermilovand 36023601548SRuslan Ermilov.Qq Li tcp . 3618360efbdSAlfred PerlsteinDefault timeouts are set, but can be modified using 36223601548SRuslan Ermilov.Fn clnt_control . 36323601548SRuslan Ermilov.Pp 3648360efbdSAlfred PerlsteinWarning: Using 36523601548SRuslan Ermilov.Tn UDP 36623601548SRuslan Ermilovhas its shortcomings. 36723601548SRuslan ErmilovSince 36823601548SRuslan Ermilov.Tn UDP Ns \-based 36923601548SRuslan Ermilov.Tn RPC 3708360efbdSAlfred Perlsteinmessages can only hold up to 8 Kbytes of encoded data, 3718360efbdSAlfred Perlsteinthis transport cannot be used for procedures that take 3728360efbdSAlfred Perlsteinlarge arguments or return huge results. 37323601548SRuslan Ermilov.Pp 37423601548SRuslan Ermilov.It Xo 37523601548SRuslan Ermilov.Ft bool_t 37623601548SRuslan Ermilov.Xc 37723601548SRuslan Ermilov.It Xo 37823601548SRuslan Ermilov.Fn clnt_control "CLIENT *cl" "u_int req" "char *info" 37923601548SRuslan Ermilov.Xc 38023601548SRuslan Ermilov.Pp 3818360efbdSAlfred PerlsteinA macro used to change or retrieve various information 3828360efbdSAlfred Perlsteinabout a client object. 3832efeeba5SRuslan ErmilovThe 38423601548SRuslan Ermilov.Fa req 3852efeeba5SRuslan Ermilovargument 3868360efbdSAlfred Perlsteinindicates the type of operation, and 38723601548SRuslan Ermilov.Fa info 38823601548SRuslan Ermilovis a pointer to the information. 38923601548SRuslan ErmilovFor both 39023601548SRuslan Ermilov.Tn UDP 3918360efbdSAlfred Perlsteinand 39223601548SRuslan Ermilov.Tn TCP , 3938360efbdSAlfred Perlsteinthe supported values of 39423601548SRuslan Ermilov.Fa req 3958360efbdSAlfred Perlsteinand their argument types and what they do are: 39623601548SRuslan Ermilov.Bl -column "CLSET_RETRY_TIMEOUT" "struct sockaddr_in" 39723601548SRuslan Ermilov.It Dv CLSET_TIMEOUT Ta Xo 39823601548SRuslan Ermilov.Vt "struct timeval" Ta "set total timeout" 39923601548SRuslan Ermilov.Xc 40023601548SRuslan Ermilov.It Dv CLGET_TIMEOUT Ta Xo 40123601548SRuslan Ermilov.Vt "struct timeval" Ta "get total timeout" 40223601548SRuslan Ermilov.Xc 40323601548SRuslan Ermilov.El 40423601548SRuslan Ermilov.Pp 4058360efbdSAlfred PerlsteinNote: if you set the timeout using 40623601548SRuslan Ermilov.Fn clnt_control , 4072efeeba5SRuslan Ermilovthe timeout argument passed to 40823601548SRuslan Ermilov.Fn clnt_call 4098360efbdSAlfred Perlsteinwill be ignored in all future calls. 41023601548SRuslan Ermilov.Bl -column "CLSET_RETRY_TIMEOUT" "struct sockaddr_in" 41123601548SRuslan Ermilov.It Dv CLGET_SERVER_ADDR Ta Xo 41223601548SRuslan Ermilov.Vt "struct sockaddr_in" Ta "get server's address" 41323601548SRuslan Ermilov.Xc 41423601548SRuslan Ermilov.El 41523601548SRuslan Ermilov.Pp 4168360efbdSAlfred PerlsteinThe following operations are valid for 41723601548SRuslan Ermilov.Tn UDP 4188360efbdSAlfred Perlsteinonly: 41923601548SRuslan Ermilov.Bl -column "CLSET_RETRY_TIMEOUT" "struct sockaddr_in" 42023601548SRuslan Ermilov.It Dv CLSET_RETRY_TIMEOUT Ta Xo 42123601548SRuslan Ermilov.Vt "struct timeval" Ta "set the retry timeout" 42223601548SRuslan Ermilov.Xc 42323601548SRuslan Ermilov.It Dv CLGET_RETRY_TIMEOUT Ta Xo 42423601548SRuslan Ermilov.Vt "struct timeval" Ta "get the retry timeout" 42523601548SRuslan Ermilov.Xc 42623601548SRuslan Ermilov.El 42723601548SRuslan Ermilov.Pp 4288360efbdSAlfred PerlsteinThe retry timeout is the time that 42923601548SRuslan Ermilov.Tn "UDP RPC" 4308360efbdSAlfred Perlsteinwaits for the server to reply before 4318360efbdSAlfred Perlsteinretransmitting the request. 43223601548SRuslan Ermilov.Pp 43323601548SRuslan Ermilov.It Xo 43423601548SRuslan Ermilov.Ft bool_t 43523601548SRuslan Ermilov.Fn clnt_freeres "CLIENT *clnt" "xdrproc_t outproc" "char *out" 43623601548SRuslan Ermilov.Xc 43723601548SRuslan Ermilov.Pp 4388360efbdSAlfred PerlsteinA macro that frees any data allocated by the 43923601548SRuslan Ermilov.Tn RPC/XDR 4408360efbdSAlfred Perlsteinsystem when it decoded the results of an 44123601548SRuslan Ermilov.Tn RPC 44223601548SRuslan Ermilovcall. 4432efeeba5SRuslan ErmilovThe 44423601548SRuslan Ermilov.Fa out 4452efeeba5SRuslan Ermilovargument 4468360efbdSAlfred Perlsteinis the address of the results, and 44723601548SRuslan Ermilov.Fa outproc 4488360efbdSAlfred Perlsteinis the 44923601548SRuslan Ermilov.Tn XDR 4508360efbdSAlfred Perlsteinroutine describing the results. 4518360efbdSAlfred PerlsteinThis routine returns one if the results were successfully 4528360efbdSAlfred Perlsteinfreed, 4538360efbdSAlfred Perlsteinand zero otherwise. 45423601548SRuslan Ermilov.Pp 45523601548SRuslan Ermilov.It Xo 45623601548SRuslan Ermilov.Ft void 45723601548SRuslan Ermilov.Xc 45823601548SRuslan Ermilov.It Xo 45923601548SRuslan Ermilov.Fn clnt_geterr "CLIENT *clnt" "struct rpc_err *errp" 46023601548SRuslan Ermilov.Xc 46123601548SRuslan Ermilov.Pp 4628360efbdSAlfred PerlsteinA macro that copies the error structure out of the client 4638360efbdSAlfred Perlsteinhandle 4648360efbdSAlfred Perlsteinto the structure at address 46523601548SRuslan Ermilov.Fa errp . 46623601548SRuslan Ermilov.Pp 46723601548SRuslan Ermilov.It Xo 46823601548SRuslan Ermilov.Ft void 46923601548SRuslan Ermilov.Xc 47023601548SRuslan Ermilov.It Xo 47123601548SRuslan Ermilov.Fn clnt_pcreateerror "char *s" 47223601548SRuslan Ermilov.Xc 47323601548SRuslan Ermilov.Pp 47423601548SRuslan Ermilovprints a message to standard error indicating 4758360efbdSAlfred Perlsteinwhy a client 47623601548SRuslan Ermilov.Tn RPC 4778360efbdSAlfred Perlsteinhandle could not be created. 4788360efbdSAlfred PerlsteinThe message is prepended with string 47923601548SRuslan Ermilov.Fa s 4808360efbdSAlfred Perlsteinand a colon. 48123601548SRuslan ErmilovA newline is appended at the end of the message. 4828360efbdSAlfred PerlsteinUsed when a 48323601548SRuslan Ermilov.Fn clnt_create , 48423601548SRuslan Ermilov.Fn clntraw_create , 48523601548SRuslan Ermilov.Fn clnttcp_create , 4868360efbdSAlfred Perlsteinor 48723601548SRuslan Ermilov.Fn clntudp_create 4888360efbdSAlfred Perlsteincall fails. 48923601548SRuslan Ermilov.Pp 49023601548SRuslan Ermilov.It Xo 49123601548SRuslan Ermilov.Ft void 49223601548SRuslan Ermilov.Xc 49323601548SRuslan Ermilov.It Xo 49423601548SRuslan Ermilov.Fn clnt_perrno "enum clnt_stat stat" 49523601548SRuslan Ermilov.Xc 49623601548SRuslan Ermilov.Pp 4978360efbdSAlfred PerlsteinPrint a message to standard error corresponding 4988360efbdSAlfred Perlsteinto the condition indicated by 49923601548SRuslan Ermilov.Fa stat . 50023601548SRuslan ErmilovA newline is appended at the end of the message. 5018360efbdSAlfred PerlsteinUsed after 50223601548SRuslan Ermilov.Fn callrpc . 50323601548SRuslan Ermilov.Pp 50423601548SRuslan Ermilov.It Xo 50523601548SRuslan Ermilov.Ft void 50623601548SRuslan Ermilov.Fn clnt_perror "CLIENT *clnt" "char *s" 50723601548SRuslan Ermilov.Xc 50823601548SRuslan Ermilov.Pp 5098360efbdSAlfred PerlsteinPrint a message to standard error indicating why an 51023601548SRuslan Ermilov.Tn RPC 5118360efbdSAlfred Perlsteincall failed; 51223601548SRuslan Ermilov.Fa clnt 5138360efbdSAlfred Perlsteinis the handle used to do the call. 5148360efbdSAlfred PerlsteinThe message is prepended with string 51523601548SRuslan Ermilov.Fa s 5168360efbdSAlfred Perlsteinand a colon. 51723601548SRuslan ErmilovA newline is appended at the end of the message. 5188360efbdSAlfred PerlsteinUsed after 51923601548SRuslan Ermilov.Fn clnt_call . 52023601548SRuslan Ermilov.Pp 52123601548SRuslan Ermilov.It Xo 52223601548SRuslan Ermilov.Ft "char *" 52323601548SRuslan Ermilov.Xc 52423601548SRuslan Ermilov.It Xo 52523601548SRuslan Ermilov.Fn clnt_spcreateerror "char *s" 52623601548SRuslan Ermilov.Xc 52723601548SRuslan Ermilov.Pp 5288360efbdSAlfred PerlsteinLike 52923601548SRuslan Ermilov.Fn clnt_pcreateerror , 5308360efbdSAlfred Perlsteinexcept that it returns a string 5318360efbdSAlfred Perlsteininstead of printing to the standard error. 53223601548SRuslan Ermilov.Pp 5338360efbdSAlfred PerlsteinBugs: returns pointer to static data that is overwritten 5348360efbdSAlfred Perlsteinon each call. 53523601548SRuslan Ermilov.Pp 53623601548SRuslan Ermilov.It Xo 53723601548SRuslan Ermilov.Ft "char *" 53823601548SRuslan Ermilov.Xc 53923601548SRuslan Ermilov.It Xo 54023601548SRuslan Ermilov.Fn clnt_sperrno "enum clnt_stat stat" 54123601548SRuslan Ermilov.Xc 54223601548SRuslan Ermilov.Pp 5438360efbdSAlfred PerlsteinTake the same arguments as 54423601548SRuslan Ermilov.Fn clnt_perrno , 5458360efbdSAlfred Perlsteinbut instead of sending a message to the standard error 5468360efbdSAlfred Perlsteinindicating why an 54723601548SRuslan Ermilov.Tn RPC 5488360efbdSAlfred Perlsteincall failed, return a pointer to a string which contains 5498360efbdSAlfred Perlsteinthe message. 55023601548SRuslan Ermilov.Pp 5511fae73b1SRuslan ErmilovThe 55223601548SRuslan Ermilov.Fn clnt_sperrno 5531fae73b1SRuslan Ermilovfunction 5548360efbdSAlfred Perlsteinis used instead of 55523601548SRuslan Ermilov.Fn clnt_perrno 5568360efbdSAlfred Perlsteinif the program does not have a standard error (as a program 5578360efbdSAlfred Perlsteinrunning as a server quite likely does not), or if the 5588360efbdSAlfred Perlsteinprogrammer 5598360efbdSAlfred Perlsteindoes not want the message to be output with 56023601548SRuslan Ermilov.Fn printf , 56123601548SRuslan Ermilovor if a message format different from that supported by 56223601548SRuslan Ermilov.Fn clnt_perrno 5638360efbdSAlfred Perlsteinis to be used. 56423601548SRuslan Ermilov.Pp 5658360efbdSAlfred PerlsteinNote: unlike 56623601548SRuslan Ermilov.Fn clnt_sperror 5678360efbdSAlfred Perlsteinand 56823601548SRuslan Ermilov.Fn clnt_spcreateerror , 56923601548SRuslan Ermilov.Fn clnt_sperrno 5708360efbdSAlfred Perlsteinreturns pointer to static data, but the 5718360efbdSAlfred Perlsteinresult will not get overwritten on each call. 57223601548SRuslan Ermilov.Pp 57323601548SRuslan Ermilov.It Xo 57423601548SRuslan Ermilov.Ft "char *" 57523601548SRuslan Ermilov.Xc 57623601548SRuslan Ermilov.It Xo 57723601548SRuslan Ermilov.Fn clnt_sperror "CLIENT *rpch" "char *s" 57823601548SRuslan Ermilov.Xc 57923601548SRuslan Ermilov.Pp 5808360efbdSAlfred PerlsteinLike 58123601548SRuslan Ermilov.Fn clnt_perror , 5828360efbdSAlfred Perlsteinexcept that (like 58323601548SRuslan Ermilov.Fn clnt_sperrno ) 5848360efbdSAlfred Perlsteinit returns a string instead of printing to standard error. 58523601548SRuslan Ermilov.Pp 5868360efbdSAlfred PerlsteinBugs: returns pointer to static data that is overwritten 5878360efbdSAlfred Perlsteinon each call. 58823601548SRuslan Ermilov.Pp 58923601548SRuslan Ermilov.It Xo 59023601548SRuslan Ermilov.Ft "CLIENT *" 59123601548SRuslan Ermilov.Xc 59223601548SRuslan Ermilov.It Xo 59323601548SRuslan Ermilov.Fn clntraw_create "u_long prognum" "u_long versnum" 59423601548SRuslan Ermilov.Xc 59523601548SRuslan Ermilov.Pp 5968360efbdSAlfred PerlsteinThis routine creates a toy 59723601548SRuslan Ermilov.Tn RPC 5988360efbdSAlfred Perlsteinclient for the remote program 59923601548SRuslan Ermilov.Fa prognum , 6008360efbdSAlfred Perlsteinversion 60123601548SRuslan Ermilov.Fa versnum . 6028360efbdSAlfred PerlsteinThe transport used to pass messages to the service is 6038360efbdSAlfred Perlsteinactually a buffer within the process's address space, so the 6048360efbdSAlfred Perlsteincorresponding 60523601548SRuslan Ermilov.Tn RPC 6068360efbdSAlfred Perlsteinserver should live in the same address space; see 60723601548SRuslan Ermilov.Fn svcraw_create . 6088360efbdSAlfred PerlsteinThis allows simulation of 60923601548SRuslan Ermilov.Tn RPC 6108360efbdSAlfred Perlsteinand acquisition of 61123601548SRuslan Ermilov.Tn RPC 6128360efbdSAlfred Perlsteinoverheads, such as round trip times, without any 61323601548SRuslan Ermilovkernel interference. 61423601548SRuslan ErmilovThis routine returns 61523601548SRuslan Ermilov.Dv NULL 6168360efbdSAlfred Perlsteinif it fails. 61723601548SRuslan Ermilov.Pp 61823601548SRuslan Ermilov.It Xo 61923601548SRuslan Ermilov.Ft "CLIENT *" 62023601548SRuslan Ermilov.Xc 62123601548SRuslan Ermilov.It Xo 62223601548SRuslan Ermilov.Fo clnttcp_create 62323601548SRuslan Ermilov.Fa "struct sockaddr_in *addr" 62423601548SRuslan Ermilov.Fa "u_long prognum" 62523601548SRuslan Ermilov.Fa "u_long versnum" 62623601548SRuslan Ermilov.Fa "int *sockp" 62723601548SRuslan Ermilov.Fa "u_int sendsz" 62823601548SRuslan Ermilov.Fa "u_int recvsz" 62923601548SRuslan Ermilov.Fc 63023601548SRuslan Ermilov.Xc 63123601548SRuslan Ermilov.Pp 6328360efbdSAlfred PerlsteinThis routine creates an 63323601548SRuslan Ermilov.Tn RPC 6348360efbdSAlfred Perlsteinclient for the remote program 63523601548SRuslan Ermilov.Fa prognum , 6368360efbdSAlfred Perlsteinversion 63723601548SRuslan Ermilov.Fa versnum ; 6388360efbdSAlfred Perlsteinthe client uses 63923601548SRuslan Ermilov.Tn TCP/IP 64023601548SRuslan Ermilovas a transport. 64123601548SRuslan ErmilovThe remote program is located at Internet 6428360efbdSAlfred Perlsteinaddress 64323601548SRuslan Ermilov.Fa addr . 6448360efbdSAlfred PerlsteinIf 64523601548SRuslan Ermilov.Fa addr\->sin_port 6468360efbdSAlfred Perlsteinis zero, then it is set to the actual port that the remote 6478360efbdSAlfred Perlsteinprogram is listening on (the remote 6488657581bSMaxim Sobolev.Xr rpcbind 8 64923601548SRuslan Ermilovservice is consulted for this information). 6502efeeba5SRuslan ErmilovThe 65123601548SRuslan Ermilov.Fa sockp 6522efeeba5SRuslan Ermilovargument 6538360efbdSAlfred Perlsteinis a socket; if it is 65423601548SRuslan Ermilov.Dv RPC_ANYSOCK , 6558360efbdSAlfred Perlsteinthen this routine opens a new one and sets 65623601548SRuslan Ermilov.Fa sockp . 6578360efbdSAlfred PerlsteinSince 65823601548SRuslan Ermilov.Tn TCP Ns \-based 65923601548SRuslan Ermilov.Tn RPC 6608360efbdSAlfred Perlsteinuses buffered 66123601548SRuslan Ermilov.Tn I/O , 6628360efbdSAlfred Perlsteinthe user may specify the size of the send and receive buffers 6632efeeba5SRuslan Ermilovwith the 66423601548SRuslan Ermilov.Fa sendsz 6658360efbdSAlfred Perlsteinand 6662efeeba5SRuslan Ermilov.Fa recvsz 6672efeeba5SRuslan Ermilovarguments; 6688360efbdSAlfred Perlsteinvalues of zero choose suitable defaults. 6698360efbdSAlfred PerlsteinThis routine returns 67023601548SRuslan Ermilov.Dv NULL 6718360efbdSAlfred Perlsteinif it fails. 67223601548SRuslan Ermilov.Pp 67323601548SRuslan Ermilov.It Xo 67423601548SRuslan Ermilov.Ft "CLIENT *" 67523601548SRuslan Ermilov.Xc 67623601548SRuslan Ermilov.It Xo 67723601548SRuslan Ermilov.Fo clntudp_create 67823601548SRuslan Ermilov.Fa "struct sockaddr_in *addr" 67923601548SRuslan Ermilov.Fa "u_long prognum" 68023601548SRuslan Ermilov.Fa "u_long versnum" 68123601548SRuslan Ermilov.Fa "struct timeval wait" 68223601548SRuslan Ermilov.Fa "int *sockp" 68323601548SRuslan Ermilov.Fc 68423601548SRuslan Ermilov.Xc 68523601548SRuslan Ermilov.Pp 6868360efbdSAlfred PerlsteinThis routine creates an 68723601548SRuslan Ermilov.Tn RPC 6888360efbdSAlfred Perlsteinclient for the remote program 68923601548SRuslan Ermilov.Fa prognum , 6908360efbdSAlfred Perlsteinversion 69123601548SRuslan Ermilov.Fa versnum ; 69223601548SRuslan Ermilovthe client uses 69323601548SRuslan Ermilov.Tn UDP/IP 69423601548SRuslan Ermilovas a transport. 69523601548SRuslan ErmilovThe remote program is located at Internet 6968360efbdSAlfred Perlsteinaddress 69723601548SRuslan Ermilov.Fa addr . 6988360efbdSAlfred PerlsteinIf 69923601548SRuslan Ermilov.Fa addr\->sin_port 7008360efbdSAlfred Perlsteinis zero, then it is set to actual port that the remote 7018360efbdSAlfred Perlsteinprogram is listening on (the remote 7028657581bSMaxim Sobolev.Xr rpcbind 8 70323601548SRuslan Ermilovservice is consulted for this information). 7042efeeba5SRuslan ErmilovThe 70523601548SRuslan Ermilov.Fa sockp 7062efeeba5SRuslan Ermilovargument 7078360efbdSAlfred Perlsteinis a socket; if it is 70823601548SRuslan Ermilov.Dv RPC_ANYSOCK , 7098360efbdSAlfred Perlsteinthen this routine opens a new one and sets 71023601548SRuslan Ermilov.Fa sockp . 7118360efbdSAlfred PerlsteinThe 71223601548SRuslan Ermilov.Tn UDP 7138360efbdSAlfred Perlsteintransport resends the call message in intervals of 71423601548SRuslan Ermilov.Fa wait 7158360efbdSAlfred Perlsteintime until a response is received or until the call times 7168360efbdSAlfred Perlsteinout. 7178360efbdSAlfred PerlsteinThe total time for the call to time out is specified by 71823601548SRuslan Ermilov.Fn clnt_call . 71923601548SRuslan Ermilov.Pp 7208360efbdSAlfred PerlsteinWarning: since 72123601548SRuslan Ermilov.Tn UDP Ns \-based 72223601548SRuslan Ermilov.Tn RPC 7238360efbdSAlfred Perlsteinmessages can only hold up to 8 Kbytes 7248360efbdSAlfred Perlsteinof encoded data, this transport cannot be used for procedures 7258360efbdSAlfred Perlsteinthat take large arguments or return huge results. 72623601548SRuslan Ermilov.Pp 72723601548SRuslan Ermilov.It Xo 72823601548SRuslan Ermilov.Ft "CLIENT *" 72923601548SRuslan Ermilov.Xc 73023601548SRuslan Ermilov.It Xo 73123601548SRuslan Ermilov.Fo clntudp_bufcreate 73223601548SRuslan Ermilov.Fa "struct sockaddr_in *addr" 73323601548SRuslan Ermilov.Fa "u_long prognum" 73423601548SRuslan Ermilov.Fa "u_long versnum" 73523601548SRuslan Ermilov.Fa "struct timeval wait" 73623601548SRuslan Ermilov.Fa "int *sockp" 73723601548SRuslan Ermilov.Fa "unsigned int sendsize" 73823601548SRuslan Ermilov.Fa "unsigned int recosize" 73923601548SRuslan Ermilov.Fc 74023601548SRuslan Ermilov.Xc 74123601548SRuslan Ermilov.Pp 7428360efbdSAlfred PerlsteinThis routine creates an 74323601548SRuslan Ermilov.Tn RPC 7448360efbdSAlfred Perlsteinclient for the remote program 74523601548SRuslan Ermilov.Fa prognum , 7468360efbdSAlfred Perlsteinon 74723601548SRuslan Ermilov.Fa versnum ; 74823601548SRuslan Ermilovthe client uses 74923601548SRuslan Ermilov.Tn UDP/IP 75023601548SRuslan Ermilovas a transport. 75123601548SRuslan ErmilovThe remote program is located at Internet 7528360efbdSAlfred Perlsteinaddress 75323601548SRuslan Ermilov.Fa addr . 7548360efbdSAlfred PerlsteinIf 75523601548SRuslan Ermilov.Fa addr\->sin_port 7568360efbdSAlfred Perlsteinis zero, then it is set to actual port that the remote 7578360efbdSAlfred Perlsteinprogram is listening on (the remote 7588657581bSMaxim Sobolev.Xr rpcbind 8 75923601548SRuslan Ermilovservice is consulted for this information). 7602efeeba5SRuslan ErmilovThe 76123601548SRuslan Ermilov.Fa sockp 7622efeeba5SRuslan Ermilovargument 7638360efbdSAlfred Perlsteinis a socket; if it is 76423601548SRuslan Ermilov.Dv RPC_ANYSOCK , 7658360efbdSAlfred Perlsteinthen this routine opens a new one and sets 76623601548SRuslan Ermilov.Fa sockp . 7678360efbdSAlfred PerlsteinThe 76823601548SRuslan Ermilov.Tn UDP 7698360efbdSAlfred Perlsteintransport resends the call message in intervals of 77023601548SRuslan Ermilov.Fa wait 7718360efbdSAlfred Perlsteintime until a response is received or until the call times 7728360efbdSAlfred Perlsteinout. 7738360efbdSAlfred PerlsteinThe total time for the call to time out is specified by 77423601548SRuslan Ermilov.Fn clnt_call . 77523601548SRuslan Ermilov.Pp 77623601548SRuslan ErmilovThis allows the user to specify the maximum packet size 77723601548SRuslan Ermilovfor sending and receiving 77823601548SRuslan Ermilov.Tn UDP Ns \-based 77923601548SRuslan Ermilov.Tn RPC 7808360efbdSAlfred Perlsteinmessages. 78123601548SRuslan Ermilov.Pp 78223601548SRuslan Ermilov.It Xo 783e6f9ad07SBill Paul.Ft "CLIENT *" 784e6f9ad07SBill Paul.Xc 785e6f9ad07SBill Paul.It Xo 786e6f9ad07SBill Paul.Fo clntunix_create 787e6f9ad07SBill Paul.Fa "struct sockaddr_un *raddr" 788e6f9ad07SBill Paul.Fa "u_long prognum" 789e6f9ad07SBill Paul.Fa "u_long versnum" 790e6f9ad07SBill Paul.Fa "int *sockp" 791e6f9ad07SBill Paul.Fa "u_int sendsz" 792e6f9ad07SBill Paul.Fa "u_int recvsz" 793e6f9ad07SBill Paul.Fc 794e6f9ad07SBill Paul.Xc 795e6f9ad07SBill Paul.Pp 796e6f9ad07SBill PaulThis routine creates an 797e6f9ad07SBill Paul.Tn RPC 798e6f9ad07SBill Paulclient for the local 799e6f9ad07SBill Paulprogram 800e6f9ad07SBill Paul.Fa prognum , 801e6f9ad07SBill Paulversion 802e6f9ad07SBill Paul.Fa versnum ; 803e6f9ad07SBill Paulthe client uses 804872013cbSRuslan Ermilov.Ux Ns -domain 805e6f9ad07SBill Paulsockets as a transport. 806e6f9ad07SBill PaulThe local program is located at the 807e6f9ad07SBill Paul.Fa *raddr . 8082efeeba5SRuslan ErmilovThe 809e6f9ad07SBill Paul.Fa sockp 8102efeeba5SRuslan Ermilovargument 811e6f9ad07SBill Paulis a socket; if it is 812e6f9ad07SBill Paul.Dv RPC_ANYSOCK , 813e6f9ad07SBill Paulthen this routine opens a new one and sets 814e6f9ad07SBill Paul.Fa sockp . 815e6f9ad07SBill PaulSince 816872013cbSRuslan Ermilov.Ux Ns -based 817e6f9ad07SBill Paul.Tn RPC 818e6f9ad07SBill Pauluses buffered 819e6f9ad07SBill Paul.Tn I/O , 820e6f9ad07SBill Paulthe user may specify the size of the send and receive buffers 8212efeeba5SRuslan Ermilovwith the 822e6f9ad07SBill Paul.Fa sendsz 823e6f9ad07SBill Pauland 8242efeeba5SRuslan Ermilov.Fa recvsz 8252efeeba5SRuslan Ermilovarguments; 826e6f9ad07SBill Paulvalues of zero choose suitable defaults. 827e6f9ad07SBill PaulThis routine returns 828e6f9ad07SBill Paul.Dv NULL 829e6f9ad07SBill Paulif it fails. 830e6f9ad07SBill Paul.Pp 831e6f9ad07SBill Paul.It Xo 83223601548SRuslan Ermilov.Ft int 83323601548SRuslan Ermilov.Xc 83423601548SRuslan Ermilov.It Xo 83523601548SRuslan Ermilov.Fn get_myaddress "struct sockaddr_in *addr" 83623601548SRuslan Ermilov.Xc 83723601548SRuslan Ermilov.Pp 8388360efbdSAlfred PerlsteinStuff the machine's 83923601548SRuslan Ermilov.Tn IP 8408360efbdSAlfred Perlsteinaddress into 84123601548SRuslan Ermilov.Fa addr , 8428360efbdSAlfred Perlsteinwithout consulting the library routines that deal with 84323601548SRuslan Ermilov.Pa /etc/hosts . 8448360efbdSAlfred PerlsteinThe port number is always set to 84523601548SRuslan Ermilov.Fn htons PMAPPORT . 8468360efbdSAlfred PerlsteinReturns zero on success, non-zero on failure. 84723601548SRuslan Ermilov.Pp 84823601548SRuslan Ermilov.It Xo 84923601548SRuslan Ermilov.Ft "struct pmaplist *" 85023601548SRuslan Ermilov.Xc 85123601548SRuslan Ermilov.It Xo 85223601548SRuslan Ermilov.Fn pmap_getmaps "struct sockaddr_in *addr" 85323601548SRuslan Ermilov.Xc 85423601548SRuslan Ermilov.Pp 8558360efbdSAlfred PerlsteinA user interface to the 8568657581bSMaxim Sobolev.Xr rpcbind 8 8578360efbdSAlfred Perlsteinservice, which returns a list of the current 85823601548SRuslan Ermilov.Tn RPC 85923601548SRuslan Ermilovprogram\-to\-port mappings 8608360efbdSAlfred Perlsteinon the host located at 86123601548SRuslan Ermilov.Tn IP 8628360efbdSAlfred Perlsteinaddress 86323601548SRuslan Ermilov.Fa addr . 8648360efbdSAlfred PerlsteinThis routine can return 86523601548SRuslan Ermilov.Dv NULL . 8668360efbdSAlfred PerlsteinThe command 86723601548SRuslan Ermilov.Dq Nm rpcinfo Fl p 8688360efbdSAlfred Perlsteinuses this routine. 86923601548SRuslan Ermilov.Pp 87023601548SRuslan Ermilov.It Xo 87123601548SRuslan Ermilov.Ft u_short 87223601548SRuslan Ermilov.Xc 87323601548SRuslan Ermilov.It Xo 87423601548SRuslan Ermilov.Fo pmap_getport 87523601548SRuslan Ermilov.Fa "struct sockaddr_in *addr" 87623601548SRuslan Ermilov.Fa "u_long prognum" 87723601548SRuslan Ermilov.Fa "u_long versnum" 87823601548SRuslan Ermilov.Fa "u_long protocol" 87923601548SRuslan Ermilov.Fc 88023601548SRuslan Ermilov.Xc 88123601548SRuslan Ermilov.Pp 8828360efbdSAlfred PerlsteinA user interface to the 8838657581bSMaxim Sobolev.Xr rpcbind 8 8848360efbdSAlfred Perlsteinservice, which returns the port number 8858360efbdSAlfred Perlsteinon which waits a service that supports program number 88623601548SRuslan Ermilov.Fa prognum , 8878360efbdSAlfred Perlsteinversion 88823601548SRuslan Ermilov.Fa versnum , 8898360efbdSAlfred Perlsteinand speaks the transport protocol associated with 89023601548SRuslan Ermilov.Fa protocol . 8918360efbdSAlfred PerlsteinThe value of 89223601548SRuslan Ermilov.Fa protocol 8938360efbdSAlfred Perlsteinis most likely 89423601548SRuslan Ermilov.Dv IPPROTO_UDP 8958360efbdSAlfred Perlsteinor 89623601548SRuslan Ermilov.Dv IPPROTO_TCP . 8978360efbdSAlfred PerlsteinA return value of zero means that the mapping does not exist 8988360efbdSAlfred Perlsteinor that 8998360efbdSAlfred Perlsteinthe 90023601548SRuslan Ermilov.Tn RPC 90123601548SRuslan Ermilovsystem failed to contact the remote 9028657581bSMaxim Sobolev.Xr rpcbind 8 90323601548SRuslan Ermilovservice. 90423601548SRuslan ErmilovIn the latter case, the global variable 90523601548SRuslan Ermilov.Va rpc_createerr 9068360efbdSAlfred Perlsteincontains the 90723601548SRuslan Ermilov.Tn RPC 9088360efbdSAlfred Perlsteinstatus. 90923601548SRuslan Ermilov.Pp 91023601548SRuslan Ermilov.It Xo 91123601548SRuslan Ermilov.Ft "enum clnt_stat" 91223601548SRuslan Ermilov.Xc 91323601548SRuslan Ermilov.It Xo 91423601548SRuslan Ermilov.Fo pmap_rmtcall 91523601548SRuslan Ermilov.Fa "struct sockaddr_in *addr" 91623601548SRuslan Ermilov.Fa "u_long prognum" 91723601548SRuslan Ermilov.Fa "u_long versnum" 91823601548SRuslan Ermilov.Fa "u_long procnum" 91923601548SRuslan Ermilov.Fa "xdrproc_t inproc" 92023601548SRuslan Ermilov.Fa "char *in" 92123601548SRuslan Ermilov.Fa "xdrproc_t outproc" 92223601548SRuslan Ermilov.Fa "char *out" 92323601548SRuslan Ermilov.Fa "struct timeval tout" 92423601548SRuslan Ermilov.Fa "u_long *portp" 92523601548SRuslan Ermilov.Fc 92623601548SRuslan Ermilov.Xc 92723601548SRuslan Ermilov.Pp 9288360efbdSAlfred PerlsteinA user interface to the 9298657581bSMaxim Sobolev.Xr rpcbind 8 9308360efbdSAlfred Perlsteinservice, which instructs 9318657581bSMaxim Sobolev.Xr rpcbind 8 9328360efbdSAlfred Perlsteinon the host at 93323601548SRuslan Ermilov.Tn IP 9348360efbdSAlfred Perlsteinaddress 93523601548SRuslan Ermilov.Fa addr 9368360efbdSAlfred Perlsteinto make an 93723601548SRuslan Ermilov.Tn RPC 9388360efbdSAlfred Perlsteincall on your behalf to a procedure on that host. 9392efeeba5SRuslan ErmilovThe 94023601548SRuslan Ermilov.Fa portp 9412efeeba5SRuslan Ermilovargument 9428360efbdSAlfred Perlsteinwill be modified to the program's port number if the 9438360efbdSAlfred Perlsteinprocedure 94423601548SRuslan Ermilovsucceeds. 9452efeeba5SRuslan ErmilovThe definitions of other arguments are discussed 9468360efbdSAlfred Perlsteinin 94723601548SRuslan Ermilov.Fn callrpc 9488360efbdSAlfred Perlsteinand 94923601548SRuslan Ermilov.Fn clnt_call . 95023601548SRuslan ErmilovThis procedure should be used for a 95123601548SRuslan Ermilov.Dq ping 95223601548SRuslan Ermilovand nothing 9538360efbdSAlfred Perlsteinelse. 9548360efbdSAlfred PerlsteinSee also 95523601548SRuslan Ermilov.Fn clnt_broadcast . 95623601548SRuslan Ermilov.Pp 95723601548SRuslan Ermilov.It Xo 95823601548SRuslan Ermilov.Ft bool_t 95923601548SRuslan Ermilov.Fn pmap_set "u_long prognum" "u_long versnum" "u_long protocol" "u_short port" 96023601548SRuslan Ermilov.Xc 96123601548SRuslan Ermilov.Pp 9628360efbdSAlfred PerlsteinA user interface to the 9638657581bSMaxim Sobolev.Xr rpcbind 8 9648360efbdSAlfred Perlsteinservice, which establishes a mapping between the triple 96523601548SRuslan Ermilov.Pq Fa prognum , versnum , protocol 9668360efbdSAlfred Perlsteinand 96723601548SRuslan Ermilov.Fa port 9688360efbdSAlfred Perlsteinon the machine's 9698657581bSMaxim Sobolev.Xr rpcbind 8 97023601548SRuslan Ermilovservice. 97123601548SRuslan ErmilovThe value of 97223601548SRuslan Ermilov.Fa protocol 9738360efbdSAlfred Perlsteinis most likely 97423601548SRuslan Ermilov.Dv IPPROTO_UDP 9758360efbdSAlfred Perlsteinor 97623601548SRuslan Ermilov.Dv IPPROTO_TCP . 9778360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise. 9788360efbdSAlfred PerlsteinAutomatically done by 97923601548SRuslan Ermilov.Fn svc_register . 98023601548SRuslan Ermilov.Pp 98123601548SRuslan Ermilov.It Xo 98223601548SRuslan Ermilov.Ft bool_t 98323601548SRuslan Ermilov.Fn pmap_unset "u_long prognum" "u_long versnum" 98423601548SRuslan Ermilov.Xc 98523601548SRuslan Ermilov.Pp 9868360efbdSAlfred PerlsteinA user interface to the 9878657581bSMaxim Sobolev.Xr rpcbind 8 9888360efbdSAlfred Perlsteinservice, which destroys all mapping between the triple 98923601548SRuslan Ermilov.Pq Fa prognum , versnum , * 9908360efbdSAlfred Perlsteinand 99123601548SRuslan Ermilov.Fa ports 9928360efbdSAlfred Perlsteinon the machine's 9938657581bSMaxim Sobolev.Xr rpcbind 8 99423601548SRuslan Ermilovservice. 99523601548SRuslan ErmilovThis routine returns one if it succeeds, zero 9968360efbdSAlfred Perlsteinotherwise. 99723601548SRuslan Ermilov.Pp 99823601548SRuslan Ermilov.It Xo 99923601548SRuslan Ermilov.Ft bool_t 100023601548SRuslan Ermilov.Fo registerrpc 100123601548SRuslan Ermilov.Fa "u_long prognum" 100223601548SRuslan Ermilov.Fa "u_long versnum" 100323601548SRuslan Ermilov.Fa "u_long procnum" 100423601548SRuslan Ermilov.Fa "char *(*procname)(void)" 100523601548SRuslan Ermilov.Fa "xdrproc_t inproc" 100623601548SRuslan Ermilov.Fa "xdrproc_t outproc" 100723601548SRuslan Ermilov.Fc 100823601548SRuslan Ermilov.Xc 100923601548SRuslan Ermilov.Pp 10108360efbdSAlfred PerlsteinRegister procedure 101123601548SRuslan Ermilov.Fa procname 10128360efbdSAlfred Perlsteinwith the 101323601548SRuslan Ermilov.Tn RPC 101423601548SRuslan Ermilovservice package. 101523601548SRuslan ErmilovIf a request arrives for program 101623601548SRuslan Ermilov.Fa prognum , 10178360efbdSAlfred Perlsteinversion 101823601548SRuslan Ermilov.Fa versnum , 10198360efbdSAlfred Perlsteinand procedure 102023601548SRuslan Ermilov.Fa procnum , 102123601548SRuslan Ermilov.Fa procname 10222efeeba5SRuslan Ermilovis called with a pointer to its argument(s); 102323601548SRuslan Ermilov.Fa progname 10248360efbdSAlfred Perlsteinshould return a pointer to its static result(s); 102523601548SRuslan Ermilov.Fa inproc 10262efeeba5SRuslan Ermilovis used to decode the arguments while 102723601548SRuslan Ermilov.Fa outproc 10288360efbdSAlfred Perlsteinis used to encode the results. 10298360efbdSAlfred PerlsteinThis routine returns zero if the registration succeeded, \-1 10308360efbdSAlfred Perlsteinotherwise. 103123601548SRuslan Ermilov.Pp 10328360efbdSAlfred PerlsteinWarning: remote procedures registered in this form 10338360efbdSAlfred Perlsteinare accessed using the 103423601548SRuslan Ermilov.Tn UDP/IP 10358360efbdSAlfred Perlsteintransport; see 103623601548SRuslan Ermilov.Fn svcudp_create 10378360efbdSAlfred Perlsteinfor restrictions. 103823601548SRuslan Ermilov.Pp 103923601548SRuslan Ermilov.It Xo 104023601548SRuslan Ermilov.Vt "struct rpc_createerr" rpc_createerr ; 104123601548SRuslan Ermilov.Xc 104223601548SRuslan Ermilov.Pp 10438360efbdSAlfred PerlsteinA global variable whose value is set by any 104423601548SRuslan Ermilov.Tn RPC 10458360efbdSAlfred Perlsteinclient creation routine 104623601548SRuslan Ermilovthat does not succeed. 104723601548SRuslan ErmilovUse the routine 104823601548SRuslan Ermilov.Fn clnt_pcreateerror 10498360efbdSAlfred Perlsteinto print the reason why. 105023601548SRuslan Ermilov.Pp 105123601548SRuslan Ermilov.It Xo 105223601548SRuslan Ermilov.Ft bool_t 105323601548SRuslan Ermilov.Fn svc_destroy "SVCXPRT * xprt" 105423601548SRuslan Ermilov.Xc 105523601548SRuslan Ermilov.Pp 10568360efbdSAlfred PerlsteinA macro that destroys the 105723601548SRuslan Ermilov.Tn RPC 10588360efbdSAlfred Perlsteinservice transport handle, 105923601548SRuslan Ermilov.Fa xprt . 10608360efbdSAlfred PerlsteinDestruction usually involves deallocation 10618360efbdSAlfred Perlsteinof private data structures, including 106223601548SRuslan Ermilov.Fa xprt 106323601548SRuslan Ermilovitself. 106423601548SRuslan ErmilovUse of 106523601548SRuslan Ermilov.Fa xprt 10668360efbdSAlfred Perlsteinis undefined after calling this routine. 106723601548SRuslan Ermilov.Pp 106823601548SRuslan Ermilov.It Xo 106923601548SRuslan Ermilov.Vt fd_set svc_fdset ; 107023601548SRuslan Ermilov.Xc 107123601548SRuslan Ermilov.Pp 10728360efbdSAlfred PerlsteinA global variable reflecting the 107323601548SRuslan Ermilov.Tn RPC 10748360efbdSAlfred Perlsteinservice side's 10752efeeba5SRuslan Ermilovread file descriptor bit mask; it is suitable as a template argument 10768360efbdSAlfred Perlsteinto the 107723601548SRuslan Ermilov.Xr select 2 107823601548SRuslan Ermilovsystem call. 107923601548SRuslan ErmilovThis is only of interest 10808360efbdSAlfred Perlsteinif a service implementor does not call 108123601548SRuslan Ermilov.Fn svc_run , 10828360efbdSAlfred Perlsteinbut rather does his own asynchronous event processing. 108323601548SRuslan ErmilovThis variable is read\-only (do not pass its address to 108423601548SRuslan Ermilov.Xr select 2 ! ) , 10858360efbdSAlfred Perlsteinyet it may change after calls to 108623601548SRuslan Ermilov.Fn svc_getreqset 10878360efbdSAlfred Perlsteinor any creation routines. 108823601548SRuslan ErmilovAs well, note that if the process has descriptor limits 108923601548SRuslan Ermilovwhich are extended beyond 109023601548SRuslan Ermilov.Dv FD_SETSIZE , 109123601548SRuslan Ermilovthis variable will only be usable for the first 109223601548SRuslan Ermilov.Dv FD_SETSIZE 109323601548SRuslan Ermilovdescriptors. 109423601548SRuslan Ermilov.Pp 109523601548SRuslan Ermilov.It Xo 109623601548SRuslan Ermilov.Vt int svc_fds ; 109723601548SRuslan Ermilov.Xc 109823601548SRuslan Ermilov.Pp 10998360efbdSAlfred PerlsteinSimilar to 110023601548SRuslan Ermilov.Va svc_fdset , 110123601548SRuslan Ermilovbut limited to 32 descriptors. 110223601548SRuslan ErmilovThis 11038360efbdSAlfred Perlsteininterface is obsoleted by 110423601548SRuslan Ermilov.Va svc_fdset . 110523601548SRuslan Ermilov.Pp 110623601548SRuslan Ermilov.It Xo 110723601548SRuslan Ermilov.Ft bool_t 110823601548SRuslan Ermilov.Fn svc_freeargs "SVCXPRT *xprt" "xdrproc_t inproc" "char *in" 110923601548SRuslan Ermilov.Xc 111023601548SRuslan Ermilov.Pp 11118360efbdSAlfred PerlsteinA macro that frees any data allocated by the 111223601548SRuslan Ermilov.Tn RPC/XDR 11138360efbdSAlfred Perlsteinsystem when it decoded the arguments to a service procedure 11148360efbdSAlfred Perlsteinusing 111523601548SRuslan Ermilov.Fn svc_getargs . 11168360efbdSAlfred PerlsteinThis routine returns 1 if the results were successfully 11178360efbdSAlfred Perlsteinfreed, 11188360efbdSAlfred Perlsteinand zero otherwise. 111923601548SRuslan Ermilov.Pp 112023601548SRuslan Ermilov.It Xo 112123601548SRuslan Ermilov.Ft bool_t 112223601548SRuslan Ermilov.Fn svc_getargs "SVCXPRT *xprt" "xdrproc_t inproc" "char *in" 112323601548SRuslan Ermilov.Xc 112423601548SRuslan Ermilov.Pp 11258360efbdSAlfred PerlsteinA macro that decodes the arguments of an 112623601548SRuslan Ermilov.Tn RPC 11278360efbdSAlfred Perlsteinrequest 11288360efbdSAlfred Perlsteinassociated with the 112923601548SRuslan Ermilov.Tn RPC 11308360efbdSAlfred Perlsteinservice transport handle, 113123601548SRuslan Ermilov.Fa xprt . 11322efeeba5SRuslan ErmilovThe 113323601548SRuslan Ermilov.Fa in 11342efeeba5SRuslan Ermilovargument 11358360efbdSAlfred Perlsteinis the address where the arguments will be placed; 113623601548SRuslan Ermilov.Fa inproc 11378360efbdSAlfred Perlsteinis the 113823601548SRuslan Ermilov.Tn XDR 11398360efbdSAlfred Perlsteinroutine used to decode the arguments. 11408360efbdSAlfred PerlsteinThis routine returns one if decoding succeeds, and zero 11418360efbdSAlfred Perlsteinotherwise. 114223601548SRuslan Ermilov.Pp 114323601548SRuslan Ermilov.It Xo 114423601548SRuslan Ermilov.Ft "struct sockaddr_in *" 114523601548SRuslan Ermilov.Xc 114623601548SRuslan Ermilov.It Xo 114723601548SRuslan Ermilov.Fn svc_getcaller "SVCXPRT *xprt" 114823601548SRuslan Ermilov.Xc 114923601548SRuslan Ermilov.Pp 11508360efbdSAlfred PerlsteinThe approved way of getting the network address of the caller 11518360efbdSAlfred Perlsteinof a procedure associated with the 115223601548SRuslan Ermilov.Tn RPC 11538360efbdSAlfred Perlsteinservice transport handle, 115423601548SRuslan Ermilov.Fa xprt . 115523601548SRuslan Ermilov.Pp 115623601548SRuslan Ermilov.It Xo 115723601548SRuslan Ermilov.Ft void 115823601548SRuslan Ermilov.Fn svc_getreqset "fd_set *rdfds" 115923601548SRuslan Ermilov.Xc 116023601548SRuslan Ermilov.Pp 11618360efbdSAlfred PerlsteinThis routine is only of interest if a service implementor 11628360efbdSAlfred Perlsteindoes not call 116323601548SRuslan Ermilov.Fn svc_run , 11648360efbdSAlfred Perlsteinbut instead implements custom asynchronous event processing. 11658360efbdSAlfred PerlsteinIt is called when the 116623601548SRuslan Ermilov.Xr select 2 11678360efbdSAlfred Perlsteinsystem call has determined that an 116823601548SRuslan Ermilov.Tn RPC 11698360efbdSAlfred Perlsteinrequest has arrived on some 117023601548SRuslan Ermilov.Tn RPC 117123601548SRuslan Ermilovsocket(s); 117223601548SRuslan Ermilov.Fa rdfds 11738360efbdSAlfred Perlsteinis the resultant read file descriptor bit mask. 11748360efbdSAlfred PerlsteinThe routine returns when all sockets associated with the 11758360efbdSAlfred Perlsteinvalue of 117623601548SRuslan Ermilov.Fa rdfds 11778360efbdSAlfred Perlsteinhave been serviced. 117823601548SRuslan Ermilov.Pp 117923601548SRuslan Ermilov.It Xo 118023601548SRuslan Ermilov.Ft void 118123601548SRuslan Ermilov.Fn svc_getreq "int rdfds" 118223601548SRuslan Ermilov.Xc 118323601548SRuslan Ermilov.Pp 11848360efbdSAlfred PerlsteinSimilar to 118523601548SRuslan Ermilov.Fn svc_getreqset , 118623601548SRuslan Ermilovbut limited to 32 descriptors. 118723601548SRuslan ErmilovThis interface is obsoleted by 118823601548SRuslan Ermilov.Fn svc_getreqset . 118923601548SRuslan Ermilov.Pp 119023601548SRuslan Ermilov.It Xo 119123601548SRuslan Ermilov.Ft bool_t 119223601548SRuslan Ermilov.Fo svc_register 119323601548SRuslan Ermilov.Fa "SVCXPRT *xprt" 119423601548SRuslan Ermilov.Fa "u_long prognum" 119523601548SRuslan Ermilov.Fa "u_long versnum" 119623601548SRuslan Ermilov.Fa "void (*dispatch)(struct svc_req *, SVCXPRT *)" 119723601548SRuslan Ermilov.Fa "int protocol" 119823601548SRuslan Ermilov.Fc 119923601548SRuslan Ermilov.Xc 120023601548SRuslan Ermilov.Pp 12018360efbdSAlfred PerlsteinAssociates 120223601548SRuslan Ermilov.Fa prognum 12038360efbdSAlfred Perlsteinand 120423601548SRuslan Ermilov.Fa versnum 12058360efbdSAlfred Perlsteinwith the service dispatch procedure, 120623601548SRuslan Ermilov.Fn dispatch . 12078360efbdSAlfred PerlsteinIf 120823601548SRuslan Ermilov.Fa protocol 12098360efbdSAlfred Perlsteinis zero, the service is not registered with the 12108657581bSMaxim Sobolev.Xr rpcbind 8 121123601548SRuslan Ermilovservice. 121223601548SRuslan ErmilovIf 121323601548SRuslan Ermilov.Fa protocol 12148360efbdSAlfred Perlsteinis non-zero, then a mapping of the triple 121523601548SRuslan Ermilov.Pq Fa prognum , versnum , protocol 12168360efbdSAlfred Perlsteinto 121723601548SRuslan Ermilov.Fa xprt\->xp_port 12188360efbdSAlfred Perlsteinis established with the local 12198657581bSMaxim Sobolev.Xr rpcbind 8 12208360efbdSAlfred Perlsteinservice (generally 122123601548SRuslan Ermilov.Fa protocol 12228360efbdSAlfred Perlsteinis zero, 122323601548SRuslan Ermilov.Dv IPPROTO_UDP 12248360efbdSAlfred Perlsteinor 122523601548SRuslan Ermilov.Dv IPPROTO_TCP ) . 12268360efbdSAlfred PerlsteinThe procedure 122723601548SRuslan Ermilov.Fn dispatch 12288360efbdSAlfred Perlsteinhas the following form: 122923601548SRuslan Ermilov.Bd -ragged -offset indent 123023601548SRuslan Ermilov.Ft bool_t 123123601548SRuslan Ermilov.Fn dispatch "struct svc_req *request" "SVCXPRT *xprt" 123223601548SRuslan Ermilov.Ed 123323601548SRuslan Ermilov.Pp 12348360efbdSAlfred PerlsteinThe 123523601548SRuslan Ermilov.Fn svc_register 12368360efbdSAlfred Perlsteinroutine returns one if it succeeds, and zero otherwise. 123723601548SRuslan Ermilov.Pp 123823601548SRuslan Ermilov.It Xo 123923601548SRuslan Ermilov.Fn svc_run 124023601548SRuslan Ermilov.Xc 124123601548SRuslan Ermilov.Pp 124223601548SRuslan ErmilovThis routine never returns. 124323601548SRuslan ErmilovIt waits for 124423601548SRuslan Ermilov.Tn RPC 12458360efbdSAlfred Perlsteinrequests to arrive, and calls the appropriate service 12468360efbdSAlfred Perlsteinprocedure using 124723601548SRuslan Ermilov.Fn svc_getreq 124823601548SRuslan Ermilovwhen one arrives. 124923601548SRuslan ErmilovThis procedure is usually waiting for a 125023601548SRuslan Ermilov.Xr select 2 12518360efbdSAlfred Perlsteinsystem call to return. 125223601548SRuslan Ermilov.Pp 125323601548SRuslan Ermilov.It Xo 125423601548SRuslan Ermilov.Ft bool_t 125523601548SRuslan Ermilov.Fn svc_sendreply "SVCXPRT *xprt" "xdrproc_t outproc" "char *out" 125623601548SRuslan Ermilov.Xc 125723601548SRuslan Ermilov.Pp 12588360efbdSAlfred PerlsteinCalled by an 125923601548SRuslan Ermilov.Tn RPC 12608360efbdSAlfred Perlsteinservice's dispatch routine to send the results of a 126123601548SRuslan Ermilovremote procedure call. 12622efeeba5SRuslan ErmilovThe 126323601548SRuslan Ermilov.Fa xprt 12642efeeba5SRuslan Ermilovargument 12658360efbdSAlfred Perlsteinis the request's associated transport handle; 126623601548SRuslan Ermilov.Fa outproc 12678360efbdSAlfred Perlsteinis the 126823601548SRuslan Ermilov.Tn XDR 12698360efbdSAlfred Perlsteinroutine which is used to encode the results; and 127023601548SRuslan Ermilov.Fa out 12718360efbdSAlfred Perlsteinis the address of the results. 12728360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise. 127323601548SRuslan Ermilov.Pp 127423601548SRuslan Ermilov.It Xo 127523601548SRuslan Ermilov.Ft void 127623601548SRuslan Ermilov.Xc 127723601548SRuslan Ermilov.It Xo 127823601548SRuslan Ermilov.Fn svc_unregister "u_long prognum" "u_long versnum" 127923601548SRuslan Ermilov.Xc 128023601548SRuslan Ermilov.Pp 12818360efbdSAlfred PerlsteinRemove all mapping of the double 128223601548SRuslan Ermilov.Pq Fa prognum , versnum 12838360efbdSAlfred Perlsteinto dispatch routines, and of the triple 128423601548SRuslan Ermilov.Pq Fa prognum , versnum , * 12858360efbdSAlfred Perlsteinto port number. 128623601548SRuslan Ermilov.Pp 128723601548SRuslan Ermilov.It Xo 128823601548SRuslan Ermilov.Ft void 128923601548SRuslan Ermilov.Xc 129023601548SRuslan Ermilov.It Xo 129123601548SRuslan Ermilov.Fn svcerr_auth "SVCXPRT *xprt" "enum auth_stat why" 129223601548SRuslan Ermilov.Xc 129323601548SRuslan Ermilov.Pp 12948360efbdSAlfred PerlsteinCalled by a service dispatch routine that refuses to perform 12958360efbdSAlfred Perlsteina remote procedure call due to an authentication error. 129623601548SRuslan Ermilov.Pp 129723601548SRuslan Ermilov.It Xo 129823601548SRuslan Ermilov.Ft void 129923601548SRuslan Ermilov.Xc 130023601548SRuslan Ermilov.It Xo 130123601548SRuslan Ermilov.Fn svcerr_decode "SVCXPRT *xprt" 130223601548SRuslan Ermilov.Xc 130323601548SRuslan Ermilov.Pp 13048360efbdSAlfred PerlsteinCalled by a service dispatch routine that cannot successfully 13052efeeba5SRuslan Ermilovdecode its arguments. 130623601548SRuslan ErmilovSee also 130723601548SRuslan Ermilov.Fn svc_getargs . 130823601548SRuslan Ermilov.Pp 130923601548SRuslan Ermilov.It Xo 131023601548SRuslan Ermilov.Ft void 131123601548SRuslan Ermilov.Xc 131223601548SRuslan Ermilov.It Xo 131323601548SRuslan Ermilov.Fn svcerr_noproc "SVCXPRT *xprt" 131423601548SRuslan Ermilov.Xc 131523601548SRuslan Ermilov.Pp 13168360efbdSAlfred PerlsteinCalled by a service dispatch routine that does not implement 13178360efbdSAlfred Perlsteinthe procedure number that the caller requests. 131823601548SRuslan Ermilov.Pp 131923601548SRuslan Ermilov.It Xo 132023601548SRuslan Ermilov.Ft void 132123601548SRuslan Ermilov.Xc 132223601548SRuslan Ermilov.It Xo 132323601548SRuslan Ermilov.Fn svcerr_noprog "SVCXPRT *xprt" 132423601548SRuslan Ermilov.Xc 132523601548SRuslan Ermilov.Pp 13268360efbdSAlfred PerlsteinCalled when the desired program is not registered with the 132723601548SRuslan Ermilov.Tn RPC 132823601548SRuslan Ermilovpackage. 132923601548SRuslan ErmilovService implementors usually do not need this routine. 133023601548SRuslan Ermilov.Pp 133123601548SRuslan Ermilov.It Xo 133223601548SRuslan Ermilov.Ft void 133323601548SRuslan Ermilov.Xc 133423601548SRuslan Ermilov.It Xo 133523601548SRuslan Ermilov.Fn svcerr_progvers "SVCXPRT *xprt" "u_long low_vers" "u_long high_vers" 133623601548SRuslan Ermilov.Xc 133723601548SRuslan Ermilov.Pp 13388360efbdSAlfred PerlsteinCalled when the desired version of a program is not registered 13398360efbdSAlfred Perlsteinwith the 134023601548SRuslan Ermilov.Tn RPC 134123601548SRuslan Ermilovpackage. 134223601548SRuslan ErmilovService implementors usually do not need this routine. 134323601548SRuslan Ermilov.Pp 134423601548SRuslan Ermilov.It Xo 134523601548SRuslan Ermilov.Ft void 134623601548SRuslan Ermilov.Xc 134723601548SRuslan Ermilov.It Xo 134823601548SRuslan Ermilov.Fn svcerr_systemerr "SVCXPRT *xprt" 134923601548SRuslan Ermilov.Xc 135023601548SRuslan Ermilov.Pp 13518360efbdSAlfred PerlsteinCalled by a service dispatch routine when it detects a system 13528360efbdSAlfred Perlsteinerror 13538360efbdSAlfred Perlsteinnot covered by any particular protocol. 13548360efbdSAlfred PerlsteinFor example, if a service can no longer allocate storage, 13558360efbdSAlfred Perlsteinit may call this routine. 135623601548SRuslan Ermilov.Pp 135723601548SRuslan Ermilov.It Xo 135823601548SRuslan Ermilov.Ft void 135923601548SRuslan Ermilov.Xc 136023601548SRuslan Ermilov.It Xo 136123601548SRuslan Ermilov.Fn svcerr_weakauth "SVCXPRT *xprt" 136223601548SRuslan Ermilov.Xc 136323601548SRuslan Ermilov.Pp 13648360efbdSAlfred PerlsteinCalled by a service dispatch routine that refuses to perform 13658360efbdSAlfred Perlsteina remote procedure call due to insufficient 13662efeeba5SRuslan Ermilovauthentication arguments. 136723601548SRuslan ErmilovThe routine calls 136823601548SRuslan Ermilov.Fn svcerr_auth xprt AUTH_TOOWEAK . 136923601548SRuslan Ermilov.Pp 137023601548SRuslan Ermilov.It Xo 137123601548SRuslan Ermilov.Ft "SVCXPRT *" 137223601548SRuslan Ermilov.Xc 137323601548SRuslan Ermilov.It Xo 137423601548SRuslan Ermilov.Fn svcraw_create void 137523601548SRuslan Ermilov.Xc 137623601548SRuslan Ermilov.Pp 13778360efbdSAlfred PerlsteinThis routine creates a toy 137823601548SRuslan Ermilov.Tn RPC 137923601548SRuslan Ermilovservice transport, to which it returns a pointer. 138023601548SRuslan ErmilovThe transport 13818360efbdSAlfred Perlsteinis really a buffer within the process's address space, 13828360efbdSAlfred Perlsteinso the corresponding 138323601548SRuslan Ermilov.Tn RPC 13848360efbdSAlfred Perlsteinclient should live in the same 13858360efbdSAlfred Perlsteinaddress space; 13868360efbdSAlfred Perlsteinsee 138723601548SRuslan Ermilov.Fn clntraw_create . 13888360efbdSAlfred PerlsteinThis routine allows simulation of 138923601548SRuslan Ermilov.Tn RPC 13908360efbdSAlfred Perlsteinand acquisition of 139123601548SRuslan Ermilov.Tn RPC 13928360efbdSAlfred Perlsteinoverheads (such as round trip times), without any kernel 13938360efbdSAlfred Perlsteininterference. 13948360efbdSAlfred PerlsteinThis routine returns 139523601548SRuslan Ermilov.Dv NULL 13968360efbdSAlfred Perlsteinif it fails. 139723601548SRuslan Ermilov.Pp 139823601548SRuslan Ermilov.It Xo 139923601548SRuslan Ermilov.Ft "SVCXPRT *" 140023601548SRuslan Ermilov.Xc 140123601548SRuslan Ermilov.It Xo 140223601548SRuslan Ermilov.Fn svctcp_create "int sock" "u_int send_buf_size" "u_int recv_buf_size" 140323601548SRuslan Ermilov.Xc 140423601548SRuslan Ermilov.Pp 14058360efbdSAlfred PerlsteinThis routine creates a 140623601548SRuslan Ermilov.Tn TCP/IP Ns \-based 140723601548SRuslan Ermilov.Tn RPC 14088360efbdSAlfred Perlsteinservice transport, to which it returns a pointer. 14098360efbdSAlfred PerlsteinThe transport is associated with the socket 141023601548SRuslan Ermilov.Fa sock , 14118360efbdSAlfred Perlsteinwhich may be 141223601548SRuslan Ermilov.Dv RPC_ANYSOCK , 14138360efbdSAlfred Perlsteinin which case a new socket is created. 14148360efbdSAlfred PerlsteinIf the socket is not bound to a local 141523601548SRuslan Ermilov.Tn TCP 141623601548SRuslan Ermilovport, then this routine binds it to an arbitrary port. 141723601548SRuslan ErmilovUpon completion, 141823601548SRuslan Ermilov.Fa xprt\->xp_fd 14198360efbdSAlfred Perlsteinis the transport's socket descriptor, and 142023601548SRuslan Ermilov.Fa xprt\->xp_port 14218360efbdSAlfred Perlsteinis the transport's port number. 14228360efbdSAlfred PerlsteinThis routine returns 142323601548SRuslan Ermilov.Dv NULL 142423601548SRuslan Ermilovif it fails. 142523601548SRuslan ErmilovSince 142623601548SRuslan Ermilov.Tn TCP Ns \-based 142723601548SRuslan Ermilov.Tn RPC 14288360efbdSAlfred Perlsteinuses buffered 142923601548SRuslan Ermilov.Tn I/O , 14308360efbdSAlfred Perlsteinusers may specify the size of buffers; values of zero 14318360efbdSAlfred Perlsteinchoose suitable defaults. 143223601548SRuslan Ermilov.Pp 143323601548SRuslan Ermilov.It Xo 143423601548SRuslan Ermilov.Ft "SVCXPRT *" 143523601548SRuslan Ermilov.Xc 143623601548SRuslan Ermilov.It Xo 1437e6f9ad07SBill Paul.Fn svcunix_create "int sock" "u_int send_buf_size" "u_int recv_buf_size" "char *path" 1438e6f9ad07SBill Paul.Xc 1439e6f9ad07SBill Paul.Pp 1440e6f9ad07SBill PaulThis routine creates a 1441872013cbSRuslan Ermilov.Ux Ns -based 1442e6f9ad07SBill Paul.Tn RPC 1443e6f9ad07SBill Paulservice transport, to which it returns a pointer. 1444e6f9ad07SBill PaulThe transport is associated with the socket 1445e6f9ad07SBill Paul.Fa sock , 1446e6f9ad07SBill Paulwhich may be 1447e6f9ad07SBill Paul.Dv RPC_ANYSOCK , 1448e6f9ad07SBill Paulin which case a new socket is created. 14492efeeba5SRuslan ErmilovThe 1450e6f9ad07SBill Paul.Fa *path 14512efeeba5SRuslan Ermilovargument 1452e6f9ad07SBill Paulis a variable-length file system pathname of 1453e6f9ad07SBill Paulat most 104 characters. 1454e6f9ad07SBill PaulThis file is 1455e6f9ad07SBill Paul.Em not 1456e6f9ad07SBill Paulremoved when the socket is closed. 1457d6498251SPhilippe CharnierThe 1458e6f9ad07SBill Paul.Xr unlink 2 1459d6498251SPhilippe Charniersystem call must be used to remove the file. 1460e6f9ad07SBill PaulUpon completion, 1461e6f9ad07SBill Paul.Fa xprt\->xp_fd 1462e6f9ad07SBill Paulis the transport's socket descriptor. 1463e6f9ad07SBill PaulThis routine returns 1464e6f9ad07SBill Paul.Dv NULL 1465e6f9ad07SBill Paulif it fails. 1466e6f9ad07SBill PaulSince 1467872013cbSRuslan Ermilov.Ux Ns -based 1468e6f9ad07SBill Paul.Tn RPC 1469e6f9ad07SBill Pauluses buffered 1470e6f9ad07SBill Paul.Tn I/O , 1471e6f9ad07SBill Paulusers may specify the size of buffers; values of zero 1472e6f9ad07SBill Paulchoose suitable defaults. 1473e6f9ad07SBill Paul.Pp 1474e6f9ad07SBill Paul.It Xo 1475e6f9ad07SBill Paul.Ft "SVCXPRT *" 1476e6f9ad07SBill Paul.Xc 1477e6f9ad07SBill Paul.It Xo 1478e6f9ad07SBill Paul.Fn svcunixfd_create "int fd" "u_int sendsize" "u_int recvsize" 1479e6f9ad07SBill Paul.Xc 1480e6f9ad07SBill Paul.Pp 1481e6f9ad07SBill PaulCreate a service on top of any open descriptor. 14822efeeba5SRuslan ErmilovThe 1483e6f9ad07SBill Paul.Fa sendsize 1484e6f9ad07SBill Pauland 1485e6f9ad07SBill Paul.Fa recvsize 14862efeeba5SRuslan Ermilovarguments 1487e6f9ad07SBill Paulindicate sizes for the send and receive buffers. 1488e6f9ad07SBill PaulIf they are 1489e6f9ad07SBill Paulzero, a reasonable default is chosen. 1490e6f9ad07SBill Paul.Pp 1491e6f9ad07SBill Paul.It Xo 1492e6f9ad07SBill Paul.Ft "SVCXPRT *" 1493e6f9ad07SBill Paul.Xc 1494e6f9ad07SBill Paul.It Xo 149523601548SRuslan Ermilov.Fn svcfd_create "int fd" "u_int sendsize" "u_int recvsize" 149623601548SRuslan Ermilov.Xc 149723601548SRuslan Ermilov.Pp 149823601548SRuslan ErmilovCreate a service on top of any open descriptor. 149923601548SRuslan ErmilovTypically, 15008360efbdSAlfred Perlsteinthis 15018360efbdSAlfred Perlsteindescriptor is a connected socket for a stream protocol such 15028360efbdSAlfred Perlsteinas 150323601548SRuslan Ermilov.Tn TCP . 15042efeeba5SRuslan ErmilovThe 150523601548SRuslan Ermilov.Fa sendsize 15068360efbdSAlfred Perlsteinand 150723601548SRuslan Ermilov.Fa recvsize 15082efeeba5SRuslan Ermilovarguments 150923601548SRuslan Ermilovindicate sizes for the send and receive buffers. 151023601548SRuslan ErmilovIf they are 15118360efbdSAlfred Perlsteinzero, a reasonable default is chosen. 151223601548SRuslan Ermilov.Pp 151323601548SRuslan Ermilov.It Xo 151423601548SRuslan Ermilov.Ft "SVCXPRT *" 151523601548SRuslan Ermilov.Xc 151623601548SRuslan Ermilov.It Xo 151723601548SRuslan Ermilov.Fn svcudp_bufcreate "int sock" "u_int sendsize" "u_int recvsize" 151823601548SRuslan Ermilov.Xc 151923601548SRuslan Ermilov.Pp 15208360efbdSAlfred PerlsteinThis routine creates a 152123601548SRuslan Ermilov.Tn UDP/IP Ns \-based 152223601548SRuslan Ermilov.Tn RPC 15238360efbdSAlfred Perlsteinservice transport, to which it returns a pointer. 15248360efbdSAlfred PerlsteinThe transport is associated with the socket 152523601548SRuslan Ermilov.Fa sock , 15268360efbdSAlfred Perlsteinwhich may be 152723601548SRuslan Ermilov.Dv RPC_ANYSOCK , 15288360efbdSAlfred Perlsteinin which case a new socket is created. 15298360efbdSAlfred PerlsteinIf the socket is not bound to a local 153023601548SRuslan Ermilov.Tn UDP 153123601548SRuslan Ermilovport, then this routine binds it to an arbitrary port. 153223601548SRuslan ErmilovUpon 15338360efbdSAlfred Perlsteincompletion, 153423601548SRuslan Ermilov.Fa xprt\->xp_fd 15358360efbdSAlfred Perlsteinis the transport's socket descriptor, and 153623601548SRuslan Ermilov.Fa xprt\->xp_port 15378360efbdSAlfred Perlsteinis the transport's port number. 15388360efbdSAlfred PerlsteinThis routine returns 153923601548SRuslan Ermilov.Dv NULL 15408360efbdSAlfred Perlsteinif it fails. 154123601548SRuslan Ermilov.Pp 15428360efbdSAlfred PerlsteinThis allows the user to specify the maximum packet size for sending and 15438360efbdSAlfred Perlsteinreceiving 154423601548SRuslan Ermilov.Tn UDP Ns \-based 154523601548SRuslan Ermilov.Tn RPC 154623601548SRuslan Ermilovmessages. 154723601548SRuslan Ermilov.Pp 154823601548SRuslan Ermilov.It Xo 154923601548SRuslan Ermilov.Ft bool_t 155023601548SRuslan Ermilov.Fn xdr_accepted_reply "XDR *xdrs" "struct accepted_reply *ar" 155123601548SRuslan Ermilov.Xc 155223601548SRuslan Ermilov.Pp 15538360efbdSAlfred PerlsteinUsed for encoding 155423601548SRuslan Ermilov.Tn RPC 155523601548SRuslan Ermilovreply messages. 155623601548SRuslan ErmilovThis routine is useful for users who 15578360efbdSAlfred Perlsteinwish to generate 155823601548SRuslan Ermilov.Tn RPC Ns \-style 15598360efbdSAlfred Perlsteinmessages without using the 156023601548SRuslan Ermilov.Tn RPC 15618360efbdSAlfred Perlsteinpackage. 156223601548SRuslan Ermilov.Pp 156323601548SRuslan Ermilov.It Xo 156423601548SRuslan Ermilov.Ft bool_t 156523601548SRuslan Ermilov.Fn xdr_authunix_parms "XDR *xdrs" "struct authunix_parms *aupp" 156623601548SRuslan Ermilov.Xc 156723601548SRuslan Ermilov.Pp 15688360efbdSAlfred PerlsteinUsed for describing 156923601548SRuslan Ermilov.Ux 157023601548SRuslan Ermilovcredentials. 157123601548SRuslan ErmilovThis routine is useful for users 15728360efbdSAlfred Perlsteinwho wish to generate these credentials without using the 157323601548SRuslan Ermilov.Tn RPC 15748360efbdSAlfred Perlsteinauthentication package. 157523601548SRuslan Ermilov.Pp 157623601548SRuslan Ermilov.It Xo 157723601548SRuslan Ermilov.Ft void 157823601548SRuslan Ermilov.Xc 157923601548SRuslan Ermilov.It Xo 158023601548SRuslan Ermilov.Ft bool_t 158123601548SRuslan Ermilov.Fn xdr_callhdr "XDR *xdrs" "struct rpc_msg *chdr" 158223601548SRuslan Ermilov.Xc 158323601548SRuslan Ermilov.Pp 15848360efbdSAlfred PerlsteinUsed for describing 158523601548SRuslan Ermilov.Tn RPC 15868360efbdSAlfred Perlsteincall header messages. 15878360efbdSAlfred PerlsteinThis routine is useful for users who wish to generate 158823601548SRuslan Ermilov.Tn RPC Ns \-style 15898360efbdSAlfred Perlsteinmessages without using the 159023601548SRuslan Ermilov.Tn RPC 15918360efbdSAlfred Perlsteinpackage. 159223601548SRuslan Ermilov.Pp 159323601548SRuslan Ermilov.It Xo 159423601548SRuslan Ermilov.Ft bool_t 159523601548SRuslan Ermilov.Fn xdr_callmsg "XDR *xdrs" "struct rpc_msg *cmsg" 159623601548SRuslan Ermilov.Xc 159723601548SRuslan Ermilov.Pp 15988360efbdSAlfred PerlsteinUsed for describing 159923601548SRuslan Ermilov.Tn RPC 16008360efbdSAlfred Perlsteincall messages. 16018360efbdSAlfred PerlsteinThis routine is useful for users who wish to generate 160223601548SRuslan Ermilov.Tn RPC Ns \-style 16038360efbdSAlfred Perlsteinmessages without using the 160423601548SRuslan Ermilov.Tn RPC 16058360efbdSAlfred Perlsteinpackage. 160623601548SRuslan Ermilov.Pp 160723601548SRuslan Ermilov.It Xo 160823601548SRuslan Ermilov.Ft bool_t 160923601548SRuslan Ermilov.Fn xdr_opaque_auth "XDR *xdrs" "struct opaque_auth *ap" 161023601548SRuslan Ermilov.Xc 161123601548SRuslan Ermilov.Pp 16128360efbdSAlfred PerlsteinUsed for describing 161323601548SRuslan Ermilov.Tn RPC 16148360efbdSAlfred Perlsteinauthentication information messages. 16158360efbdSAlfred PerlsteinThis routine is useful for users who wish to generate 161623601548SRuslan Ermilov.Tn RPC Ns \-style 16178360efbdSAlfred Perlsteinmessages without using the 161823601548SRuslan Ermilov.Tn RPC 16198360efbdSAlfred Perlsteinpackage. 162023601548SRuslan Ermilov.Pp 162123601548SRuslan Ermilov.It Xo 162223601548SRuslan Ermilov.Vt struct pmap ; 162323601548SRuslan Ermilov.Xc 162423601548SRuslan Ermilov.It Xo 162523601548SRuslan Ermilov.Ft bool_t 162623601548SRuslan Ermilov.Fn xdr_pmap "XDR *xdrs" "struct pmap *regs" 162723601548SRuslan Ermilov.Xc 162823601548SRuslan Ermilov.Pp 16292efeeba5SRuslan ErmilovUsed for describing arguments to various 16308657581bSMaxim Sobolev.Xr rpcbind 8 16318360efbdSAlfred Perlsteinprocedures, externally. 16328360efbdSAlfred PerlsteinThis routine is useful for users who wish to generate 16332efeeba5SRuslan Ermilovthese arguments without using the 163423601548SRuslan Ermilov.Fn pmap_* 16358360efbdSAlfred Perlsteininterface. 163623601548SRuslan Ermilov.Pp 163723601548SRuslan Ermilov.It Xo 163823601548SRuslan Ermilov.Ft bool_t 163923601548SRuslan Ermilov.Fn xdr_pmaplist "XDR *xdrs" "struct pmaplist **rp" 164023601548SRuslan Ermilov.Xc 164123601548SRuslan Ermilov.Pp 16428360efbdSAlfred PerlsteinUsed for describing a list of port mappings, externally. 16438360efbdSAlfred PerlsteinThis routine is useful for users who wish to generate 16442efeeba5SRuslan Ermilovthese arguments without using the 164523601548SRuslan Ermilov.Fn pmap_* 16468360efbdSAlfred Perlsteininterface. 164723601548SRuslan Ermilov.Pp 164823601548SRuslan Ermilov.It Xo 164923601548SRuslan Ermilov.Ft bool_t 165023601548SRuslan Ermilov.Fn xdr_rejected_reply "XDR *xdrs" "struct rejected_reply *rr" 165123601548SRuslan Ermilov.Xc 165223601548SRuslan Ermilov.Pp 16538360efbdSAlfred PerlsteinUsed for describing 165423601548SRuslan Ermilov.Tn RPC 16558360efbdSAlfred Perlsteinreply messages. 16568360efbdSAlfred PerlsteinThis routine is useful for users who wish to generate 165723601548SRuslan Ermilov.Tn RPC Ns \-style 16588360efbdSAlfred Perlsteinmessages without using the 165923601548SRuslan Ermilov.Tn RPC 16608360efbdSAlfred Perlsteinpackage. 166123601548SRuslan Ermilov.Pp 166223601548SRuslan Ermilov.It Xo 166323601548SRuslan Ermilov.Ft bool_t 166423601548SRuslan Ermilov.Fn xdr_replymsg "XDR *xdrs" "struct rpc_msg *rmsg" 166523601548SRuslan Ermilov.Xc 166623601548SRuslan Ermilov.Pp 16678360efbdSAlfred PerlsteinUsed for describing 166823601548SRuslan Ermilov.Tn RPC 16698360efbdSAlfred Perlsteinreply messages. 16708360efbdSAlfred PerlsteinThis routine is useful for users who wish to generate 167123601548SRuslan Ermilov.Tn RPC 16728360efbdSAlfred Perlsteinstyle messages without using the 167323601548SRuslan Ermilov.Tn RPC 16748360efbdSAlfred Perlsteinpackage. 167523601548SRuslan Ermilov.Pp 167623601548SRuslan Ermilov.It Xo 167723601548SRuslan Ermilov.Ft void 167823601548SRuslan Ermilov.Xc 167923601548SRuslan Ermilov.It Xo 168023601548SRuslan Ermilov.Fn xprt_register "SVCXPRT *xprt" 168123601548SRuslan Ermilov.Xc 168223601548SRuslan Ermilov.Pp 16838360efbdSAlfred PerlsteinAfter 168423601548SRuslan Ermilov.Tn RPC 16858360efbdSAlfred Perlsteinservice transport handles are created, 16868360efbdSAlfred Perlsteinthey should register themselves with the 168723601548SRuslan Ermilov.Tn RPC 16888360efbdSAlfred Perlsteinservice package. 16898360efbdSAlfred PerlsteinThis routine modifies the global variable 169023601548SRuslan Ermilov.Va svc_fds . 16918360efbdSAlfred PerlsteinService implementors usually do not need this routine. 169223601548SRuslan Ermilov.Pp 169323601548SRuslan Ermilov.It Xo 169423601548SRuslan Ermilov.Ft void 169523601548SRuslan Ermilov.Xc 169623601548SRuslan Ermilov.It Xo 169723601548SRuslan Ermilov.Fn xprt_unregister "SVCXPRT *xprt" 169823601548SRuslan Ermilov.Xc 169923601548SRuslan Ermilov.Pp 17008360efbdSAlfred PerlsteinBefore an 170123601548SRuslan Ermilov.Tn RPC 17028360efbdSAlfred Perlsteinservice transport handle is destroyed, 17038360efbdSAlfred Perlsteinit should unregister itself with the 170423601548SRuslan Ermilov.Tn RPC 17058360efbdSAlfred Perlsteinservice package. 17068360efbdSAlfred PerlsteinThis routine modifies the global variable 170723601548SRuslan Ermilov.Va svc_fds . 17088360efbdSAlfred PerlsteinService implementors usually do not need this routine. 170923601548SRuslan Ermilov.El 171023601548SRuslan Ermilov.Sh SEE ALSO 171123601548SRuslan Ermilov.Xr rpc_secure 3 , 171223601548SRuslan Ermilov.Xr xdr 3 171323601548SRuslan Ermilov.Rs 171423601548SRuslan Ermilov.%T "Remote Procedure Calls: Protocol Specification" 171523601548SRuslan Ermilov.Re 171623601548SRuslan Ermilov.Rs 171723601548SRuslan Ermilov.%T "Remote Procedure Call Programming Guide" 171823601548SRuslan Ermilov.Re 171923601548SRuslan Ermilov.Rs 172023601548SRuslan Ermilov.%T "rpcgen Programming Guide" 172123601548SRuslan Ermilov.Re 172223601548SRuslan Ermilov.Rs 172323601548SRuslan Ermilov.%T "RPC: Remote Procedure Call Protocol Specification" 172423601548SRuslan Ermilov.%O RFC1050 172523601548SRuslan Ermilov.%Q "Sun Microsystems, Inc., USC-ISI" 172623601548SRuslan Ermilov.Re 1727