2 % * $FreeBSD: src/include/rpc/rpcb_prot.x,v 1.3 2002/03/13 10:29:06 obrien Exp $
5 % * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
6 % * unrestricted use provided that this legend is included on all tape
7 % * media and as a part of the software program in whole or part. Users
8 % * may copy or modify Sun RPC without charge, but are not authorized
9 % * to license or distribute it to anyone else except as part of a product or
10 % * program developed by the user.
12 % * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
13 % * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
14 % * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 % * Sun RPC is provided with no support and without any obligation on the
17 % * part of Sun Microsystems, Inc. to assist in its use, correction,
18 % * modification or enhancement.
20 % * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
21 % * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
22 % * OR ANY PART THEREOF.
24 % * In no event will Sun Microsystems, Inc. be liable for any lost revenue
25 % * or profits or other special, indirect and consequential damages, even if
26 % * Sun has been advised of the possibility of such damages.
28 % * Sun Microsystems, Inc.
29 % * 2550 Garcia Avenue
30 % * Mountain View, California 94043
33 % * Copyright (c) 1988 by Sun Microsystems, Inc.
36 %/* from rpcb_prot.x */
40 %/* #pragma ident "@(#)rpcb_prot.x 1.5 94/04/29 SMI" */
48 * rpcbind protocol, versions 3 and 4, in RPC Language
52 % * The following procedures are supported by the protocol in version 3:
54 % * RPCBPROC_NULL() returns ()
55 % * takes nothing, returns nothing
57 % * RPCBPROC_SET(rpcb) returns (bool_t)
58 % * TRUE is success, FALSE is failure. Registers the tuple
59 % * [prog, vers, address, owner, netid].
60 % * Finds out owner and netid information on its own.
62 % * RPCBPROC_UNSET(rpcb) returns (bool_t)
63 % * TRUE is success, FALSE is failure. Un-registers tuple
64 % * [prog, vers, netid]. addresses is ignored.
65 % * If netid is NULL, unregister all.
67 % * RPCBPROC_GETADDR(rpcb) returns (string).
68 % * 0 is failure. Otherwise returns the universal address where the
69 % * triple [prog, vers, netid] is registered. Ignore address and owner.
71 % * RPCBPROC_DUMP() RETURNS (rpcblist_ptr)
72 % * used to dump the entire rpcbind maps
74 % * RPCBPROC_CALLIT(rpcb_rmtcallargs)
75 % * RETURNS (rpcb_rmtcallres);
76 % * Calls the procedure on the remote machine. If it is not registered,
77 % * this procedure is quiet; i.e. it does not return error information!!!
78 % * This routine only passes null authentication parameters.
79 % * It has no interface to xdr routines for RPCBPROC_CALLIT.
81 % * RPCBPROC_GETTIME() returns (int).
82 % * Gets the remote machines time
84 % * RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf)
85 % * Returns the netbuf address from universal address.
87 % * RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string)
88 % * Returns the universal address from netbuf address.
90 % * END OF RPCBIND VERSION 3 PROCEDURES
93 % * Except for RPCBPROC_CALLIT, the procedures above are carried over to
94 % * rpcbind version 4. Those below are added or modified for version 4.
95 % * NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER
96 % * AS RPCBPROC_CALLIT.
98 % * RPCBPROC_BCAST(rpcb_rmtcallargs)
99 % * RETURNS (rpcb_rmtcallres);
100 % * Calls the procedure on the remote machine. If it is not registered,
101 % * this procedure IS quiet; i.e. it DOES NOT return error information!!!
102 % * This routine should be used for broadcasting and nothing else.
104 % * RPCBPROC_GETVERSADDR(rpcb) returns (string).
105 % * 0 is failure. Otherwise returns the universal address where the
106 % * triple [prog, vers, netid] is registered. Ignore address and owner.
107 % * Same as RPCBPROC_GETADDR except that if the given version number
108 % * is not available, the address is not returned.
110 % * RPCBPROC_INDIRECT(rpcb_rmtcallargs)
111 % * RETURNS (rpcb_rmtcallres);
112 % * Calls the procedure on the remote machine. If it is not registered,
113 % * this procedure is NOT quiet; i.e. it DOES return error information!!!
114 % * as any normal application would expect.
116 % * RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr).
117 % * Same as RPCBPROC_GETADDR except that it returns a list of all the
118 % * addresses registered for the combination (prog, vers) (for all
121 % * RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers)
122 % * Returns the statistics about the kind of requests received by rpcbind.
126 % * A mapping of (program, version, network ID) to address
129 rpcprog_t r_prog; /* program number */
130 rpcvers_t r_vers; /* version number */
131 string r_netid<>; /* network id */
132 string r_addr<>; /* universal address */
133 string r_owner<>; /* owner of this service */
142 % * A list of mappings
144 % * Below are two definitions for the rpcblist structure. This is done because
145 % * xdr_rpcblist() is specified to take a struct rpcblist **, rather than a
146 % * struct rpcblist * that rpcgen would produce. One version of the rpcblist
147 % * structure (actually called rp__list) is used with rpcgen, and the other is
148 % * defined only in the header file for compatibility with the specified
154 struct rp__list *rpcb_next;
157 typedef rp__list *rpcblist_ptr; /* results of RPCBPROC_DUMP */
161 %typedef struct rp__list rpcblist;
162 %typedef struct rp__list RPCBLIST;
167 % struct rpcblist *rpcb_next;
174 %extern bool_t xdr_rpcblist(XDR *, rpcblist**);
183 % * Arguments of remote calls
185 struct rpcb_rmtcallargs {
186 rpcprog_t prog; /* program number */
187 rpcvers_t vers; /* version number */
188 rpcproc_t proc; /* procedure number */
189 opaque args<>; /* argument */
194 % * Client-side only representation of rpcb_rmtcallargs structure.
196 % * The routine that XDRs the rpcb_rmtcallargs structure must deal with the
197 % * opaque arguments in the "args" structure. xdr_rpcb_rmtcallargs() needs to
198 % * be passed the XDR routine that knows the args' structure. This routine
199 % * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
200 % * the application being called already knows the args structure. So we use a
201 % * different "XDR" structure on the client side, r_rpcb_rmtcallargs, which
202 % * includes the args' XDR routine.
204 %struct r_rpcb_rmtcallargs {
212 % xdrproc_t xdr_args; /* encodes args */
215 #endif /* def RPC_HDR */
218 % * Results of the remote call
220 struct rpcb_rmtcallres {
221 string addr<>; /* remote universal address */
222 opaque results<>; /* result */
227 % * Client-side only representation of rpcb_rmtcallres structure.
229 %struct r_rpcb_rmtcallres {
232 % u_int32_t results_len;
235 % xdrproc_t xdr_res; /* decodes results */
240 % * rpcb_entry contains a merged address of a service on a particular
241 % * transport, plus associated netconfig information. A list of rpcb_entrys
242 % * is returned by RPCBPROC_GETADDRLIST. See netconfig.h for values used
243 % * in r_nc_* fields.
246 string r_maddr<>; /* merged address of service */
247 string r_nc_netid<>; /* netid field */
248 unsigned int r_nc_semantics; /* semantics of transport */
249 string r_nc_protofmly<>; /* protocol family */
250 string r_nc_proto<>; /* protocol name */
254 % * A list of addresses supported by a service.
256 struct rpcb_entry_list {
257 rpcb_entry rpcb_entry_map;
258 struct rpcb_entry_list *rpcb_entry_next;
261 typedef rpcb_entry_list *rpcb_entry_list_ptr;
265 % * rpcbind statistics
268 const rpcb_highproc_2 = RPCBPROC_CALLIT;
269 const rpcb_highproc_3 = RPCBPROC_TADDR2UADDR;
270 const rpcb_highproc_4 = RPCBPROC_GETSTAT;
272 const RPCBSTAT_HIGHPROC = 13; /* # of procs in rpcbind V4 plus one */
273 const RPCBVERS_STAT = 3; /* provide only for rpcbind V2, V3 and V4 */
274 const RPCBVERS_4_STAT = 2;
275 const RPCBVERS_3_STAT = 1;
276 const RPCBVERS_2_STAT = 0;
278 %/* Link list of all the stats about getport and getaddr */
279 struct rpcbs_addrlist {
285 struct rpcbs_addrlist *next;
288 %/* Link list of all the stats about rmtcall */
289 struct rpcbs_rmtcalllist {
295 int indirect; /* whether callit or indirect */
297 struct rpcbs_rmtcalllist *next;
300 typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
301 typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
302 typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
308 rpcbs_addrlist_ptr addrinfo;
309 rpcbs_rmtcalllist_ptr rmtinfo;
313 % * One rpcb_stat structure is returned for each version of rpcbind
317 typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
322 % * We don't define netbuf in RPCL, since it would contain structure member
323 % * names that would conflict with the definition of struct netbuf in
324 % * <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here,
325 % * and implement it ourselves in rpc/rpcb_prot.c.
328 %extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *);
330 %#else /* __STDC__ */
331 %extern bool_t xdr_netbuf(XDR *, struct netbuf *);
334 #endif /* def RPC_HDR */
342 RPCBPROC_SET(rpcb) = 1;
345 RPCBPROC_UNSET(rpcb) = 2;
348 RPCBPROC_GETADDR(rpcb) = 3;
351 RPCBPROC_DUMP(void) = 4;
354 RPCBPROC_CALLIT(rpcb_rmtcallargs) = 5;
357 RPCBPROC_GETTIME(void) = 6;
360 RPCBPROC_UADDR2TADDR(string) = 7;
363 RPCBPROC_TADDR2UADDR(struct netbuf) = 8;
368 RPCBPROC_SET(rpcb) = 1;
371 RPCBPROC_UNSET(rpcb) = 2;
374 RPCBPROC_GETADDR(rpcb) = 3;
377 RPCBPROC_DUMP(void) = 4;
380 * NOTE: RPCBPROC_BCAST has the same functionality as CALLIT;
381 * the new name is intended to indicate that this
382 * procedure should be used for broadcast RPC, and
383 * RPCBPROC_INDIRECT should be used for indirect calls.
386 RPCBPROC_BCAST(rpcb_rmtcallargs) = RPCBPROC_CALLIT;
389 RPCBPROC_GETTIME(void) = 6;
392 RPCBPROC_UADDR2TADDR(string) = 7;
395 RPCBPROC_TADDR2UADDR(struct netbuf) = 8;
398 RPCBPROC_GETVERSADDR(rpcb) = 9;
401 RPCBPROC_INDIRECT(rpcb_rmtcallargs) = 10;
404 RPCBPROC_GETADDRLIST(rpcb) = 11;
407 RPCBPROC_GETSTAT(void) = 12;
412 %#define RPCBVERS_3 RPCBVERS
413 %#define RPCBVERS_4 RPCBVERS4
415 %#define _PATH_RPCBINDSOCK "/var/run/rpcbind.sock"
417 %#else /* ndef _KERNEL */
423 % * A mapping of (program, version, network ID) to address
426 % rpcprog_t r_prog; /* program number */
427 % rpcvers_t r_vers; /* version number */
428 % char *r_netid; /* network id */
429 % char *r_addr; /* universal address */
430 % char *r_owner; /* owner of the mapping */
432 %typedef struct rpcb RPCB;
435 % * A list of mappings
439 % struct rpcblist *rpcb_next;
441 %typedef struct rpcblist RPCBLIST;
442 %typedef struct rpcblist *rpcblist_ptr;
445 % * Remote calls arguments
447 %struct rpcb_rmtcallargs {
448 % rpcprog_t prog; /* program number */
449 % rpcvers_t vers; /* version number */
450 % rpcproc_t proc; /* procedure number */
451 % u_int32_t arglen; /* arg len */
452 % caddr_t args_ptr; /* argument */
453 % xdrproc_t xdr_args; /* XDR routine for argument */
455 %typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
458 % * Remote calls results
460 %struct rpcb_rmtcallres {
461 % char *addr_ptr; /* remote universal address */
462 % u_int32_t resultslen; /* results length */
463 % caddr_t results_ptr; /* results */
464 % xdrproc_t xdr_results; /* XDR routine for result */
466 %typedef struct rpcb_rmtcallres rpcb_rmtcallres;
471 % unsigned int r_nc_semantics;
472 % char *r_nc_protofmly;
475 %typedef struct rpcb_entry rpcb_entry;
478 % * A list of addresses supported by a service.
481 %struct rpcb_entry_list {
482 % rpcb_entry rpcb_entry_map;
483 % struct rpcb_entry_list *rpcb_entry_next;
485 %typedef struct rpcb_entry_list rpcb_entry_list;
487 %typedef rpcb_entry_list *rpcb_entry_list_ptr;
490 % * rpcbind statistics
493 %#define rpcb_highproc_2 RPCBPROC_CALLIT
494 %#define rpcb_highproc_3 RPCBPROC_TADDR2UADDR
495 %#define rpcb_highproc_4 RPCBPROC_GETSTAT
496 %#define RPCBSTAT_HIGHPROC 13
497 %#define RPCBVERS_STAT 3
498 %#define RPCBVERS_4_STAT 2
499 %#define RPCBVERS_3_STAT 1
500 %#define RPCBVERS_2_STAT 0
502 %/* Link list of all the stats about getport and getaddr */
504 %struct rpcbs_addrlist {
510 % struct rpcbs_addrlist *next;
512 %typedef struct rpcbs_addrlist rpcbs_addrlist;
514 %/* Link list of all the stats about rmtcall */
516 %struct rpcbs_rmtcalllist {
524 % struct rpcbs_rmtcalllist *next;
526 %typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
528 %typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
530 %typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
532 %typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
538 % rpcbs_addrlist_ptr addrinfo;
539 % rpcbs_rmtcalllist_ptr rmtinfo;
541 %typedef struct rpcb_stat rpcb_stat;
544 % * One rpcb_stat structure is returned for each version of rpcbind
548 %typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
554 %#endif /* ndef _KERNEL */