1RPCBIND(3) BSD Library Functions Manual RPCBIND(3)
2
4 rpcb_getmaps, rpcb_getaddr, rpcb_gettime, rpcb_rmtcall, rpcb_set,
5 rpcb_unset — library routines for RPC bind service
6
8 #include <rpc/rpc.h>
9
10 rpcblist *
11 rpcb_getmaps(const struct netconfig *netconf, const char *host);
12
13 bool_t
14 rpcb_getaddr(const rpcprog_t prognum, const rpcvers_t versnum,
15 const struct netconfig *netconf, struct netbuf *svcaddr,
16 const char *host);
17
18 bool_t
19 rpcb_gettime(const char *host, time_t * timep);
20
21 enum clnt_stat
22 rpcb_rmtcall(const struct netconfig *netconf, const char *host,
23 const rpcprog_t prognum, const rpcvers_t versnum,
24 const rpcproc_t procnum, const xdrproc_t inproc, const caddr_t in,
25 const xdrproc_t outproc, const caddr_t out,
26 const struct timeval tout, const struct netbuf *svcaddr);
27
28 bool_t
29 rpcb_set(const rpcprog_t prognum, const rpcvers_t versnum,
30 const struct netconfig *netconf, const struct netbuf *svcaddr);
31
32 bool_t
33 rpcb_unset(const rpcprog_t prognum, const rpcvers_t versnum,
34 const struct netconfig *netconf);
35
37 These routines allow client C programs to make procedure calls to the RPC
38 binder service. (see rpcbind(8)) maintains a list of mappings between
39 programs and their universal addresses.
40
42 rpcb_getmaps()
43 An interface to the rpcbind service, which returns a list of the
44 current RPC program-to-address mappings on host. It uses the
45 transport specified through netconf to contact the remote rpcbind
46 service on host. This routine will return NULL, if the remote
47 rpcbind could not be contacted.
48
49 rpcb_getaddr()
50 An interface to the rpcbind service, which finds the address of
51 the service on host that is registered with program number
52 prognum, version versnum, and speaks the transport protocol asso‐
53 ciated with netconf. The address found is returned in svcaddr.
54 The svcaddr argument should be preallocated. This routine returns
55 TRUE if it succeeds. A return value of FALSE means that the map‐
56 ping does not exist or that the RPC system failed to contact the
57 remote rpcbind service. In the latter case, the global variable
58 rpc_createerr (see rpc_clnt_create(3)) contains the RPC status.
59
60 rpcb_gettime()
61 This routine returns the time on host in timep. If host is NULL,
62 rpcb_gettime() returns the time on its own machine. This routine
63 returns TRUE if it succeeds, FALSE if it fails. The
64 rpcb_gettime() function can be used to synchronize the time be‐
65 tween the client and the remote server.
66
67 rpcb_rmtcall()
68 An interface to the rpcbind service, which instructs rpcbind on
69 host to make an RPC call on your behalf to a procedure on that
70 host. The netconfig() structure should correspond to a connec‐
71 tionless transport. The svcaddr argument will be modified to the
72 server's address if the procedure succeeds (see rpc_call() and
73 clnt_call() in rpc_clnt_calls(3) for the definitions of other ar‐
74 guments).
75
76 This procedure should normally be used for a “ping” and nothing
77 else. This routine allows programs to do lookup and call, all in
78 one step.
79
80 Note: Even if the server is not running rpcb_rmtcall() does not
81 return any error messages to the caller. In such a case, the
82 caller times out.
83
84 Note: rpcb_rmtcall() is only available for connectionless trans‐
85 ports.
86
87 rpcb_set()
88 An interface to the rpcbind service, which establishes a mapping
89 between the triple [prognum, versnum, netconf->nc_netid] and
90 svcaddr on the machine's rpcbind service. The value of nc_netid
91 must correspond to a network identifier that is defined by the
92 netconfig database. This routine returns TRUE if it succeeds,
93 FALSE otherwise. (See also svc_reg() in rpc_svc_calls(3).) If
94 there already exists such an entry with rpcbind, rpcb_set() will
95 fail.
96
97 rpcb_unset()
98 An interface to the rpcbind service, which destroys the mapping
99 between the triple [prognum, versnum, netconf->nc_netid] and the
100 address on the machine's rpcbind service. If netconf is NULL,
101 rpcb_unset() destroys all mapping between the triple [prognum,
102 versnum, all-transports] and the addresses on the machine's
103 rpcbind service. This routine returns TRUE if it succeeds, FALSE
104 otherwise. Only the owner of the service or the super-user can
105 destroy the mapping. (See also svc_unreg() in rpc_svc_calls(3).)
106
108 These functions are part of libtirpc.
109
111 If RPCB_V2FIRST is defined, rpcbind protocol version tryout algorithm
112 changes from v4,v2,v3 to v2,v4,v3.
113
115 rpc_clnt_calls(3), rpc_svc_calls(3), rpcbind(8), rpcinfo(8)
116
117BSD May 7, 1993 BSD