xref: /onnv-gate/usr/src/uts/common/rpc/rpcb_prot.x (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate %/*
23*0Sstevel@tonic-gate % * Copyright (c) 1988,1994 by Sun Microsystems, Inc.
24*0Sstevel@tonic-gate % * All rights reserved.
25*0Sstevel@tonic-gate % */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate %/* from rpcb_prot.x */
28*0Sstevel@tonic-gate 
29*0Sstevel@tonic-gate #ifdef RPC_HDR
30*0Sstevel@tonic-gate %
31*0Sstevel@tonic-gate %#pragma ident	"%Z%%M%	%I%	%E% SMI"
32*0Sstevel@tonic-gate %
33*0Sstevel@tonic-gate %#ifndef _KERNEL
34*0Sstevel@tonic-gate %
35*0Sstevel@tonic-gate #endif
36*0Sstevel@tonic-gate 
37*0Sstevel@tonic-gate /*
38*0Sstevel@tonic-gate  * rpcb_prot.x
39*0Sstevel@tonic-gate  * rpcbind protocol, versions 3 and 4, in RPC Language
40*0Sstevel@tonic-gate  */
41*0Sstevel@tonic-gate %
42*0Sstevel@tonic-gate %/*
43*0Sstevel@tonic-gate % * The following procedures are supported by the protocol in version 3:
44*0Sstevel@tonic-gate % *
45*0Sstevel@tonic-gate % * RPCBPROC_NULL() returns ()
46*0Sstevel@tonic-gate % * 	takes nothing, returns nothing
47*0Sstevel@tonic-gate % *
48*0Sstevel@tonic-gate % * RPCBPROC_SET(rpcb) returns (bool_t)
49*0Sstevel@tonic-gate % * 	TRUE is success, FALSE is failure.  Registers the tuple
50*0Sstevel@tonic-gate % *	[prog, vers, address, owner, netid].
51*0Sstevel@tonic-gate % *	Finds out owner and netid information on its own.
52*0Sstevel@tonic-gate % *
53*0Sstevel@tonic-gate % * RPCBPROC_UNSET(rpcb) returns (bool_t)
54*0Sstevel@tonic-gate % *	TRUE is success, FALSE is failure.  Un-registers tuple
55*0Sstevel@tonic-gate % *	[prog, vers, netid].  addresses is ignored.
56*0Sstevel@tonic-gate % *	If netid is NULL, unregister all.
57*0Sstevel@tonic-gate % *
58*0Sstevel@tonic-gate % * RPCBPROC_GETADDR(rpcb) returns (string).
59*0Sstevel@tonic-gate % *	0 is failure.  Otherwise returns the universal address where the
60*0Sstevel@tonic-gate % *	triple [prog, vers, netid] is registered.  Ignore address and owner.
61*0Sstevel@tonic-gate % *
62*0Sstevel@tonic-gate % * RPCBPROC_DUMP() RETURNS (rpcblist_ptr)
63*0Sstevel@tonic-gate % *	used to dump the entire rpcbind maps
64*0Sstevel@tonic-gate % *
65*0Sstevel@tonic-gate % * RPCBPROC_CALLIT(rpcb_rmtcallargs)
66*0Sstevel@tonic-gate % * 	RETURNS (rpcb_rmtcallres);
67*0Sstevel@tonic-gate % * 	Calls the procedure on the remote machine.  If it is not registered,
68*0Sstevel@tonic-gate % *	this procedure is quiet; i.e. it does not return error information!!!
69*0Sstevel@tonic-gate % *	This routine only passes null authentication parameters.
70*0Sstevel@tonic-gate % *	It has no interface to xdr routines for RPCBPROC_CALLIT.
71*0Sstevel@tonic-gate % *
72*0Sstevel@tonic-gate % * RPCBPROC_GETTIME() returns (int).
73*0Sstevel@tonic-gate % *	Gets the remote machines time
74*0Sstevel@tonic-gate % *
75*0Sstevel@tonic-gate % * RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf)
76*0Sstevel@tonic-gate % *	Returns the netbuf address from universal address.
77*0Sstevel@tonic-gate % *
78*0Sstevel@tonic-gate % * RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string)
79*0Sstevel@tonic-gate % *	Returns the universal address from netbuf address.
80*0Sstevel@tonic-gate % *
81*0Sstevel@tonic-gate % * END OF RPCBIND VERSION 3 PROCEDURES
82*0Sstevel@tonic-gate % */
83*0Sstevel@tonic-gate %/*
84*0Sstevel@tonic-gate % * Except for RPCBPROC_CALLIT, the procedures above are carried over to
85*0Sstevel@tonic-gate % * rpcbind version 4.  Those below are added or modified for version 4.
86*0Sstevel@tonic-gate % * NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER
87*0Sstevel@tonic-gate % * AS RPCBPROC_CALLIT.
88*0Sstevel@tonic-gate % *
89*0Sstevel@tonic-gate % * RPCBPROC_BCAST(rpcb_rmtcallargs)
90*0Sstevel@tonic-gate % * 	RETURNS (rpcb_rmtcallres);
91*0Sstevel@tonic-gate % * 	Calls the procedure on the remote machine.  If it is not registered,
92*0Sstevel@tonic-gate % *	this procedure IS quiet; i.e. it DOES NOT return error information!!!
93*0Sstevel@tonic-gate % *	This routine should be used for broadcasting and nothing else.
94*0Sstevel@tonic-gate % *
95*0Sstevel@tonic-gate % * RPCBPROC_GETVERSADDR(rpcb) returns (string).
96*0Sstevel@tonic-gate % *	0 is failure.  Otherwise returns the universal address where the
97*0Sstevel@tonic-gate % *	triple [prog, vers, netid] is registered.  Ignore address and owner.
98*0Sstevel@tonic-gate % *	Same as RPCBPROC_GETADDR except that if the given version number
99*0Sstevel@tonic-gate % *	is not available, the address is not returned.
100*0Sstevel@tonic-gate % *
101*0Sstevel@tonic-gate % * RPCBPROC_INDIRECT(rpcb_rmtcallargs)
102*0Sstevel@tonic-gate % * 	RETURNS (rpcb_rmtcallres);
103*0Sstevel@tonic-gate % * 	Calls the procedure on the remote machine.  If it is not registered,
104*0Sstevel@tonic-gate % *	this procedure is NOT quiet; i.e. it DOES return error information!!!
105*0Sstevel@tonic-gate % * 	as any normal application would expect.
106*0Sstevel@tonic-gate % *
107*0Sstevel@tonic-gate % * RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr).
108*0Sstevel@tonic-gate % *	Same as RPCBPROC_GETADDR except that it returns a list of all the
109*0Sstevel@tonic-gate % *	addresses registered for the combination (prog, vers) (for all
110*0Sstevel@tonic-gate % *	transports).
111*0Sstevel@tonic-gate % *
112*0Sstevel@tonic-gate % * RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers)
113*0Sstevel@tonic-gate % *	Returns the statistics about the kind of requests received by rpcbind.
114*0Sstevel@tonic-gate % */
115*0Sstevel@tonic-gate %
116*0Sstevel@tonic-gate %/*
117*0Sstevel@tonic-gate % * A mapping of (program, version, network ID) to address
118*0Sstevel@tonic-gate % */
119*0Sstevel@tonic-gate struct rpcb {
120*0Sstevel@tonic-gate 	rpcprog_t r_prog;		/* program number */
121*0Sstevel@tonic-gate 	rpcvers_t r_vers;		/* version number */
122*0Sstevel@tonic-gate 	string r_netid<>;		/* network id */
123*0Sstevel@tonic-gate 	string r_addr<>;		/* universal address */
124*0Sstevel@tonic-gate 	string r_owner<>;		/* owner of this service */
125*0Sstevel@tonic-gate };
126*0Sstevel@tonic-gate #ifdef RPC_HDR
127*0Sstevel@tonic-gate %
128*0Sstevel@tonic-gate %typedef rpcb RPCB;
129*0Sstevel@tonic-gate %
130*0Sstevel@tonic-gate #endif
131*0Sstevel@tonic-gate %
132*0Sstevel@tonic-gate %/*
133*0Sstevel@tonic-gate % * A list of mappings
134*0Sstevel@tonic-gate % *
135*0Sstevel@tonic-gate % * Below are two definitions for the rpcblist structure.  This is done because
136*0Sstevel@tonic-gate % * xdr_rpcblist() is specified to take a struct rpcblist **, rather than a
137*0Sstevel@tonic-gate % * struct rpcblist * that rpcgen would produce.  One version of the rpcblist
138*0Sstevel@tonic-gate % * structure (actually called rp__list) is used with rpcgen, and the other is
139*0Sstevel@tonic-gate % * defined only in the header file for compatibility with the specified
140*0Sstevel@tonic-gate % * interface.
141*0Sstevel@tonic-gate % */
142*0Sstevel@tonic-gate 
143*0Sstevel@tonic-gate struct rp__list {
144*0Sstevel@tonic-gate 	rpcb rpcb_map;
145*0Sstevel@tonic-gate 	struct rp__list *rpcb_next;
146*0Sstevel@tonic-gate };
147*0Sstevel@tonic-gate 
148*0Sstevel@tonic-gate typedef rp__list *rpcblist_ptr;		/* results of RPCBPROC_DUMP */
149*0Sstevel@tonic-gate 
150*0Sstevel@tonic-gate #ifdef RPC_HDR
151*0Sstevel@tonic-gate %
152*0Sstevel@tonic-gate %typedef struct rp__list rpcblist;
153*0Sstevel@tonic-gate %typedef struct rp__list RPCBLIST;
154*0Sstevel@tonic-gate %
155*0Sstevel@tonic-gate %#ifndef __cplusplus
156*0Sstevel@tonic-gate %struct rpcblist {
157*0Sstevel@tonic-gate %	RPCB rpcb_map;
158*0Sstevel@tonic-gate %	struct rpcblist *rpcb_next;
159*0Sstevel@tonic-gate %};
160*0Sstevel@tonic-gate %#endif
161*0Sstevel@tonic-gate %
162*0Sstevel@tonic-gate %#ifdef __cplusplus
163*0Sstevel@tonic-gate %extern "C" {
164*0Sstevel@tonic-gate %#endif
165*0Sstevel@tonic-gate %#ifdef __STDC__
166*0Sstevel@tonic-gate %extern  bool_t xdr_rpcblist(XDR *, rpcblist**);
167*0Sstevel@tonic-gate %#else /* K&R C */
168*0Sstevel@tonic-gate %bool_t xdr_rpcblist();
169*0Sstevel@tonic-gate %#endif
170*0Sstevel@tonic-gate %#ifdef	__cplusplus
171*0Sstevel@tonic-gate %}
172*0Sstevel@tonic-gate %#endif
173*0Sstevel@tonic-gate %
174*0Sstevel@tonic-gate #endif
175*0Sstevel@tonic-gate 
176*0Sstevel@tonic-gate %
177*0Sstevel@tonic-gate %/*
178*0Sstevel@tonic-gate % * Arguments of remote calls
179*0Sstevel@tonic-gate % */
180*0Sstevel@tonic-gate struct rpcb_rmtcallargs {
181*0Sstevel@tonic-gate 	rpcprog_t prog;			/* program number */
182*0Sstevel@tonic-gate 	rpcvers_t vers;			/* version number */
183*0Sstevel@tonic-gate 	rpcproc_t proc;			/* procedure number */
184*0Sstevel@tonic-gate 	opaque args<>;			/* argument */
185*0Sstevel@tonic-gate };
186*0Sstevel@tonic-gate #ifdef RPC_HDR
187*0Sstevel@tonic-gate %
188*0Sstevel@tonic-gate %/*
189*0Sstevel@tonic-gate % * Client-side only representation of rpcb_rmtcallargs structure.
190*0Sstevel@tonic-gate % *
191*0Sstevel@tonic-gate % * The routine that XDRs the rpcb_rmtcallargs structure must deal with the
192*0Sstevel@tonic-gate % * opaque arguments in the "args" structure.  xdr_rpcb_rmtcallargs() needs to
193*0Sstevel@tonic-gate % * be passed the XDR routine that knows the args' structure.  This routine
194*0Sstevel@tonic-gate % * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
195*0Sstevel@tonic-gate % * the application being called already knows the args structure.  So we use a
196*0Sstevel@tonic-gate % * different "XDR" structure on the client side, r_rpcb_rmtcallargs, which
197*0Sstevel@tonic-gate % * includes the args' XDR routine.
198*0Sstevel@tonic-gate % */
199*0Sstevel@tonic-gate %struct r_rpcb_rmtcallargs {
200*0Sstevel@tonic-gate %	rpcprog_t prog;
201*0Sstevel@tonic-gate %	rpcvers_t vers;
202*0Sstevel@tonic-gate %	rpcproc_t proc;
203*0Sstevel@tonic-gate %	struct {
204*0Sstevel@tonic-gate %		uint32_t args_len;
205*0Sstevel@tonic-gate %		char *args_val;
206*0Sstevel@tonic-gate %	} args;
207*0Sstevel@tonic-gate %	xdrproc_t	xdr_args;	/* encodes args */
208*0Sstevel@tonic-gate %};
209*0Sstevel@tonic-gate %
210*0Sstevel@tonic-gate #endif	/* def RPC_HDR */
211*0Sstevel@tonic-gate %
212*0Sstevel@tonic-gate %/*
213*0Sstevel@tonic-gate % * Results of the remote call
214*0Sstevel@tonic-gate % */
215*0Sstevel@tonic-gate struct rpcb_rmtcallres {
216*0Sstevel@tonic-gate 	string addr<>;			/* remote universal address */
217*0Sstevel@tonic-gate 	opaque results<>;		/* result */
218*0Sstevel@tonic-gate };
219*0Sstevel@tonic-gate #ifdef RPC_HDR
220*0Sstevel@tonic-gate %
221*0Sstevel@tonic-gate %/*
222*0Sstevel@tonic-gate % * Client-side only representation of rpcb_rmtcallres structure.
223*0Sstevel@tonic-gate % */
224*0Sstevel@tonic-gate %struct r_rpcb_rmtcallres {
225*0Sstevel@tonic-gate %	char *addr;
226*0Sstevel@tonic-gate %	struct {
227*0Sstevel@tonic-gate %		uint32_t results_len;
228*0Sstevel@tonic-gate %		char *results_val;
229*0Sstevel@tonic-gate %	} results;
230*0Sstevel@tonic-gate %	xdrproc_t	xdr_res;	/* decodes results */
231*0Sstevel@tonic-gate %};
232*0Sstevel@tonic-gate #endif RPC_HDR
233*0Sstevel@tonic-gate %
234*0Sstevel@tonic-gate %/*
235*0Sstevel@tonic-gate % * rpcb_entry contains a merged address of a service on a particular
236*0Sstevel@tonic-gate % * transport, plus associated netconfig information.  A list of rpcb_entrys
237*0Sstevel@tonic-gate % * is returned by RPCBPROC_GETADDRLIST.  See netconfig.h for values used
238*0Sstevel@tonic-gate % * in r_nc_* fields.
239*0Sstevel@tonic-gate % */
240*0Sstevel@tonic-gate struct rpcb_entry {
241*0Sstevel@tonic-gate 	string		r_maddr<>;	/* merged address of service */
242*0Sstevel@tonic-gate 	string		r_nc_netid<>;	/* netid field */
243*0Sstevel@tonic-gate 	unsigned int	r_nc_semantics;	/* semantics of transport */
244*0Sstevel@tonic-gate 	string		r_nc_protofmly<>; /* protocol family */
245*0Sstevel@tonic-gate 	string		r_nc_proto<>;	/* protocol name */
246*0Sstevel@tonic-gate };
247*0Sstevel@tonic-gate %
248*0Sstevel@tonic-gate %/*
249*0Sstevel@tonic-gate % * A list of addresses supported by a service.
250*0Sstevel@tonic-gate % */
251*0Sstevel@tonic-gate struct rpcb_entry_list {
252*0Sstevel@tonic-gate 	rpcb_entry rpcb_entry_map;
253*0Sstevel@tonic-gate 	struct rpcb_entry_list *rpcb_entry_next;
254*0Sstevel@tonic-gate };
255*0Sstevel@tonic-gate 
256*0Sstevel@tonic-gate typedef rpcb_entry_list *rpcb_entry_list_ptr;
257*0Sstevel@tonic-gate 
258*0Sstevel@tonic-gate %
259*0Sstevel@tonic-gate %/*
260*0Sstevel@tonic-gate % * rpcbind statistics
261*0Sstevel@tonic-gate % */
262*0Sstevel@tonic-gate %
263*0Sstevel@tonic-gate const rpcb_highproc_2 = RPCBPROC_CALLIT;
264*0Sstevel@tonic-gate const rpcb_highproc_3 = RPCBPROC_TADDR2UADDR;
265*0Sstevel@tonic-gate const rpcb_highproc_4 = RPCBPROC_GETSTAT;
266*0Sstevel@tonic-gate 
267*0Sstevel@tonic-gate const RPCBSTAT_HIGHPROC = 13;	/* # of procs in rpcbind V4 plus one */
268*0Sstevel@tonic-gate const RPCBVERS_STAT = 3;	/* provide only for rpcbind V2, V3 and V4 */
269*0Sstevel@tonic-gate const RPCBVERS_4_STAT = 2;
270*0Sstevel@tonic-gate const RPCBVERS_3_STAT = 1;
271*0Sstevel@tonic-gate const RPCBVERS_2_STAT = 0;
272*0Sstevel@tonic-gate %
273*0Sstevel@tonic-gate %/* Link list of all the stats about getport and getaddr */
274*0Sstevel@tonic-gate struct rpcbs_addrlist {
275*0Sstevel@tonic-gate 	rpcprog_t prog;
276*0Sstevel@tonic-gate 	rpcvers_t vers;
277*0Sstevel@tonic-gate 	int success;
278*0Sstevel@tonic-gate 	int failure;
279*0Sstevel@tonic-gate 	string netid<>;
280*0Sstevel@tonic-gate 	struct rpcbs_addrlist *next;
281*0Sstevel@tonic-gate };
282*0Sstevel@tonic-gate %
283*0Sstevel@tonic-gate %/* Link list of all the stats about rmtcall */
284*0Sstevel@tonic-gate struct rpcbs_rmtcalllist {
285*0Sstevel@tonic-gate 	rpcprog_t prog;
286*0Sstevel@tonic-gate 	rpcvers_t vers;
287*0Sstevel@tonic-gate 	rpcproc_t proc;
288*0Sstevel@tonic-gate 	int success;
289*0Sstevel@tonic-gate 	int failure;
290*0Sstevel@tonic-gate 	int indirect;	/* whether callit or indirect */
291*0Sstevel@tonic-gate 	string netid<>;
292*0Sstevel@tonic-gate 	struct rpcbs_rmtcalllist *next;
293*0Sstevel@tonic-gate };
294*0Sstevel@tonic-gate 
295*0Sstevel@tonic-gate typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
296*0Sstevel@tonic-gate typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
297*0Sstevel@tonic-gate typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
298*0Sstevel@tonic-gate 
299*0Sstevel@tonic-gate struct rpcb_stat {
300*0Sstevel@tonic-gate 	rpcbs_proc		info;
301*0Sstevel@tonic-gate 	int			setinfo;
302*0Sstevel@tonic-gate 	int			unsetinfo;
303*0Sstevel@tonic-gate 	rpcbs_addrlist_ptr	addrinfo;
304*0Sstevel@tonic-gate 	rpcbs_rmtcalllist_ptr	rmtinfo;
305*0Sstevel@tonic-gate };
306*0Sstevel@tonic-gate %
307*0Sstevel@tonic-gate %/*
308*0Sstevel@tonic-gate % * One rpcb_stat structure is returned for each version of rpcbind
309*0Sstevel@tonic-gate % * being monitored.
310*0Sstevel@tonic-gate % */
311*0Sstevel@tonic-gate 
312*0Sstevel@tonic-gate typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
313*0Sstevel@tonic-gate 
314*0Sstevel@tonic-gate #ifdef RPC_HDR
315*0Sstevel@tonic-gate %
316*0Sstevel@tonic-gate %/*
317*0Sstevel@tonic-gate % * We don't define netbuf in RPCL, since it would contain structure member
318*0Sstevel@tonic-gate % * names that would conflict with the definition of struct netbuf in
319*0Sstevel@tonic-gate % * <tiuser.h>.  Instead we merely declare the XDR routine xdr_netbuf() here,
320*0Sstevel@tonic-gate % * and implement it ourselves in rpc/rpcb_prot.c.
321*0Sstevel@tonic-gate % */
322*0Sstevel@tonic-gate %#ifdef __cplusplus
323*0Sstevel@tonic-gate %extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *);
324*0Sstevel@tonic-gate %
325*0Sstevel@tonic-gate %#elif __STDC__
326*0Sstevel@tonic-gate %extern  bool_t xdr_netbuf(XDR *, struct netbuf *);
327*0Sstevel@tonic-gate %
328*0Sstevel@tonic-gate %#else /* K&R C */
329*0Sstevel@tonic-gate %bool_t xdr_netbuf();
330*0Sstevel@tonic-gate %
331*0Sstevel@tonic-gate %#endif /* K&R C */
332*0Sstevel@tonic-gate #endif /* def RPC_HDR */
333*0Sstevel@tonic-gate 
334*0Sstevel@tonic-gate /*
335*0Sstevel@tonic-gate  * rpcbind procedures
336*0Sstevel@tonic-gate  */
337*0Sstevel@tonic-gate program RPCBPROG {
338*0Sstevel@tonic-gate 	version RPCBVERS {
339*0Sstevel@tonic-gate 		bool
340*0Sstevel@tonic-gate 		RPCBPROC_SET(rpcb) = 1;
341*0Sstevel@tonic-gate 
342*0Sstevel@tonic-gate 		bool
343*0Sstevel@tonic-gate 		RPCBPROC_UNSET(rpcb) = 2;
344*0Sstevel@tonic-gate 
345*0Sstevel@tonic-gate 		string
346*0Sstevel@tonic-gate 		RPCBPROC_GETADDR(rpcb) = 3;
347*0Sstevel@tonic-gate 
348*0Sstevel@tonic-gate 		rpcblist_ptr
349*0Sstevel@tonic-gate 		RPCBPROC_DUMP(void) = 4;
350*0Sstevel@tonic-gate 
351*0Sstevel@tonic-gate 		rpcb_rmtcallres
352*0Sstevel@tonic-gate 		RPCBPROC_CALLIT(rpcb_rmtcallargs) = 5;
353*0Sstevel@tonic-gate 
354*0Sstevel@tonic-gate 		unsigned int
355*0Sstevel@tonic-gate 		RPCBPROC_GETTIME(void) = 6;
356*0Sstevel@tonic-gate 
357*0Sstevel@tonic-gate 		struct netbuf
358*0Sstevel@tonic-gate 		RPCBPROC_UADDR2TADDR(string) = 7;
359*0Sstevel@tonic-gate 
360*0Sstevel@tonic-gate 		string
361*0Sstevel@tonic-gate 		RPCBPROC_TADDR2UADDR(struct netbuf) = 8;
362*0Sstevel@tonic-gate 	} = 3;
363*0Sstevel@tonic-gate 
364*0Sstevel@tonic-gate 	version RPCBVERS4 {
365*0Sstevel@tonic-gate 		bool
366*0Sstevel@tonic-gate 		RPCBPROC_SET(rpcb) = 1;
367*0Sstevel@tonic-gate 
368*0Sstevel@tonic-gate 		bool
369*0Sstevel@tonic-gate 		RPCBPROC_UNSET(rpcb) = 2;
370*0Sstevel@tonic-gate 
371*0Sstevel@tonic-gate 		string
372*0Sstevel@tonic-gate 		RPCBPROC_GETADDR(rpcb) = 3;
373*0Sstevel@tonic-gate 
374*0Sstevel@tonic-gate 		rpcblist_ptr
375*0Sstevel@tonic-gate 		RPCBPROC_DUMP(void) = 4;
376*0Sstevel@tonic-gate 
377*0Sstevel@tonic-gate 		/*
378*0Sstevel@tonic-gate 		 * NOTE: RPCBPROC_BCAST has the same functionality as CALLIT;
379*0Sstevel@tonic-gate 		 * the new name is intended to indicate that this
380*0Sstevel@tonic-gate 		 * procedure should be used for broadcast RPC, and
381*0Sstevel@tonic-gate 		 * RPCBPROC_INDIRECT should be used for indirect calls.
382*0Sstevel@tonic-gate 		 */
383*0Sstevel@tonic-gate 		rpcb_rmtcallres
384*0Sstevel@tonic-gate 		RPCBPROC_BCAST(rpcb_rmtcallargs) = RPCBPROC_CALLIT;
385*0Sstevel@tonic-gate 
386*0Sstevel@tonic-gate 		unsigned int
387*0Sstevel@tonic-gate 		RPCBPROC_GETTIME(void) = 6;
388*0Sstevel@tonic-gate 
389*0Sstevel@tonic-gate 		struct netbuf
390*0Sstevel@tonic-gate 		RPCBPROC_UADDR2TADDR(string) = 7;
391*0Sstevel@tonic-gate 
392*0Sstevel@tonic-gate 		string
393*0Sstevel@tonic-gate 		RPCBPROC_TADDR2UADDR(struct netbuf) = 8;
394*0Sstevel@tonic-gate 
395*0Sstevel@tonic-gate 		string
396*0Sstevel@tonic-gate 		RPCBPROC_GETVERSADDR(rpcb) = 9;
397*0Sstevel@tonic-gate 
398*0Sstevel@tonic-gate 		rpcb_rmtcallres
399*0Sstevel@tonic-gate 		RPCBPROC_INDIRECT(rpcb_rmtcallargs) = 10;
400*0Sstevel@tonic-gate 
401*0Sstevel@tonic-gate 		rpcb_entry_list_ptr
402*0Sstevel@tonic-gate 		RPCBPROC_GETADDRLIST(rpcb) = 11;
403*0Sstevel@tonic-gate 
404*0Sstevel@tonic-gate 		rpcb_stat_byvers
405*0Sstevel@tonic-gate 		RPCBPROC_GETSTAT(void) = 12;
406*0Sstevel@tonic-gate 	} = 4;
407*0Sstevel@tonic-gate } = 100000;
408*0Sstevel@tonic-gate #ifdef RPC_HDR
409*0Sstevel@tonic-gate %
410*0Sstevel@tonic-gate %#define	RPCBVERS_3		RPCBVERS
411*0Sstevel@tonic-gate %#define	RPCBVERS_4		RPCBVERS4
412*0Sstevel@tonic-gate %
413*0Sstevel@tonic-gate %#else		/* ndef _KERNEL */
414*0Sstevel@tonic-gate %#ifdef __cplusplus
415*0Sstevel@tonic-gate %extern "C" {
416*0Sstevel@tonic-gate %#endif
417*0Sstevel@tonic-gate %
418*0Sstevel@tonic-gate %/*
419*0Sstevel@tonic-gate % * A mapping of (program, version, network ID) to address
420*0Sstevel@tonic-gate % */
421*0Sstevel@tonic-gate %struct rpcb {
422*0Sstevel@tonic-gate %	rpcprog_t r_prog;			/* program number */
423*0Sstevel@tonic-gate %	rpcvers_t r_vers;			/* version number */
424*0Sstevel@tonic-gate %	char *r_netid;			/* network id */
425*0Sstevel@tonic-gate %	char *r_addr;			/* universal address */
426*0Sstevel@tonic-gate %	char *r_owner;			/* owner of the mapping */
427*0Sstevel@tonic-gate %};
428*0Sstevel@tonic-gate %typedef struct rpcb RPCB;
429*0Sstevel@tonic-gate %
430*0Sstevel@tonic-gate %/*
431*0Sstevel@tonic-gate % * A list of mappings
432*0Sstevel@tonic-gate % */
433*0Sstevel@tonic-gate %struct rpcblist {
434*0Sstevel@tonic-gate %	RPCB rpcb_map;
435*0Sstevel@tonic-gate %	struct rpcblist *rpcb_next;
436*0Sstevel@tonic-gate %};
437*0Sstevel@tonic-gate %typedef struct rpcblist RPCBLIST;
438*0Sstevel@tonic-gate %typedef struct rpcblist *rpcblist_ptr;
439*0Sstevel@tonic-gate %
440*0Sstevel@tonic-gate %/*
441*0Sstevel@tonic-gate % * Remote calls arguments
442*0Sstevel@tonic-gate % */
443*0Sstevel@tonic-gate %struct rpcb_rmtcallargs {
444*0Sstevel@tonic-gate %	rpcprog_t prog;			/* program number */
445*0Sstevel@tonic-gate %	rpcvers_t vers;			/* version number */
446*0Sstevel@tonic-gate %	rpcproc_t proc;			/* procedure number */
447*0Sstevel@tonic-gate %	unsigned int  arglen;		/* arg len */
448*0Sstevel@tonic-gate %	caddr_t args_ptr;		/* argument */
449*0Sstevel@tonic-gate %	xdrproc_t xdr_args;		/* XDR routine for argument */
450*0Sstevel@tonic-gate %};
451*0Sstevel@tonic-gate %typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;
452*0Sstevel@tonic-gate %
453*0Sstevel@tonic-gate %/*
454*0Sstevel@tonic-gate % * Remote calls results
455*0Sstevel@tonic-gate % */
456*0Sstevel@tonic-gate %struct rpcb_rmtcallres {
457*0Sstevel@tonic-gate %	char *addr_ptr;			/* remote universal address */
458*0Sstevel@tonic-gate %	uint32_t resultslen;		/* results length */
459*0Sstevel@tonic-gate %	caddr_t results_ptr;		/* results */
460*0Sstevel@tonic-gate %	xdrproc_t xdr_results;		/* XDR routine for result */
461*0Sstevel@tonic-gate %};
462*0Sstevel@tonic-gate %typedef struct rpcb_rmtcallres rpcb_rmtcallres;
463*0Sstevel@tonic-gate %
464*0Sstevel@tonic-gate %struct rpcb_entry {
465*0Sstevel@tonic-gate %	char *r_maddr;
466*0Sstevel@tonic-gate %	char *r_nc_netid;
467*0Sstevel@tonic-gate %	unsigned int r_nc_semantics;
468*0Sstevel@tonic-gate %	char *r_nc_protofmly;
469*0Sstevel@tonic-gate %	char *r_nc_proto;
470*0Sstevel@tonic-gate %};
471*0Sstevel@tonic-gate %typedef struct rpcb_entry rpcb_entry;
472*0Sstevel@tonic-gate %
473*0Sstevel@tonic-gate %/*
474*0Sstevel@tonic-gate % * A list of addresses supported by a service.
475*0Sstevel@tonic-gate % */
476*0Sstevel@tonic-gate %
477*0Sstevel@tonic-gate %struct rpcb_entry_list {
478*0Sstevel@tonic-gate %	rpcb_entry rpcb_entry_map;
479*0Sstevel@tonic-gate %	struct rpcb_entry_list *rpcb_entry_next;
480*0Sstevel@tonic-gate %};
481*0Sstevel@tonic-gate %typedef struct rpcb_entry_list rpcb_entry_list;
482*0Sstevel@tonic-gate %
483*0Sstevel@tonic-gate %typedef rpcb_entry_list *rpcb_entry_list_ptr;
484*0Sstevel@tonic-gate %
485*0Sstevel@tonic-gate %/*
486*0Sstevel@tonic-gate % * rpcbind statistics
487*0Sstevel@tonic-gate % */
488*0Sstevel@tonic-gate %
489*0Sstevel@tonic-gate %#define	rpcb_highproc_2 RPCBPROC_CALLIT
490*0Sstevel@tonic-gate %#define	rpcb_highproc_3 RPCBPROC_TADDR2UADDR
491*0Sstevel@tonic-gate %#define	rpcb_highproc_4 RPCBPROC_GETSTAT
492*0Sstevel@tonic-gate %#define	RPCBSTAT_HIGHPROC 13
493*0Sstevel@tonic-gate %#define	RPCBVERS_STAT 3
494*0Sstevel@tonic-gate %#define	RPCBVERS_4_STAT 2
495*0Sstevel@tonic-gate %#define	RPCBVERS_3_STAT 1
496*0Sstevel@tonic-gate %#define	RPCBVERS_2_STAT 0
497*0Sstevel@tonic-gate %
498*0Sstevel@tonic-gate %/* Link list of all the stats about getport and getaddr */
499*0Sstevel@tonic-gate %
500*0Sstevel@tonic-gate %struct rpcbs_addrlist {
501*0Sstevel@tonic-gate %	rpcprog_t prog;
502*0Sstevel@tonic-gate %	rpcvers_t vers;
503*0Sstevel@tonic-gate %	int success;
504*0Sstevel@tonic-gate %	int failure;
505*0Sstevel@tonic-gate %	char *netid;
506*0Sstevel@tonic-gate %	struct rpcbs_addrlist *next;
507*0Sstevel@tonic-gate %};
508*0Sstevel@tonic-gate %typedef struct rpcbs_addrlist rpcbs_addrlist;
509*0Sstevel@tonic-gate %
510*0Sstevel@tonic-gate %/* Link list of all the stats about rmtcall */
511*0Sstevel@tonic-gate %
512*0Sstevel@tonic-gate %struct rpcbs_rmtcalllist {
513*0Sstevel@tonic-gate %	rpcprog_t prog;
514*0Sstevel@tonic-gate %	rpcvers_t vers;
515*0Sstevel@tonic-gate %	rpcproc_t proc;
516*0Sstevel@tonic-gate %	int success;
517*0Sstevel@tonic-gate %	int failure;
518*0Sstevel@tonic-gate %	int indirect;
519*0Sstevel@tonic-gate %	char *netid;
520*0Sstevel@tonic-gate %	struct rpcbs_rmtcalllist *next;
521*0Sstevel@tonic-gate %};
522*0Sstevel@tonic-gate %typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;
523*0Sstevel@tonic-gate %
524*0Sstevel@tonic-gate %typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];
525*0Sstevel@tonic-gate %
526*0Sstevel@tonic-gate %typedef rpcbs_addrlist *rpcbs_addrlist_ptr;
527*0Sstevel@tonic-gate %
528*0Sstevel@tonic-gate %typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;
529*0Sstevel@tonic-gate %
530*0Sstevel@tonic-gate %struct rpcb_stat {
531*0Sstevel@tonic-gate %	rpcbs_proc info;
532*0Sstevel@tonic-gate %	int setinfo;
533*0Sstevel@tonic-gate %	int unsetinfo;
534*0Sstevel@tonic-gate %	rpcbs_addrlist_ptr addrinfo;
535*0Sstevel@tonic-gate %	rpcbs_rmtcalllist_ptr rmtinfo;
536*0Sstevel@tonic-gate %};
537*0Sstevel@tonic-gate %typedef struct rpcb_stat rpcb_stat;
538*0Sstevel@tonic-gate %
539*0Sstevel@tonic-gate %/*
540*0Sstevel@tonic-gate % * One rpcb_stat structure is returned for each version of rpcbind
541*0Sstevel@tonic-gate % * being monitored.
542*0Sstevel@tonic-gate % */
543*0Sstevel@tonic-gate %
544*0Sstevel@tonic-gate %typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];
545*0Sstevel@tonic-gate %
546*0Sstevel@tonic-gate %extern  bool_t xdr_netbuf(XDR *, struct netbuf *);
547*0Sstevel@tonic-gate %
548*0Sstevel@tonic-gate %#ifdef __cplusplus
549*0Sstevel@tonic-gate %}
550*0Sstevel@tonic-gate %#endif
551*0Sstevel@tonic-gate %
552*0Sstevel@tonic-gate %#endif		/* ndef _KERNEL */
553*0Sstevel@tonic-gate #endif		/* RPC_HDR */
554