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
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.
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]
23 % * Copyright (c) 1984,1989 by Sun Microsystems, Inc.
26 %/* from pmap_prot.x */
30 %#pragma ident "%Z%%M% %I% %E% SMI"
37 * Port Mapper Protocol Specification (in RPC Language)
38 * derived from RFC 1057
42 % * Protocol for the local binder service, or pmap.
44 % * Copyright (C) 1984, Sun Microsystems, Inc.
46 % * The following procedures are supported by the protocol:
48 % * PMAPPROC_NULL() returns ()
49 % * takes nothing, returns nothing
51 % * PMAPPROC_SET(struct pmap) returns (bool_t)
52 % * TRUE is success, FALSE is failure. Registers the tuple
53 % * [prog, vers, prot, port].
55 % * PMAPPROC_UNSET(struct pmap) returns (bool_t)
56 % * TRUE is success, FALSE is failure. Un-registers pair
57 % * [prog, vers]. prot and port are ignored.
59 % * PMAPPROC_GETPORT(struct pmap) returns (rpcport_t).
60 % * 0 is failure. Otherwise returns the port number where the pair
61 % * [prog, vers] is registered. It may lie!
63 % * PMAPPROC_DUMP() RETURNS (struct pmaplist_ptr)
65 % * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
66 % * RETURNS (port, string<>);
67 % * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc,
68 % * encapsulatedargs);
69 % * Calls the procedure on the local machine. If it is not registered,
70 % * this procedure is quite; ie it does not return error information!!!
71 % * This procedure only is supported on rpc/udp and calls via
72 % * rpc/udp. This routine only passes null authentication parameters.
73 % * This file has no interface to xdr routines for PMAPPROC_CALLIT.
75 % * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
78 const PMAPPORT = 111; /* portmapper port number */
82 % * A mapping of (program, version, protocol) to port number
98 % * Supported values for the "prot" field
101 const PMAP_IPPROTO_TCP = 6; /* protocol number for TCP/IP */
102 const PMAP_IPPROTO_UDP = 17; /* protocol number for UDP/IP */
106 % * A list of mappings
108 % * Below are two definitions for the pmaplist structure. This is done because
109 % * xdr_pmaplist() is specified to take a struct pmaplist **, rather than a
110 % * struct pmaplist * that rpcgen would produce. One version of the pmaplist
111 % * structure (actually called pm__list) is used with rpcgen, and the other is
112 % * defined only in the header file for compatibility with the specified
118 struct pm__list *pml_next;
121 typedef pm__list *pmaplist_ptr; /* results of PMAPPROC_DUMP */
127 % struct pmaplist *pml_next;
130 %typedef struct pmaplist pmaplist;
131 %typedef struct pmaplist PMAPLIST;
137 %extern bool_t xdr_pmaplist(XDR *, pmaplist**);
139 %bool_t xdr_pmaplist();
149 % * Arguments to callit
161 % * Client-side only representation of rmtcallargs structure.
163 % * The routine that XDRs the rmtcallargs structure must deal with the
164 % * opaque arguments in the "args" structure. xdr_rmtcall_args() needs to be
165 % * passed the XDR routine that knows the args' structure. This routine
166 % * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
167 % * the application being called knows the args structure already. So we use a
168 % * different "XDR" structure on the client side, p_rmtcallargs, which includes
169 % * the args' XDR routine.
171 %struct p_rmtcallargs {
179 % xdrproc_t xdr_args; /* encodes args */
182 #endif /* def RPC_HDR */
186 % * Results of callit
196 % * Client-side only representation of rmtcallres structure.
198 %struct p_rmtcallres {
204 % xdrproc_t xdr_res; /* decodes res */
207 #endif /* def RPC_HDR */
210 * Port mapper procedures
216 PMAPPROC_NULL(void) = 0;
219 PMAPPROC_SET(pmap) = 1;
222 PMAPPROC_UNSET(pmap) = 2;
225 PMAPPROC_GETPORT(pmap) = 3;
228 PMAPPROC_DUMP(void) = 4;
231 PMAPPROC_CALLIT(rmtcallargs) = 5;
236 %#define PMAPVERS_PROTO ((rpcvers_t)2)
237 %#define PMAPVERS_ORIG ((rpcvers_t)1)
239 %#else /* ndef _KERNEL */
241 %#include <rpc/pmap_rmt.h>
247 %#define PMAPPORT 111
255 %typedef struct pmap PMAP;
257 %extern bool_t xdr_pmap (XDR *, struct pmap *);
259 %extern bool_t xdr_pmap ();
263 % struct pmap pml_map;
264 % struct pmaplist *pml_next;
266 %typedef struct pmaplist PMAPLIST;
267 %typedef struct pmaplist *pmaplist_ptr;
274 %#endif /* ndef _KERNEL */