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 * SPDX-License-Identifier: BSD-3-Clause
18 * Copyright (c) 2009, Sun Microsystems, Inc.
19 * All rights reserved.
21 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions are met:
23 * - Redistributions of source code must retain the above copyright notice,
24 * this list of conditions and the following disclaimer.
25 * - Redistributions in binary form must reproduce the above copyright notice,
26 * this list of conditions and the following disclaimer in the documentation
27 * and/or other materials provided with the distribution.
28 * - Neither the name of Sun Microsystems, Inc. nor the names of its
29 * contributors may be used to endorse or promote products derived
30 * from this software without specific prior written permission.
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
33 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
35 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
36 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
37 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
38 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
39 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
40 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
41 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 * POSSIBILITY OF SUCH DAMAGE.
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 uint32_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 #else /* ndef _KERNEL */
359 * A mapping of (program, version, network ID) to address
362 rpcprog_t r_prog; /* program number */
363 rpcvers_t r_vers; /* version number */
364 char *r_netid; /* network id */
365 char *r_addr; /* universal address */
366 char *r_owner; /* owner of the mapping */
368 typedef struct rpcb RPCB;
375 struct rpcblist *rpcb_next;
377 typedef struct rpcblist RPCBLIST;
378 typedef struct rpcblist *rpcblist_ptr;
381 * Remote calls arguments
383 struct rpcb_rmtcallargs {
384 rpcprog_t prog; /* program number */
385 rpcvers_t vers; /* version number */
386 rpcproc_t proc; /* procedure number */
387 uint32_t arglen; /* arg len */
388 caddr_t args_ptr; /* argument */
389 xdrproc_t xdr_args; /* XDR routine for argument */
391 typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
394 * Remote calls results
396 struct rpcb_rmtcallres {
397 char *addr_ptr; /* remote universal address */
398 uint32_t resultslen; /* results length */
399 caddr_t results_ptr; /* results */
400 xdrproc_t xdr_results; /* XDR routine for result */
402 typedef struct rpcb_rmtcallres rpcb_rmtcallres;
407 unsigned int r_nc_semantics;
408 char *r_nc_protofmly;
411 typedef struct rpcb_entry rpcb_entry;
414 * A list of addresses supported by a service.
417 struct rpcb_entry_list {
418 rpcb_entry rpcb_entry_map;
419 struct rpcb_entry_list *rpcb_entry_next;
421 typedef struct rpcb_entry_list rpcb_entry_list;
423 typedef rpcb_entry_list *rpcb_entry_list_ptr;
429 #define rpcb_highproc_2 RPCBPROC_CALLIT
430 #define rpcb_highproc_3 RPCBPROC_TADDR2UADDR
431 #define rpcb_highproc_4 RPCBPROC_GETSTAT
432 #define RPCBSTAT_HIGHPROC 13
433 #define RPCBVERS_STAT 3
434 #define RPCBVERS_4_STAT 2
435 #define RPCBVERS_3_STAT 1
436 #define RPCBVERS_2_STAT 0
438 /* Link list of all the stats about getport and getaddr */
440 struct rpcbs_addrlist {
446 struct rpcbs_addrlist *next;
448 typedef struct rpcbs_addrlist rpcbs_addrlist;
450 /* Link list of all the stats about rmtcall */
452 struct rpcbs_rmtcalllist {
460 struct rpcbs_rmtcalllist *next;
462 typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
464 typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
466 typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
468 typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
474 rpcbs_addrlist_ptr addrinfo;
475 rpcbs_rmtcalllist_ptr rmtinfo;
477 typedef struct rpcb_stat rpcb_stat;
480 * One rpcb_stat structure is returned for each version of rpcbind
484 typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
490 #endif /* ndef _KERNEL */
492 #define _PATH_RPCBINDSOCK "/var/run/rpcbind.sock"
494 #define RPCBPROG ((unsigned long)(100000))
495 #define RPCBVERS ((unsigned long)(3))
497 extern void rpcbprog_3(struct svc_req *rqstp, SVCXPRT *transp);
498 #define RPCBPROC_SET ((unsigned long)(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 ((unsigned long)(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 ((unsigned long)(3))
505 extern char ** rpcbproc_getaddr_3(RPCB *, CLIENT *);
506 extern char ** rpcbproc_getaddr_3_svc(RPCB *, struct svc_req *);
507 #define RPCBPROC_DUMP ((unsigned long)(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 ((unsigned long)(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 ((unsigned long)(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 ((unsigned long)(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 ((unsigned long)(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);
523 #define RPCBVERS4 ((unsigned long)(4))
525 extern void rpcbprog_4(struct svc_req *rqstp, SVCXPRT *transp);
526 extern bool_t * rpcbproc_set_4(RPCB *, CLIENT *);
527 extern bool_t * rpcbproc_set_4_svc(RPCB *, struct svc_req *);
528 extern bool_t * rpcbproc_unset_4(RPCB *, CLIENT *);
529 extern bool_t * rpcbproc_unset_4_svc(RPCB *, struct svc_req *);
530 extern char ** rpcbproc_getaddr_4(RPCB *, CLIENT *);
531 extern char ** rpcbproc_getaddr_4_svc(RPCB *, struct svc_req *);
532 extern rpcblist_ptr * rpcbproc_dump_4(void *, CLIENT *);
533 extern rpcblist_ptr * rpcbproc_dump_4_svc(void *, struct svc_req *);
534 #define RPCBPROC_BCAST ((unsigned long)(RPCBPROC_CALLIT))
535 extern rpcb_rmtcallres * rpcbproc_bcast_4(rpcb_rmtcallargs *, CLIENT *);
536 extern rpcb_rmtcallres * rpcbproc_bcast_4_svc(rpcb_rmtcallargs *, struct svc_req *);
537 extern u_int * rpcbproc_gettime_4(void *, CLIENT *);
538 extern u_int * rpcbproc_gettime_4_svc(void *, struct svc_req *);
539 extern struct netbuf * rpcbproc_uaddr2taddr_4(char **, CLIENT *);
540 extern struct netbuf * rpcbproc_uaddr2taddr_4_svc(char **, struct svc_req *);
541 extern char ** rpcbproc_taddr2uaddr_4(struct netbuf *, CLIENT *);
542 extern char ** rpcbproc_taddr2uaddr_4_svc(struct netbuf *, struct svc_req *);
543 #define RPCBPROC_GETVERSADDR ((unsigned long)(9))
544 extern char ** rpcbproc_getversaddr_4(RPCB *, CLIENT *);
545 extern char ** rpcbproc_getversaddr_4_svc(RPCB *, struct svc_req *);
546 #define RPCBPROC_INDIRECT ((unsigned long)(10))
547 extern rpcb_rmtcallres * rpcbproc_indirect_4(rpcb_rmtcallargs *, CLIENT *);
548 extern rpcb_rmtcallres * rpcbproc_indirect_4_svc(rpcb_rmtcallargs *, struct svc_req *);
549 #define RPCBPROC_GETADDRLIST ((unsigned long)(11))
550 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4(RPCB *, CLIENT *);
551 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4_svc(RPCB *, struct svc_req *);
552 #define RPCBPROC_GETSTAT ((unsigned long)(12))
553 extern rpcb_stat * rpcbproc_getstat_4(void *, CLIENT *);
554 extern rpcb_stat * rpcbproc_getstat_4_svc(void *, struct svc_req *);
555 extern int rpcbprog_4_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
557 /* the xdr functions */
558 extern bool_t xdr_rpcb(XDR *, RPCB *);
560 extern bool_t xdr_rp__list(XDR *, rp__list*);
562 extern bool_t xdr_rpcblist_ptr(XDR *, rpcblist_ptr*);
563 extern bool_t xdr_rpcb_rmtcallargs(XDR *, rpcb_rmtcallargs*);
564 extern bool_t xdr_rpcb_rmtcallres(XDR *, rpcb_rmtcallres*);
565 extern bool_t xdr_rpcb_entry(XDR *, rpcb_entry*);
566 extern bool_t xdr_rpcb_entry_list(XDR *, rpcb_entry_list*);
567 extern bool_t xdr_rpcb_entry_list_ptr(XDR *, rpcb_entry_list_ptr*);
568 extern bool_t xdr_rpcbs_addrlist(XDR *, rpcbs_addrlist*);
569 extern bool_t xdr_rpcbs_rmtcalllist(XDR *, rpcbs_rmtcalllist*);
570 extern bool_t xdr_rpcbs_proc(XDR *, rpcbs_proc);
571 extern bool_t xdr_rpcbs_addrlist_ptr(XDR *, rpcbs_addrlist_ptr*);
572 extern bool_t xdr_rpcbs_rmtcalllist_ptr(XDR *, rpcbs_rmtcalllist_ptr*);
573 extern bool_t xdr_rpcb_stat(XDR *, rpcb_stat*);
574 extern bool_t xdr_rpcb_stat_byvers(XDR *, rpcb_stat_byvers);
580 #endif /* !_RPCB_PROT_H_RPCGEN */