1rpcbind(3NSL) Networking Services Library Functions rpcbind(3NSL)
2
3
4
6 rpcbind, rpcb_getmaps, rpcb_getaddr, rpcb_gettime, rpcb_rmtcall,
7 rpcb_set, rpcb_unset - library routines for RPC bind service
8
10 #include <rpc/rpc.h>
11
12
13
14 struct rpcblist *rpcb_getmaps(const struct netconfig *nnetconf,
15 const char *host);
16
17
18 bool_t rpcb_getaddr(const rpcprog_t prognum, const rpcvers_t versnum,
19 const struct netconfig *netconf, struct netbuf *ssvcaddr,
20 const char *host);
21
22
23 bool_t rpcb_gettime(const char *host, time_t *timep);
24
25
26 enum clnt_stat rpcb_rmtcall(const struct netconfig *netconf,
27 const char *host, const rpcprog_t prognum,
28 const rpcvers_t versnum, const rpcproc_t procnum,
29 const xdrproc_t inproc, const caddr_t in,
30 const xdrproc_t outproc caddr_t out,,
31 const struct timeval tout, struct netbuf *svcaddr);
32
33
34 bool_t rpcb_set(const rpcprog_t prognum, const rpcvers_t versnum,
35 const struct netconfig *netconf, const struct netbuf *svcaddr);
36
37
38 bool_t rpcb_unset(const rpcprog_t prognum, const rpcvers_t versnum,
39 const struct netconfig *netconf);
40
41
43 These routines allow client C programs to make procedure calls to the
44 RPC binder service. rpcbind maintains a list of mappings between pro‐
45 grams and their universal addresses. See rpcbind(1M).
46
47 Routines
48 rpcb_getmaps() An interface to the rpcbind service, which returns a
49 list of the current RPC program-to-address mappings
50 on host. It uses the transport specified through
51 netconf to contact the remote rpcbind service on
52 host. This routine will return NULL, if the remote
53 rpcbind could not be contacted.
54
55
56 rpcb_getaddr() An interface to the rpcbind service, which finds the
57 address of the service on host that is registered
58 with program number prognum, version versnum, and
59 speaks the transport protocol associated with net‐
60 conf. The address found is returned in svcaddr.
61 svcaddr should be preallocated. This routine returns
62 TRUE if it succeeds. A return value of FALSE means
63 that the mapping does not exist or that the RPC sys‐
64 tem failed to contact the remote rpcbind service. In
65 the latter case, the global variable rpc_createerr
66 contains the RPC status. See rpc_clnt_create(3NSL).
67
68
69 rpcb_gettime() This routine returns the time on host in timep. If
70 host is NULL, rpcb_gettime() returns the time on its
71 own machine. This routine returns TRUE if it suc‐
72 ceeds, FALSE if it fails. rpcb_gettime() can be used
73 to synchronize the time between the client and the
74 remote server. This routine is particularly useful
75 for secure RPC.
76
77
78 rpcb_rmtcall() An interface to the rpcbind service, which instructs
79 rpcbind on host to make an RPC call on your behalf to
80 a procedure on that host. The netconfig structure
81 should correspond to a connectionless transport. The
82 parameter *svcaddr will be modified to the server's
83 address if the procedure succeeds. See rpc_call()
84 and clnt_call() in rpc_clnt_calls(3NSL) for the defi‐
85 nitions of other parameters.
86
87 This procedure should normally be used for a "ping"
88 and nothing else. This routine allows programs to do
89 lookup and call, all in one step.
90
91 Note: Even if the server is not running rpcbind does
92 not return any error messages to the caller. In such
93 a case, the caller times out.
94
95 Note: rpcb_rmtcall() is only available for connec‐
96 tionless transports.
97
98
99 rpcb_set() An interface to the rpcbind service, which estab‐
100 lishes a mapping between the triple [prognum, ver‐
101 snum, netconf->nc_netid] and svcaddr on the machine's
102 rpcbind service. The value of nc_netid must corre‐
103 spond to a network identifier that is defined by the
104 netconfig database. This routine returns TRUE if it
105 succeeds, FALSE otherwise. See also svc_reg() in
106 rpc_svc_calls(3NSL). If there already exists such an
107 entry with rpcbind, rpcb_set() will fail.
108
109
110 rpcb_unset() An interface to the rpcbind service, which destroys
111 the mapping between the triple [prognum, versnum,
112 netconf->nc_netid] and the address on the machine's
113 rpcbind service. If netconf is NULL, rpcb_unset()
114 destroys all mapping between the triple [prognum,
115 versnum, all-transports] and the addresses on the
116 machine's rpcbind service. This routine returns TRUE
117 if it succeeds, FALSE otherwise. Only the owner of
118 the service or the super-user can destroy the map‐
119 ping. See also svc_unreg() in rpc_svc_calls(3NSL).
120
121
123 See attributes(5) for descriptions of the following attributes:
124
125
126
127
128 ┌─────────────────────────────┬─────────────────────────────┐
129 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
130 ├─────────────────────────────┼─────────────────────────────┤
131 │MT-Level │MT-Safe │
132 └─────────────────────────────┴─────────────────────────────┘
133
135 rpcbind(1M), rpcinfo(1M), rpc_clnt_calls(3NSL), rpc_clnt_create(3NSL),
136 rpc_svc_calls(3NSL), attributes(5)
137
138
139
140SunOS 5.11 20 Feb 1998 rpcbind(3NSL)