17df0ccbaSfvdl.\" @(#)rpcbind.3n 1.25 93/05/07 SMI; from SVr4 27df0ccbaSfvdl.\" Copyright 1989 AT&T 3708eed19Sjschauma.\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved. 4*01869ca4Swiz.\" $NetBSD: rpcbind.3,v 1.12 2017/07/03 21:32:49 wiz Exp $ 5347f995cSyamt.Dd December 4, 2005 67df0ccbaSfvdl.Dt RPCBIND 3 77df0ccbaSfvdl.Os 87df0ccbaSfvdl.Sh NAME 97df0ccbaSfvdl.Nm rpcb_getmaps , 107df0ccbaSfvdl.Nm rpcb_getaddr , 117df0ccbaSfvdl.Nm rpcb_gettime , 127df0ccbaSfvdl.Nm rpcb_rmtcall , 137df0ccbaSfvdl.Nm rpcb_set , 147df0ccbaSfvdl.Nm rpcb_unset 157df0ccbaSfvdl.Nd library routines for RPC bind service 167df0ccbaSfvdl.Sh LIBRARY 177df0ccbaSfvdl.Lb libc 187df0ccbaSfvdl.Sh SYNOPSIS 19472351e1Swiz.In rpc/rpc.h 207df0ccbaSfvdl.Ft "struct rpcblist *" 217df0ccbaSfvdl.Fn rpcb_getmaps "const struct netconfig *netconf" "const char *host" 227df0ccbaSfvdl.Ft bool_t 237df0ccbaSfvdl.Fn rpcb_getaddr "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" "struct netbuf *svcaddr" "const char *host" 247df0ccbaSfvdl.Ft bool_t 257df0ccbaSfvdl.Fn rpcb_gettime "const char *host" "time_t * timep" 267df0ccbaSfvdl.Ft "enum clnt_stat" 27347f995cSyamt.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" 287df0ccbaSfvdl.Ft bool_t 297df0ccbaSfvdl.Fn rpcb_set "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" "const struct netbuf *svcaddr" 307df0ccbaSfvdl.Ft bool_t 318b656ef9Sfvdl.Fn rpcb_unset "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" 327df0ccbaSfvdl.Sh DESCRIPTION 337df0ccbaSfvdlThese routines allow client C programs to make procedure 347df0ccbaSfvdlcalls to the RPC binder service. 357df0ccbaSfvdl(see 367df0ccbaSfvdl.Xr rpcbind 8 ) 377df0ccbaSfvdlmaintains a list of mappings between programs 387df0ccbaSfvdland their universal addresses. 39723dbf64Swiz.Sh ROUTINES 407df0ccbaSfvdl.Bl -tag -width XXXXX 417df0ccbaSfvdl.It Fn rpcb_getmaps 427df0ccbaSfvdlAn interface to the rpcbind service, 437df0ccbaSfvdlwhich returns a list of the current 447df0ccbaSfvdlRPC program-to-address mappings on 457df0ccbaSfvdl.Fa host . 467df0ccbaSfvdlIt uses the transport specified through 477df0ccbaSfvdl.Fa netconf 487df0ccbaSfvdlto contact the remote rpcbind 497df0ccbaSfvdlservice on 507df0ccbaSfvdl.Fa host . 517df0ccbaSfvdlThis routine will return 527df0ccbaSfvdl.Dv NULL , 537df0ccbaSfvdlif the remote rpcbind could not be contacted. 547df0ccbaSfvdl.Pp 557df0ccbaSfvdl.It Fn rpcb_getaddr 567df0ccbaSfvdlAn interface to the rpcbind 577df0ccbaSfvdlservice, which finds the address of the service on 587df0ccbaSfvdl.Fa host 597df0ccbaSfvdlthat is registered with program number 607df0ccbaSfvdl.Fa prognum , 617df0ccbaSfvdlversion 627df0ccbaSfvdl.Fa versnum , 637df0ccbaSfvdland speaks the transport protocol associated with 647df0ccbaSfvdl.Fa netconf . 657df0ccbaSfvdlThe address found is returned in 667df0ccbaSfvdl.Fa svcaddr . 677df0ccbaSfvdl.Fa svcaddr 687df0ccbaSfvdlshould be preallocated. 697df0ccbaSfvdlThis routine returns 707df0ccbaSfvdl.Dv TRUE 716569c5c5Swizif it succeeds. 726569c5c5SwizA return value of 737df0ccbaSfvdl.Dv FALSE 747df0ccbaSfvdlmeans that the mapping does not exist 757df0ccbaSfvdlor that the RPC 767df0ccbaSfvdlsystem failed to contact the remote 777df0ccbaSfvdlrpcbind service. 787df0ccbaSfvdlIn the latter case, the global variable 797df0ccbaSfvdl.Va rpc_createerr 807df0ccbaSfvdl(see 817df0ccbaSfvdl.Xr rpc_clnt_create 3 827df0ccbaSfvdlcontains the 837df0ccbaSfvdlRPC status. 847df0ccbaSfvdl.Pp 857df0ccbaSfvdl.It Fn rpcb_gettime 867df0ccbaSfvdlThis routine returns the time on 877df0ccbaSfvdl.Fa host 887df0ccbaSfvdlin 897df0ccbaSfvdl.Fa timep . 907df0ccbaSfvdlIf 917df0ccbaSfvdl.Fa host 927df0ccbaSfvdlis 937df0ccbaSfvdl.Dv NULL , 947df0ccbaSfvdl.Fn rpcb_gettime 957df0ccbaSfvdlreturns the time on its own machine. 967df0ccbaSfvdlThis routine returns 977df0ccbaSfvdl.Dv TRUE 987df0ccbaSfvdlif it succeeds, 997df0ccbaSfvdl.Dv FALSE 1007df0ccbaSfvdlif it fails. 1017df0ccbaSfvdl.Fn rpcb_gettime 1027df0ccbaSfvdlcan be used to synchronize the time between the 1037df0ccbaSfvdlclient and the remote server. 1047df0ccbaSfvdl.Pp 1057df0ccbaSfvdl.It Fn rpcb_rmtcall 1067df0ccbaSfvdlAn interface to the rpcbind service, which instructs 1077df0ccbaSfvdlrpcbind on 1087df0ccbaSfvdl.Fa host 1097df0ccbaSfvdlto make an RPC 1107df0ccbaSfvdlcall on your behalf to a procedure on that host. 1117df0ccbaSfvdlThe 1127df0ccbaSfvdl.Fn netconfig 1137df0ccbaSfvdlstructure should correspond to a connectionless transport. 1147df0ccbaSfvdlThe parameter 1157df0ccbaSfvdl.Fa svcaddr 1167df0ccbaSfvdlwill be modified to the server's address if the procedure succeeds 1177df0ccbaSfvdl(see 1187df0ccbaSfvdl.Fn rpc_call 1197df0ccbaSfvdland 1207df0ccbaSfvdl.Fn clnt_call 1217df0ccbaSfvdlin 1227df0ccbaSfvdl.Xr rpc_clnt_calls 3 1237df0ccbaSfvdlfor the definitions of other parameters). 1247df0ccbaSfvdl.Pp 1257df0ccbaSfvdlThis procedure should normally be used for a 1267df0ccbaSfvdl``ping'' and nothing else. 1277df0ccbaSfvdlThis routine allows programs to do lookup and call, all in one step. 1283d2415a2Sjoerg.Pp 1297df0ccbaSfvdlNote: Even if the server is not running 1307df0ccbaSfvdl.Fn rpcb_rmtcall 1317df0ccbaSfvdldoes not return any error messages to the caller. 1327df0ccbaSfvdlIn such a case, the caller times out. 1337df0ccbaSfvdl.Pp 1347df0ccbaSfvdlNote: 1357df0ccbaSfvdl.Fn rpcb_rmtcall 1367df0ccbaSfvdlis only available for connectionless transports. 1377df0ccbaSfvdl.Pp 1387df0ccbaSfvdl.It Fn rpcb_set 1397df0ccbaSfvdlAn interface to the rpcbind 1407df0ccbaSfvdlservice, which establishes a mapping between the triple 1417df0ccbaSfvdl[ 1427df0ccbaSfvdl.Fa prognum , 1437df0ccbaSfvdl.Fa versnum , 144*01869ca4Swiz.Fa netconf->nc_netid ] 1457df0ccbaSfvdland 1467df0ccbaSfvdl.Fa svcaddr 1477df0ccbaSfvdlon the machine's rpcbind 1487df0ccbaSfvdlservice. 1497df0ccbaSfvdlThe value of 1507df0ccbaSfvdl.Fa nc_netid 1517df0ccbaSfvdlmust correspond to a network identifier that is defined by the 1527df0ccbaSfvdlnetconfig database. 1537df0ccbaSfvdlThis routine returns 1547df0ccbaSfvdl.Dv TRUE 1557df0ccbaSfvdlif it succeeds, 1567df0ccbaSfvdl.Dv FALSE 1577df0ccbaSfvdlotherwise. 1587df0ccbaSfvdl(See also 1593d2415a2Sjoerg.Fn svc_reg 1607df0ccbaSfvdlin 1617df0ccbaSfvdl.Xr rpc_svc_calls 3 . 1627df0ccbaSfvdlIf there already exists such an entry with rpcbind, 1637df0ccbaSfvdl.Fn rpcb_set 1647df0ccbaSfvdlwill fail. 1657df0ccbaSfvdl.Pp 1667df0ccbaSfvdl.It Fn rpcb_unset 1677df0ccbaSfvdlAn interface to the rpcbind 1687df0ccbaSfvdlservice, which destroys the mapping between the triple 1697df0ccbaSfvdl[ 1707df0ccbaSfvdl.Fa prognum , 1717df0ccbaSfvdl.Fa versnum , 172*01869ca4Swiz.Fa netconf->nc_netid ] 1737df0ccbaSfvdland the address on the machine's rpcbind 1747df0ccbaSfvdlservice. 1757df0ccbaSfvdlIf 1767df0ccbaSfvdl.Fa netconf 1777df0ccbaSfvdlis 1787df0ccbaSfvdl.Dv NULL , 1797df0ccbaSfvdl.Fn rpcb_unset 1807df0ccbaSfvdldestroys all mapping between the triple 1817df0ccbaSfvdl[ 1827df0ccbaSfvdl.Fa prognum , 1837df0ccbaSfvdl.Fa versnum , 1847df0ccbaSfvdl.Fa all-transports ] 1857df0ccbaSfvdland the addresses on the machine's rpcbind service. 1867df0ccbaSfvdlThis routine returns 1877df0ccbaSfvdl.Dv TRUE 1887df0ccbaSfvdlif it succeeds, 1897df0ccbaSfvdl.Dv FALSE 1907df0ccbaSfvdlotherwise. 1917df0ccbaSfvdlOnly the owner of the service or the super-user can destroy the mapping. 1927df0ccbaSfvdl(See also 1937df0ccbaSfvdl.Fn svc_unreg 1947df0ccbaSfvdlin 1957df0ccbaSfvdl.Xr rpc_svc_calls 3 . 1967df0ccbaSfvdl.El 1977df0ccbaSfvdl.Sh SEE ALSO 1988c56635fSwiz.Xr rpc_clnt_calls 3 , 1998c56635fSwiz.Xr rpc_svc_calls 3 , 2007df0ccbaSfvdl.Xr rpcbind 8 , 2018c56635fSwiz.Xr rpcinfo 8 202