2 * Please do not edit this file.
3 * It was generated using rpcgen.
6 #ifndef _RPCB_PROT_H_RPCGEN
7 #define _RPCB_PROT_H_RPCGEN
17 * $FreeBSD: src/include/rpc/rpcb_prot.x,v 1.3 2002/03/13 10:29:06 obrien Exp $
19 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
20 * unrestricted use provided that this legend is included on all tape
21 * media and as a part of the software program in whole or part. Users
22 * may copy or modify Sun RPC without charge, but are not authorized
23 * to license or distribute it to anyone else except as part of a product or
24 * program developed by the user.
26 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
27 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
30 * Sun RPC is provided with no support and without any obligation on the
31 * part of Sun Microsystems, Inc. to assist in its use, correction,
32 * modification or enhancement.
34 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
35 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
36 * OR ANY PART THEREOF.
38 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
39 * or profits or other special, indirect and consequential damages, even if
40 * Sun has been advised of the possibility of such damages.
42 * Sun Microsystems, Inc.
44 * Mountain View, California 94043
47 * Copyright (c) 1988 by Sun Microsystems, Inc.
49 /* from rpcb_prot.x */
51 /* #pragma ident "@(#)rpcb_prot.x 1.5 94/04/29 SMI" */
57 * The following procedures are supported by the protocol in version 3:
59 * RPCBPROC_NULL() returns ()
60 * takes nothing, returns nothing
62 * RPCBPROC_SET(rpcb) returns (bool_t)
63 * TRUE is success, FALSE is failure. Registers the tuple
64 * [prog, vers, address, owner, netid].
65 * Finds out owner and netid information on its own.
67 * RPCBPROC_UNSET(rpcb) returns (bool_t)
68 * TRUE is success, FALSE is failure. Un-registers tuple
69 * [prog, vers, netid]. addresses is ignored.
70 * If netid is NULL, unregister all.
72 * RPCBPROC_GETADDR(rpcb) returns (string).
73 * 0 is failure. Otherwise returns the universal address where the
74 * triple [prog, vers, netid] is registered. Ignore address and owner.
76 * RPCBPROC_DUMP() RETURNS (rpcblist_ptr)
77 * used to dump the entire rpcbind maps
79 * RPCBPROC_CALLIT(rpcb_rmtcallargs)
80 * RETURNS (rpcb_rmtcallres);
81 * Calls the procedure on the remote machine. If it is not registered,
82 * this procedure is quiet; i.e. it does not return error information!!!
83 * This routine only passes null authentication parameters.
84 * It has no interface to xdr routines for RPCBPROC_CALLIT.
86 * RPCBPROC_GETTIME() returns (int).
87 * Gets the remote machines time
89 * RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf)
90 * Returns the netbuf address from universal address.
92 * RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string)
93 * Returns the universal address from netbuf address.
95 * END OF RPCBIND VERSION 3 PROCEDURES
98 * Except for RPCBPROC_CALLIT, the procedures above are carried over to
99 * rpcbind version 4. Those below are added or modified for version 4.
100 * NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER
101 * AS RPCBPROC_CALLIT.
103 * RPCBPROC_BCAST(rpcb_rmtcallargs)
104 * RETURNS (rpcb_rmtcallres);
105 * Calls the procedure on the remote machine. If it is not registered,
106 * this procedure IS quiet; i.e. it DOES NOT return error information!!!
107 * This routine should be used for broadcasting and nothing else.
109 * RPCBPROC_GETVERSADDR(rpcb) returns (string).
110 * 0 is failure. Otherwise returns the universal address where the
111 * triple [prog, vers, netid] is registered. Ignore address and owner.
112 * Same as RPCBPROC_GETADDR except that if the given version number
113 * is not available, the address is not returned.
115 * RPCBPROC_INDIRECT(rpcb_rmtcallargs)
116 * RETURNS (rpcb_rmtcallres);
117 * Calls the procedure on the remote machine. If it is not registered,
118 * this procedure is NOT quiet; i.e. it DOES return error information!!!
119 * as any normal application would expect.
121 * RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr).
122 * Same as RPCBPROC_GETADDR except that it returns a list of all the
123 * addresses registered for the combination (prog, vers) (for all
126 * RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers)
127 * Returns the statistics about the kind of requests received by rpcbind.
131 * A mapping of (program, version, network ID) to address
141 typedef struct rpcb rpcb;
149 * Below are two definitions for the rpcblist structure. This is done because
150 * xdr_rpcblist() is specified to take a struct rpcblist **, rather than a
151 * struct rpcblist * that rpcgen would produce. One version of the rpcblist
152 * structure (actually called rp__list) is used with rpcgen, and the other is
153 * defined only in the header file for compatibility with the specified
159 struct rp__list *rpcb_next;
161 typedef struct rp__list rp__list;
163 typedef rp__list *rpcblist_ptr;
165 typedef struct rp__list rpcblist;
166 typedef struct rp__list RPCBLIST;
171 struct rpcblist *rpcb_next;
178 extern bool_t xdr_rpcblist(XDR *, rpcblist**);
185 * Arguments of remote calls
188 struct rpcb_rmtcallargs {
197 typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
200 * Client-side only representation of rpcb_rmtcallargs structure.
202 * The routine that XDRs the rpcb_rmtcallargs structure must deal with the
203 * opaque arguments in the "args" structure. xdr_rpcb_rmtcallargs() needs to
204 * be passed the XDR routine that knows the args' structure. This routine
205 * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
206 * the application being called already knows the args structure. So we use a
207 * different "XDR" structure on the client side, r_rpcb_rmtcallargs, which
208 * includes the args' XDR routine.
210 struct r_rpcb_rmtcallargs {
218 xdrproc_t xdr_args; /* encodes args */
223 * Results of the remote call
226 struct rpcb_rmtcallres {
233 typedef struct rpcb_rmtcallres rpcb_rmtcallres;
236 * Client-side only representation of rpcb_rmtcallres structure.
238 struct r_rpcb_rmtcallres {
241 u_int32_t results_len;
244 xdrproc_t xdr_res; /* decodes results */
248 * rpcb_entry contains a merged address of a service on a particular
249 * transport, plus associated netconfig information. A list of rpcb_entrys
250 * is returned by RPCBPROC_GETADDRLIST. See netconfig.h for values used
257 u_int r_nc_semantics;
258 char *r_nc_protofmly;
261 typedef struct rpcb_entry rpcb_entry;
264 * A list of addresses supported by a service.
267 struct rpcb_entry_list {
268 rpcb_entry rpcb_entry_map;
269 struct rpcb_entry_list *rpcb_entry_next;
271 typedef struct rpcb_entry_list rpcb_entry_list;
273 typedef rpcb_entry_list *rpcb_entry_list_ptr;
279 #define rpcb_highproc_2 RPCBPROC_CALLIT
280 #define rpcb_highproc_3 RPCBPROC_TADDR2UADDR
281 #define rpcb_highproc_4 RPCBPROC_GETSTAT
282 #define RPCBSTAT_HIGHPROC 13
283 #define RPCBVERS_STAT 3
284 #define RPCBVERS_4_STAT 2
285 #define RPCBVERS_3_STAT 1
286 #define RPCBVERS_2_STAT 0
288 /* Link list of all the stats about getport and getaddr */
290 struct rpcbs_addrlist {
296 struct rpcbs_addrlist *next;
298 typedef struct rpcbs_addrlist rpcbs_addrlist;
300 /* Link list of all the stats about rmtcall */
302 struct rpcbs_rmtcalllist {
310 struct rpcbs_rmtcalllist *next;
312 typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
314 typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
316 typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
318 typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
324 rpcbs_addrlist_ptr addrinfo;
325 rpcbs_rmtcalllist_ptr rmtinfo;
327 typedef struct rpcb_stat rpcb_stat;
330 * One rpcb_stat structure is returned for each version of rpcbind
334 typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
337 * We don't define netbuf in RPCL, since it would contain structure member
338 * names that would conflict with the definition of struct netbuf in
339 * <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here,
340 * and implement it ourselves in rpc/rpcb_prot.c.
343 extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *);
346 extern bool_t xdr_netbuf(XDR *, struct netbuf *);
350 #define RPCBVERS_3 RPCBVERS
351 #define RPCBVERS_4 RPCBVERS4
353 #define _PATH_RPCBINDSOCK "/var/run/rpcbind.sock"
355 #else /* ndef _KERNEL */
361 * A mapping of (program, version, network ID) to address
364 rpcprog_t r_prog; /* program number */
365 rpcvers_t r_vers; /* version number */
366 char *r_netid; /* network id */
367 char *r_addr; /* universal address */
368 char *r_owner; /* owner of the mapping */
370 typedef struct rpcb RPCB;
377 struct rpcblist *rpcb_next;
379 typedef struct rpcblist RPCBLIST;
380 typedef struct rpcblist *rpcblist_ptr;
383 * Remote calls arguments
385 struct rpcb_rmtcallargs {
386 rpcprog_t prog; /* program number */
387 rpcvers_t vers; /* version number */
388 rpcproc_t proc; /* procedure number */
389 u_int32_t arglen; /* arg len */
390 caddr_t args_ptr; /* argument */
391 xdrproc_t xdr_args; /* XDR routine for argument */
393 typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
396 * Remote calls results
398 struct rpcb_rmtcallres {
399 char *addr_ptr; /* remote universal address */
400 u_int32_t resultslen; /* results length */
401 caddr_t results_ptr; /* results */
402 xdrproc_t xdr_results; /* XDR routine for result */
404 typedef struct rpcb_rmtcallres rpcb_rmtcallres;
409 unsigned int r_nc_semantics;
410 char *r_nc_protofmly;
413 typedef struct rpcb_entry rpcb_entry;
416 * A list of addresses supported by a service.
419 struct rpcb_entry_list {
420 rpcb_entry rpcb_entry_map;
421 struct rpcb_entry_list *rpcb_entry_next;
423 typedef struct rpcb_entry_list rpcb_entry_list;
425 typedef rpcb_entry_list *rpcb_entry_list_ptr;
431 #define rpcb_highproc_2 RPCBPROC_CALLIT
432 #define rpcb_highproc_3 RPCBPROC_TADDR2UADDR
433 #define rpcb_highproc_4 RPCBPROC_GETSTAT
434 #define RPCBSTAT_HIGHPROC 13
435 #define RPCBVERS_STAT 3
436 #define RPCBVERS_4_STAT 2
437 #define RPCBVERS_3_STAT 1
438 #define RPCBVERS_2_STAT 0
440 /* Link list of all the stats about getport and getaddr */
442 struct rpcbs_addrlist {
448 struct rpcbs_addrlist *next;
450 typedef struct rpcbs_addrlist rpcbs_addrlist;
452 /* Link list of all the stats about rmtcall */
454 struct rpcbs_rmtcalllist {
462 struct rpcbs_rmtcalllist *next;
464 typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
466 typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
468 typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
470 typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
476 rpcbs_addrlist_ptr addrinfo;
477 rpcbs_rmtcalllist_ptr rmtinfo;
479 typedef struct rpcb_stat rpcb_stat;
482 * One rpcb_stat structure is returned for each version of rpcbind
486 typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
492 #endif /* ndef _KERNEL */
494 #define RPCBPROG 100000
497 #if defined(__STDC__) || defined(__cplusplus)
498 #define RPCBPROC_SET 1
499 extern bool_t * rpcbproc_set_3(rpcb *, CLIENT *);
500 extern bool_t * rpcbproc_set_3_svc(rpcb *, struct svc_req *);
501 #define RPCBPROC_UNSET 2
502 extern bool_t * rpcbproc_unset_3(rpcb *, CLIENT *);
503 extern bool_t * rpcbproc_unset_3_svc(rpcb *, struct svc_req *);
504 #define RPCBPROC_GETADDR 3
505 extern char ** rpcbproc_getaddr_3(rpcb *, CLIENT *);
506 extern char ** rpcbproc_getaddr_3_svc(rpcb *, struct svc_req *);
507 #define RPCBPROC_DUMP 4
508 extern rpcblist_ptr * rpcbproc_dump_3(void *, CLIENT *);
509 extern rpcblist_ptr * rpcbproc_dump_3_svc(void *, struct svc_req *);
510 #define RPCBPROC_CALLIT 5
511 extern rpcb_rmtcallres * rpcbproc_callit_3(rpcb_rmtcallargs *, CLIENT *);
512 extern rpcb_rmtcallres * rpcbproc_callit_3_svc(rpcb_rmtcallargs *, struct svc_req *);
513 #define RPCBPROC_GETTIME 6
514 extern u_int * rpcbproc_gettime_3(void *, CLIENT *);
515 extern u_int * rpcbproc_gettime_3_svc(void *, struct svc_req *);
516 #define RPCBPROC_UADDR2TADDR 7
517 extern struct netbuf * rpcbproc_uaddr2taddr_3(char **, CLIENT *);
518 extern struct netbuf * rpcbproc_uaddr2taddr_3_svc(char **, struct svc_req *);
519 #define RPCBPROC_TADDR2UADDR 8
520 extern char ** rpcbproc_taddr2uaddr_3(struct netbuf *, CLIENT *);
521 extern char ** rpcbproc_taddr2uaddr_3_svc(struct netbuf *, struct svc_req *);
522 extern int rpcbprog_3_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
525 #define RPCBPROC_SET 1
526 extern bool_t * rpcbproc_set_3();
527 extern bool_t * rpcbproc_set_3_svc();
528 #define RPCBPROC_UNSET 2
529 extern bool_t * rpcbproc_unset_3();
530 extern bool_t * rpcbproc_unset_3_svc();
531 #define RPCBPROC_GETADDR 3
532 extern char ** rpcbproc_getaddr_3();
533 extern char ** rpcbproc_getaddr_3_svc();
534 #define RPCBPROC_DUMP 4
535 extern rpcblist_ptr * rpcbproc_dump_3();
536 extern rpcblist_ptr * rpcbproc_dump_3_svc();
537 #define RPCBPROC_CALLIT 5
538 extern rpcb_rmtcallres * rpcbproc_callit_3();
539 extern rpcb_rmtcallres * rpcbproc_callit_3_svc();
540 #define RPCBPROC_GETTIME 6
541 extern u_int * rpcbproc_gettime_3();
542 extern u_int * rpcbproc_gettime_3_svc();
543 #define RPCBPROC_UADDR2TADDR 7
544 extern struct netbuf * rpcbproc_uaddr2taddr_3();
545 extern struct netbuf * rpcbproc_uaddr2taddr_3_svc();
546 #define RPCBPROC_TADDR2UADDR 8
547 extern char ** rpcbproc_taddr2uaddr_3();
548 extern char ** rpcbproc_taddr2uaddr_3_svc();
549 extern int rpcbprog_3_freeresult ();
553 #if defined(__STDC__) || defined(__cplusplus)
554 extern bool_t * rpcbproc_set_4(rpcb *, CLIENT *);
555 extern bool_t * rpcbproc_set_4_svc(rpcb *, struct svc_req *);
556 extern bool_t * rpcbproc_unset_4(rpcb *, CLIENT *);
557 extern bool_t * rpcbproc_unset_4_svc(rpcb *, struct svc_req *);
558 extern char ** rpcbproc_getaddr_4(rpcb *, CLIENT *);
559 extern char ** rpcbproc_getaddr_4_svc(rpcb *, struct svc_req *);
560 extern rpcblist_ptr * rpcbproc_dump_4(void *, CLIENT *);
561 extern rpcblist_ptr * rpcbproc_dump_4_svc(void *, struct svc_req *);
562 #define RPCBPROC_BCAST RPCBPROC_CALLIT
563 extern rpcb_rmtcallres * rpcbproc_bcast_4(rpcb_rmtcallargs *, CLIENT *);
564 extern rpcb_rmtcallres * rpcbproc_bcast_4_svc(rpcb_rmtcallargs *, struct svc_req *);
565 extern u_int * rpcbproc_gettime_4(void *, CLIENT *);
566 extern u_int * rpcbproc_gettime_4_svc(void *, struct svc_req *);
567 extern struct netbuf * rpcbproc_uaddr2taddr_4(char **, CLIENT *);
568 extern struct netbuf * rpcbproc_uaddr2taddr_4_svc(char **, struct svc_req *);
569 extern char ** rpcbproc_taddr2uaddr_4(struct netbuf *, CLIENT *);
570 extern char ** rpcbproc_taddr2uaddr_4_svc(struct netbuf *, struct svc_req *);
571 #define RPCBPROC_GETVERSADDR 9
572 extern char ** rpcbproc_getversaddr_4(rpcb *, CLIENT *);
573 extern char ** rpcbproc_getversaddr_4_svc(rpcb *, struct svc_req *);
574 #define RPCBPROC_INDIRECT 10
575 extern rpcb_rmtcallres * rpcbproc_indirect_4(rpcb_rmtcallargs *, CLIENT *);
576 extern rpcb_rmtcallres * rpcbproc_indirect_4_svc(rpcb_rmtcallargs *, struct svc_req *);
577 #define RPCBPROC_GETADDRLIST 11
578 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4(rpcb *, CLIENT *);
579 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4_svc(rpcb *, struct svc_req *);
580 #define RPCBPROC_GETSTAT 12
581 extern rpcb_stat * rpcbproc_getstat_4(void *, CLIENT *);
582 extern rpcb_stat * rpcbproc_getstat_4_svc(void *, struct svc_req *);
583 extern int rpcbprog_4_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
586 extern bool_t * rpcbproc_set_4();
587 extern bool_t * rpcbproc_set_4_svc();
588 extern bool_t * rpcbproc_unset_4();
589 extern bool_t * rpcbproc_unset_4_svc();
590 extern char ** rpcbproc_getaddr_4();
591 extern char ** rpcbproc_getaddr_4_svc();
592 extern rpcblist_ptr * rpcbproc_dump_4();
593 extern rpcblist_ptr * rpcbproc_dump_4_svc();
594 #define RPCBPROC_BCAST RPCBPROC_CALLIT
595 extern rpcb_rmtcallres * rpcbproc_bcast_4();
596 extern rpcb_rmtcallres * rpcbproc_bcast_4_svc();
597 extern u_int * rpcbproc_gettime_4();
598 extern u_int * rpcbproc_gettime_4_svc();
599 extern struct netbuf * rpcbproc_uaddr2taddr_4();
600 extern struct netbuf * rpcbproc_uaddr2taddr_4_svc();
601 extern char ** rpcbproc_taddr2uaddr_4();
602 extern char ** rpcbproc_taddr2uaddr_4_svc();
603 #define RPCBPROC_GETVERSADDR 9
604 extern char ** rpcbproc_getversaddr_4();
605 extern char ** rpcbproc_getversaddr_4_svc();
606 #define RPCBPROC_INDIRECT 10
607 extern rpcb_rmtcallres * rpcbproc_indirect_4();
608 extern rpcb_rmtcallres * rpcbproc_indirect_4_svc();
609 #define RPCBPROC_GETADDRLIST 11
610 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4();
611 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4_svc();
612 #define RPCBPROC_GETSTAT 12
613 extern rpcb_stat * rpcbproc_getstat_4();
614 extern rpcb_stat * rpcbproc_getstat_4_svc();
615 extern int rpcbprog_4_freeresult ();
618 /* the xdr functions */
620 #if defined(__STDC__) || defined(__cplusplus)
621 extern bool_t xdr_rpcb (XDR *, rpcb*);
622 extern bool_t xdr_rp__list (XDR *, rp__list*);
623 extern bool_t xdr_rpcblist_ptr (XDR *, rpcblist_ptr*);
624 extern bool_t xdr_rpcb_rmtcallargs (XDR *, rpcb_rmtcallargs*);
625 extern bool_t xdr_rpcb_rmtcallres (XDR *, rpcb_rmtcallres*);
626 extern bool_t xdr_rpcb_entry (XDR *, rpcb_entry*);
627 extern bool_t xdr_rpcb_entry_list (XDR *, rpcb_entry_list*);
628 extern bool_t xdr_rpcb_entry_list_ptr (XDR *, rpcb_entry_list_ptr*);
629 extern bool_t xdr_rpcbs_addrlist (XDR *, rpcbs_addrlist*);
630 extern bool_t xdr_rpcbs_rmtcalllist (XDR *, rpcbs_rmtcalllist*);
631 extern bool_t xdr_rpcbs_proc (XDR *, rpcbs_proc);
632 extern bool_t xdr_rpcbs_addrlist_ptr (XDR *, rpcbs_addrlist_ptr*);
633 extern bool_t xdr_rpcbs_rmtcalllist_ptr (XDR *, rpcbs_rmtcalllist_ptr*);
634 extern bool_t xdr_rpcb_stat (XDR *, rpcb_stat*);
635 extern bool_t xdr_rpcb_stat_byvers (XDR *, rpcb_stat_byvers);
638 extern bool_t xdr_rpcb ();
639 extern bool_t xdr_rp__list ();
640 extern bool_t xdr_rpcblist_ptr ();
641 extern bool_t xdr_rpcb_rmtcallargs ();
642 extern bool_t xdr_rpcb_rmtcallres ();
643 extern bool_t xdr_rpcb_entry ();
644 extern bool_t xdr_rpcb_entry_list ();
645 extern bool_t xdr_rpcb_entry_list_ptr ();
646 extern bool_t xdr_rpcbs_addrlist ();
647 extern bool_t xdr_rpcbs_rmtcalllist ();
648 extern bool_t xdr_rpcbs_proc ();
649 extern bool_t xdr_rpcbs_addrlist_ptr ();
650 extern bool_t xdr_rpcbs_rmtcalllist_ptr ();
651 extern bool_t xdr_rpcb_stat ();
652 extern bool_t xdr_rpcb_stat_byvers ();
660 #endif /* !_RPCB_PROT_H_RPCGEN */