master
1/*
2 * Please do not edit this file.
3 * It was generated using rpcgen.
4 */
5
6#ifndef _RPCB_PROT_H_RPCGEN
7#define _RPCB_PROT_H_RPCGEN
8
9#include <rpc/rpc.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15/*-
16 * Copyright (c) 2009, Sun Microsystems, Inc.
17 * All rights reserved.
18 *
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.
29 *
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.
41 */
42/*
43 * Copyright (c) 1988 by Sun Microsystems, Inc.
44 */
45/* from rpcb_prot.x */
46
47/* #pragma ident "@(#)rpcb_prot.x 1.5 94/04/29 SMI" */
48
49#ifndef _KERNEL
50
51
52/*
53 * The following procedures are supported by the protocol in version 3:
54 *
55 * RPCBPROC_NULL() returns ()
56 * takes nothing, returns nothing
57 *
58 * RPCBPROC_SET(rpcb) returns (bool_t)
59 * TRUE is success, FALSE is failure. Registers the tuple
60 * [prog, vers, address, owner, netid].
61 * Finds out owner and netid information on its own.
62 *
63 * RPCBPROC_UNSET(rpcb) returns (bool_t)
64 * TRUE is success, FALSE is failure. Un-registers tuple
65 * [prog, vers, netid]. addresses is ignored.
66 * If netid is NULL, unregister all.
67 *
68 * RPCBPROC_GETADDR(rpcb) returns (string).
69 * 0 is failure. Otherwise returns the universal address where the
70 * triple [prog, vers, netid] is registered. Ignore address and owner.
71 *
72 * RPCBPROC_DUMP() RETURNS (rpcblist_ptr)
73 * used to dump the entire rpcbind maps
74 *
75 * RPCBPROC_CALLIT(rpcb_rmtcallargs)
76 * RETURNS (rpcb_rmtcallres);
77 * Calls the procedure on the remote machine. If it is not registered,
78 * this procedure is quiet; i.e. it does not return error information!!!
79 * This routine only passes null authentication parameters.
80 * It has no interface to xdr routines for RPCBPROC_CALLIT.
81 *
82 * RPCBPROC_GETTIME() returns (int).
83 * Gets the remote machines time
84 *
85 * RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf)
86 * Returns the netbuf address from universal address.
87 *
88 * RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string)
89 * Returns the universal address from netbuf address.
90 *
91 * END OF RPCBIND VERSION 3 PROCEDURES
92 */
93/*
94 * Except for RPCBPROC_CALLIT, the procedures above are carried over to
95 * rpcbind version 4. Those below are added or modified for version 4.
96 * NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER
97 * AS RPCBPROC_CALLIT.
98 *
99 * RPCBPROC_BCAST(rpcb_rmtcallargs)
100 * RETURNS (rpcb_rmtcallres);
101 * Calls the procedure on the remote machine. If it is not registered,
102 * this procedure IS quiet; i.e. it DOES NOT return error information!!!
103 * This routine should be used for broadcasting and nothing else.
104 *
105 * RPCBPROC_GETVERSADDR(rpcb) returns (string).
106 * 0 is failure. Otherwise returns the universal address where the
107 * triple [prog, vers, netid] is registered. Ignore address and owner.
108 * Same as RPCBPROC_GETADDR except that if the given version number
109 * is not available, the address is not returned.
110 *
111 * RPCBPROC_INDIRECT(rpcb_rmtcallargs)
112 * RETURNS (rpcb_rmtcallres);
113 * Calls the procedure on the remote machine. If it is not registered,
114 * this procedure is NOT quiet; i.e. it DOES return error information!!!
115 * as any normal application would expect.
116 *
117 * RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr).
118 * Same as RPCBPROC_GETADDR except that it returns a list of all the
119 * addresses registered for the combination (prog, vers) (for all
120 * transports).
121 *
122 * RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers)
123 * Returns the statistics about the kind of requests received by rpcbind.
124 */
125
126/*
127 * A mapping of (program, version, network ID) to address
128 */
129
130struct rpcb {
131 rpcprog_t r_prog;
132 rpcvers_t r_vers;
133 char *r_netid;
134 char *r_addr;
135 char *r_owner;
136};
137typedef struct rpcb rpcb;
138
139typedef rpcb RPCB;
140
141
142/*
143 * A list of mappings
144 *
145 * Below are two definitions for the rpcblist structure. This is done because
146 * xdr_rpcblist() is specified to take a struct rpcblist **, rather than a
147 * struct rpcblist * that rpcgen would produce. One version of the rpcblist
148 * structure (actually called rp__list) is used with rpcgen, and the other is
149 * defined only in the header file for compatibility with the specified
150 * interface.
151 */
152
153struct rp__list {
154 rpcb rpcb_map;
155 struct rp__list *rpcb_next;
156};
157typedef struct rp__list rp__list;
158
159typedef rp__list *rpcblist_ptr;
160
161typedef struct rp__list rpcblist;
162typedef struct rp__list RPCBLIST;
163
164#ifndef __cplusplus
165struct rpcblist {
166 RPCB rpcb_map;
167 struct rpcblist *rpcb_next;
168};
169#endif
170
171#ifdef __cplusplus
172extern "C" {
173#endif
174extern bool_t xdr_rpcblist(XDR *, rpcblist**);
175#ifdef __cplusplus
176}
177#endif
178
179
180/*
181 * Arguments of remote calls
182 */
183
184struct rpcb_rmtcallargs {
185 rpcprog_t prog;
186 rpcvers_t vers;
187 rpcproc_t proc;
188 struct {
189 u_int args_len;
190 char *args_val;
191 } args;
192};
193typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
194
195/*
196 * Client-side only representation of rpcb_rmtcallargs structure.
197 *
198 * The routine that XDRs the rpcb_rmtcallargs structure must deal with the
199 * opaque arguments in the "args" structure. xdr_rpcb_rmtcallargs() needs to
200 * be passed the XDR routine that knows the args' structure. This routine
201 * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
202 * the application being called already knows the args structure. So we use a
203 * different "XDR" structure on the client side, r_rpcb_rmtcallargs, which
204 * includes the args' XDR routine.
205 */
206struct r_rpcb_rmtcallargs {
207 rpcprog_t prog;
208 rpcvers_t vers;
209 rpcproc_t proc;
210 struct {
211 u_int args_len;
212 char *args_val;
213 } args;
214 xdrproc_t xdr_args; /* encodes args */
215};
216
217
218/*
219 * Results of the remote call
220 */
221
222struct rpcb_rmtcallres {
223 char *addr;
224 struct {
225 u_int results_len;
226 char *results_val;
227 } results;
228};
229typedef struct rpcb_rmtcallres rpcb_rmtcallres;
230
231/*
232 * Client-side only representation of rpcb_rmtcallres structure.
233 */
234struct r_rpcb_rmtcallres {
235 char *addr;
236 struct {
237 u_int32_t results_len;
238 char *results_val;
239 } results;
240 xdrproc_t xdr_res; /* decodes results */
241};
242
243/*
244 * rpcb_entry contains a merged address of a service on a particular
245 * transport, plus associated netconfig information. A list of rpcb_entrys
246 * is returned by RPCBPROC_GETADDRLIST. See netconfig.h for values used
247 * in r_nc_* fields.
248 */
249
250struct rpcb_entry {
251 char *r_maddr;
252 char *r_nc_netid;
253 u_int r_nc_semantics;
254 char *r_nc_protofmly;
255 char *r_nc_proto;
256};
257typedef struct rpcb_entry rpcb_entry;
258
259/*
260 * A list of addresses supported by a service.
261 */
262
263struct rpcb_entry_list {
264 rpcb_entry rpcb_entry_map;
265 struct rpcb_entry_list *rpcb_entry_next;
266};
267typedef struct rpcb_entry_list rpcb_entry_list;
268
269typedef rpcb_entry_list *rpcb_entry_list_ptr;
270
271/*
272 * rpcbind statistics
273 */
274
275#define rpcb_highproc_2 RPCBPROC_CALLIT
276#define rpcb_highproc_3 RPCBPROC_TADDR2UADDR
277#define rpcb_highproc_4 RPCBPROC_GETSTAT
278#define RPCBSTAT_HIGHPROC 13
279#define RPCBVERS_STAT 3
280#define RPCBVERS_4_STAT 2
281#define RPCBVERS_3_STAT 1
282#define RPCBVERS_2_STAT 0
283
284/* Link list of all the stats about getport and getaddr */
285
286struct rpcbs_addrlist {
287 rpcprog_t prog;
288 rpcvers_t vers;
289 int success;
290 int failure;
291 char *netid;
292 struct rpcbs_addrlist *next;
293};
294typedef struct rpcbs_addrlist rpcbs_addrlist;
295
296/* Link list of all the stats about rmtcall */
297
298struct rpcbs_rmtcalllist {
299 rpcprog_t prog;
300 rpcvers_t vers;
301 rpcproc_t proc;
302 int success;
303 int failure;
304 int indirect;
305 char *netid;
306 struct rpcbs_rmtcalllist *next;
307};
308typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
309
310typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
311
312typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
313
314typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
315
316struct rpcb_stat {
317 rpcbs_proc info;
318 int setinfo;
319 int unsetinfo;
320 rpcbs_addrlist_ptr addrinfo;
321 rpcbs_rmtcalllist_ptr rmtinfo;
322};
323typedef struct rpcb_stat rpcb_stat;
324
325/*
326 * One rpcb_stat structure is returned for each version of rpcbind
327 * being monitored.
328 */
329
330typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
331
332/*
333 * We don't define netbuf in RPCL, since it would contain structure member
334 * names that would conflict with the definition of struct netbuf in
335 * <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here,
336 * and implement it ourselves in rpc/rpcb_prot.c.
337 */
338#ifdef __cplusplus
339extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *);
340
341#else /* __STDC__ */
342extern bool_t xdr_netbuf(XDR *, struct netbuf *);
343
344#endif
345
346#define RPCBVERS_3 RPCBVERS
347#define RPCBVERS_4 RPCBVERS4
348
349#define _PATH_RPCBINDSOCK "/var/run/rpcbind.sock"
350
351#else /* ndef _KERNEL */
352#ifdef __cplusplus
353extern "C" {
354#endif
355
356/*
357 * A mapping of (program, version, network ID) to address
358 */
359struct rpcb {
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 */
365};
366typedef struct rpcb RPCB;
367
368/*
369 * A list of mappings
370 */
371struct rpcblist {
372 RPCB rpcb_map;
373 struct rpcblist *rpcb_next;
374};
375typedef struct rpcblist RPCBLIST;
376typedef struct rpcblist *rpcblist_ptr;
377
378/*
379 * Remote calls arguments
380 */
381struct rpcb_rmtcallargs {
382 rpcprog_t prog; /* program number */
383 rpcvers_t vers; /* version number */
384 rpcproc_t proc; /* procedure number */
385 u_int32_t arglen; /* arg len */
386 caddr_t args_ptr; /* argument */
387 xdrproc_t xdr_args; /* XDR routine for argument */
388};
389typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
390
391/*
392 * Remote calls results
393 */
394struct rpcb_rmtcallres {
395 char *addr_ptr; /* remote universal address */
396 u_int32_t resultslen; /* results length */
397 caddr_t results_ptr; /* results */
398 xdrproc_t xdr_results; /* XDR routine for result */
399};
400typedef struct rpcb_rmtcallres rpcb_rmtcallres;
401
402struct rpcb_entry {
403 char *r_maddr;
404 char *r_nc_netid;
405 unsigned int r_nc_semantics;
406 char *r_nc_protofmly;
407 char *r_nc_proto;
408};
409typedef struct rpcb_entry rpcb_entry;
410
411/*
412 * A list of addresses supported by a service.
413 */
414
415struct rpcb_entry_list {
416 rpcb_entry rpcb_entry_map;
417 struct rpcb_entry_list *rpcb_entry_next;
418};
419typedef struct rpcb_entry_list rpcb_entry_list;
420
421typedef rpcb_entry_list *rpcb_entry_list_ptr;
422
423/*
424 * rpcbind statistics
425 */
426
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
435
436/* Link list of all the stats about getport and getaddr */
437
438struct rpcbs_addrlist {
439 rpcprog_t prog;
440 rpcvers_t vers;
441 int success;
442 int failure;
443 char *netid;
444 struct rpcbs_addrlist *next;
445};
446typedef struct rpcbs_addrlist rpcbs_addrlist;
447
448/* Link list of all the stats about rmtcall */
449
450struct rpcbs_rmtcalllist {
451 rpcprog_t prog;
452 rpcvers_t vers;
453 rpcproc_t proc;
454 int success;
455 int failure;
456 int indirect;
457 char *netid;
458 struct rpcbs_rmtcalllist *next;
459};
460typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
461
462typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
463
464typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
465
466typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
467
468struct rpcb_stat {
469 rpcbs_proc info;
470 int setinfo;
471 int unsetinfo;
472 rpcbs_addrlist_ptr addrinfo;
473 rpcbs_rmtcalllist_ptr rmtinfo;
474};
475typedef struct rpcb_stat rpcb_stat;
476
477/*
478 * One rpcb_stat structure is returned for each version of rpcbind
479 * being monitored.
480 */
481
482typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
483
484#ifdef __cplusplus
485}
486#endif
487
488#endif /* ndef _KERNEL */
489
490#define RPCBPROG ((unsigned long)(100000))
491#define RPCBVERS ((unsigned long)(3))
492
493extern void rpcbprog_3(struct svc_req *rqstp, SVCXPRT *transp);
494#define RPCBPROC_SET ((unsigned long)(1))
495extern bool_t * rpcbproc_set_3(rpcb *, CLIENT *);
496extern bool_t * rpcbproc_set_3_svc(rpcb *, struct svc_req *);
497#define RPCBPROC_UNSET ((unsigned long)(2))
498extern bool_t * rpcbproc_unset_3(rpcb *, CLIENT *);
499extern bool_t * rpcbproc_unset_3_svc(rpcb *, struct svc_req *);
500#define RPCBPROC_GETADDR ((unsigned long)(3))
501extern char ** rpcbproc_getaddr_3(rpcb *, CLIENT *);
502extern char ** rpcbproc_getaddr_3_svc(rpcb *, struct svc_req *);
503#define RPCBPROC_DUMP ((unsigned long)(4))
504extern rpcblist_ptr * rpcbproc_dump_3(void *, CLIENT *);
505extern rpcblist_ptr * rpcbproc_dump_3_svc(void *, struct svc_req *);
506#define RPCBPROC_CALLIT ((unsigned long)(5))
507extern rpcb_rmtcallres * rpcbproc_callit_3(rpcb_rmtcallargs *, CLIENT *);
508extern rpcb_rmtcallres * rpcbproc_callit_3_svc(rpcb_rmtcallargs *, struct svc_req *);
509#define RPCBPROC_GETTIME ((unsigned long)(6))
510extern u_int * rpcbproc_gettime_3(void *, CLIENT *);
511extern u_int * rpcbproc_gettime_3_svc(void *, struct svc_req *);
512#define RPCBPROC_UADDR2TADDR ((unsigned long)(7))
513extern struct netbuf * rpcbproc_uaddr2taddr_3(char **, CLIENT *);
514extern struct netbuf * rpcbproc_uaddr2taddr_3_svc(char **, struct svc_req *);
515#define RPCBPROC_TADDR2UADDR ((unsigned long)(8))
516extern char ** rpcbproc_taddr2uaddr_3(struct netbuf *, CLIENT *);
517extern char ** rpcbproc_taddr2uaddr_3_svc(struct netbuf *, struct svc_req *);
518extern int rpcbprog_3_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
519#define RPCBVERS4 ((unsigned long)(4))
520
521extern void rpcbprog_4(struct svc_req *rqstp, SVCXPRT *transp);
522extern bool_t * rpcbproc_set_4(rpcb *, CLIENT *);
523extern bool_t * rpcbproc_set_4_svc(rpcb *, struct svc_req *);
524extern bool_t * rpcbproc_unset_4(rpcb *, CLIENT *);
525extern bool_t * rpcbproc_unset_4_svc(rpcb *, struct svc_req *);
526extern char ** rpcbproc_getaddr_4(rpcb *, CLIENT *);
527extern char ** rpcbproc_getaddr_4_svc(rpcb *, struct svc_req *);
528extern rpcblist_ptr * rpcbproc_dump_4(void *, CLIENT *);
529extern rpcblist_ptr * rpcbproc_dump_4_svc(void *, struct svc_req *);
530#define RPCBPROC_BCAST ((unsigned long)(RPCBPROC_CALLIT))
531extern rpcb_rmtcallres * rpcbproc_bcast_4(rpcb_rmtcallargs *, CLIENT *);
532extern rpcb_rmtcallres * rpcbproc_bcast_4_svc(rpcb_rmtcallargs *, struct svc_req *);
533extern u_int * rpcbproc_gettime_4(void *, CLIENT *);
534extern u_int * rpcbproc_gettime_4_svc(void *, struct svc_req *);
535extern struct netbuf * rpcbproc_uaddr2taddr_4(char **, CLIENT *);
536extern struct netbuf * rpcbproc_uaddr2taddr_4_svc(char **, struct svc_req *);
537extern char ** rpcbproc_taddr2uaddr_4(struct netbuf *, CLIENT *);
538extern char ** rpcbproc_taddr2uaddr_4_svc(struct netbuf *, struct svc_req *);
539#define RPCBPROC_GETVERSADDR ((unsigned long)(9))
540extern char ** rpcbproc_getversaddr_4(rpcb *, CLIENT *);
541extern char ** rpcbproc_getversaddr_4_svc(rpcb *, struct svc_req *);
542#define RPCBPROC_INDIRECT ((unsigned long)(10))
543extern rpcb_rmtcallres * rpcbproc_indirect_4(rpcb_rmtcallargs *, CLIENT *);
544extern rpcb_rmtcallres * rpcbproc_indirect_4_svc(rpcb_rmtcallargs *, struct svc_req *);
545#define RPCBPROC_GETADDRLIST ((unsigned long)(11))
546extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4(rpcb *, CLIENT *);
547extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4_svc(rpcb *, struct svc_req *);
548#define RPCBPROC_GETSTAT ((unsigned long)(12))
549extern rpcb_stat * rpcbproc_getstat_4(void *, CLIENT *);
550extern rpcb_stat * rpcbproc_getstat_4_svc(void *, struct svc_req *);
551extern int rpcbprog_4_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
552
553/* the xdr functions */
554extern bool_t xdr_rpcb(XDR *, rpcb*);
555extern bool_t xdr_rp__list(XDR *, rp__list*);
556extern bool_t xdr_rpcblist_ptr(XDR *, rpcblist_ptr*);
557extern bool_t xdr_rpcb_rmtcallargs(XDR *, rpcb_rmtcallargs*);
558extern bool_t xdr_rpcb_rmtcallres(XDR *, rpcb_rmtcallres*);
559extern bool_t xdr_rpcb_entry(XDR *, rpcb_entry*);
560extern bool_t xdr_rpcb_entry_list(XDR *, rpcb_entry_list*);
561extern bool_t xdr_rpcb_entry_list_ptr(XDR *, rpcb_entry_list_ptr*);
562extern bool_t xdr_rpcbs_addrlist(XDR *, rpcbs_addrlist*);
563extern bool_t xdr_rpcbs_rmtcalllist(XDR *, rpcbs_rmtcalllist*);
564extern bool_t xdr_rpcbs_proc(XDR *, rpcbs_proc);
565extern bool_t xdr_rpcbs_addrlist_ptr(XDR *, rpcbs_addrlist_ptr*);
566extern bool_t xdr_rpcbs_rmtcalllist_ptr(XDR *, rpcbs_rmtcalllist_ptr*);
567extern bool_t xdr_rpcb_stat(XDR *, rpcb_stat*);
568extern bool_t xdr_rpcb_stat_byvers(XDR *, rpcb_stat_byvers);
569
570#ifdef __cplusplus
571}
572#endif
573
574#endif /* !_RPCB_PROT_H_RPCGEN */