14736 zfs: Improve sorted scan memory accounting
[illumos-gate.git] / usr / src / uts / common / rpc / pmap_prot.x
blob99621a6500fd675fb4496e00515d33e438fd4799
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 %/*
23 % * Copyright (c) 1984,1989 by Sun Microsystems, Inc.
24 % */
26 %/* from pmap_prot.x */
28 #ifdef RPC_HDR
30 %#ifndef _KERNEL
32 #endif
35  * Port Mapper Protocol Specification (in RPC Language)
36  * derived from RFC 1057
37  */
39 %/*
40 % * Protocol for the local binder service, or pmap.
41 % *
42 % * Copyright (C) 1984, Sun Microsystems, Inc.
43 % *
44 % * The following procedures are supported by the protocol:
45 % *
46 % * PMAPPROC_NULL() returns ()
47 % *     takes nothing, returns nothing
48 % *
49 % * PMAPPROC_SET(struct pmap) returns (bool_t)
50 % *     TRUE is success, FALSE is failure.  Registers the tuple
51 % *     [prog, vers, prot, port].
52 % *
53 % * PMAPPROC_UNSET(struct pmap) returns (bool_t)
54 % *     TRUE is success, FALSE is failure.  Un-registers pair
55 % *     [prog, vers].  prot and port are ignored.
56 % *
57 % * PMAPPROC_GETPORT(struct pmap) returns (rpcport_t).
58 % *     0 is failure.  Otherwise returns the port number where the pair
59 % *     [prog, vers] is registered.  It may lie!
60 % *
61 % * PMAPPROC_DUMP() RETURNS (struct pmaplist_ptr)
62 % *
63 % * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
64 % *     RETURNS (port, string<>);
65 % * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc,
66 % *                                             encapsulatedargs);
67 % *     Calls the procedure on the local machine.  If it is not registered,
68 % *     this procedure is quite; ie it does not return error information!!!
69 % *     This procedure only is supported on rpc/udp and calls via
70 % *     rpc/udp.  This routine only passes null authentication parameters.
71 % *     This file has no interface to xdr routines for PMAPPROC_CALLIT.
72 % *
73 % * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
74 % */
76 const PMAPPORT = 111;   /* portmapper port number */
79 %/*
80 % * A mapping of (program, version, protocol) to port number
81 % */
83 struct pmap {
84         rpcprog_t pm_prog;
85         rpcvers_t pm_vers;
86         rpcprot_t pm_prot;
87         rpcport_t pm_port;
89 #ifdef RPC_HDR
91 %typedef pmap PMAP;
93 #endif
95 %/*
96 % * Supported values for the "prot" field
97 % */
99 const PMAP_IPPROTO_TCP = 6;     /* protocol number for TCP/IP */
100 const PMAP_IPPROTO_UDP = 17;    /* protocol number for UDP/IP */
104 % * A list of mappings
105 % *
106 % * Below are two definitions for the pmaplist structure.  This is done because
107 % * xdr_pmaplist() is specified to take a struct pmaplist **, rather than a
108 % * struct pmaplist * that rpcgen would produce.  One version of the pmaplist
109 % * structure (actually called pm__list) is used with rpcgen, and the other is
110 % * defined only in the header file for compatibility with the specified
111 % * interface.
112 % */
114 struct pm__list {
115         pmap pml_map;
116         struct pm__list *pml_next;
119 typedef pm__list *pmaplist_ptr;         /* results of PMAPPROC_DUMP */
121 #ifdef RPC_HDR
123 %struct pmaplist {
124 %       PMAP pml_map;
125 %       struct pmaplist *pml_next;
128 %typedef struct pmaplist pmaplist;
129 %typedef struct pmaplist PMAPLIST;
131 %#ifdef __cplusplus
132 %extern "C" {
133 %#endif
134 %#ifdef __STDC__
135 %extern  bool_t xdr_pmaplist(XDR *, pmaplist**);
136 %#else /* K&R C */
137 %bool_t xdr_pmaplist();
138 %#endif
139 %#ifdef __cplusplus
141 %#endif
143 #endif
147 % * Arguments to callit
148 % */
150 struct rmtcallargs {
151         rpcprog_t prog;
152         rpcvers_t vers;
153         rpcproc_t proc;
154         opaque args<>;
156 #ifdef RPC_HDR
159 % * Client-side only representation of rmtcallargs structure.
160 % *
161 % * The routine that XDRs the rmtcallargs structure must deal with the
162 % * opaque arguments in the "args" structure.  xdr_rmtcall_args() needs to be
163 % * passed the XDR routine that knows the args' structure.  This routine
164 % * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
165 % * the application being called knows the args structure already.  So we use a
166 % * different "XDR" structure on the client side, p_rmtcallargs, which includes
167 % * the args' XDR routine.
168 % */
169 %struct p_rmtcallargs {
170 %       rpcprog_t prog;
171 %       rpcvers_t vers;
172 %       rpcproc_t proc;
173 %       struct {
174 %               u_int args_len;
175 %               char *args_val;
176 %       } args;
177 %       xdrproc_t       xdr_args;       /* encodes args */
180 #endif  /* def RPC_HDR */
184 % * Results of callit
185 % */
187 struct rmtcallres {
188         rpcport_t port;
189         opaque res<>;
191 #ifdef RPC_HDR
194 % * Client-side only representation of rmtcallres structure.
195 % */
196 %struct p_rmtcallres {
197 %       rpcport_t port;
198 %       struct {
199 %               u_int res_len;
200 %               char *res_val;
201 %       } res;
202 %       xdrproc_t       xdr_res;        /* decodes res */
205 #endif  /* def RPC_HDR */
208  * Port mapper procedures
209  */
211 program PMAPPROG {
212    version PMAPVERS {
213         void
214         PMAPPROC_NULL(void)     = 0;
216         bool
217         PMAPPROC_SET(pmap)      = 1;
219         bool
220         PMAPPROC_UNSET(pmap)    = 2;
222         rpcport_t
223         PMAPPROC_GETPORT(pmap)  = 3;
225         pmaplist_ptr
226         PMAPPROC_DUMP(void)     = 4;
228         rmtcallres
229         PMAPPROC_CALLIT(rmtcallargs)  = 5;
230    } = 2;
231 } = 100000;
233 #ifdef RPC_HDR
234 %#define        PMAPVERS_PROTO          ((rpcvers_t)2)
235 %#define        PMAPVERS_ORIG           ((rpcvers_t)1)
237 %#else          /* ndef _KERNEL */
239 %#include <rpc/pmap_rmt.h>
241 %#ifdef __cplusplus
242 %extern "C" {
243 %#endif
245 %#define        PMAPPORT 111
247 %struct pmap {
248 %       rpcprog_t pm_prog;
249 %       rpcvers_t pm_vers;
250 %       rpcprot_t pm_prot;
251 %       rpcport_t pm_port;
253 %typedef struct pmap PMAP;
254 %#ifdef __STDC__
255 %extern bool_t xdr_pmap (XDR *, struct pmap *);
256 %#else
257 %extern bool_t xdr_pmap ();
258 %#endif
260 %struct pmaplist {
261 %       struct pmap pml_map;
262 %       struct pmaplist *pml_next;
264 %typedef struct pmaplist PMAPLIST;
265 %typedef struct pmaplist *pmaplist_ptr;
268 %#ifdef __cplusplus
270 %#endif
272 %#endif         /* ndef _KERNEL */
273 #endif