# phpman > man > rpcbind(3t)

[RPCBIND(3)](https://www.chedong.com/phpMan.php/man/RPCBIND/3/markdown)               BSD Library Functions Manual               [RPCBIND(3)](https://www.chedong.com/phpMan.php/man/RPCBIND/3/markdown)

## NAME
     **rpcb**___**getmaps**, **rpcb**___**getaddr**, **rpcb**___**gettime**, **rpcb**___**rmtcall**, **rpcb**___**set**, **rpcb**___**unset** — library routines
     for RPC bind service

## SYNOPSIS
### #include <rpc/rpc.h>

     _rpcblist_ _*_
     **rpcb**___**getmaps**(_const_ _struct_ _netconfig_ _*netconf_, _const_ _char_ _*host_);

     _bool_t_
     **rpcb**___**getaddr**(_const_ _rpcprog_t_ _prognum_, _const_ _rpcvers_t_ _versnum_, _const_ _struct_ _netconfig_ _*netconf_,
         _struct_ _netbuf_ _*svcaddr_, _const_ _char_ _*host_);

     _bool_t_
     **rpcb**___**gettime**(_const_ _char_ _*host_, _time_t_ _*_ _timep_);

     _enum_ _clnt_stat_
     **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_);

     _bool_t_
     **rpcb**___**set**(_const_ _rpcprog_t_ _prognum_, _const_ _rpcvers_t_ _versnum_, _const_ _struct_ _netconfig_ _*netconf_,
         _const_ _struct_ _netbuf_ _*svcaddr_);

     _bool_t_
     **rpcb**___**unset**(_const_ _rpcprog_t_ _prognum_, _const_ _rpcvers_t_ _versnum_, _const_ _struct_ _netconfig_ _*netconf_);

## DESCRIPTION
     These routines allow client C programs to make procedure calls to the RPC binder service.  (see
     [rpcbind(8)](https://www.chedong.com/phpMan.php/man/rpcbind/8/markdown)) maintains a list of mappings between programs and their universal addresses.

## Routines
     **rpcb**___**getmaps**()
            An interface to the rpcbind service, which returns a list of the current RPC program-to-
            address mappings on _host_.  It uses the transport specified through _netconf_ to contact
            the remote rpcbind service on _host_.  This routine will return NULL, if the remote
            rpcbind could not be contacted.

     **rpcb**___**getaddr**()
            An interface to the rpcbind service, which finds the address of the service on _host_ that
            is registered with program number _prognum_, version _versnum_, and speaks the transport
            protocol associated with _netconf_.  The address found is returned in _svcaddr_.  The
            _svcaddr_ argument should be preallocated.  This routine returns TRUE if it succeeds.  A
            return value of FALSE means that the mapping does not exist or that the RPC system
            failed to contact the remote rpcbind service.  In the latter case, the global variable
            _rpc_createerr_ (see [rpc_clnt_create(3)](https://www.chedong.com/phpMan.php/man/rpcclntcreate/3/markdown)) contains the RPC status.

     **rpcb**___**gettime**()
            This routine returns the time on _host_ in _timep_.  If _host_ is NULL, **rpcb**___**gettime**() returns
            the time on its own machine.  This routine returns TRUE if it succeeds, FALSE if it
            fails.  The **rpcb**___**gettime**() function can be used to synchronize the time between the
            client and the remote server.

     **rpcb**___**rmtcall**()
            An interface to the rpcbind service, which instructs rpcbind on _host_ to make an RPC call
            on your behalf to a procedure on that host.  The **netconfig**() structure should correspond
            to a connectionless transport.  The _svcaddr_ argument will be modified to the server's
            address if the procedure succeeds (see **rpc**___**call**() and **clnt**___**call**() in [rpc_clnt_calls(3)](https://www.chedong.com/phpMan.php/man/rpcclntcalls/3/markdown)
            for the definitions of other arguments).

            This procedure should normally be used for a “ping” and nothing else.  This routine al‐
            lows programs to do lookup and call, all in one step.

            Note: Even if the server is not running **rpcb**___**rmtcall**() does not return any error mes‐
            sages to the caller.  In such a case, the caller times out.

            Note: **rpcb**___**rmtcall**() is only available for connectionless transports.

     **rpcb**___**set**()
            An interface to the rpcbind service, which establishes a mapping between the triple
            [_prognum_, _versnum_, _netconf->nc_netid_] and _svcaddr_ on the machine's rpcbind service.  The
            value of _nc_netid_ must correspond to a network identifier that is defined by the netcon‐
            fig database.  This routine returns TRUE if it succeeds, FALSE otherwise.  (See also
            **svc**___**reg**() in [rpc_svc_calls(3)](https://www.chedong.com/phpMan.php/man/rpcsvccalls/3/markdown).)  If there already exists such an entry with rpcbind,
            **rpcb**___**set**() will fail.

     **rpcb**___**unset**()
            An interface to the rpcbind service, which destroys the mapping between the triple
            [_prognum_, _versnum_, _netconf->nc_netid_] and the address on the machine's rpcbind service.
            If _netconf_ is NULL, **rpcb**___**unset**() destroys all mapping between the triple [_prognum_,
            _versnum_, all-transports] and the addresses on the machine's rpcbind service.  This rou‐
            tine returns TRUE if it succeeds, FALSE otherwise.  Only the owner of the service or the
            super-user can destroy the mapping.  (See also **svc**___**unreg**() in [rpc_svc_calls(3)](https://www.chedong.com/phpMan.php/man/rpcsvccalls/3/markdown).)

## AVAILABILITY
     These functions are part of libtirpc.

## SEE ALSO
     [rpc_clnt_calls(3)](https://www.chedong.com/phpMan.php/man/rpcclntcalls/3/markdown), [rpc_svc_calls(3)](https://www.chedong.com/phpMan.php/man/rpcsvccalls/3/markdown), [rpcbind(8)](https://www.chedong.com/phpMan.php/man/rpcbind/8/markdown), [rpcinfo(8)](https://www.chedong.com/phpMan.php/man/rpcinfo/8/markdown)

BSD                               May 7, 1993                              BSD
