libkvm - Update for new dumps & minidumps
[dragonfly.git] / include / rpc / rpcb_prot.h
blob9c318188fa4c9b7a8a4f17147f22ca8785ba9e88
1 /*
2 * Please do not edit this file.
3 * It was generated using rpcgen.
4 */
6 #ifndef _RPCB_PROT_H_RPCGEN
7 #define _RPCB_PROT_H_RPCGEN
9 #include <rpc/rpc.h>
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
16 * $FreeBSD: src/include/rpc/rpcb_prot.x,v 1.3 2002/03/13 10:29:06 obrien Exp $
18 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
19 * unrestricted use provided that this legend is included on all tape
20 * media and as a part of the software program in whole or part. Users
21 * may copy or modify Sun RPC without charge, but are not authorized
22 * to license or distribute it to anyone else except as part of a product or
23 * program developed by the user.
25 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
26 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
27 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
29 * Sun RPC is provided with no support and without any obligation on the
30 * part of Sun Microsystems, Inc. to assist in its use, correction,
31 * modification or enhancement.
33 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
34 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
35 * OR ANY PART THEREOF.
37 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
38 * or profits or other special, indirect and consequential damages, even if
39 * Sun has been advised of the possibility of such damages.
41 * Sun Microsystems, Inc.
42 * 2550 Garcia Avenue
43 * Mountain View, California 94043
46 * Copyright (c) 1988 by Sun Microsystems, Inc.
48 /* from rpcb_prot.x */
50 /* #pragma ident "@(#)rpcb_prot.x 1.5 94/04/29 SMI" */
52 #ifndef _KERNEL
56 * The following procedures are supported by the protocol in version 3:
58 * RPCBPROC_NULL() returns ()
59 * takes nothing, returns nothing
61 * RPCBPROC_SET(rpcb) returns (bool_t)
62 * TRUE is success, FALSE is failure. Registers the tuple
63 * [prog, vers, address, owner, netid].
64 * Finds out owner and netid information on its own.
66 * RPCBPROC_UNSET(rpcb) returns (bool_t)
67 * TRUE is success, FALSE is failure. Un-registers tuple
68 * [prog, vers, netid]. addresses is ignored.
69 * If netid is NULL, unregister all.
71 * RPCBPROC_GETADDR(rpcb) returns (string).
72 * 0 is failure. Otherwise returns the universal address where the
73 * triple [prog, vers, netid] is registered. Ignore address and owner.
75 * RPCBPROC_DUMP() RETURNS (rpcblist_ptr)
76 * used to dump the entire rpcbind maps
78 * RPCBPROC_CALLIT(rpcb_rmtcallargs)
79 * RETURNS (rpcb_rmtcallres);
80 * Calls the procedure on the remote machine. If it is not registered,
81 * this procedure is quiet; i.e. it does not return error information!!!
82 * This routine only passes null authentication parameters.
83 * It has no interface to xdr routines for RPCBPROC_CALLIT.
85 * RPCBPROC_GETTIME() returns (int).
86 * Gets the remote machines time
88 * RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf)
89 * Returns the netbuf address from universal address.
91 * RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string)
92 * Returns the universal address from netbuf address.
94 * END OF RPCBIND VERSION 3 PROCEDURES
97 * Except for RPCBPROC_CALLIT, the procedures above are carried over to
98 * rpcbind version 4. Those below are added or modified for version 4.
99 * NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER
100 * AS RPCBPROC_CALLIT.
102 * RPCBPROC_BCAST(rpcb_rmtcallargs)
103 * RETURNS (rpcb_rmtcallres);
104 * Calls the procedure on the remote machine. If it is not registered,
105 * this procedure IS quiet; i.e. it DOES NOT return error information!!!
106 * This routine should be used for broadcasting and nothing else.
108 * RPCBPROC_GETVERSADDR(rpcb) returns (string).
109 * 0 is failure. Otherwise returns the universal address where the
110 * triple [prog, vers, netid] is registered. Ignore address and owner.
111 * Same as RPCBPROC_GETADDR except that if the given version number
112 * is not available, the address is not returned.
114 * RPCBPROC_INDIRECT(rpcb_rmtcallargs)
115 * RETURNS (rpcb_rmtcallres);
116 * Calls the procedure on the remote machine. If it is not registered,
117 * this procedure is NOT quiet; i.e. it DOES return error information!!!
118 * as any normal application would expect.
120 * RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr).
121 * Same as RPCBPROC_GETADDR except that it returns a list of all the
122 * addresses registered for the combination (prog, vers) (for all
123 * transports).
125 * RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers)
126 * Returns the statistics about the kind of requests received by rpcbind.
130 * A mapping of (program, version, network ID) to address
133 struct rpcb {
134 rpcprog_t r_prog;
135 rpcvers_t r_vers;
136 char *r_netid;
137 char *r_addr;
138 char *r_owner;
140 typedef struct rpcb rpcb;
142 typedef rpcb RPCB;
146 * A list of mappings
148 * Below are two definitions for the rpcblist structure. This is done because
149 * xdr_rpcblist() is specified to take a struct rpcblist **, rather than a
150 * struct rpcblist * that rpcgen would produce. One version of the rpcblist
151 * structure (actually called rp__list) is used with rpcgen, and the other is
152 * defined only in the header file for compatibility with the specified
153 * interface.
156 struct rp__list {
157 rpcb rpcb_map;
158 struct rp__list *rpcb_next;
160 typedef struct rp__list rp__list;
162 typedef rp__list *rpcblist_ptr;
164 typedef struct rp__list rpcblist;
165 typedef struct rp__list RPCBLIST;
167 #ifndef __cplusplus
168 struct rpcblist {
169 RPCB rpcb_map;
170 struct rpcblist *rpcb_next;
172 #endif
174 #ifdef __cplusplus
175 extern "C" {
176 #endif
177 extern bool_t xdr_rpcblist(XDR *, rpcblist**);
178 #ifdef __cplusplus
180 #endif
184 * Arguments of remote calls
187 struct rpcb_rmtcallargs {
188 rpcprog_t prog;
189 rpcvers_t vers;
190 rpcproc_t proc;
191 struct {
192 u_int args_len;
193 char *args_val;
194 } args;
196 typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
199 * Client-side only representation of rpcb_rmtcallargs structure.
201 * The routine that XDRs the rpcb_rmtcallargs structure must deal with the
202 * opaque arguments in the "args" structure. xdr_rpcb_rmtcallargs() needs to
203 * be passed the XDR routine that knows the args' structure. This routine
204 * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
205 * the application being called already knows the args structure. So we use a
206 * different "XDR" structure on the client side, r_rpcb_rmtcallargs, which
207 * includes the args' XDR routine.
209 struct r_rpcb_rmtcallargs {
210 rpcprog_t prog;
211 rpcvers_t vers;
212 rpcproc_t proc;
213 struct {
214 u_int args_len;
215 char *args_val;
216 } args;
217 xdrproc_t xdr_args; /* encodes args */
222 * Results of the remote call
225 struct rpcb_rmtcallres {
226 char *addr;
227 struct {
228 u_int results_len;
229 char *results_val;
230 } results;
232 typedef struct rpcb_rmtcallres rpcb_rmtcallres;
235 * Client-side only representation of rpcb_rmtcallres structure.
237 struct r_rpcb_rmtcallres {
238 char *addr;
239 struct {
240 u_int32_t results_len;
241 char *results_val;
242 } results;
243 xdrproc_t xdr_res; /* decodes results */
247 * rpcb_entry contains a merged address of a service on a particular
248 * transport, plus associated netconfig information. A list of rpcb_entrys
249 * is returned by RPCBPROC_GETADDRLIST. See netconfig.h for values used
250 * in r_nc_* fields.
253 struct rpcb_entry {
254 char *r_maddr;
255 char *r_nc_netid;
256 u_int r_nc_semantics;
257 char *r_nc_protofmly;
258 char *r_nc_proto;
260 typedef struct rpcb_entry rpcb_entry;
263 * A list of addresses supported by a service.
266 struct rpcb_entry_list {
267 rpcb_entry rpcb_entry_map;
268 struct rpcb_entry_list *rpcb_entry_next;
270 typedef struct rpcb_entry_list rpcb_entry_list;
272 typedef rpcb_entry_list *rpcb_entry_list_ptr;
275 * rpcbind statistics
278 #define rpcb_highproc_2 RPCBPROC_CALLIT
279 #define rpcb_highproc_3 RPCBPROC_TADDR2UADDR
280 #define rpcb_highproc_4 RPCBPROC_GETSTAT
281 #define RPCBSTAT_HIGHPROC 13
282 #define RPCBVERS_STAT 3
283 #define RPCBVERS_4_STAT 2
284 #define RPCBVERS_3_STAT 1
285 #define RPCBVERS_2_STAT 0
287 /* Link list of all the stats about getport and getaddr */
289 struct rpcbs_addrlist {
290 rpcprog_t prog;
291 rpcvers_t vers;
292 int success;
293 int failure;
294 char *netid;
295 struct rpcbs_addrlist *next;
297 typedef struct rpcbs_addrlist rpcbs_addrlist;
299 /* Link list of all the stats about rmtcall */
301 struct rpcbs_rmtcalllist {
302 rpcprog_t prog;
303 rpcvers_t vers;
304 rpcproc_t proc;
305 int success;
306 int failure;
307 int indirect;
308 char *netid;
309 struct rpcbs_rmtcalllist *next;
311 typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
313 typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
315 typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
317 typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
319 struct rpcb_stat {
320 rpcbs_proc info;
321 int setinfo;
322 int unsetinfo;
323 rpcbs_addrlist_ptr addrinfo;
324 rpcbs_rmtcalllist_ptr rmtinfo;
326 typedef struct rpcb_stat rpcb_stat;
329 * One rpcb_stat structure is returned for each version of rpcbind
330 * being monitored.
333 typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
336 * We don't define netbuf in RPCL, since it would contain structure member
337 * names that would conflict with the definition of struct netbuf in
338 * <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here,
339 * and implement it ourselves in rpc/rpcb_prot.c.
341 #ifdef __cplusplus
342 extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *);
344 #else /* __STDC__ */
345 extern bool_t xdr_netbuf(XDR *, struct netbuf *);
347 #endif
349 #define RPCBVERS_3 RPCBVERS
350 #define RPCBVERS_4 RPCBVERS4
352 #define _PATH_RPCBINDSOCK "/var/run/rpcbind.sock"
354 #else /* ndef _KERNEL */
355 #ifdef __cplusplus
356 extern "C" {
357 #endif
360 * A mapping of (program, version, network ID) to address
362 struct rpcb {
363 rpcprog_t r_prog; /* program number */
364 rpcvers_t r_vers; /* version number */
365 char *r_netid; /* network id */
366 char *r_addr; /* universal address */
367 char *r_owner; /* owner of the mapping */
369 typedef struct rpcb RPCB;
372 * A list of mappings
374 struct rpcblist {
375 RPCB rpcb_map;
376 struct rpcblist *rpcb_next;
378 typedef struct rpcblist RPCBLIST;
379 typedef struct rpcblist *rpcblist_ptr;
382 * Remote calls arguments
384 struct rpcb_rmtcallargs {
385 rpcprog_t prog; /* program number */
386 rpcvers_t vers; /* version number */
387 rpcproc_t proc; /* procedure number */
388 u_int32_t arglen; /* arg len */
389 caddr_t args_ptr; /* argument */
390 xdrproc_t xdr_args; /* XDR routine for argument */
392 typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
395 * Remote calls results
397 struct rpcb_rmtcallres {
398 char *addr_ptr; /* remote universal address */
399 u_int32_t resultslen; /* results length */
400 caddr_t results_ptr; /* results */
401 xdrproc_t xdr_results; /* XDR routine for result */
403 typedef struct rpcb_rmtcallres rpcb_rmtcallres;
405 struct rpcb_entry {
406 char *r_maddr;
407 char *r_nc_netid;
408 unsigned int r_nc_semantics;
409 char *r_nc_protofmly;
410 char *r_nc_proto;
412 typedef struct rpcb_entry rpcb_entry;
415 * A list of addresses supported by a service.
418 struct rpcb_entry_list {
419 rpcb_entry rpcb_entry_map;
420 struct rpcb_entry_list *rpcb_entry_next;
422 typedef struct rpcb_entry_list rpcb_entry_list;
424 typedef rpcb_entry_list *rpcb_entry_list_ptr;
427 * rpcbind statistics
430 #define rpcb_highproc_2 RPCBPROC_CALLIT
431 #define rpcb_highproc_3 RPCBPROC_TADDR2UADDR
432 #define rpcb_highproc_4 RPCBPROC_GETSTAT
433 #define RPCBSTAT_HIGHPROC 13
434 #define RPCBVERS_STAT 3
435 #define RPCBVERS_4_STAT 2
436 #define RPCBVERS_3_STAT 1
437 #define RPCBVERS_2_STAT 0
439 /* Link list of all the stats about getport and getaddr */
441 struct rpcbs_addrlist {
442 rpcprog_t prog;
443 rpcvers_t vers;
444 int success;
445 int failure;
446 char *netid;
447 struct rpcbs_addrlist *next;
449 typedef struct rpcbs_addrlist rpcbs_addrlist;
451 /* Link list of all the stats about rmtcall */
453 struct rpcbs_rmtcalllist {
454 rpcprog_t prog;
455 rpcvers_t vers;
456 rpcproc_t proc;
457 int success;
458 int failure;
459 int indirect;
460 char *netid;
461 struct rpcbs_rmtcalllist *next;
463 typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
465 typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
467 typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
469 typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
471 struct rpcb_stat {
472 rpcbs_proc info;
473 int setinfo;
474 int unsetinfo;
475 rpcbs_addrlist_ptr addrinfo;
476 rpcbs_rmtcalllist_ptr rmtinfo;
478 typedef struct rpcb_stat rpcb_stat;
481 * One rpcb_stat structure is returned for each version of rpcbind
482 * being monitored.
485 typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
487 #ifdef __cplusplus
489 #endif
491 #endif /* ndef _KERNEL */
493 #define RPCBPROG ((unsigned long)(100000))
494 #define RPCBVERS ((unsigned long)(3))
496 extern void rpcbprog_3(struct svc_req *rqstp, SVCXPRT *transp);
497 #define RPCBPROC_SET ((unsigned long)(1))
498 extern bool_t * rpcbproc_set_3(rpcb *, CLIENT *);
499 extern bool_t * rpcbproc_set_3_svc(rpcb *, struct svc_req *);
500 #define RPCBPROC_UNSET ((unsigned long)(2))
501 extern bool_t * rpcbproc_unset_3(rpcb *, CLIENT *);
502 extern bool_t * rpcbproc_unset_3_svc(rpcb *, struct svc_req *);
503 #define RPCBPROC_GETADDR ((unsigned long)(3))
504 extern char ** rpcbproc_getaddr_3(rpcb *, CLIENT *);
505 extern char ** rpcbproc_getaddr_3_svc(rpcb *, struct svc_req *);
506 #define RPCBPROC_DUMP ((unsigned long)(4))
507 extern rpcblist_ptr * rpcbproc_dump_3(void *, CLIENT *);
508 extern rpcblist_ptr * rpcbproc_dump_3_svc(void *, struct svc_req *);
509 #define RPCBPROC_CALLIT ((unsigned long)(5))
510 extern rpcb_rmtcallres * rpcbproc_callit_3(rpcb_rmtcallargs *, CLIENT *);
511 extern rpcb_rmtcallres * rpcbproc_callit_3_svc(rpcb_rmtcallargs *, struct svc_req *);
512 #define RPCBPROC_GETTIME ((unsigned long)(6))
513 extern u_int * rpcbproc_gettime_3(void *, CLIENT *);
514 extern u_int * rpcbproc_gettime_3_svc(void *, struct svc_req *);
515 #define RPCBPROC_UADDR2TADDR ((unsigned long)(7))
516 extern struct netbuf * rpcbproc_uaddr2taddr_3(char **, CLIENT *);
517 extern struct netbuf * rpcbproc_uaddr2taddr_3_svc(char **, struct svc_req *);
518 #define RPCBPROC_TADDR2UADDR ((unsigned long)(8))
519 extern char ** rpcbproc_taddr2uaddr_3(struct netbuf *, CLIENT *);
520 extern char ** rpcbproc_taddr2uaddr_3_svc(struct netbuf *, struct svc_req *);
521 extern int rpcbprog_3_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
522 #define RPCBVERS4 ((unsigned long)(4))
524 extern void rpcbprog_4(struct svc_req *rqstp, SVCXPRT *transp);
525 extern bool_t * rpcbproc_set_4(rpcb *, CLIENT *);
526 extern bool_t * rpcbproc_set_4_svc(rpcb *, struct svc_req *);
527 extern bool_t * rpcbproc_unset_4(rpcb *, CLIENT *);
528 extern bool_t * rpcbproc_unset_4_svc(rpcb *, struct svc_req *);
529 extern char ** rpcbproc_getaddr_4(rpcb *, CLIENT *);
530 extern char ** rpcbproc_getaddr_4_svc(rpcb *, struct svc_req *);
531 extern rpcblist_ptr * rpcbproc_dump_4(void *, CLIENT *);
532 extern rpcblist_ptr * rpcbproc_dump_4_svc(void *, struct svc_req *);
533 #define RPCBPROC_BCAST ((unsigned long)(RPCBPROC_CALLIT))
534 extern rpcb_rmtcallres * rpcbproc_bcast_4(rpcb_rmtcallargs *, CLIENT *);
535 extern rpcb_rmtcallres * rpcbproc_bcast_4_svc(rpcb_rmtcallargs *, struct svc_req *);
536 extern u_int * rpcbproc_gettime_4(void *, CLIENT *);
537 extern u_int * rpcbproc_gettime_4_svc(void *, struct svc_req *);
538 extern struct netbuf * rpcbproc_uaddr2taddr_4(char **, CLIENT *);
539 extern struct netbuf * rpcbproc_uaddr2taddr_4_svc(char **, struct svc_req *);
540 extern char ** rpcbproc_taddr2uaddr_4(struct netbuf *, CLIENT *);
541 extern char ** rpcbproc_taddr2uaddr_4_svc(struct netbuf *, struct svc_req *);
542 #define RPCBPROC_GETVERSADDR ((unsigned long)(9))
543 extern char ** rpcbproc_getversaddr_4(rpcb *, CLIENT *);
544 extern char ** rpcbproc_getversaddr_4_svc(rpcb *, struct svc_req *);
545 #define RPCBPROC_INDIRECT ((unsigned long)(10))
546 extern rpcb_rmtcallres * rpcbproc_indirect_4(rpcb_rmtcallargs *, CLIENT *);
547 extern rpcb_rmtcallres * rpcbproc_indirect_4_svc(rpcb_rmtcallargs *, struct svc_req *);
548 #define RPCBPROC_GETADDRLIST ((unsigned long)(11))
549 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4(rpcb *, CLIENT *);
550 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4_svc(rpcb *, struct svc_req *);
551 #define RPCBPROC_GETSTAT ((unsigned long)(12))
552 extern rpcb_stat * rpcbproc_getstat_4(void *, CLIENT *);
553 extern rpcb_stat * rpcbproc_getstat_4_svc(void *, struct svc_req *);
554 extern int rpcbprog_4_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
556 /* the xdr functions */
557 extern bool_t xdr_rpcb(XDR *, rpcb*);
558 extern bool_t xdr_rp__list(XDR *, rp__list*);
559 extern bool_t xdr_rpcblist_ptr(XDR *, rpcblist_ptr*);
560 extern bool_t xdr_rpcb_rmtcallargs(XDR *, rpcb_rmtcallargs*);
561 extern bool_t xdr_rpcb_rmtcallres(XDR *, rpcb_rmtcallres*);
562 extern bool_t xdr_rpcb_entry(XDR *, rpcb_entry*);
563 extern bool_t xdr_rpcb_entry_list(XDR *, rpcb_entry_list*);
564 extern bool_t xdr_rpcb_entry_list_ptr(XDR *, rpcb_entry_list_ptr*);
565 extern bool_t xdr_rpcbs_addrlist(XDR *, rpcbs_addrlist*);
566 extern bool_t xdr_rpcbs_rmtcalllist(XDR *, rpcbs_rmtcalllist*);
567 extern bool_t xdr_rpcbs_proc(XDR *, rpcbs_proc);
568 extern bool_t xdr_rpcbs_addrlist_ptr(XDR *, rpcbs_addrlist_ptr*);
569 extern bool_t xdr_rpcbs_rmtcalllist_ptr(XDR *, rpcbs_rmtcalllist_ptr*);
570 extern bool_t xdr_rpcb_stat(XDR *, rpcb_stat*);
571 extern bool_t xdr_rpcb_stat_byvers(XDR *, rpcb_stat_byvers);
573 #ifdef __cplusplus
575 #endif
577 #endif /* !_RPCB_PROT_H_RPCGEN */