1*2fe8fb19SBen Gras.\" @(#)rpcbind.3n 1.25 93/05/07 SMI; from SVr4 2*2fe8fb19SBen Gras.\" Copyright 1989 AT&T 3*2fe8fb19SBen Gras.\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved. 4*2fe8fb19SBen Gras.\" $NetBSD: rpcbind.3,v 1.11 2009/04/11 16:07:20 joerg Exp $ 5*2fe8fb19SBen Gras.Dd December 4, 2005 6*2fe8fb19SBen Gras.Dt RPCBIND 3 7*2fe8fb19SBen Gras.Os 8*2fe8fb19SBen Gras.Sh NAME 9*2fe8fb19SBen Gras.Nm rpcb_getmaps , 10*2fe8fb19SBen Gras.Nm rpcb_getaddr , 11*2fe8fb19SBen Gras.Nm rpcb_gettime , 12*2fe8fb19SBen Gras.Nm rpcb_rmtcall , 13*2fe8fb19SBen Gras.Nm rpcb_set , 14*2fe8fb19SBen Gras.Nm rpcb_unset 15*2fe8fb19SBen Gras.Nd library routines for RPC bind service 16*2fe8fb19SBen Gras.Sh LIBRARY 17*2fe8fb19SBen Gras.Lb libc 18*2fe8fb19SBen Gras.Sh SYNOPSIS 19*2fe8fb19SBen Gras.In rpc/rpc.h 20*2fe8fb19SBen Gras.Ft "struct rpcblist *" 21*2fe8fb19SBen Gras.Fn rpcb_getmaps "const struct netconfig *netconf" "const char *host" 22*2fe8fb19SBen Gras.Ft bool_t 23*2fe8fb19SBen Gras.Fn rpcb_getaddr "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" "struct netbuf *svcaddr" "const char *host" 24*2fe8fb19SBen Gras.Ft bool_t 25*2fe8fb19SBen Gras.Fn rpcb_gettime "const char *host" "time_t * timep" 26*2fe8fb19SBen Gras.Ft "enum clnt_stat" 27*2fe8fb19SBen Gras.Fn rpcb_rmtcall "const struct netconfig *netconf" "const char *host" "const rpcprog_t prognum, const rpcvers_t versnum" "const rpcproc_t procnum, const xdrproc_t inproc" "const char *in" "const xdrproc_t outproc" "caddr_t out" "const struct timeval tout, struct netbuf *svcaddr" 28*2fe8fb19SBen Gras.Ft bool_t 29*2fe8fb19SBen Gras.Fn rpcb_set "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" "const struct netbuf *svcaddr" 30*2fe8fb19SBen Gras.Ft bool_t 31*2fe8fb19SBen Gras.Fn rpcb_unset "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" 32*2fe8fb19SBen Gras.Sh DESCRIPTION 33*2fe8fb19SBen GrasThese routines allow client C programs to make procedure 34*2fe8fb19SBen Grascalls to the RPC binder service. 35*2fe8fb19SBen Gras(see 36*2fe8fb19SBen Gras.Xr rpcbind 8 ) 37*2fe8fb19SBen Grasmaintains a list of mappings between programs 38*2fe8fb19SBen Grasand their universal addresses. 39*2fe8fb19SBen Gras.Sh ROUTINES 40*2fe8fb19SBen Gras.Bl -tag -width XXXXX 41*2fe8fb19SBen Gras.It Fn rpcb_getmaps 42*2fe8fb19SBen GrasAn interface to the rpcbind service, 43*2fe8fb19SBen Graswhich returns a list of the current 44*2fe8fb19SBen GrasRPC program-to-address mappings on 45*2fe8fb19SBen Gras.Fa host . 46*2fe8fb19SBen GrasIt uses the transport specified through 47*2fe8fb19SBen Gras.Fa netconf 48*2fe8fb19SBen Grasto contact the remote rpcbind 49*2fe8fb19SBen Grasservice on 50*2fe8fb19SBen Gras.Fa host . 51*2fe8fb19SBen GrasThis routine will return 52*2fe8fb19SBen Gras.Dv NULL , 53*2fe8fb19SBen Grasif the remote rpcbind could not be contacted. 54*2fe8fb19SBen Gras.Pp 55*2fe8fb19SBen Gras.It Fn rpcb_getaddr 56*2fe8fb19SBen GrasAn interface to the rpcbind 57*2fe8fb19SBen Grasservice, which finds the address of the service on 58*2fe8fb19SBen Gras.Fa host 59*2fe8fb19SBen Grasthat is registered with program number 60*2fe8fb19SBen Gras.Fa prognum , 61*2fe8fb19SBen Grasversion 62*2fe8fb19SBen Gras.Fa versnum , 63*2fe8fb19SBen Grasand speaks the transport protocol associated with 64*2fe8fb19SBen Gras.Fa netconf . 65*2fe8fb19SBen GrasThe address found is returned in 66*2fe8fb19SBen Gras.Fa svcaddr . 67*2fe8fb19SBen Gras.Fa svcaddr 68*2fe8fb19SBen Grasshould be preallocated. 69*2fe8fb19SBen GrasThis routine returns 70*2fe8fb19SBen Gras.Dv TRUE 71*2fe8fb19SBen Grasif it succeeds. 72*2fe8fb19SBen GrasA return value of 73*2fe8fb19SBen Gras.Dv FALSE 74*2fe8fb19SBen Grasmeans that the mapping does not exist 75*2fe8fb19SBen Grasor that the RPC 76*2fe8fb19SBen Grassystem failed to contact the remote 77*2fe8fb19SBen Grasrpcbind service. 78*2fe8fb19SBen GrasIn the latter case, the global variable 79*2fe8fb19SBen Gras.Va rpc_createerr 80*2fe8fb19SBen Gras(see 81*2fe8fb19SBen Gras.Xr rpc_clnt_create 3 82*2fe8fb19SBen Grascontains the 83*2fe8fb19SBen GrasRPC status. 84*2fe8fb19SBen Gras.Pp 85*2fe8fb19SBen Gras.It Fn rpcb_gettime 86*2fe8fb19SBen GrasThis routine returns the time on 87*2fe8fb19SBen Gras.Fa host 88*2fe8fb19SBen Grasin 89*2fe8fb19SBen Gras.Fa timep . 90*2fe8fb19SBen GrasIf 91*2fe8fb19SBen Gras.Fa host 92*2fe8fb19SBen Grasis 93*2fe8fb19SBen Gras.Dv NULL , 94*2fe8fb19SBen Gras.Fn rpcb_gettime 95*2fe8fb19SBen Grasreturns the time on its own machine. 96*2fe8fb19SBen GrasThis routine returns 97*2fe8fb19SBen Gras.Dv TRUE 98*2fe8fb19SBen Grasif it succeeds, 99*2fe8fb19SBen Gras.Dv FALSE 100*2fe8fb19SBen Grasif it fails. 101*2fe8fb19SBen Gras.Fn rpcb_gettime 102*2fe8fb19SBen Grascan be used to synchronize the time between the 103*2fe8fb19SBen Grasclient and the remote server. 104*2fe8fb19SBen Gras.Pp 105*2fe8fb19SBen Gras.It Fn rpcb_rmtcall 106*2fe8fb19SBen GrasAn interface to the rpcbind service, which instructs 107*2fe8fb19SBen Grasrpcbind on 108*2fe8fb19SBen Gras.Fa host 109*2fe8fb19SBen Grasto make an RPC 110*2fe8fb19SBen Grascall on your behalf to a procedure on that host. 111*2fe8fb19SBen GrasThe 112*2fe8fb19SBen Gras.Fn netconfig 113*2fe8fb19SBen Grasstructure should correspond to a connectionless transport. 114*2fe8fb19SBen GrasThe parameter 115*2fe8fb19SBen Gras.Fa svcaddr 116*2fe8fb19SBen Graswill be modified to the server's address if the procedure succeeds 117*2fe8fb19SBen Gras(see 118*2fe8fb19SBen Gras.Fn rpc_call 119*2fe8fb19SBen Grasand 120*2fe8fb19SBen Gras.Fn clnt_call 121*2fe8fb19SBen Grasin 122*2fe8fb19SBen Gras.Xr rpc_clnt_calls 3 123*2fe8fb19SBen Grasfor the definitions of other parameters). 124*2fe8fb19SBen Gras.Pp 125*2fe8fb19SBen GrasThis procedure should normally be used for a 126*2fe8fb19SBen Gras``ping'' and nothing else. 127*2fe8fb19SBen GrasThis routine allows programs to do lookup and call, all in one step. 128*2fe8fb19SBen Gras.Pp 129*2fe8fb19SBen GrasNote: Even if the server is not running 130*2fe8fb19SBen Gras.Fn rpcb_rmtcall 131*2fe8fb19SBen Grasdoes not return any error messages to the caller. 132*2fe8fb19SBen GrasIn such a case, the caller times out. 133*2fe8fb19SBen Gras.Pp 134*2fe8fb19SBen GrasNote: 135*2fe8fb19SBen Gras.Fn rpcb_rmtcall 136*2fe8fb19SBen Grasis only available for connectionless transports. 137*2fe8fb19SBen Gras.Pp 138*2fe8fb19SBen Gras.It Fn rpcb_set 139*2fe8fb19SBen GrasAn interface to the rpcbind 140*2fe8fb19SBen Grasservice, which establishes a mapping between the triple 141*2fe8fb19SBen Gras[ 142*2fe8fb19SBen Gras.Fa prognum , 143*2fe8fb19SBen Gras.Fa versnum , 144*2fe8fb19SBen Gras.Fa netconf-\*[Gt]nc_netid ] 145*2fe8fb19SBen Grasand 146*2fe8fb19SBen Gras.Fa svcaddr 147*2fe8fb19SBen Grason the machine's rpcbind 148*2fe8fb19SBen Grasservice. 149*2fe8fb19SBen GrasThe value of 150*2fe8fb19SBen Gras.Fa nc_netid 151*2fe8fb19SBen Grasmust correspond to a network identifier that is defined by the 152*2fe8fb19SBen Grasnetconfig database. 153*2fe8fb19SBen GrasThis routine returns 154*2fe8fb19SBen Gras.Dv TRUE 155*2fe8fb19SBen Grasif it succeeds, 156*2fe8fb19SBen Gras.Dv FALSE 157*2fe8fb19SBen Grasotherwise. 158*2fe8fb19SBen Gras(See also 159*2fe8fb19SBen Gras.Fn svc_reg 160*2fe8fb19SBen Grasin 161*2fe8fb19SBen Gras.Xr rpc_svc_calls 3 . 162*2fe8fb19SBen GrasIf there already exists such an entry with rpcbind, 163*2fe8fb19SBen Gras.Fn rpcb_set 164*2fe8fb19SBen Graswill fail. 165*2fe8fb19SBen Gras.Pp 166*2fe8fb19SBen Gras.It Fn rpcb_unset 167*2fe8fb19SBen GrasAn interface to the rpcbind 168*2fe8fb19SBen Grasservice, which destroys the mapping between the triple 169*2fe8fb19SBen Gras[ 170*2fe8fb19SBen Gras.Fa prognum , 171*2fe8fb19SBen Gras.Fa versnum , 172*2fe8fb19SBen Gras.Fa netconf-\*[Gt]nc_netid ] 173*2fe8fb19SBen Grasand the address on the machine's rpcbind 174*2fe8fb19SBen Grasservice. 175*2fe8fb19SBen GrasIf 176*2fe8fb19SBen Gras.Fa netconf 177*2fe8fb19SBen Grasis 178*2fe8fb19SBen Gras.Dv NULL , 179*2fe8fb19SBen Gras.Fn rpcb_unset 180*2fe8fb19SBen Grasdestroys all mapping between the triple 181*2fe8fb19SBen Gras[ 182*2fe8fb19SBen Gras.Fa prognum , 183*2fe8fb19SBen Gras.Fa versnum , 184*2fe8fb19SBen Gras.Fa all-transports ] 185*2fe8fb19SBen Grasand the addresses on the machine's rpcbind service. 186*2fe8fb19SBen GrasThis routine returns 187*2fe8fb19SBen Gras.Dv TRUE 188*2fe8fb19SBen Grasif it succeeds, 189*2fe8fb19SBen Gras.Dv FALSE 190*2fe8fb19SBen Grasotherwise. 191*2fe8fb19SBen GrasOnly the owner of the service or the super-user can destroy the mapping. 192*2fe8fb19SBen Gras(See also 193*2fe8fb19SBen Gras.Fn svc_unreg 194*2fe8fb19SBen Grasin 195*2fe8fb19SBen Gras.Xr rpc_svc_calls 3 . 196*2fe8fb19SBen Gras.El 197*2fe8fb19SBen Gras.Sh SEE ALSO 198*2fe8fb19SBen Gras.Xr rpc_clnt_calls 3 , 199*2fe8fb19SBen Gras.Xr rpc_svc_calls 3 , 200*2fe8fb19SBen Gras.Xr rpcbind 8 , 201*2fe8fb19SBen Gras.Xr rpcinfo 8 202