2 % * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 % * unrestricted use provided that this legend is included on all tape
4 % * media and as a part of the software program in whole or part. Users
5 % * may copy or modify Sun RPC without charge, but are not authorized
6 % * to license or distribute it to anyone else except as part of a product or
7 % * program developed by the user.
9 % * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 % * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11 % * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 % * Sun RPC is provided with no support and without any obligation on the
14 % * part of Sun Microsystems, Inc. to assist in its use, correction,
15 % * modification or enhancement.
17 % * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 % * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 % * OR ANY PART THEREOF.
21 % * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 % * or profits or other special, indirect and consequential damages, even if
23 % * Sun has been advised of the possibility of such damages.
25 % * Sun Microsystems, Inc.
26 % * 2550 Garcia Avenue
27 % * Mountain View, California 94043
30 % * Copyright (c) 1988 by Sun Microsystems, Inc.
33 %/* from rpcb_prot.x */
37 %/* #pragma ident "@(#)rpcb_prot.x 1.5 94/04/29 SMI" */
45 * rpcbind protocol, versions 3 and 4, in RPC Language
49 % * The following procedures are supported by the protocol in version 3:
51 % * RPCBPROC_NULL() returns ()
52 % * takes nothing, returns nothing
54 % * RPCBPROC_SET(rpcb) returns (bool_t)
55 % * TRUE is success, FALSE is failure. Registers the tuple
56 % * [prog, vers, address, owner, netid].
57 % * Finds out owner and netid information on its own.
59 % * RPCBPROC_UNSET(rpcb) returns (bool_t)
60 % * TRUE is success, FALSE is failure. Un-registers tuple
61 % * [prog, vers, netid]. addresses is ignored.
62 % * If netid is NULL, unregister all.
64 % * RPCBPROC_GETADDR(rpcb) returns (string).
65 % * 0 is failure. Otherwise returns the universal address where the
66 % * triple [prog, vers, netid] is registered. Ignore address and owner.
68 % * RPCBPROC_DUMP() RETURNS (rpcblist_ptr)
69 % * used to dump the entire rpcbind maps
71 % * RPCBPROC_CALLIT(rpcb_rmtcallargs)
72 % * RETURNS (rpcb_rmtcallres);
73 % * Calls the procedure on the remote machine. If it is not registered,
74 % * this procedure is quiet; i.e. it does not return error information!!!
75 % * This routine only passes null authentication parameters.
76 % * It has no interface to xdr routines for RPCBPROC_CALLIT.
78 % * RPCBPROC_GETTIME() returns (int).
79 % * Gets the remote machines time
81 % * RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf)
82 % * Returns the netbuf address from universal address.
84 % * RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string)
85 % * Returns the universal address from netbuf address.
87 % * END OF RPCBIND VERSION 3 PROCEDURES
90 % * Except for RPCBPROC_CALLIT, the procedures above are carried over to
91 % * rpcbind version 4. Those below are added or modified for version 4.
92 % * NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER
93 % * AS RPCBPROC_CALLIT.
95 % * RPCBPROC_BCAST(rpcb_rmtcallargs)
96 % * RETURNS (rpcb_rmtcallres);
97 % * Calls the procedure on the remote machine. If it is not registered,
98 % * this procedure IS quiet; i.e. it DOES NOT return error information!!!
99 % * This routine should be used for broadcasting and nothing else.
101 % * RPCBPROC_GETVERSADDR(rpcb) returns (string).
102 % * 0 is failure. Otherwise returns the universal address where the
103 % * triple [prog, vers, netid] is registered. Ignore address and owner.
104 % * Same as RPCBPROC_GETADDR except that if the given version number
105 % * is not available, the address is not returned.
107 % * RPCBPROC_INDIRECT(rpcb_rmtcallargs)
108 % * RETURNS (rpcb_rmtcallres);
109 % * Calls the procedure on the remote machine. If it is not registered,
110 % * this procedure is NOT quiet; i.e. it DOES return error information!!!
111 % * as any normal application would expect.
113 % * RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr).
114 % * Same as RPCBPROC_GETADDR except that it returns a list of all the
115 % * addresses registered for the combination (prog, vers) (for all
118 % * RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers)
119 % * Returns the statistics about the kind of requests received by rpcbind.
123 % * A mapping of (program, version, network ID) to address
126 rpcprog_t r_prog; /* program number */
127 rpcvers_t r_vers; /* version number */
128 string r_netid<>; /* network id */
129 string r_addr<>; /* universal address */
130 string r_owner<>; /* owner of this service */
139 % * A list of mappings
141 % * Below are two definitions for the rpcblist structure. This is done because
142 % * xdr_rpcblist() is specified to take a struct rpcblist **, rather than a
143 % * struct rpcblist * that rpcgen would produce. One version of the rpcblist
144 % * structure (actually called rp__list) is used with rpcgen, and the other is
145 % * defined only in the header file for compatibility with the specified
151 struct rp__list *rpcb_next;
154 typedef rp__list *rpcblist_ptr; /* results of RPCBPROC_DUMP */
158 %typedef struct rp__list rpcblist;
159 %typedef struct rp__list RPCBLIST;
164 % struct rpcblist *rpcb_next;
172 %extern bool_t xdr_rpcblist(XDR *, rpcblist**);
174 %bool_t xdr_rpcblist();
184 % * Arguments of remote calls
186 struct rpcb_rmtcallargs {
187 rpcprog_t prog; /* program number */
188 rpcvers_t vers; /* version number */
189 rpcproc_t proc; /* procedure number */
190 opaque args<>; /* argument */
195 % * Client-side only representation of rpcb_rmtcallargs structure.
197 % * The routine that XDRs the rpcb_rmtcallargs structure must deal with the
198 % * opaque arguments in the "args" structure. xdr_rpcb_rmtcallargs() needs to
199 % * be passed the XDR routine that knows the args' structure. This routine
200 % * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
201 % * the application being called already knows the args structure. So we use a
202 % * different "XDR" structure on the client side, r_rpcb_rmtcallargs, which
203 % * includes the args' XDR routine.
205 %struct r_rpcb_rmtcallargs {
211 % const char *args_val;
213 % xdrproc_t xdr_args; /* encodes args */
216 #endif /* def RPC_HDR */
219 % * Results of the remote call
221 struct rpcb_rmtcallres {
222 string addr<>; /* remote universal address */
223 opaque results<>; /* result */
228 % * Client-side only representation of rpcb_rmtcallres structure.
230 %struct r_rpcb_rmtcallres {
233 % u_int32_t results_len;
236 % xdrproc_t xdr_res; /* decodes results */
241 % * rpcb_entry contains a merged address of a service on a particular
242 % * transport, plus associated netconfig information. A list of rpcb_entrys
243 % * is returned by RPCBPROC_GETADDRLIST. See netconfig.h for values used
244 % * in r_nc_* fields.
247 string r_maddr<>; /* merged address of service */
248 string r_nc_netid<>; /* netid field */
249 unsigned int r_nc_semantics; /* semantics of transport */
250 string r_nc_protofmly<>; /* protocol family */
251 string r_nc_proto<>; /* protocol name */
255 % * A list of addresses supported by a service.
257 struct rpcb_entry_list {
258 rpcb_entry rpcb_entry_map;
259 struct rpcb_entry_list *rpcb_entry_next;
262 typedef rpcb_entry_list *rpcb_entry_list_ptr;
266 % * rpcbind statistics
269 const rpcb_highproc_2 = RPCBPROC_CALLIT;
270 const rpcb_highproc_3 = RPCBPROC_TADDR2UADDR;
271 const rpcb_highproc_4 = RPCBPROC_GETSTAT;
273 const RPCBSTAT_HIGHPROC = 13; /* # of procs in rpcbind V4 plus one */
274 const RPCBVERS_STAT = 3; /* provide only for rpcbind V2, V3 and V4 */
275 const RPCBVERS_4_STAT = 2;
276 const RPCBVERS_3_STAT = 1;
277 const RPCBVERS_2_STAT = 0;
279 %/* Link list of all the stats about getport and getaddr */
280 struct rpcbs_addrlist {
286 struct rpcbs_addrlist *next;
289 %/* Link list of all the stats about rmtcall */
290 struct rpcbs_rmtcalllist {
296 int indirect; /* whether callit or indirect */
298 struct rpcbs_rmtcalllist *next;
301 typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
302 typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
303 typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
309 rpcbs_addrlist_ptr addrinfo;
310 rpcbs_rmtcalllist_ptr rmtinfo;
314 % * One rpcb_stat structure is returned for each version of rpcbind
318 typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
323 % * We don't define netbuf in RPCL, since it would contain structure member
324 % * names that would conflict with the definition of struct netbuf in
325 % * <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here,
326 % * and implement it ourselves in rpc/rpcb_prot.c.
329 %extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *);
332 %extern bool_t xdr_netbuf(XDR *, struct netbuf *);
335 %bool_t xdr_netbuf();
338 #endif /* def RPC_HDR */
346 RPCBPROC_SET(rpcb) = 1;
349 RPCBPROC_UNSET(rpcb) = 2;
352 RPCBPROC_GETADDR(rpcb) = 3;
355 RPCBPROC_DUMP(void) = 4;
358 RPCBPROC_CALLIT(rpcb_rmtcallargs) = 5;
361 RPCBPROC_GETTIME(void) = 6;
364 RPCBPROC_UADDR2TADDR(string) = 7;
367 RPCBPROC_TADDR2UADDR(struct netbuf) = 8;
372 RPCBPROC_SET(rpcb) = 1;
375 RPCBPROC_UNSET(rpcb) = 2;
378 RPCBPROC_GETADDR(rpcb) = 3;
381 RPCBPROC_DUMP(void) = 4;
384 * NOTE: RPCBPROC_BCAST has the same functionality as CALLIT;
385 * the new name is intended to indicate that this
386 * procedure should be used for broadcast RPC, and
387 * RPCBPROC_INDIRECT should be used for indirect calls.
390 RPCBPROC_BCAST(rpcb_rmtcallargs) = RPCBPROC_CALLIT;
393 RPCBPROC_GETTIME(void) = 6;
396 RPCBPROC_UADDR2TADDR(string) = 7;
399 RPCBPROC_TADDR2UADDR(struct netbuf) = 8;
402 RPCBPROC_GETVERSADDR(rpcb) = 9;
405 RPCBPROC_INDIRECT(rpcb_rmtcallargs) = 10;
408 RPCBPROC_GETADDRLIST(rpcb) = 11;
411 RPCBPROC_GETSTAT(void) = 12;
416 %#define RPCBVERS_3 RPCBVERS
417 %#define RPCBVERS_4 RPCBVERS4
419 %#define _PATH_RPCBINDSOCK "/var/run/rpcbind.sock"
421 %#else /* ifndef _KERNEL */
427 % * A mapping of (program, version, network ID) to address
430 % rpcprog_t r_prog; /* program number */
431 % rpcvers_t r_vers; /* version number */
432 % char *r_netid; /* network id */
433 % char *r_addr; /* universal address */
434 % char *r_owner; /* owner of the mapping */
436 %typedef struct rpcb RPCB;
439 % * A list of mappings
443 % struct rpcblist *rpcb_next;
445 %typedef struct rpcblist RPCBLIST;
446 %typedef struct rpcblist *rpcblist_ptr;
449 % * Remote calls arguments
451 %struct rpcb_rmtcallargs {
452 % rpcprog_t prog; /* program number */
453 % rpcvers_t vers; /* version number */
454 % rpcproc_t proc; /* procedure number */
455 % u_int32_t arglen; /* arg len */
456 % caddr_t args_ptr; /* argument */
457 % xdrproc_t xdr_args; /* XDR routine for argument */
459 %typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
462 % * Remote calls results
464 %struct rpcb_rmtcallres {
465 % char *addr_ptr; /* remote universal address */
466 % u_int32_t resultslen; /* results length */
467 % caddr_t results_ptr; /* results */
468 % xdrproc_t xdr_results; /* XDR routine for result */
470 %typedef struct rpcb_rmtcallres rpcb_rmtcallres;
475 % unsigned int r_nc_semantics;
476 % char *r_nc_protofmly;
479 %typedef struct rpcb_entry rpcb_entry;
482 % * A list of addresses supported by a service.
485 %struct rpcb_entry_list {
486 % rpcb_entry rpcb_entry_map;
487 % struct rpcb_entry_list *rpcb_entry_next;
489 %typedef struct rpcb_entry_list rpcb_entry_list;
491 %typedef rpcb_entry_list *rpcb_entry_list_ptr;
494 % * rpcbind statistics
497 %#define rpcb_highproc_2 RPCBPROC_CALLIT
498 %#define rpcb_highproc_3 RPCBPROC_TADDR2UADDR
499 %#define rpcb_highproc_4 RPCBPROC_GETSTAT
500 %#define RPCBSTAT_HIGHPROC 13
501 %#define RPCBVERS_STAT 3
502 %#define RPCBVERS_4_STAT 2
503 %#define RPCBVERS_3_STAT 1
504 %#define RPCBVERS_2_STAT 0
506 %/* Link list of all the stats about getport and getaddr */
508 %struct rpcbs_addrlist {
514 % struct rpcbs_addrlist *next;
516 %typedef struct rpcbs_addrlist rpcbs_addrlist;
518 %/* Link list of all the stats about rmtcall */
520 %struct rpcbs_rmtcalllist {
528 % struct rpcbs_rmtcalllist *next;
530 %typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
532 %typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
534 %typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
536 %typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
542 % rpcbs_addrlist_ptr addrinfo;
543 % rpcbs_rmtcalllist_ptr rmtinfo;
545 %typedef struct rpcb_stat rpcb_stat;
548 % * One rpcb_stat structure is returned for each version of rpcbind
552 %typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
558 %#endif /* ifndef _KERNEL */