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