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
16 * Copyright (c) 2009, Sun Microsystems, Inc.
17 * All rights reserved.
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions are met:
21 * - Redistributions of source code must retain the above copyright notice,
22 * this list of conditions and the following disclaimer.
23 * - Redistributions in binary form must reproduce the above copyright notice,
24 * this list of conditions and the following disclaimer in the documentation
25 * and/or other materials provided with the distribution.
26 * - Neither the name of Sun Microsystems, Inc. nor the names of its
27 * contributors may be used to endorse or promote products derived
28 * from this software without specific prior written permission.
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
34 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
38 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40 * POSSIBILITY OF SUCH DAMAGE.
45 * Copyright (c) 1988 by Sun Microsystems, Inc.
47 /* from rpcb_prot.x */
49 /* #pragma ident "@(#)rpcb_prot.x 1.5 94/04/29 SMI" */
55 * The following procedures are supported by the protocol in version 3:
57 * RPCBPROC_NULL() returns ()
58 * takes nothing, returns nothing
60 * RPCBPROC_SET(rpcb) returns (bool_t)
61 * TRUE is success, FALSE is failure. Registers the tuple
62 * [prog, vers, address, owner, netid].
63 * Finds out owner and netid information on its own.
65 * RPCBPROC_UNSET(rpcb) returns (bool_t)
66 * TRUE is success, FALSE is failure. Un-registers tuple
67 * [prog, vers, netid]. addresses is ignored.
68 * If netid is NULL, unregister all.
70 * RPCBPROC_GETADDR(rpcb) returns (string).
71 * 0 is failure. Otherwise returns the universal address where the
72 * triple [prog, vers, netid] is registered. Ignore address and owner.
74 * RPCBPROC_DUMP() RETURNS (rpcblist_ptr)
75 * used to dump the entire rpcbind maps
77 * RPCBPROC_CALLIT(rpcb_rmtcallargs)
78 * RETURNS (rpcb_rmtcallres);
79 * Calls the procedure on the remote machine. If it is not registered,
80 * this procedure is quiet; i.e. it does not return error information!!!
81 * This routine only passes null authentication parameters.
82 * It has no interface to xdr routines for RPCBPROC_CALLIT.
84 * RPCBPROC_GETTIME() returns (int).
85 * Gets the remote machines time
87 * RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf)
88 * Returns the netbuf address from universal address.
90 * RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string)
91 * Returns the universal address from netbuf address.
93 * END OF RPCBIND VERSION 3 PROCEDURES
96 * Except for RPCBPROC_CALLIT, the procedures above are carried over to
97 * rpcbind version 4. Those below are added or modified for version 4.
98 * NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER
101 * RPCBPROC_BCAST(rpcb_rmtcallargs)
102 * RETURNS (rpcb_rmtcallres);
103 * Calls the procedure on the remote machine. If it is not registered,
104 * this procedure IS quiet; i.e. it DOES NOT return error information!!!
105 * This routine should be used for broadcasting and nothing else.
107 * RPCBPROC_GETVERSADDR(rpcb) returns (string).
108 * 0 is failure. Otherwise returns the universal address where the
109 * triple [prog, vers, netid] is registered. Ignore address and owner.
110 * Same as RPCBPROC_GETADDR except that if the given version number
111 * is not available, the address is not returned.
113 * RPCBPROC_INDIRECT(rpcb_rmtcallargs)
114 * RETURNS (rpcb_rmtcallres);
115 * Calls the procedure on the remote machine. If it is not registered,
116 * this procedure is NOT quiet; i.e. it DOES return error information!!!
117 * as any normal application would expect.
119 * RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr).
120 * Same as RPCBPROC_GETADDR except that it returns a list of all the
121 * addresses registered for the combination (prog, vers) (for all
124 * RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers)
125 * Returns the statistics about the kind of requests received by rpcbind.
129 * A mapping of (program, version, network ID) to address
139 typedef struct rpcb rpcb;
147 * Below are two definitions for the rpcblist structure. This is done because
148 * xdr_rpcblist() is specified to take a struct rpcblist **, rather than a
149 * struct rpcblist * that rpcgen would produce. One version of the rpcblist
150 * structure (actually called rp__list) is used with rpcgen, and the other is
151 * defined only in the header file for compatibility with the specified
157 struct rp__list *rpcb_next;
159 typedef struct rp__list rp__list;
161 typedef rp__list *rpcblist_ptr;
163 typedef struct rp__list rpcblist;
164 typedef struct rp__list RPCBLIST;
169 struct rpcblist *rpcb_next;
176 extern bool_t xdr_rpcblist(XDR *, rpcblist**);
183 * Arguments of remote calls
186 struct rpcb_rmtcallargs {
195 typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
198 * Client-side only representation of rpcb_rmtcallargs structure.
200 * The routine that XDRs the rpcb_rmtcallargs structure must deal with the
201 * opaque arguments in the "args" structure. xdr_rpcb_rmtcallargs() needs to
202 * be passed the XDR routine that knows the args' structure. This routine
203 * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
204 * the application being called already knows the args structure. So we use a
205 * different "XDR" structure on the client side, r_rpcb_rmtcallargs, which
206 * includes the args' XDR routine.
208 struct r_rpcb_rmtcallargs {
216 xdrproc_t xdr_args; /* encodes args */
221 * Results of the remote call
224 struct rpcb_rmtcallres {
231 typedef struct rpcb_rmtcallres rpcb_rmtcallres;
234 * Client-side only representation of rpcb_rmtcallres structure.
236 struct r_rpcb_rmtcallres {
239 uint32_t results_len;
242 xdrproc_t xdr_res; /* decodes results */
246 * rpcb_entry contains a merged address of a service on a particular
247 * transport, plus associated netconfig information. A list of rpcb_entrys
248 * is returned by RPCBPROC_GETADDRLIST. See netconfig.h for values used
255 u_int r_nc_semantics;
256 char *r_nc_protofmly;
259 typedef struct rpcb_entry rpcb_entry;
262 * A list of addresses supported by a service.
265 struct rpcb_entry_list {
266 rpcb_entry rpcb_entry_map;
267 struct rpcb_entry_list *rpcb_entry_next;
269 typedef struct rpcb_entry_list rpcb_entry_list;
271 typedef rpcb_entry_list *rpcb_entry_list_ptr;
277 #define rpcb_highproc_2 RPCBPROC_CALLIT
278 #define rpcb_highproc_3 RPCBPROC_TADDR2UADDR
279 #define rpcb_highproc_4 RPCBPROC_GETSTAT
280 #define RPCBSTAT_HIGHPROC 13
281 #define RPCBVERS_STAT 3
282 #define RPCBVERS_4_STAT 2
283 #define RPCBVERS_3_STAT 1
284 #define RPCBVERS_2_STAT 0
286 /* Link list of all the stats about getport and getaddr */
288 struct rpcbs_addrlist {
294 struct rpcbs_addrlist *next;
296 typedef struct rpcbs_addrlist rpcbs_addrlist;
298 /* Link list of all the stats about rmtcall */
300 struct rpcbs_rmtcalllist {
308 struct rpcbs_rmtcalllist *next;
310 typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
312 typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
314 typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
316 typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
322 rpcbs_addrlist_ptr addrinfo;
323 rpcbs_rmtcalllist_ptr rmtinfo;
325 typedef struct rpcb_stat rpcb_stat;
328 * One rpcb_stat structure is returned for each version of rpcbind
332 typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
335 * We don't define netbuf in RPCL, since it would contain structure member
336 * names that would conflict with the definition of struct netbuf in
337 * <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here,
338 * and implement it ourselves in rpc/rpcb_prot.c.
341 extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *);
344 extern bool_t xdr_netbuf(XDR *, struct netbuf *);
348 #define RPCBVERS_3 RPCBVERS
349 #define RPCBVERS_4 RPCBVERS4
351 #else /* ndef _KERNEL */
357 * A mapping of (program, version, network ID) to address
360 rpcprog_t r_prog; /* program number */
361 rpcvers_t r_vers; /* version number */
362 char *r_netid; /* network id */
363 char *r_addr; /* universal address */
364 char *r_owner; /* owner of the mapping */
366 typedef struct rpcb RPCB;
373 struct rpcblist *rpcb_next;
375 typedef struct rpcblist RPCBLIST;
376 typedef struct rpcblist *rpcblist_ptr;
379 * Remote calls arguments
381 struct rpcb_rmtcallargs {
382 rpcprog_t prog; /* program number */
383 rpcvers_t vers; /* version number */
384 rpcproc_t proc; /* procedure number */
385 uint32_t arglen; /* arg len */
386 caddr_t args_ptr; /* argument */
387 xdrproc_t xdr_args; /* XDR routine for argument */
389 typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
392 * Remote calls results
394 struct rpcb_rmtcallres {
395 char *addr_ptr; /* remote universal address */
396 uint32_t resultslen; /* results length */
397 caddr_t results_ptr; /* results */
398 xdrproc_t xdr_results; /* XDR routine for result */
400 typedef struct rpcb_rmtcallres rpcb_rmtcallres;
405 unsigned int r_nc_semantics;
406 char *r_nc_protofmly;
409 typedef struct rpcb_entry rpcb_entry;
412 * A list of addresses supported by a service.
415 struct rpcb_entry_list {
416 rpcb_entry rpcb_entry_map;
417 struct rpcb_entry_list *rpcb_entry_next;
419 typedef struct rpcb_entry_list rpcb_entry_list;
421 typedef rpcb_entry_list *rpcb_entry_list_ptr;
427 #define rpcb_highproc_2 RPCBPROC_CALLIT
428 #define rpcb_highproc_3 RPCBPROC_TADDR2UADDR
429 #define rpcb_highproc_4 RPCBPROC_GETSTAT
430 #define RPCBSTAT_HIGHPROC 13
431 #define RPCBVERS_STAT 3
432 #define RPCBVERS_4_STAT 2
433 #define RPCBVERS_3_STAT 1
434 #define RPCBVERS_2_STAT 0
436 /* Link list of all the stats about getport and getaddr */
438 struct rpcbs_addrlist {
444 struct rpcbs_addrlist *next;
446 typedef struct rpcbs_addrlist rpcbs_addrlist;
448 /* Link list of all the stats about rmtcall */
450 struct rpcbs_rmtcalllist {
458 struct rpcbs_rmtcalllist *next;
460 typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
462 typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
464 typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
466 typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
472 rpcbs_addrlist_ptr addrinfo;
473 rpcbs_rmtcalllist_ptr rmtinfo;
475 typedef struct rpcb_stat rpcb_stat;
478 * One rpcb_stat structure is returned for each version of rpcbind
482 typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
488 #endif /* ndef _KERNEL */
490 #define _PATH_RPCBINDSOCK "/var/run/rpcbind.sock"
492 #define RPCBPROG ((unsigned long)(100000))
493 #define RPCBVERS ((unsigned long)(3))
495 extern void rpcbprog_3(struct svc_req *rqstp, SVCXPRT *transp);
496 #define RPCBPROC_SET ((unsigned long)(1))
497 extern bool_t * rpcbproc_set_3(RPCB *, CLIENT *);
498 extern bool_t * rpcbproc_set_3_svc(RPCB *, struct svc_req *);
499 #define RPCBPROC_UNSET ((unsigned long)(2))
500 extern bool_t * rpcbproc_unset_3(RPCB *, CLIENT *);
501 extern bool_t * rpcbproc_unset_3_svc(RPCB *, struct svc_req *);
502 #define RPCBPROC_GETADDR ((unsigned long)(3))
503 extern char ** rpcbproc_getaddr_3(RPCB *, CLIENT *);
504 extern char ** rpcbproc_getaddr_3_svc(RPCB *, struct svc_req *);
505 #define RPCBPROC_DUMP ((unsigned long)(4))
506 extern rpcblist_ptr * rpcbproc_dump_3(void *, CLIENT *);
507 extern rpcblist_ptr * rpcbproc_dump_3_svc(void *, struct svc_req *);
508 #define RPCBPROC_CALLIT ((unsigned long)(5))
509 extern rpcb_rmtcallres * rpcbproc_callit_3(rpcb_rmtcallargs *, CLIENT *);
510 extern rpcb_rmtcallres * rpcbproc_callit_3_svc(rpcb_rmtcallargs *, struct svc_req *);
511 #define RPCBPROC_GETTIME ((unsigned long)(6))
512 extern u_int * rpcbproc_gettime_3(void *, CLIENT *);
513 extern u_int * rpcbproc_gettime_3_svc(void *, struct svc_req *);
514 #define RPCBPROC_UADDR2TADDR ((unsigned long)(7))
515 extern struct netbuf * rpcbproc_uaddr2taddr_3(char **, CLIENT *);
516 extern struct netbuf * rpcbproc_uaddr2taddr_3_svc(char **, struct svc_req *);
517 #define RPCBPROC_TADDR2UADDR ((unsigned long)(8))
518 extern char ** rpcbproc_taddr2uaddr_3(struct netbuf *, CLIENT *);
519 extern char ** rpcbproc_taddr2uaddr_3_svc(struct netbuf *, struct svc_req *);
520 extern int rpcbprog_3_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
521 #define RPCBVERS4 ((unsigned long)(4))
523 extern void rpcbprog_4(struct svc_req *rqstp, SVCXPRT *transp);
524 extern bool_t * rpcbproc_set_4(RPCB *, CLIENT *);
525 extern bool_t * rpcbproc_set_4_svc(RPCB *, struct svc_req *);
526 extern bool_t * rpcbproc_unset_4(RPCB *, CLIENT *);
527 extern bool_t * rpcbproc_unset_4_svc(RPCB *, struct svc_req *);
528 extern char ** rpcbproc_getaddr_4(RPCB *, CLIENT *);
529 extern char ** rpcbproc_getaddr_4_svc(RPCB *, struct svc_req *);
530 extern rpcblist_ptr * rpcbproc_dump_4(void *, CLIENT *);
531 extern rpcblist_ptr * rpcbproc_dump_4_svc(void *, struct svc_req *);
532 #define RPCBPROC_BCAST ((unsigned long)(RPCBPROC_CALLIT))
533 extern rpcb_rmtcallres * rpcbproc_bcast_4(rpcb_rmtcallargs *, CLIENT *);
534 extern rpcb_rmtcallres * rpcbproc_bcast_4_svc(rpcb_rmtcallargs *, struct svc_req *);
535 extern u_int * rpcbproc_gettime_4(void *, CLIENT *);
536 extern u_int * rpcbproc_gettime_4_svc(void *, struct svc_req *);
537 extern struct netbuf * rpcbproc_uaddr2taddr_4(char **, CLIENT *);
538 extern struct netbuf * rpcbproc_uaddr2taddr_4_svc(char **, struct svc_req *);
539 extern char ** rpcbproc_taddr2uaddr_4(struct netbuf *, CLIENT *);
540 extern char ** rpcbproc_taddr2uaddr_4_svc(struct netbuf *, struct svc_req *);
541 #define RPCBPROC_GETVERSADDR ((unsigned long)(9))
542 extern char ** rpcbproc_getversaddr_4(RPCB *, CLIENT *);
543 extern char ** rpcbproc_getversaddr_4_svc(RPCB *, struct svc_req *);
544 #define RPCBPROC_INDIRECT ((unsigned long)(10))
545 extern rpcb_rmtcallres * rpcbproc_indirect_4(rpcb_rmtcallargs *, CLIENT *);
546 extern rpcb_rmtcallres * rpcbproc_indirect_4_svc(rpcb_rmtcallargs *, struct svc_req *);
547 #define RPCBPROC_GETADDRLIST ((unsigned long)(11))
548 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4(RPCB *, CLIENT *);
549 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4_svc(RPCB *, struct svc_req *);
550 #define RPCBPROC_GETSTAT ((unsigned long)(12))
551 extern rpcb_stat * rpcbproc_getstat_4(void *, CLIENT *);
552 extern rpcb_stat * rpcbproc_getstat_4_svc(void *, struct svc_req *);
553 extern int rpcbprog_4_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
555 /* the xdr functions */
556 extern bool_t xdr_rpcb(XDR *, RPCB *);
558 extern bool_t xdr_rp__list(XDR *, rp__list*);
560 extern bool_t xdr_rpcblist_ptr(XDR *, rpcblist_ptr*);
561 extern bool_t xdr_rpcb_rmtcallargs(XDR *, rpcb_rmtcallargs*);
562 extern bool_t xdr_rpcb_rmtcallres(XDR *, rpcb_rmtcallres*);
563 extern bool_t xdr_rpcb_entry(XDR *, rpcb_entry*);
564 extern bool_t xdr_rpcb_entry_list(XDR *, rpcb_entry_list*);
565 extern bool_t xdr_rpcb_entry_list_ptr(XDR *, rpcb_entry_list_ptr*);
566 extern bool_t xdr_rpcbs_addrlist(XDR *, rpcbs_addrlist*);
567 extern bool_t xdr_rpcbs_rmtcalllist(XDR *, rpcbs_rmtcalllist*);
568 extern bool_t xdr_rpcbs_proc(XDR *, rpcbs_proc);
569 extern bool_t xdr_rpcbs_addrlist_ptr(XDR *, rpcbs_addrlist_ptr*);
570 extern bool_t xdr_rpcbs_rmtcalllist_ptr(XDR *, rpcbs_rmtcalllist_ptr*);
571 extern bool_t xdr_rpcb_stat(XDR *, rpcb_stat*);
572 extern bool_t xdr_rpcb_stat_byvers(XDR *, rpcb_stat_byvers);
578 #endif /* !_RPCB_PROT_H_RPCGEN */