18360efbdSAlfred Perlstein.\" Copyright 1989 AT&T 28360efbdSAlfred Perlstein.\" Copyright (c) 1988 Sun Microsystem's, Inc. - All Right's Reserved. 38360efbdSAlfred Perlstein.\" $NetBSD: rpcbind.3,v 1.2 2000/06/03 18:47:28 fvdl Exp $ 48360efbdSAlfred Perlstein.Dd May 7, 1993 58360efbdSAlfred Perlstein.Dt RPCBIND 3 68360efbdSAlfred Perlstein.Os 78360efbdSAlfred Perlstein.Sh NAME 88360efbdSAlfred Perlstein.Nm rpcb_getmaps , 98360efbdSAlfred Perlstein.Nm rpcb_getaddr , 108360efbdSAlfred Perlstein.Nm rpcb_gettime , 118360efbdSAlfred Perlstein.Nm rpcb_rmtcall , 128360efbdSAlfred Perlstein.Nm rpcb_set , 138360efbdSAlfred Perlstein.Nm rpcb_unset 148360efbdSAlfred Perlstein.Nd library routines for RPC bind service 158360efbdSAlfred Perlstein.Sh LIBRARY 168360efbdSAlfred Perlstein.Lb libc 178360efbdSAlfred Perlstein.Sh SYNOPSIS 1832eef9aeSRuslan Ermilov.In rpc/rpc.h 19db7534cfSBruce Evans.Ft "rpcblist *" 208360efbdSAlfred Perlstein.Fn rpcb_getmaps "const struct netconfig *netconf" "const char *host" 218360efbdSAlfred Perlstein.Ft bool_t 228360efbdSAlfred Perlstein.Fn rpcb_getaddr "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" "struct netbuf *svcaddr" "const char *host" 238360efbdSAlfred Perlstein.Ft bool_t 248360efbdSAlfred Perlstein.Fn rpcb_gettime "const char *host" "time_t * timep" 258360efbdSAlfred Perlstein.Ft "enum clnt_stat" 26*583110b7SBaptiste Daroussin.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 caddr_t in" "const xdrproc_t outproc" "const caddr_t out" "const struct timeval tout" "const struct netbuf *svcaddr" 278360efbdSAlfred Perlstein.Ft bool_t 288360efbdSAlfred Perlstein.Fn rpcb_set "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" "const struct netbuf *svcaddr" 298360efbdSAlfred Perlstein.Ft bool_t 308360efbdSAlfred Perlstein.Fn rpcb_unset "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" 318360efbdSAlfred Perlstein.Sh DESCRIPTION 328360efbdSAlfred PerlsteinThese routines allow client C programs to make procedure 338360efbdSAlfred Perlsteincalls to the RPC binder service. 348360efbdSAlfred Perlstein(see 358360efbdSAlfred Perlstein.Xr rpcbind 8 ) 368360efbdSAlfred Perlsteinmaintains a list of mappings between programs 378360efbdSAlfred Perlsteinand their universal addresses. 388360efbdSAlfred Perlstein.Sh Routines 398360efbdSAlfred Perlstein.Bl -tag -width XXXXX 408360efbdSAlfred Perlstein.It Fn rpcb_getmaps 418360efbdSAlfred PerlsteinAn interface to the rpcbind service, 428360efbdSAlfred Perlsteinwhich returns a list of the current 438360efbdSAlfred PerlsteinRPC program-to-address mappings on 448360efbdSAlfred Perlstein.Fa host . 458360efbdSAlfred PerlsteinIt uses the transport specified through 468360efbdSAlfred Perlstein.Fa netconf 478360efbdSAlfred Perlsteinto contact the remote rpcbind 488360efbdSAlfred Perlsteinservice on 498360efbdSAlfred Perlstein.Fa host . 508360efbdSAlfred PerlsteinThis routine will return 518360efbdSAlfred Perlstein.Dv NULL , 528360efbdSAlfred Perlsteinif the remote rpcbind could not be contacted. 538360efbdSAlfred Perlstein.It Fn rpcb_getaddr 548360efbdSAlfred PerlsteinAn interface to the rpcbind 558360efbdSAlfred Perlsteinservice, which finds the address of the service on 568360efbdSAlfred Perlstein.Fa host 578360efbdSAlfred Perlsteinthat is registered with program number 588360efbdSAlfred Perlstein.Fa prognum , 598360efbdSAlfred Perlsteinversion 608360efbdSAlfred Perlstein.Fa versnum , 618360efbdSAlfred Perlsteinand speaks the transport protocol associated with 628360efbdSAlfred Perlstein.Fa netconf . 638360efbdSAlfred PerlsteinThe address found is returned in 648360efbdSAlfred Perlstein.Fa svcaddr . 652efeeba5SRuslan ErmilovThe 668360efbdSAlfred Perlstein.Fa svcaddr 672efeeba5SRuslan Ermilovargument 688360efbdSAlfred Perlsteinshould be preallocated. 698360efbdSAlfred PerlsteinThis routine returns 708360efbdSAlfred Perlstein.Dv TRUE 718360efbdSAlfred Perlsteinif it succeeds. 728360efbdSAlfred PerlsteinA return value of 738360efbdSAlfred Perlstein.Dv FALSE 748360efbdSAlfred Perlsteinmeans that the mapping does not exist 758360efbdSAlfred Perlsteinor that the RPC 768360efbdSAlfred Perlsteinsystem failed to contact the remote 778360efbdSAlfred Perlsteinrpcbind service. 788360efbdSAlfred PerlsteinIn the latter case, the global variable 798360efbdSAlfred Perlstein.Va rpc_createerr 808360efbdSAlfred Perlstein(see 818360efbdSAlfred Perlstein.Xr rpc_clnt_create 3 ) 828360efbdSAlfred Perlsteincontains the 838360efbdSAlfred PerlsteinRPC status. 848360efbdSAlfred Perlstein.It Fn rpcb_gettime 858360efbdSAlfred PerlsteinThis routine returns the time on 868360efbdSAlfred Perlstein.Fa host 878360efbdSAlfred Perlsteinin 888360efbdSAlfred Perlstein.Fa timep . 898360efbdSAlfred PerlsteinIf 908360efbdSAlfred Perlstein.Fa host 918360efbdSAlfred Perlsteinis 928360efbdSAlfred Perlstein.Dv NULL , 938360efbdSAlfred Perlstein.Fn rpcb_gettime 948360efbdSAlfred Perlsteinreturns the time on its own machine. 958360efbdSAlfred PerlsteinThis routine returns 968360efbdSAlfred Perlstein.Dv TRUE 978360efbdSAlfred Perlsteinif it succeeds, 988360efbdSAlfred Perlstein.Dv FALSE 998360efbdSAlfred Perlsteinif it fails. 1001fae73b1SRuslan ErmilovThe 1018360efbdSAlfred Perlstein.Fn rpcb_gettime 1021fae73b1SRuslan Ermilovfunction 1038360efbdSAlfred Perlsteincan be used to synchronize the time between the 1048360efbdSAlfred Perlsteinclient and the remote server. 1058360efbdSAlfred Perlstein.It Fn rpcb_rmtcall 1068360efbdSAlfred PerlsteinAn interface to the rpcbind service, which instructs 1078360efbdSAlfred Perlsteinrpcbind on 1088360efbdSAlfred Perlstein.Fa host 1098360efbdSAlfred Perlsteinto make an RPC 1108360efbdSAlfred Perlsteincall on your behalf to a procedure on that host. 1118360efbdSAlfred PerlsteinThe 1128360efbdSAlfred Perlstein.Fn netconfig 1138360efbdSAlfred Perlsteinstructure should correspond to a connectionless transport. 1142efeeba5SRuslan ErmilovThe 1158360efbdSAlfred Perlstein.Fa svcaddr 1162efeeba5SRuslan Ermilovargument 1178360efbdSAlfred Perlsteinwill be modified to the server's address if the procedure succeeds 1188360efbdSAlfred Perlstein(see 1198360efbdSAlfred Perlstein.Fn rpc_call 1208360efbdSAlfred Perlsteinand 1218360efbdSAlfred Perlstein.Fn clnt_call 1228360efbdSAlfred Perlsteinin 1238360efbdSAlfred Perlstein.Xr rpc_clnt_calls 3 1242efeeba5SRuslan Ermilovfor the definitions of other arguments). 1258360efbdSAlfred Perlstein.Pp 1268360efbdSAlfred PerlsteinThis procedure should normally be used for a 1278360efbdSAlfred Perlstein.Dq ping 1288360efbdSAlfred Perlsteinand nothing else. 1298360efbdSAlfred PerlsteinThis routine allows programs to do lookup and call, all in one step. 1308360efbdSAlfred Perlstein.Pp 1318360efbdSAlfred PerlsteinNote: Even if the server is not running 1328360efbdSAlfred Perlstein.Fn rpcb_rmtcall 1338360efbdSAlfred Perlsteindoes not return any error messages to the caller. 1348360efbdSAlfred PerlsteinIn such a case, the caller times out. 1358360efbdSAlfred Perlstein.Pp 1368360efbdSAlfred PerlsteinNote: 1378360efbdSAlfred Perlstein.Fn rpcb_rmtcall 1388360efbdSAlfred Perlsteinis only available for connectionless transports. 1398360efbdSAlfred Perlstein.It Fn rpcb_set 1408360efbdSAlfred PerlsteinAn interface to the rpcbind 1418360efbdSAlfred Perlsteinservice, which establishes a mapping between the triple 1428360efbdSAlfred Perlstein.Bq Fa prognum , versnum , netconf->nc_netid 1438360efbdSAlfred Perlsteinand 1448360efbdSAlfred Perlstein.Fa svcaddr 1458360efbdSAlfred Perlsteinon the machine's rpcbind 1468360efbdSAlfred Perlsteinservice. 1478360efbdSAlfred PerlsteinThe value of 1488360efbdSAlfred Perlstein.Fa nc_netid 1498360efbdSAlfred Perlsteinmust correspond to a network identifier that is defined by the 1508360efbdSAlfred Perlsteinnetconfig database. 1518360efbdSAlfred PerlsteinThis routine returns 1528360efbdSAlfred Perlstein.Dv TRUE 1538360efbdSAlfred Perlsteinif it succeeds, 1548360efbdSAlfred Perlstein.Dv FALSE 1558360efbdSAlfred Perlsteinotherwise. 1568360efbdSAlfred Perlstein(See also 1578360efbdSAlfred Perlstein.Fn svc_reg 1588360efbdSAlfred Perlsteinin 1598360efbdSAlfred Perlstein.Xr rpc_svc_calls 3 . ) 1608360efbdSAlfred PerlsteinIf there already exists such an entry with rpcbind, 1618360efbdSAlfred Perlstein.Fn rpcb_set 1628360efbdSAlfred Perlsteinwill fail. 1638360efbdSAlfred Perlstein.It Fn rpcb_unset 1648360efbdSAlfred PerlsteinAn interface to the rpcbind 1658360efbdSAlfred Perlsteinservice, which destroys the mapping between the triple 1668360efbdSAlfred Perlstein.Bq Fa prognum , versnum , netconf->nc_netid 1678360efbdSAlfred Perlsteinand the address on the machine's rpcbind 1688360efbdSAlfred Perlsteinservice. 1698360efbdSAlfred PerlsteinIf 1708360efbdSAlfred Perlstein.Fa netconf 1718360efbdSAlfred Perlsteinis 1728360efbdSAlfred Perlstein.Dv NULL , 1738360efbdSAlfred Perlstein.Fn rpcb_unset 1748360efbdSAlfred Perlsteindestroys all mapping between the triple 1758360efbdSAlfred Perlstein.Bq Fa prognum , versnum , No all-transports 1768360efbdSAlfred Perlsteinand the addresses on the machine's rpcbind service. 1778360efbdSAlfred PerlsteinThis routine returns 1788360efbdSAlfred Perlstein.Dv TRUE 1798360efbdSAlfred Perlsteinif it succeeds, 1808360efbdSAlfred Perlstein.Dv FALSE 1818360efbdSAlfred Perlsteinotherwise. 1828360efbdSAlfred PerlsteinOnly the owner of the service or the super-user can destroy the mapping. 1838360efbdSAlfred Perlstein(See also 1848360efbdSAlfred Perlstein.Fn svc_unreg 1858360efbdSAlfred Perlsteinin 1868360efbdSAlfred Perlstein.Xr rpc_svc_calls 3 . ) 1878360efbdSAlfred Perlstein.El 1888360efbdSAlfred Perlstein.Sh SEE ALSO 1898360efbdSAlfred Perlstein.Xr rpc_clnt_calls 3 , 1908360efbdSAlfred Perlstein.Xr rpc_svc_calls 3 , 1918360efbdSAlfred Perlstein.Xr rpcbind 8 , 1928360efbdSAlfred Perlstein.Xr rpcinfo 8 193