rpcb_prot.x revision 1.1.4.2 1 1.1.4.2 minoura %/*
2 1.1.4.2 minoura % * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 1.1.4.2 minoura % * unrestricted use provided that this legend is included on all tape
4 1.1.4.2 minoura % * media and as a part of the software program in whole or part. Users
5 1.1.4.2 minoura % * may copy or modify Sun RPC without charge, but are not authorized
6 1.1.4.2 minoura % * to license or distribute it to anyone else except as part of a product or
7 1.1.4.2 minoura % * program developed by the user.
8 1.1.4.2 minoura % *
9 1.1.4.2 minoura % * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 1.1.4.2 minoura % * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11 1.1.4.2 minoura % * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
12 1.1.4.2 minoura % *
13 1.1.4.2 minoura % * Sun RPC is provided with no support and without any obligation on the
14 1.1.4.2 minoura % * part of Sun Microsystems, Inc. to assist in its use, correction,
15 1.1.4.2 minoura % * modification or enhancement.
16 1.1.4.2 minoura % *
17 1.1.4.2 minoura % * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 1.1.4.2 minoura % * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 1.1.4.2 minoura % * OR ANY PART THEREOF.
20 1.1.4.2 minoura % *
21 1.1.4.2 minoura % * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 1.1.4.2 minoura % * or profits or other special, indirect and consequential damages, even if
23 1.1.4.2 minoura % * Sun has been advised of the possibility of such damages.
24 1.1.4.2 minoura % *
25 1.1.4.2 minoura % * Sun Microsystems, Inc.
26 1.1.4.2 minoura % * 2550 Garcia Avenue
27 1.1.4.2 minoura % * Mountain View, California 94043
28 1.1.4.2 minoura % */
29 1.1.4.2 minoura %/*
30 1.1.4.2 minoura % * Copyright (c) 1988 by Sun Microsystems, Inc.
31 1.1.4.2 minoura % */
32 1.1.4.2 minoura
33 1.1.4.2 minoura %/* from rpcb_prot.x */
34 1.1.4.2 minoura
35 1.1.4.2 minoura #ifdef RPC_HDR
36 1.1.4.2 minoura %
37 1.1.4.2 minoura %/* #pragma ident "@(#)rpcb_prot.x 1.5 94/04/29 SMI" */
38 1.1.4.2 minoura %
39 1.1.4.2 minoura %#ifndef _KERNEL
40 1.1.4.2 minoura %
41 1.1.4.2 minoura #endif
42 1.1.4.2 minoura
43 1.1.4.2 minoura /*
44 1.1.4.2 minoura * rpcb_prot.x
45 1.1.4.2 minoura * rpcbind protocol, versions 3 and 4, in RPC Language
46 1.1.4.2 minoura */
47 1.1.4.2 minoura %
48 1.1.4.2 minoura %/*
49 1.1.4.2 minoura % * The following procedures are supported by the protocol in version 3:
50 1.1.4.2 minoura % *
51 1.1.4.2 minoura % * RPCBPROC_NULL() returns ()
52 1.1.4.2 minoura % * takes nothing, returns nothing
53 1.1.4.2 minoura % *
54 1.1.4.2 minoura % * RPCBPROC_SET(rpcb) returns (bool_t)
55 1.1.4.2 minoura % * TRUE is success, FALSE is failure. Registers the tuple
56 1.1.4.2 minoura % * [prog, vers, address, owner, netid].
57 1.1.4.2 minoura % * Finds out owner and netid information on its own.
58 1.1.4.2 minoura % *
59 1.1.4.2 minoura % * RPCBPROC_UNSET(rpcb) returns (bool_t)
60 1.1.4.2 minoura % * TRUE is success, FALSE is failure. Un-registers tuple
61 1.1.4.2 minoura % * [prog, vers, netid]. addresses is ignored.
62 1.1.4.2 minoura % * If netid is NULL, unregister all.
63 1.1.4.2 minoura % *
64 1.1.4.2 minoura % * RPCBPROC_GETADDR(rpcb) returns (string).
65 1.1.4.2 minoura % * 0 is failure. Otherwise returns the universal address where the
66 1.1.4.2 minoura % * triple [prog, vers, netid] is registered. Ignore address and owner.
67 1.1.4.2 minoura % *
68 1.1.4.2 minoura % * RPCBPROC_DUMP() RETURNS (rpcblist_ptr)
69 1.1.4.2 minoura % * used to dump the entire rpcbind maps
70 1.1.4.2 minoura % *
71 1.1.4.2 minoura % * RPCBPROC_CALLIT(rpcb_rmtcallargs)
72 1.1.4.2 minoura % * RETURNS (rpcb_rmtcallres);
73 1.1.4.2 minoura % * Calls the procedure on the remote machine. If it is not registered,
74 1.1.4.2 minoura % * this procedure is quiet; i.e. it does not return error information!!!
75 1.1.4.2 minoura % * This routine only passes null authentication parameters.
76 1.1.4.2 minoura % * It has no interface to xdr routines for RPCBPROC_CALLIT.
77 1.1.4.2 minoura % *
78 1.1.4.2 minoura % * RPCBPROC_GETTIME() returns (int).
79 1.1.4.2 minoura % * Gets the remote machines time
80 1.1.4.2 minoura % *
81 1.1.4.2 minoura % * RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf)
82 1.1.4.2 minoura % * Returns the netbuf address from universal address.
83 1.1.4.2 minoura % *
84 1.1.4.2 minoura % * RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string)
85 1.1.4.2 minoura % * Returns the universal address from netbuf address.
86 1.1.4.2 minoura % *
87 1.1.4.2 minoura % * END OF RPCBIND VERSION 3 PROCEDURES
88 1.1.4.2 minoura % */
89 1.1.4.2 minoura %/*
90 1.1.4.2 minoura % * Except for RPCBPROC_CALLIT, the procedures above are carried over to
91 1.1.4.2 minoura % * rpcbind version 4. Those below are added or modified for version 4.
92 1.1.4.2 minoura % * NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER
93 1.1.4.2 minoura % * AS RPCBPROC_CALLIT.
94 1.1.4.2 minoura % *
95 1.1.4.2 minoura % * RPCBPROC_BCAST(rpcb_rmtcallargs)
96 1.1.4.2 minoura % * RETURNS (rpcb_rmtcallres);
97 1.1.4.2 minoura % * Calls the procedure on the remote machine. If it is not registered,
98 1.1.4.2 minoura % * this procedure IS quiet; i.e. it DOES NOT return error information!!!
99 1.1.4.2 minoura % * This routine should be used for broadcasting and nothing else.
100 1.1.4.2 minoura % *
101 1.1.4.2 minoura % * RPCBPROC_GETVERSADDR(rpcb) returns (string).
102 1.1.4.2 minoura % * 0 is failure. Otherwise returns the universal address where the
103 1.1.4.2 minoura % * triple [prog, vers, netid] is registered. Ignore address and owner.
104 1.1.4.2 minoura % * Same as RPCBPROC_GETADDR except that if the given version number
105 1.1.4.2 minoura % * is not available, the address is not returned.
106 1.1.4.2 minoura % *
107 1.1.4.2 minoura % * RPCBPROC_INDIRECT(rpcb_rmtcallargs)
108 1.1.4.2 minoura % * RETURNS (rpcb_rmtcallres);
109 1.1.4.2 minoura % * Calls the procedure on the remote machine. If it is not registered,
110 1.1.4.2 minoura % * this procedure is NOT quiet; i.e. it DOES return error information!!!
111 1.1.4.2 minoura % * as any normal application would expect.
112 1.1.4.2 minoura % *
113 1.1.4.2 minoura % * RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr).
114 1.1.4.2 minoura % * Same as RPCBPROC_GETADDR except that it returns a list of all the
115 1.1.4.2 minoura % * addresses registered for the combination (prog, vers) (for all
116 1.1.4.2 minoura % * transports).
117 1.1.4.2 minoura % *
118 1.1.4.2 minoura % * RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers)
119 1.1.4.2 minoura % * Returns the statistics about the kind of requests received by rpcbind.
120 1.1.4.2 minoura % */
121 1.1.4.2 minoura %
122 1.1.4.2 minoura %/*
123 1.1.4.2 minoura % * A mapping of (program, version, network ID) to address
124 1.1.4.2 minoura % */
125 1.1.4.2 minoura struct rpcb {
126 1.1.4.2 minoura rpcprog_t r_prog; /* program number */
127 1.1.4.2 minoura rpcvers_t r_vers; /* version number */
128 1.1.4.2 minoura string r_netid<>; /* network id */
129 1.1.4.2 minoura string r_addr<>; /* universal address */
130 1.1.4.2 minoura string r_owner<>; /* owner of this service */
131 1.1.4.2 minoura };
132 1.1.4.2 minoura #ifdef RPC_HDR
133 1.1.4.2 minoura %
134 1.1.4.2 minoura %typedef rpcb RPCB;
135 1.1.4.2 minoura %
136 1.1.4.2 minoura #endif
137 1.1.4.2 minoura %
138 1.1.4.2 minoura %/*
139 1.1.4.2 minoura % * A list of mappings
140 1.1.4.2 minoura % *
141 1.1.4.2 minoura % * Below are two definitions for the rpcblist structure. This is done because
142 1.1.4.2 minoura % * xdr_rpcblist() is specified to take a struct rpcblist **, rather than a
143 1.1.4.2 minoura % * struct rpcblist * that rpcgen would produce. One version of the rpcblist
144 1.1.4.2 minoura % * structure (actually called rp__list) is used with rpcgen, and the other is
145 1.1.4.2 minoura % * defined only in the header file for compatibility with the specified
146 1.1.4.2 minoura % * interface.
147 1.1.4.2 minoura % */
148 1.1.4.2 minoura
149 1.1.4.2 minoura struct rp__list {
150 1.1.4.2 minoura rpcb rpcb_map;
151 1.1.4.2 minoura struct rp__list *rpcb_next;
152 1.1.4.2 minoura };
153 1.1.4.2 minoura
154 1.1.4.2 minoura typedef rp__list *rpcblist_ptr; /* results of RPCBPROC_DUMP */
155 1.1.4.2 minoura
156 1.1.4.2 minoura #ifdef RPC_HDR
157 1.1.4.2 minoura %
158 1.1.4.2 minoura %typedef struct rp__list rpcblist;
159 1.1.4.2 minoura %typedef struct rp__list RPCBLIST;
160 1.1.4.2 minoura %
161 1.1.4.2 minoura %#ifndef __cplusplus
162 1.1.4.2 minoura %struct rpcblist {
163 1.1.4.2 minoura % RPCB rpcb_map;
164 1.1.4.2 minoura % struct rpcblist *rpcb_next;
165 1.1.4.2 minoura %};
166 1.1.4.2 minoura %#endif
167 1.1.4.2 minoura %
168 1.1.4.2 minoura %#ifdef __cplusplus
169 1.1.4.2 minoura %extern "C" {
170 1.1.4.2 minoura %#endif
171 1.1.4.2 minoura %#ifdef __STDC__
172 1.1.4.2 minoura %extern bool_t xdr_rpcblist(XDR *, rpcblist**);
173 1.1.4.2 minoura %#else /* K&R C */
174 1.1.4.2 minoura %bool_t xdr_rpcblist();
175 1.1.4.2 minoura %#endif
176 1.1.4.2 minoura %#ifdef __cplusplus
177 1.1.4.2 minoura %}
178 1.1.4.2 minoura %#endif
179 1.1.4.2 minoura %
180 1.1.4.2 minoura #endif
181 1.1.4.2 minoura
182 1.1.4.2 minoura %
183 1.1.4.2 minoura %/*
184 1.1.4.2 minoura % * Arguments of remote calls
185 1.1.4.2 minoura % */
186 1.1.4.2 minoura struct rpcb_rmtcallargs {
187 1.1.4.2 minoura rpcprog_t prog; /* program number */
188 1.1.4.2 minoura rpcvers_t vers; /* version number */
189 1.1.4.2 minoura rpcproc_t proc; /* procedure number */
190 1.1.4.2 minoura opaque args<>; /* argument */
191 1.1.4.2 minoura };
192 1.1.4.2 minoura #ifdef RPC_HDR
193 1.1.4.2 minoura %
194 1.1.4.2 minoura %/*
195 1.1.4.2 minoura % * Client-side only representation of rpcb_rmtcallargs structure.
196 1.1.4.2 minoura % *
197 1.1.4.2 minoura % * The routine that XDRs the rpcb_rmtcallargs structure must deal with the
198 1.1.4.2 minoura % * opaque arguments in the "args" structure. xdr_rpcb_rmtcallargs() needs to
199 1.1.4.2 minoura % * be passed the XDR routine that knows the args' structure. This routine
200 1.1.4.2 minoura % * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
201 1.1.4.2 minoura % * the application being called already knows the args structure. So we use a
202 1.1.4.2 minoura % * different "XDR" structure on the client side, r_rpcb_rmtcallargs, which
203 1.1.4.2 minoura % * includes the args' XDR routine.
204 1.1.4.2 minoura % */
205 1.1.4.2 minoura %struct r_rpcb_rmtcallargs {
206 1.1.4.2 minoura % rpcprog_t prog;
207 1.1.4.2 minoura % rpcvers_t vers;
208 1.1.4.2 minoura % rpcproc_t proc;
209 1.1.4.2 minoura % struct {
210 1.1.4.2 minoura % u_int args_len;
211 1.1.4.2 minoura % char *args_val;
212 1.1.4.2 minoura % } args;
213 1.1.4.2 minoura % xdrproc_t xdr_args; /* encodes args */
214 1.1.4.2 minoura %};
215 1.1.4.2 minoura %
216 1.1.4.2 minoura #endif /* def RPC_HDR */
217 1.1.4.2 minoura %
218 1.1.4.2 minoura %/*
219 1.1.4.2 minoura % * Results of the remote call
220 1.1.4.2 minoura % */
221 1.1.4.2 minoura struct rpcb_rmtcallres {
222 1.1.4.2 minoura string addr<>; /* remote universal address */
223 1.1.4.2 minoura opaque results<>; /* result */
224 1.1.4.2 minoura };
225 1.1.4.2 minoura #ifdef RPC_HDR
226 1.1.4.2 minoura %
227 1.1.4.2 minoura %/*
228 1.1.4.2 minoura % * Client-side only representation of rpcb_rmtcallres structure.
229 1.1.4.2 minoura % */
230 1.1.4.2 minoura %struct r_rpcb_rmtcallres {
231 1.1.4.2 minoura % char *addr;
232 1.1.4.2 minoura % struct {
233 1.1.4.2 minoura % u_int32_t results_len;
234 1.1.4.2 minoura % char *results_val;
235 1.1.4.2 minoura % } results;
236 1.1.4.2 minoura % xdrproc_t xdr_res; /* decodes results */
237 1.1.4.2 minoura %};
238 1.1.4.2 minoura #endif RPC_HDR
239 1.1.4.2 minoura %
240 1.1.4.2 minoura %/*
241 1.1.4.2 minoura % * rpcb_entry contains a merged address of a service on a particular
242 1.1.4.2 minoura % * transport, plus associated netconfig information. A list of rpcb_entrys
243 1.1.4.2 minoura % * is returned by RPCBPROC_GETADDRLIST. See netconfig.h for values used
244 1.1.4.2 minoura % * in r_nc_* fields.
245 1.1.4.2 minoura % */
246 1.1.4.2 minoura struct rpcb_entry {
247 1.1.4.2 minoura string r_maddr<>; /* merged address of service */
248 1.1.4.2 minoura string r_nc_netid<>; /* netid field */
249 1.1.4.2 minoura unsigned int r_nc_semantics; /* semantics of transport */
250 1.1.4.2 minoura string r_nc_protofmly<>; /* protocol family */
251 1.1.4.2 minoura string r_nc_proto<>; /* protocol name */
252 1.1.4.2 minoura };
253 1.1.4.2 minoura %
254 1.1.4.2 minoura %/*
255 1.1.4.2 minoura % * A list of addresses supported by a service.
256 1.1.4.2 minoura % */
257 1.1.4.2 minoura struct rpcb_entry_list {
258 1.1.4.2 minoura rpcb_entry rpcb_entry_map;
259 1.1.4.2 minoura struct rpcb_entry_list *rpcb_entry_next;
260 1.1.4.2 minoura };
261 1.1.4.2 minoura
262 1.1.4.2 minoura typedef rpcb_entry_list *rpcb_entry_list_ptr;
263 1.1.4.2 minoura
264 1.1.4.2 minoura %
265 1.1.4.2 minoura %/*
266 1.1.4.2 minoura % * rpcbind statistics
267 1.1.4.2 minoura % */
268 1.1.4.2 minoura %
269 1.1.4.2 minoura const rpcb_highproc_2 = RPCBPROC_CALLIT;
270 1.1.4.2 minoura const rpcb_highproc_3 = RPCBPROC_TADDR2UADDR;
271 1.1.4.2 minoura const rpcb_highproc_4 = RPCBPROC_GETSTAT;
272 1.1.4.2 minoura
273 1.1.4.2 minoura const RPCBSTAT_HIGHPROC = 13; /* # of procs in rpcbind V4 plus one */
274 1.1.4.2 minoura const RPCBVERS_STAT = 3; /* provide only for rpcbind V2, V3 and V4 */
275 1.1.4.2 minoura const RPCBVERS_4_STAT = 2;
276 1.1.4.2 minoura const RPCBVERS_3_STAT = 1;
277 1.1.4.2 minoura const RPCBVERS_2_STAT = 0;
278 1.1.4.2 minoura %
279 1.1.4.2 minoura %/* Link list of all the stats about getport and getaddr */
280 1.1.4.2 minoura struct rpcbs_addrlist {
281 1.1.4.2 minoura rpcprog_t prog;
282 1.1.4.2 minoura rpcvers_t vers;
283 1.1.4.2 minoura int success;
284 1.1.4.2 minoura int failure;
285 1.1.4.2 minoura string netid<>;
286 1.1.4.2 minoura struct rpcbs_addrlist *next;
287 1.1.4.2 minoura };
288 1.1.4.2 minoura %
289 1.1.4.2 minoura %/* Link list of all the stats about rmtcall */
290 1.1.4.2 minoura struct rpcbs_rmtcalllist {
291 1.1.4.2 minoura rpcprog_t prog;
292 1.1.4.2 minoura rpcvers_t vers;
293 1.1.4.2 minoura rpcproc_t proc;
294 1.1.4.2 minoura int success;
295 1.1.4.2 minoura int failure;
296 1.1.4.2 minoura int indirect; /* whether callit or indirect */
297 1.1.4.2 minoura string netid<>;
298 1.1.4.2 minoura struct rpcbs_rmtcalllist *next;
299 1.1.4.2 minoura };
300 1.1.4.2 minoura
301 1.1.4.2 minoura typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
302 1.1.4.2 minoura typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
303 1.1.4.2 minoura typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
304 1.1.4.2 minoura
305 1.1.4.2 minoura struct rpcb_stat {
306 1.1.4.2 minoura rpcbs_proc info;
307 1.1.4.2 minoura int setinfo;
308 1.1.4.2 minoura int unsetinfo;
309 1.1.4.2 minoura rpcbs_addrlist_ptr addrinfo;
310 1.1.4.2 minoura rpcbs_rmtcalllist_ptr rmtinfo;
311 1.1.4.2 minoura };
312 1.1.4.2 minoura %
313 1.1.4.2 minoura %/*
314 1.1.4.2 minoura % * One rpcb_stat structure is returned for each version of rpcbind
315 1.1.4.2 minoura % * being monitored.
316 1.1.4.2 minoura % */
317 1.1.4.2 minoura
318 1.1.4.2 minoura typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
319 1.1.4.2 minoura
320 1.1.4.2 minoura #ifdef RPC_HDR
321 1.1.4.2 minoura %
322 1.1.4.2 minoura %/*
323 1.1.4.2 minoura % * We don't define netbuf in RPCL, since it would contain structure member
324 1.1.4.2 minoura % * names that would conflict with the definition of struct netbuf in
325 1.1.4.2 minoura % * <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here,
326 1.1.4.2 minoura % * and implement it ourselves in rpc/rpcb_prot.c.
327 1.1.4.2 minoura % */
328 1.1.4.2 minoura %#ifdef __cplusplus
329 1.1.4.2 minoura %extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *);
330 1.1.4.2 minoura %
331 1.1.4.2 minoura %#elif __STDC__
332 1.1.4.2 minoura %extern bool_t xdr_netbuf(XDR *, struct netbuf *);
333 1.1.4.2 minoura %
334 1.1.4.2 minoura %#else /* K&R C */
335 1.1.4.2 minoura %bool_t xdr_netbuf();
336 1.1.4.2 minoura %
337 1.1.4.2 minoura %#endif /* K&R C*/
338 1.1.4.2 minoura #endif /* def RPC_HDR */
339 1.1.4.2 minoura
340 1.1.4.2 minoura /*
341 1.1.4.2 minoura * rpcbind procedures
342 1.1.4.2 minoura */
343 1.1.4.2 minoura program RPCBPROG {
344 1.1.4.2 minoura version RPCBVERS {
345 1.1.4.2 minoura bool
346 1.1.4.2 minoura RPCBPROC_SET(rpcb) = 1;
347 1.1.4.2 minoura
348 1.1.4.2 minoura bool
349 1.1.4.2 minoura RPCBPROC_UNSET(rpcb) = 2;
350 1.1.4.2 minoura
351 1.1.4.2 minoura string
352 1.1.4.2 minoura RPCBPROC_GETADDR(rpcb) = 3;
353 1.1.4.2 minoura
354 1.1.4.2 minoura rpcblist_ptr
355 1.1.4.2 minoura RPCBPROC_DUMP(void) = 4;
356 1.1.4.2 minoura
357 1.1.4.2 minoura rpcb_rmtcallres
358 1.1.4.2 minoura RPCBPROC_CALLIT(rpcb_rmtcallargs) = 5;
359 1.1.4.2 minoura
360 1.1.4.2 minoura unsigned int
361 1.1.4.2 minoura RPCBPROC_GETTIME(void) = 6;
362 1.1.4.2 minoura
363 1.1.4.2 minoura struct netbuf
364 1.1.4.2 minoura RPCBPROC_UADDR2TADDR(string) = 7;
365 1.1.4.2 minoura
366 1.1.4.2 minoura string
367 1.1.4.2 minoura RPCBPROC_TADDR2UADDR(struct netbuf) = 8;
368 1.1.4.2 minoura } = 3;
369 1.1.4.2 minoura
370 1.1.4.2 minoura version RPCBVERS4 {
371 1.1.4.2 minoura bool
372 1.1.4.2 minoura RPCBPROC_SET(rpcb) = 1;
373 1.1.4.2 minoura
374 1.1.4.2 minoura bool
375 1.1.4.2 minoura RPCBPROC_UNSET(rpcb) = 2;
376 1.1.4.2 minoura
377 1.1.4.2 minoura string
378 1.1.4.2 minoura RPCBPROC_GETADDR(rpcb) = 3;
379 1.1.4.2 minoura
380 1.1.4.2 minoura rpcblist_ptr
381 1.1.4.2 minoura RPCBPROC_DUMP(void) = 4;
382 1.1.4.2 minoura
383 1.1.4.2 minoura /*
384 1.1.4.2 minoura * NOTE: RPCBPROC_BCAST has the same functionality as CALLIT;
385 1.1.4.2 minoura * the new name is intended to indicate that this
386 1.1.4.2 minoura * procedure should be used for broadcast RPC, and
387 1.1.4.2 minoura * RPCBPROC_INDIRECT should be used for indirect calls.
388 1.1.4.2 minoura */
389 1.1.4.2 minoura rpcb_rmtcallres
390 1.1.4.2 minoura RPCBPROC_BCAST(rpcb_rmtcallargs) = RPCBPROC_CALLIT;
391 1.1.4.2 minoura
392 1.1.4.2 minoura unsigned int
393 1.1.4.2 minoura RPCBPROC_GETTIME(void) = 6;
394 1.1.4.2 minoura
395 1.1.4.2 minoura struct netbuf
396 1.1.4.2 minoura RPCBPROC_UADDR2TADDR(string) = 7;
397 1.1.4.2 minoura
398 1.1.4.2 minoura string
399 1.1.4.2 minoura RPCBPROC_TADDR2UADDR(struct netbuf) = 8;
400 1.1.4.2 minoura
401 1.1.4.2 minoura string
402 1.1.4.2 minoura RPCBPROC_GETVERSADDR(rpcb) = 9;
403 1.1.4.2 minoura
404 1.1.4.2 minoura rpcb_rmtcallres
405 1.1.4.2 minoura RPCBPROC_INDIRECT(rpcb_rmtcallargs) = 10;
406 1.1.4.2 minoura
407 1.1.4.2 minoura rpcb_entry_list_ptr
408 1.1.4.2 minoura RPCBPROC_GETADDRLIST(rpcb) = 11;
409 1.1.4.2 minoura
410 1.1.4.2 minoura rpcb_stat_byvers
411 1.1.4.2 minoura RPCBPROC_GETSTAT(void) = 12;
412 1.1.4.2 minoura } = 4;
413 1.1.4.2 minoura } = 100000;
414 1.1.4.2 minoura #ifdef RPC_HDR
415 1.1.4.2 minoura %
416 1.1.4.2 minoura %#define RPCBVERS_3 RPCBVERS
417 1.1.4.2 minoura %#define RPCBVERS_4 RPCBVERS4
418 1.1.4.2 minoura %
419 1.1.4.2 minoura %#define _PATH_RPCBINDSOCK "/var/run/rpcbind.sock"
420 1.1.4.2 minoura %
421 1.1.4.2 minoura %#else /* ndef _KERNEL */
422 1.1.4.2 minoura %#ifdef __cplusplus
423 1.1.4.2 minoura %extern "C" {
424 1.1.4.2 minoura %#endif
425 1.1.4.2 minoura %
426 1.1.4.2 minoura %/*
427 1.1.4.2 minoura % * A mapping of (program, version, network ID) to address
428 1.1.4.2 minoura % */
429 1.1.4.2 minoura %struct rpcb {
430 1.1.4.2 minoura % rpcprog_t r_prog; /* program number */
431 1.1.4.2 minoura % rpcvers_t r_vers; /* version number */
432 1.1.4.2 minoura % char *r_netid; /* network id */
433 1.1.4.2 minoura % char *r_addr; /* universal address */
434 1.1.4.2 minoura % char *r_owner; /* owner of the mapping */
435 1.1.4.2 minoura %};
436 1.1.4.2 minoura %typedef struct rpcb RPCB;
437 1.1.4.2 minoura %
438 1.1.4.2 minoura %/*
439 1.1.4.2 minoura % * A list of mappings
440 1.1.4.2 minoura % */
441 1.1.4.2 minoura %struct rpcblist {
442 1.1.4.2 minoura % RPCB rpcb_map;
443 1.1.4.2 minoura % struct rpcblist *rpcb_next;
444 1.1.4.2 minoura %};
445 1.1.4.2 minoura %typedef struct rpcblist RPCBLIST;
446 1.1.4.2 minoura %typedef struct rpcblist *rpcblist_ptr;
447 1.1.4.2 minoura %
448 1.1.4.2 minoura %/*
449 1.1.4.2 minoura % * Remote calls arguments
450 1.1.4.2 minoura % */
451 1.1.4.2 minoura %struct rpcb_rmtcallargs {
452 1.1.4.2 minoura % rpcprog_t prog; /* program number */
453 1.1.4.2 minoura % rpcvers_t vers; /* version number */
454 1.1.4.2 minoura % rpcproc_t proc; /* procedure number */
455 1.1.4.2 minoura % u_int32_t arglen; /* arg len */
456 1.1.4.2 minoura % caddr_t args_ptr; /* argument */
457 1.1.4.2 minoura % xdrproc_t xdr_args; /* XDR routine for argument */
458 1.1.4.2 minoura %};
459 1.1.4.2 minoura %typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
460 1.1.4.2 minoura %
461 1.1.4.2 minoura %/*
462 1.1.4.2 minoura % * Remote calls results
463 1.1.4.2 minoura % */
464 1.1.4.2 minoura %struct rpcb_rmtcallres {
465 1.1.4.2 minoura % char *addr_ptr; /* remote universal address */
466 1.1.4.2 minoura % u_int32_t resultslen; /* results length */
467 1.1.4.2 minoura % caddr_t results_ptr; /* results */
468 1.1.4.2 minoura % xdrproc_t xdr_results; /* XDR routine for result */
469 1.1.4.2 minoura %};
470 1.1.4.2 minoura %typedef struct rpcb_rmtcallres rpcb_rmtcallres;
471 1.1.4.2 minoura %
472 1.1.4.2 minoura %struct rpcb_entry {
473 1.1.4.2 minoura % char *r_maddr;
474 1.1.4.2 minoura % char *r_nc_netid;
475 1.1.4.2 minoura % unsigned int r_nc_semantics;
476 1.1.4.2 minoura % char *r_nc_protofmly;
477 1.1.4.2 minoura % char *r_nc_proto;
478 1.1.4.2 minoura %};
479 1.1.4.2 minoura %typedef struct rpcb_entry rpcb_entry;
480 1.1.4.2 minoura %
481 1.1.4.2 minoura %/*
482 1.1.4.2 minoura % * A list of addresses supported by a service.
483 1.1.4.2 minoura % */
484 1.1.4.2 minoura %
485 1.1.4.2 minoura %struct rpcb_entry_list {
486 1.1.4.2 minoura % rpcb_entry rpcb_entry_map;
487 1.1.4.2 minoura % struct rpcb_entry_list *rpcb_entry_next;
488 1.1.4.2 minoura %};
489 1.1.4.2 minoura %typedef struct rpcb_entry_list rpcb_entry_list;
490 1.1.4.2 minoura %
491 1.1.4.2 minoura %typedef rpcb_entry_list *rpcb_entry_list_ptr;
492 1.1.4.2 minoura %
493 1.1.4.2 minoura %/*
494 1.1.4.2 minoura % * rpcbind statistics
495 1.1.4.2 minoura % */
496 1.1.4.2 minoura %
497 1.1.4.2 minoura %#define rpcb_highproc_2 RPCBPROC_CALLIT
498 1.1.4.2 minoura %#define rpcb_highproc_3 RPCBPROC_TADDR2UADDR
499 1.1.4.2 minoura %#define rpcb_highproc_4 RPCBPROC_GETSTAT
500 1.1.4.2 minoura %#define RPCBSTAT_HIGHPROC 13
501 1.1.4.2 minoura %#define RPCBVERS_STAT 3
502 1.1.4.2 minoura %#define RPCBVERS_4_STAT 2
503 1.1.4.2 minoura %#define RPCBVERS_3_STAT 1
504 1.1.4.2 minoura %#define RPCBVERS_2_STAT 0
505 1.1.4.2 minoura %
506 1.1.4.2 minoura %/* Link list of all the stats about getport and getaddr */
507 1.1.4.2 minoura %
508 1.1.4.2 minoura %struct rpcbs_addrlist {
509 1.1.4.2 minoura % rpcprog_t prog;
510 1.1.4.2 minoura % rpcvers_t vers;
511 1.1.4.2 minoura % int success;
512 1.1.4.2 minoura % int failure;
513 1.1.4.2 minoura % char *netid;
514 1.1.4.2 minoura % struct rpcbs_addrlist *next;
515 1.1.4.2 minoura %};
516 1.1.4.2 minoura %typedef struct rpcbs_addrlist rpcbs_addrlist;
517 1.1.4.2 minoura %
518 1.1.4.2 minoura %/* Link list of all the stats about rmtcall */
519 1.1.4.2 minoura %
520 1.1.4.2 minoura %struct rpcbs_rmtcalllist {
521 1.1.4.2 minoura % rpcprog_t prog;
522 1.1.4.2 minoura % rpcvers_t vers;
523 1.1.4.2 minoura % rpcproc_t proc;
524 1.1.4.2 minoura % int success;
525 1.1.4.2 minoura % int failure;
526 1.1.4.2 minoura % int indirect;
527 1.1.4.2 minoura % char *netid;
528 1.1.4.2 minoura % struct rpcbs_rmtcalllist *next;
529 1.1.4.2 minoura %};
530 1.1.4.2 minoura %typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
531 1.1.4.2 minoura %
532 1.1.4.2 minoura %typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
533 1.1.4.2 minoura %
534 1.1.4.2 minoura %typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
535 1.1.4.2 minoura %
536 1.1.4.2 minoura %typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
537 1.1.4.2 minoura %
538 1.1.4.2 minoura %struct rpcb_stat {
539 1.1.4.2 minoura % rpcbs_proc info;
540 1.1.4.2 minoura % int setinfo;
541 1.1.4.2 minoura % int unsetinfo;
542 1.1.4.2 minoura % rpcbs_addrlist_ptr addrinfo;
543 1.1.4.2 minoura % rpcbs_rmtcalllist_ptr rmtinfo;
544 1.1.4.2 minoura %};
545 1.1.4.2 minoura %typedef struct rpcb_stat rpcb_stat;
546 1.1.4.2 minoura %
547 1.1.4.2 minoura %/*
548 1.1.4.2 minoura % * One rpcb_stat structure is returned for each version of rpcbind
549 1.1.4.2 minoura % * being monitored.
550 1.1.4.2 minoura % */
551 1.1.4.2 minoura %
552 1.1.4.2 minoura %typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
553 1.1.4.2 minoura %
554 1.1.4.2 minoura %#ifdef __cplusplus
555 1.1.4.2 minoura %}
556 1.1.4.2 minoura %#endif
557 1.1.4.2 minoura %
558 1.1.4.2 minoura %#endif /* ndef _KERNEL */
559 1.1.4.2 minoura #endif /* RPC_HDR */
560