4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 % * Copyright (c) 1988,1994 by Sun Microsystems, Inc.
24 % * All rights reserved.
27 %/* from rpcb_prot.x */
31 %#pragma ident "%Z%%M% %I% %E% SMI"
39 * rpcbind protocol, versions 3 and 4, in RPC Language
43 % * The following procedures are supported by the protocol in version 3:
45 % * RPCBPROC_NULL() returns ()
46 % * takes nothing, returns nothing
48 % * RPCBPROC_SET(rpcb) returns (bool_t)
49 % * TRUE is success, FALSE is failure. Registers the tuple
50 % * [prog, vers, address, owner, netid].
51 % * Finds out owner and netid information on its own.
53 % * RPCBPROC_UNSET(rpcb) returns (bool_t)
54 % * TRUE is success, FALSE is failure. Un-registers tuple
55 % * [prog, vers, netid]. addresses is ignored.
56 % * If netid is NULL, unregister all.
58 % * RPCBPROC_GETADDR(rpcb) returns (string).
59 % * 0 is failure. Otherwise returns the universal address where the
60 % * triple [prog, vers, netid] is registered. Ignore address and owner.
62 % * RPCBPROC_DUMP() RETURNS (rpcblist_ptr)
63 % * used to dump the entire rpcbind maps
65 % * RPCBPROC_CALLIT(rpcb_rmtcallargs)
66 % * RETURNS (rpcb_rmtcallres);
67 % * Calls the procedure on the remote machine. If it is not registered,
68 % * this procedure is quiet; i.e. it does not return error information!!!
69 % * This routine only passes null authentication parameters.
70 % * It has no interface to xdr routines for RPCBPROC_CALLIT.
72 % * RPCBPROC_GETTIME() returns (int).
73 % * Gets the remote machines time
75 % * RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf)
76 % * Returns the netbuf address from universal address.
78 % * RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string)
79 % * Returns the universal address from netbuf address.
81 % * END OF RPCBIND VERSION 3 PROCEDURES
84 % * Except for RPCBPROC_CALLIT, the procedures above are carried over to
85 % * rpcbind version 4. Those below are added or modified for version 4.
86 % * NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER
87 % * AS RPCBPROC_CALLIT.
89 % * RPCBPROC_BCAST(rpcb_rmtcallargs)
90 % * RETURNS (rpcb_rmtcallres);
91 % * Calls the procedure on the remote machine. If it is not registered,
92 % * this procedure IS quiet; i.e. it DOES NOT return error information!!!
93 % * This routine should be used for broadcasting and nothing else.
95 % * RPCBPROC_GETVERSADDR(rpcb) returns (string).
96 % * 0 is failure. Otherwise returns the universal address where the
97 % * triple [prog, vers, netid] is registered. Ignore address and owner.
98 % * Same as RPCBPROC_GETADDR except that if the given version number
99 % * is not available, the address is not returned.
101 % * RPCBPROC_INDIRECT(rpcb_rmtcallargs)
102 % * RETURNS (rpcb_rmtcallres);
103 % * Calls the procedure on the remote machine. If it is not registered,
104 % * this procedure is NOT quiet; i.e. it DOES return error information!!!
105 % * as any normal application would expect.
107 % * RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr).
108 % * Same as RPCBPROC_GETADDR except that it returns a list of all the
109 % * addresses registered for the combination (prog, vers) (for all
112 % * RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers)
113 % * Returns the statistics about the kind of requests received by rpcbind.
117 % * A mapping of (program, version, network ID) to address
120 rpcprog_t r_prog; /* program number */
121 rpcvers_t r_vers; /* version number */
122 string r_netid<>; /* network id */
123 string r_addr<>; /* universal address */
124 string r_owner<>; /* owner of this service */
133 % * A list of mappings
135 % * Below are two definitions for the rpcblist structure. This is done because
136 % * xdr_rpcblist() is specified to take a struct rpcblist **, rather than a
137 % * struct rpcblist * that rpcgen would produce. One version of the rpcblist
138 % * structure (actually called rp__list) is used with rpcgen, and the other is
139 % * defined only in the header file for compatibility with the specified
145 struct rp__list *rpcb_next;
148 typedef rp__list *rpcblist_ptr; /* results of RPCBPROC_DUMP */
152 %typedef struct rp__list rpcblist;
153 %typedef struct rp__list RPCBLIST;
158 % struct rpcblist *rpcb_next;
165 %extern bool_t xdr_rpcblist(XDR *, rpcblist**);
174 % * Arguments of remote calls
176 struct rpcb_rmtcallargs {
177 rpcprog_t prog; /* program number */
178 rpcvers_t vers; /* version number */
179 rpcproc_t proc; /* procedure number */
180 opaque args<>; /* argument */
185 % * Client-side only representation of rpcb_rmtcallargs structure.
187 % * The routine that XDRs the rpcb_rmtcallargs structure must deal with the
188 % * opaque arguments in the "args" structure. xdr_rpcb_rmtcallargs() needs to
189 % * be passed the XDR routine that knows the args' structure. This routine
190 % * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
191 % * the application being called already knows the args structure. So we use a
192 % * different "XDR" structure on the client side, r_rpcb_rmtcallargs, which
193 % * includes the args' XDR routine.
195 %struct r_rpcb_rmtcallargs {
203 % xdrproc_t xdr_args; /* encodes args */
206 #endif /* def RPC_HDR */
209 % * Results of the remote call
211 struct rpcb_rmtcallres {
212 string addr<>; /* remote universal address */
213 opaque results<>; /* result */
218 % * Client-side only representation of rpcb_rmtcallres structure.
220 %struct r_rpcb_rmtcallres {
223 % uint32_t results_len;
226 % xdrproc_t xdr_res; /* decodes results */
231 % * rpcb_entry contains a merged address of a service on a particular
232 % * transport, plus associated netconfig information. A list of rpcb_entrys
233 % * is returned by RPCBPROC_GETADDRLIST. See netconfig.h for values used
234 % * in r_nc_* fields.
237 string r_maddr<>; /* merged address of service */
238 string r_nc_netid<>; /* netid field */
239 unsigned int r_nc_semantics; /* semantics of transport */
240 string r_nc_protofmly<>; /* protocol family */
241 string r_nc_proto<>; /* protocol name */
245 % * A list of addresses supported by a service.
247 struct rpcb_entry_list {
248 rpcb_entry rpcb_entry_map;
249 struct rpcb_entry_list *rpcb_entry_next;
252 typedef rpcb_entry_list *rpcb_entry_list_ptr;
256 % * rpcbind statistics
259 const rpcb_highproc_2 = RPCBPROC_CALLIT;
260 const rpcb_highproc_3 = RPCBPROC_TADDR2UADDR;
261 const rpcb_highproc_4 = RPCBPROC_GETSTAT;
263 const RPCBSTAT_HIGHPROC = 13; /* # of procs in rpcbind V4 plus one */
264 const RPCBVERS_STAT = 3; /* provide only for rpcbind V2, V3 and V4 */
265 const RPCBVERS_4_STAT = 2;
266 const RPCBVERS_3_STAT = 1;
267 const RPCBVERS_2_STAT = 0;
269 %/* Link list of all the stats about getport and getaddr */
270 struct rpcbs_addrlist {
276 struct rpcbs_addrlist *next;
279 %/* Link list of all the stats about rmtcall */
280 struct rpcbs_rmtcalllist {
286 int indirect; /* whether callit or indirect */
288 struct rpcbs_rmtcalllist *next;
291 typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
292 typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
293 typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
299 rpcbs_addrlist_ptr addrinfo;
300 rpcbs_rmtcalllist_ptr rmtinfo;
304 % * One rpcb_stat structure is returned for each version of rpcbind
308 typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
313 % * We don't define netbuf in RPCL, since it would contain structure member
314 % * names that would conflict with the definition of struct netbuf in
315 % * <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here,
316 % * and implement it ourselves in rpc/rpcb_prot.c.
319 %extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *);
322 %extern bool_t xdr_netbuf(XDR *, struct netbuf *);
325 #endif /* def RPC_HDR */
333 RPCBPROC_SET(rpcb) = 1;
336 RPCBPROC_UNSET(rpcb) = 2;
339 RPCBPROC_GETADDR(rpcb) = 3;
342 RPCBPROC_DUMP(void) = 4;
345 RPCBPROC_CALLIT(rpcb_rmtcallargs) = 5;
348 RPCBPROC_GETTIME(void) = 6;
351 RPCBPROC_UADDR2TADDR(string) = 7;
354 RPCBPROC_TADDR2UADDR(struct netbuf) = 8;
359 RPCBPROC_SET(rpcb) = 1;
362 RPCBPROC_UNSET(rpcb) = 2;
365 RPCBPROC_GETADDR(rpcb) = 3;
368 RPCBPROC_DUMP(void) = 4;
371 * NOTE: RPCBPROC_BCAST has the same functionality as CALLIT;
372 * the new name is intended to indicate that this
373 * procedure should be used for broadcast RPC, and
374 * RPCBPROC_INDIRECT should be used for indirect calls.
377 RPCBPROC_BCAST(rpcb_rmtcallargs) = RPCBPROC_CALLIT;
380 RPCBPROC_GETTIME(void) = 6;
383 RPCBPROC_UADDR2TADDR(string) = 7;
386 RPCBPROC_TADDR2UADDR(struct netbuf) = 8;
389 RPCBPROC_GETVERSADDR(rpcb) = 9;
392 RPCBPROC_INDIRECT(rpcb_rmtcallargs) = 10;
395 RPCBPROC_GETADDRLIST(rpcb) = 11;
398 RPCBPROC_GETSTAT(void) = 12;
403 %#define RPCBVERS_3 RPCBVERS
404 %#define RPCBVERS_4 RPCBVERS4
406 %#else /* ndef _KERNEL */
412 % * A mapping of (program, version, network ID) to address
415 % rpcprog_t r_prog; /* program number */
416 % rpcvers_t r_vers; /* version number */
417 % char *r_netid; /* network id */
418 % char *r_addr; /* universal address */
419 % char *r_owner; /* owner of the mapping */
421 %typedef struct rpcb RPCB;
424 % * A list of mappings
428 % struct rpcblist *rpcb_next;
430 %typedef struct rpcblist RPCBLIST;
431 %typedef struct rpcblist *rpcblist_ptr;
434 % * Remote calls arguments
436 %struct rpcb_rmtcallargs {
437 % rpcprog_t prog; /* program number */
438 % rpcvers_t vers; /* version number */
439 % rpcproc_t proc; /* procedure number */
440 % unsigned int arglen; /* arg len */
441 % caddr_t args_ptr; /* argument */
442 % xdrproc_t xdr_args; /* XDR routine for argument */
444 %typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
447 % * Remote calls results
449 %struct rpcb_rmtcallres {
450 % char *addr_ptr; /* remote universal address */
451 % uint32_t resultslen; /* results length */
452 % caddr_t results_ptr; /* results */
453 % xdrproc_t xdr_results; /* XDR routine for result */
455 %typedef struct rpcb_rmtcallres rpcb_rmtcallres;
460 % unsigned int r_nc_semantics;
461 % char *r_nc_protofmly;
464 %typedef struct rpcb_entry rpcb_entry;
467 % * A list of addresses supported by a service.
470 %struct rpcb_entry_list {
471 % rpcb_entry rpcb_entry_map;
472 % struct rpcb_entry_list *rpcb_entry_next;
474 %typedef struct rpcb_entry_list rpcb_entry_list;
476 %typedef rpcb_entry_list *rpcb_entry_list_ptr;
479 % * rpcbind statistics
482 %#define rpcb_highproc_2 RPCBPROC_CALLIT
483 %#define rpcb_highproc_3 RPCBPROC_TADDR2UADDR
484 %#define rpcb_highproc_4 RPCBPROC_GETSTAT
485 %#define RPCBSTAT_HIGHPROC 13
486 %#define RPCBVERS_STAT 3
487 %#define RPCBVERS_4_STAT 2
488 %#define RPCBVERS_3_STAT 1
489 %#define RPCBVERS_2_STAT 0
491 %/* Link list of all the stats about getport and getaddr */
493 %struct rpcbs_addrlist {
499 % struct rpcbs_addrlist *next;
501 %typedef struct rpcbs_addrlist rpcbs_addrlist;
503 %/* Link list of all the stats about rmtcall */
505 %struct rpcbs_rmtcalllist {
513 % struct rpcbs_rmtcalllist *next;
515 %typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
517 %typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
519 %typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
521 %typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
527 % rpcbs_addrlist_ptr addrinfo;
528 % rpcbs_rmtcalllist_ptr rmtinfo;
530 %typedef struct rpcb_stat rpcb_stat;
533 % * One rpcb_stat structure is returned for each version of rpcbind
537 %typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
539 %extern bool_t xdr_netbuf(XDR *, struct netbuf *);
545 %#endif /* ndef _KERNEL */