4 % * Copyright (c) 2009, Sun Microsystems, Inc.
5 % * All rights reserved.
7 % * Redistribution and use in source and binary forms, with or without
8 % * modification, are permitted provided that the following conditions are met:
9 % * - Redistributions of source code must retain the above copyright notice,
10 % * this list of conditions and the following disclaimer.
11 % * - Redistributions in binary form must reproduce the above copyright notice,
12 % * this list of conditions and the following disclaimer in the documentation
13 % * and/or other materials provided with the distribution.
14 % * - Neither the name of Sun Microsystems, Inc. nor the names of its
15 % * contributors may be used to endorse or promote products derived
16 % * from this software without specific prior written permission.
18 % * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 % * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 % * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 % * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 % * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 % * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 % * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 % * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 % * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 % * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 % * POSSIBILITY OF SUCH DAMAGE.
31 % * Copyright (c) 1988 by Sun Microsystems, Inc.
34 %/* from rpcb_prot.x */
38 %/* #pragma ident "@(#)rpcb_prot.x 1.5 94/04/29 SMI" */
46 * rpcbind protocol, versions 3 and 4, in RPC Language
50 % * The following procedures are supported by the protocol in version 3:
52 % * RPCBPROC_NULL() returns ()
53 % * takes nothing, returns nothing
55 % * RPCBPROC_SET(rpcb) returns (bool_t)
56 % * TRUE is success, FALSE is failure. Registers the tuple
57 % * [prog, vers, address, owner, netid].
58 % * Finds out owner and netid information on its own.
60 % * RPCBPROC_UNSET(rpcb) returns (bool_t)
61 % * TRUE is success, FALSE is failure. Un-registers tuple
62 % * [prog, vers, netid]. addresses is ignored.
63 % * If netid is NULL, unregister all.
65 % * RPCBPROC_GETADDR(rpcb) returns (string).
66 % * 0 is failure. Otherwise returns the universal address where the
67 % * triple [prog, vers, netid] is registered. Ignore address and owner.
69 % * RPCBPROC_DUMP() RETURNS (rpcblist_ptr)
70 % * used to dump the entire rpcbind maps
72 % * RPCBPROC_CALLIT(rpcb_rmtcallargs)
73 % * RETURNS (rpcb_rmtcallres);
74 % * Calls the procedure on the remote machine. If it is not registered,
75 % * this procedure is quiet; i.e. it does not return error information!!!
76 % * This routine only passes null authentication parameters.
77 % * It has no interface to xdr routines for RPCBPROC_CALLIT.
79 % * RPCBPROC_GETTIME() returns (int).
80 % * Gets the remote machines time
82 % * RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf)
83 % * Returns the netbuf address from universal address.
85 % * RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string)
86 % * Returns the universal address from netbuf address.
88 % * END OF RPCBIND VERSION 3 PROCEDURES
91 % * Except for RPCBPROC_CALLIT, the procedures above are carried over to
92 % * rpcbind version 4. Those below are added or modified for version 4.
93 % * NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER
94 % * AS RPCBPROC_CALLIT.
96 % * RPCBPROC_BCAST(rpcb_rmtcallargs)
97 % * RETURNS (rpcb_rmtcallres);
98 % * Calls the procedure on the remote machine. If it is not registered,
99 % * this procedure IS quiet; i.e. it DOES NOT return error information!!!
100 % * This routine should be used for broadcasting and nothing else.
102 % * RPCBPROC_GETVERSADDR(rpcb) returns (string).
103 % * 0 is failure. Otherwise returns the universal address where the
104 % * triple [prog, vers, netid] is registered. Ignore address and owner.
105 % * Same as RPCBPROC_GETADDR except that if the given version number
106 % * is not available, the address is not returned.
108 % * RPCBPROC_INDIRECT(rpcb_rmtcallargs)
109 % * RETURNS (rpcb_rmtcallres);
110 % * Calls the procedure on the remote machine. If it is not registered,
111 % * this procedure is NOT quiet; i.e. it DOES return error information!!!
112 % * as any normal application would expect.
114 % * RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr).
115 % * Same as RPCBPROC_GETADDR except that it returns a list of all the
116 % * addresses registered for the combination (prog, vers) (for all
119 % * RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers)
120 % * Returns the statistics about the kind of requests received by rpcbind.
124 % * A mapping of (program, version, network ID) to address
127 rpcprog_t r_prog; /* program number */
128 rpcvers_t r_vers; /* version number */
129 string r_netid<>; /* network id */
130 string r_addr<>; /* universal address */
131 string r_owner<>; /* owner of this service */
140 % * A list of mappings
142 % * Below are two definitions for the rpcblist structure. This is done because
143 % * xdr_rpcblist() is specified to take a struct rpcblist **, rather than a
144 % * struct rpcblist * that rpcgen would produce. One version of the rpcblist
145 % * structure (actually called rp__list) is used with rpcgen, and the other is
146 % * defined only in the header file for compatibility with the specified
152 struct rp__list *rpcb_next;
155 typedef rp__list *rpcblist_ptr; /* results of RPCBPROC_DUMP */
159 %typedef struct rp__list rpcblist;
160 %typedef struct rp__list RPCBLIST;
165 % struct rpcblist *rpcb_next;
172 %extern bool_t xdr_rpcblist(XDR *, rpcblist**);
181 % * Arguments of remote calls
183 struct rpcb_rmtcallargs {
184 rpcprog_t prog; /* program number */
185 rpcvers_t vers; /* version number */
186 rpcproc_t proc; /* procedure number */
187 opaque args<>; /* argument */
192 % * Client-side only representation of rpcb_rmtcallargs structure.
194 % * The routine that XDRs the rpcb_rmtcallargs structure must deal with the
195 % * opaque arguments in the "args" structure. xdr_rpcb_rmtcallargs() needs to
196 % * be passed the XDR routine that knows the args' structure. This routine
197 % * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
198 % * the application being called already knows the args structure. So we use a
199 % * different "XDR" structure on the client side, r_rpcb_rmtcallargs, which
200 % * includes the args' XDR routine.
202 %struct r_rpcb_rmtcallargs {
210 % xdrproc_t xdr_args; /* encodes args */
213 #endif /* def RPC_HDR */
216 % * Results of the remote call
218 struct rpcb_rmtcallres {
219 string addr<>; /* remote universal address */
220 opaque results<>; /* result */
225 % * Client-side only representation of rpcb_rmtcallres structure.
227 %struct r_rpcb_rmtcallres {
230 % u_int32_t results_len;
233 % xdrproc_t xdr_res; /* decodes results */
238 % * rpcb_entry contains a merged address of a service on a particular
239 % * transport, plus associated netconfig information. A list of rpcb_entrys
240 % * is returned by RPCBPROC_GETADDRLIST. See netconfig.h for values used
241 % * in r_nc_* fields.
244 string r_maddr<>; /* merged address of service */
245 string r_nc_netid<>; /* netid field */
246 unsigned int r_nc_semantics; /* semantics of transport */
247 string r_nc_protofmly<>; /* protocol family */
248 string r_nc_proto<>; /* protocol name */
252 % * A list of addresses supported by a service.
254 struct rpcb_entry_list {
255 rpcb_entry rpcb_entry_map;
256 struct rpcb_entry_list *rpcb_entry_next;
259 typedef rpcb_entry_list *rpcb_entry_list_ptr;
263 % * rpcbind statistics
266 const rpcb_highproc_2 = RPCBPROC_CALLIT;
267 const rpcb_highproc_3 = RPCBPROC_TADDR2UADDR;
268 const rpcb_highproc_4 = RPCBPROC_GETSTAT;
270 const RPCBSTAT_HIGHPROC = 13; /* # of procs in rpcbind V4 plus one */
271 const RPCBVERS_STAT = 3; /* provide only for rpcbind V2, V3 and V4 */
272 const RPCBVERS_4_STAT = 2;
273 const RPCBVERS_3_STAT = 1;
274 const RPCBVERS_2_STAT = 0;
276 %/* Link list of all the stats about getport and getaddr */
277 struct rpcbs_addrlist {
283 struct rpcbs_addrlist *next;
286 %/* Link list of all the stats about rmtcall */
287 struct rpcbs_rmtcalllist {
293 int indirect; /* whether callit or indirect */
295 struct rpcbs_rmtcalllist *next;
298 typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
299 typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
300 typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
306 rpcbs_addrlist_ptr addrinfo;
307 rpcbs_rmtcalllist_ptr rmtinfo;
311 % * One rpcb_stat structure is returned for each version of rpcbind
315 typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
320 % * We don't define netbuf in RPCL, since it would contain structure member
321 % * names that would conflict with the definition of struct netbuf in
322 % * <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here,
323 % * and implement it ourselves in rpc/rpcb_prot.c.
326 %extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *);
328 %#else /* __STDC__ */
329 %extern bool_t xdr_netbuf(XDR *, struct netbuf *);
332 #endif /* def RPC_HDR */
340 RPCBPROC_SET(rpcb) = 1;
343 RPCBPROC_UNSET(rpcb) = 2;
346 RPCBPROC_GETADDR(rpcb) = 3;
349 RPCBPROC_DUMP(void) = 4;
352 RPCBPROC_CALLIT(rpcb_rmtcallargs) = 5;
355 RPCBPROC_GETTIME(void) = 6;
358 RPCBPROC_UADDR2TADDR(string) = 7;
361 RPCBPROC_TADDR2UADDR(struct netbuf) = 8;
366 RPCBPROC_SET(rpcb) = 1;
369 RPCBPROC_UNSET(rpcb) = 2;
372 RPCBPROC_GETADDR(rpcb) = 3;
375 RPCBPROC_DUMP(void) = 4;
378 * NOTE: RPCBPROC_BCAST has the same functionality as CALLIT;
379 * the new name is intended to indicate that this
380 * procedure should be used for broadcast RPC, and
381 * RPCBPROC_INDIRECT should be used for indirect calls.
384 RPCBPROC_BCAST(rpcb_rmtcallargs) = RPCBPROC_CALLIT;
387 RPCBPROC_GETTIME(void) = 6;
390 RPCBPROC_UADDR2TADDR(string) = 7;
393 RPCBPROC_TADDR2UADDR(struct netbuf) = 8;
396 RPCBPROC_GETVERSADDR(rpcb) = 9;
399 RPCBPROC_INDIRECT(rpcb_rmtcallargs) = 10;
402 RPCBPROC_GETADDRLIST(rpcb) = 11;
405 RPCBPROC_GETSTAT(void) = 12;
410 %#define RPCBVERS_3 RPCBVERS
411 %#define RPCBVERS_4 RPCBVERS4
413 %#define _PATH_RPCBINDSOCK "/var/run/rpcbind.sock"
415 %#else /* ndef _KERNEL */
421 % * A mapping of (program, version, network ID) to address
424 % rpcprog_t r_prog; /* program number */
425 % rpcvers_t r_vers; /* version number */
426 % char *r_netid; /* network id */
427 % char *r_addr; /* universal address */
428 % char *r_owner; /* owner of the mapping */
430 %typedef struct rpcb RPCB;
433 % * A list of mappings
437 % struct rpcblist *rpcb_next;
439 %typedef struct rpcblist RPCBLIST;
440 %typedef struct rpcblist *rpcblist_ptr;
443 % * Remote calls arguments
445 %struct rpcb_rmtcallargs {
446 % rpcprog_t prog; /* program number */
447 % rpcvers_t vers; /* version number */
448 % rpcproc_t proc; /* procedure number */
449 % u_int32_t arglen; /* arg len */
450 % caddr_t args_ptr; /* argument */
451 % xdrproc_t xdr_args; /* XDR routine for argument */
453 %typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
456 % * Remote calls results
458 %struct rpcb_rmtcallres {
459 % char *addr_ptr; /* remote universal address */
460 % u_int32_t resultslen; /* results length */
461 % caddr_t results_ptr; /* results */
462 % xdrproc_t xdr_results; /* XDR routine for result */
464 %typedef struct rpcb_rmtcallres rpcb_rmtcallres;
469 % unsigned int r_nc_semantics;
470 % char *r_nc_protofmly;
473 %typedef struct rpcb_entry rpcb_entry;
476 % * A list of addresses supported by a service.
479 %struct rpcb_entry_list {
480 % rpcb_entry rpcb_entry_map;
481 % struct rpcb_entry_list *rpcb_entry_next;
483 %typedef struct rpcb_entry_list rpcb_entry_list;
485 %typedef rpcb_entry_list *rpcb_entry_list_ptr;
488 % * rpcbind statistics
491 %#define rpcb_highproc_2 RPCBPROC_CALLIT
492 %#define rpcb_highproc_3 RPCBPROC_TADDR2UADDR
493 %#define rpcb_highproc_4 RPCBPROC_GETSTAT
494 %#define RPCBSTAT_HIGHPROC 13
495 %#define RPCBVERS_STAT 3
496 %#define RPCBVERS_4_STAT 2
497 %#define RPCBVERS_3_STAT 1
498 %#define RPCBVERS_2_STAT 0
500 %/* Link list of all the stats about getport and getaddr */
502 %struct rpcbs_addrlist {
508 % struct rpcbs_addrlist *next;
510 %typedef struct rpcbs_addrlist rpcbs_addrlist;
512 %/* Link list of all the stats about rmtcall */
514 %struct rpcbs_rmtcalllist {
522 % struct rpcbs_rmtcalllist *next;
524 %typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
526 %typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
528 %typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
530 %typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
536 % rpcbs_addrlist_ptr addrinfo;
537 % rpcbs_rmtcalllist_ptr rmtinfo;
539 %typedef struct rpcb_stat rpcb_stat;
542 % * One rpcb_stat structure is returned for each version of rpcbind
546 %typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
552 %#endif /* ndef _KERNEL */